Layer.h
1 /**************************************************************************\
2  *
3  * FILE: Layer.h
4  *
5  * This source file is part of DIME.
6  * Copyright (C) 1998-1999 by Systems In Motion. All rights reserved.
7  *
8  * This library is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License, version 2, as
10  * published by the Free Software Foundation.
11  *
12  * This library is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License (the accompanying file named COPYING) for more
16  * details.
17  *
18  **************************************************************************
19  *
20  * If you need DIME for a non-GPL project, contact Systems In Motion
21  * to acquire a Professional Edition License:
22  *
23  * Systems In Motion http://www.sim.no/
24  * Prof. Brochs gate 6 sales@sim.no
25  * N-7030 Trondheim Voice: +47 22114160
26  * NORWAY Fax: +47 67172912
27  *
28 \**************************************************************************/
29 
30 #ifndef DIME_LAYER_H
31 #define DIME_LAYER_H
32 
33 #include <dime/Basic.h>
34 
35 class DIME_DLL_API dimeLayer
36 {
37 public:
38 
39  enum Flags {
40  FROZEN = 0x1,
41  FROZEN_NEW_VIEWPORTS = 0x2,
42  LOCKED = 0x4
43  };
44 
45  const char *getLayerName() const;
46  int getLayerNum() const;
47 
48  int16 getColorNumber() const;
49  void setColorNumber(const int16 num);
50 
51  int16 getFlags() const;
52  void setFlags(const int16 &flags);
53 
54  bool isDefaultLayer() const;
55 
56  static const dimeLayer *getDefaultLayer();
57 
58  static void colorToRGB(const int colornum,
59  dxfdouble &r, dxfdouble &g, dxfdouble &b);
60 
61 private:
62  friend class dimeModel;
63 
64  dimeLayer();
65  dimeLayer(const char * const name, const int num,
66  const int16 colnum, const int16 flags);
67  const char *layerName;
68  int layerNum;
69  int16 colorNum;
70  int16 flags;
71 
72  static void cleanup_default_layer(void);
73  static dimeLayer * defaultLayer;
74 
75 }; // class dimeLayer
76 
77 inline const char *
79 {
80  return layerName;
81 }
82 
83 inline int
85 {
86  return layerNum;
87 }
88 
89 inline int16
91 {
92  return colorNum;
93 }
94 
95 inline void
96 dimeLayer::setColorNumber(const int16 num)
97 {
98  this->colorNum = num;
99 }
100 
101 inline int16
103 {
104  return this->flags;
105 }
106 
107 inline void
108 dimeLayer::setFlags(const int16 &flags)
109 {
110  this->flags = flags;
111 }
112 
113 inline bool
115 {
116  return this == dimeLayer::getDefaultLayer();
117 }
118 
119 #endif // ! DIME_LAYER_H
120 

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