Main Page | Class Hierarchy | Class List | Directories | File List | Class Members

Layer.h

00001 /**************************************************************************\
00002  * 
00003  *  FILE: Layer.h
00004  *
00005  *  This source file is part of DIME.
00006  *  Copyright (C) 1998-1999 by Systems In Motion.  All rights reserved.
00007  *
00008  *  This library is free software; you can redistribute it and/or modify it
00009  *  under the terms of the GNU General Public License, version 2, as
00010  *  published by the Free Software Foundation.
00011  *
00012  *  This library is distributed in the hope that it will be useful, but
00013  *  WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  *  General Public License (the accompanying file named COPYING) for more
00016  *  details.
00017  *
00018  **************************************************************************
00019  *
00020  *  If you need DIME for a non-GPL project, contact Systems In Motion
00021  *  to acquire a Professional Edition License:
00022  *
00023  *  Systems In Motion                                   http://www.sim.no/
00024  *  Prof. Brochs gate 6                                       sales@sim.no
00025  *  N-7030 Trondheim                                   Voice: +47 22114160
00026  *  NORWAY                                               Fax: +47 67172912
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 }; // class dimeLayer
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 

Copyright © 1998-1999, Systems In Motion <sales@sim.no>. All rights reserved.
System documentation was generated using doxygen.