VR-Forces 4.2 Class Documentation
DtEnvironmentalCreationData.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtEnvironmentalCreationData.h,v $ $Revision: 1.1 $ $State: Exp $
7 ******************************************************************************/
8 
11 
13 
14 #pragma once
15 
16 #include <vrfGuiCore/vrfGuiCore.h>
17 
18 #include <string>
19 
20 static const int DtLineWidthMask = 0xF0000000;
21 static const int DtAppearanceMask = 0x0FFFFFFF;
22 
23 namespace makVrf
24 {
26  {
27  #define DtLineWidthFromAppearance(theAppr) ((theAppr >> 28) & 0x0000000F)
28  #define DtLineWidthToAppearance(theLineWidth) (theLineWidth << 28)
29  #define DtPenStyleFromAppearance(theAppr) ((theAppr >> 8) & 0x0000000F)
30  #define DtPenStyleToAppearance(theLineStyle) (theLineStyle << 8)
31  #define DtFillStyleFromAppearance(theAppr) ((theAppr >> 12) & 0x0000000F)
32  #define DtFillStyleToAppearance(theFillStyle) (theFillStyle << 12)
33 
34  public:
35  DtEnvironmentalCreationData(const std::string& name = "",
36  const std::string& label = "", int color = 0, const std::string& overlayParent = "",
37  bool projected = false, bool closed = false, int appearance = 0,
38  const std::string& attachedTo = "", const std::string& userData = "",
39  unsigned int rId = 0)
40  : myName(name)
41  , myLabel(label)
42  , myColor(color)
43  , myOverlayParent(overlayParent)
44  , myIsProjected(projected)
45  , myIsClosedFigure(closed)
46  , myAppearance(appearance)
47  , myAttachedTo(attachedTo)
48  , myUserData(userData)
49  , myRequestId(rId)
50  {
51  }
52 
54  : myName(orig.myName)
55  , myLabel(orig.myLabel)
56  , myColor(orig.myColor)
57  , myOverlayParent(orig.myOverlayParent)
58  , myIsProjected(orig.myIsProjected)
59  , myIsClosedFigure(orig.myIsClosedFigure)
60  , myAppearance(orig.myAppearance)
61  , myAttachedTo(orig.myAttachedTo)
62  , myUserData(orig.myUserData)
63  , myRequestId(orig.myRequestId)
64  {
65  }
66 
67  void setName(const std::string& n)
68  {
69  myName = n;
70  }
71 
72  const std::string& name() const
73  {
74  return myName;
75  }
76 
77  void setLabel(const std::string& l)
78  {
79  myLabel = l;
80  }
81 
82  const std::string& label() const
83  {
84  return myLabel;
85  }
86 
87  void setColor(int c)
88  {
89  myColor = c;
90  }
91 
92  int color() const
93  {
94  return myColor;
95  }
96 
97  void setOverlayParent(const std::string& s)
98  {
99  myOverlayParent = s;
100  }
101 
102  const std::string& overlayParent() const
103  {
104  return myOverlayParent;
105  }
106 
107  void setIsProjected(bool b)
108  {
109  myIsProjected = b;
110  }
111 
112  bool isProjected() const
113  {
114  return myIsProjected;
115  }
116 
117  void setIsClosedFigure(bool b)
118  {
119  myIsClosedFigure = b;
120  }
121 
122  bool isClosedFigure() const
123  {
124  return myIsClosedFigure;
125  }
126 
127  void setAppearance(int i)
128  {
129  myAppearance = lineWidth() | (i & DtAppearanceMask);
130  }
131 
132  int appearance() const
133  {
134  return (rawAppearance() & DtAppearanceMask);
135  }
136 
137  void setAttachedTo(const std::string& a)
138  {
139  myAttachedTo = a;
140  }
141 
142  const std::string& attachedTo() const
143  {
144  return myAttachedTo;
145  }
146 
147  void setUserData(const std::string& u)
148  {
149  myUserData = u;
150  }
151 
152  const std::string& userData() const
153  {
154  return myUserData;
155  }
156 
157  void setRequestId(unsigned int id)
158  {
159  myRequestId = id;
160  }
161 
162  int requestId() const
163  {
164  return myRequestId;
165  }
166 
167  int rawAppearance() const
168  {
169  return myAppearance;
170  }
171 
172  protected:
173 
174  public:
175  void setPenStyle(int i)
176  {
177  myAppearance = (rawAppearance() & 0xFFFFF0FF) | (i << 8);
178  }
179 
180  int penStyle() const
181  {
182  int appearance = rawAppearance();
183 
184  return DtPenStyleFromAppearance(appearance);
185  }
186 
187  void setFillStyle(int i)
188  {
189  myAppearance = (rawAppearance() & 0xFFFF0FFF) | (i << 12);
190  }
191 
192  int fillStyle() const
193  {
194  int appearance = rawAppearance();
195 
196  return DtFillStyleFromAppearance(appearance);
197  }
198 
199  void setLineWidth(int i)
200  {
201  myAppearance = appearance() | (i << 28);
202  }
203 
204  int lineWidth() const
205  {
206  return DtLineWidthFromAppearance(myAppearance);
207  }
208 
209  protected:
210  std::string myName;
211  std::string myLabel;
212  int myColor;
213  std::string myOverlayParent;
217  std::string myAttachedTo;
218  std::string myUserData;
219  unsigned int myRequestId;
220  };
221 }

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)