Main Page   Class Hierarchy   Compound List   File List   Compound 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 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 dimeLayer defaultLayer;
00073 
00074 }; // class dimeLayer
00075 
00076 inline const char *
00077 dimeLayer::getLayerName() const
00078 {
00079   return layerName;
00080 }
00081 
00082 inline int 
00083 dimeLayer::getLayerNum() const
00084 {
00085   return layerNum;
00086 }
00087 
00088 inline int16 
00089 dimeLayer::getColorNumber() const
00090 {
00091   return colorNum;
00092 }
00093 
00094 inline void 
00095 dimeLayer::setColorNumber(const int16 num)
00096 {
00097   this->colorNum = num;
00098 }
00099   
00100 inline int16 
00101 dimeLayer::getFlags() const
00102 {
00103   return this->flags;
00104 }
00105 
00106 inline void 
00107 dimeLayer::setFlags(const int16 &flags)
00108 {
00109   this->flags = flags;
00110 }
00111 
00112 inline const dimeLayer *
00113 dimeLayer::getDefaultLayer()
00114 {
00115   return &defaultLayer;
00116 }
00117 
00118 inline bool 
00119 dimeLayer::isDefaultLayer() const
00120 {
00121   return this == &defaultLayer;
00122 }
00123 
00124 #endif // ! DIME_LAYER_H
00125 

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