00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef DIME_LAYER_H
00031 #define DIME_LAYER_H
00032
00033 #include <dime/Basic.h>
00034
00035 class DIME_DLL_API dimeLayer
00036 {
00037 public:
00038
00039 enum Flags {
00040 FROZEN = 0x1,
00041 FROZEN_NEW_VIEWPORTS = 0x2,
00042 LOCKED = 0x4
00043 };
00044
00045 const char *getLayerName() const;
00046 int getLayerNum() const;
00047
00048 int16 getColorNumber() const;
00049 void setColorNumber(const int16 num);
00050
00051 int16 getFlags() const;
00052 void setFlags(const int16 &flags);
00053
00054 bool isDefaultLayer() const;
00055
00056 static const dimeLayer *getDefaultLayer();
00057
00058 static void colorToRGB(const int colornum,
00059 dxfdouble &r, dxfdouble &g, dxfdouble &b);
00060
00061 private:
00062 friend class dimeModel;
00063
00064 dimeLayer();
00065 dimeLayer(const char * const name, const int num,
00066 const int16 colnum, const int16 flags);
00067 const char *layerName;
00068 int layerNum;
00069 int16 colorNum;
00070 int16 flags;
00071
00072 static void cleanup_default_layer(void);
00073 static dimeLayer * defaultLayer;
00074
00075 };
00076
00077 inline const char *
00078 dimeLayer::getLayerName() const
00079 {
00080 return layerName;
00081 }
00082
00083 inline int
00084 dimeLayer::getLayerNum() const
00085 {
00086 return layerNum;
00087 }
00088
00089 inline int16
00090 dimeLayer::getColorNumber() const
00091 {
00092 return colorNum;
00093 }
00094
00095 inline void
00096 dimeLayer::setColorNumber(const int16 num)
00097 {
00098 this->colorNum = num;
00099 }
00100
00101 inline int16
00102 dimeLayer::getFlags() const
00103 {
00104 return this->flags;
00105 }
00106
00107 inline void
00108 dimeLayer::setFlags(const int16 &flags)
00109 {
00110 this->flags = flags;
00111 }
00112
00113 inline bool
00114 dimeLayer::isDefaultLayer() const
00115 {
00116 return this == dimeLayer::getDefaultLayer();
00117 }
00118
00119 #endif // ! DIME_LAYER_H
00120