![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2007 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtEntityAppearanceMapper.h,v $ $Revision: 1.9 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00012 00013 #ifndef DtEntityAppearanceMapper_H_ 00014 #define DtEntityAppearanceMapper_H_ 00015 00016 #include <vrvVrl/vrvVrl.h> 00017 00018 #include <vlpi/disEnums.h> 00019 #include <vlpi/entityType.h> 00020 00021 #include <map> 00022 00023 namespace makVrv 00024 { 00028 class DT_DLL_VRVVRL DtEntityAppearanceMapper 00029 { 00030 public: 00031 typedef std::map<int,int> AttributeToStateMap; 00032 00033 struct StateInfo 00034 { 00035 int bitShift; 00036 int state; 00037 }; 00038 00039 typedef std::map<int,StateInfo> AttributeToStateInfoMap; 00040 00042 DtEntityAppearanceMapper(const DtEntityType& type, const AttributeToStateMap& appearanceMap); 00043 00045 virtual ~DtEntityAppearanceMapper(); 00046 00048 bool mapAttributeToState(const DtAppearAttribute attr, const DtAppearAttrVal val, 00049 int& state,int& stateVal) const; 00050 00051 00052 //Get a map to attributes to state info. 00053 inline const AttributeToStateInfoMap& attributes() const 00054 { 00055 return myAttributesToStateMap; 00056 } 00057 00058 const DtEntityType& entityType() const 00059 { 00060 return myEntityType; 00061 } 00062 00063 public: 00064 00065 static bool vrfColorToRgba( unsigned vrfColor, float& r, float& g, float& b, 00066 float& a); 00067 00069 static unsigned short mapVrfLineStyleToStipplePattern(int lineStyle); 00070 00071 protected: 00072 00073 DtEntityType myEntityType; 00074 AttributeToStateInfoMap myAttributesToStateMap; 00075 }; 00076 } 00077 00078 #endif 00079