VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
environmentalCreationData.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 #include <vrfGuiCore/vrfGuiCore.h>
14 #include <vlutil/vlString.h>
17 #include <vrfutil/rwUUID.h>
18 
19 #include <string>
20 #include <map>
21 
22 static const int DtLineWidthMask = 0xF0000000;
23 static const int DtAppearanceMask = 0x0FFFFFFF;
24 
25 namespace makVrf
26 {
28  {
29  #define DtLineWidthFromAppearance(theAppr) ((theAppr >> 28) & 0x0000000F)
30  #define DtLineWidthToAppearance(theLineWidth) (theLineWidth << 28)
31  #define DtPenStyleFromAppearance(theAppr) ((theAppr >> 8) & 0x0000000F)
32  #define DtPenStyleToAppearance(theLineStyle) (theLineStyle << 8)
33  #define DtFillStyleFromAppearance(theAppr) ((theAppr >> 12) & 0x0000000F)
34  #define DtFillStyleToAppearance(theFillStyle) (theFillStyle << 12)
35 
36  public:
37  DtEnvironmentalCreationData(const std::string& name = "",
38  const std::string& label = "", int color = 0, const std::string& overlayParent = "",
39  bool projected = false, bool closed = false, int appearance = 0,
40  const std::string& attachedTo = "", const std::string& userData = "",
41  const std::map<std::string, std::string>& extendedData = std::map<std::string, std::string>(),
42  const std::map<int, DtString>& extendedLabels = std::map<int, DtString>(),
43  unsigned int rId = 0)
44  : myName(name)
45  , myLabel(label)
46  , myColor(color)
47  , myOverlayParent(overlayParent)
48  , myIsProjected(projected)
49  , myIsClosedFigure(closed)
50  , myAppearance(appearance)
51  , myAttachedTo(attachedTo)
52  , myUserData(userData)
53  , myRequestId(rId)
54  , myExtendedData(extendedData)
55  , myExtendedLabels(extendedLabels)
56  , myPhysicalLineHeight(0.)
57  , myPhysicalLineWidth(0.)
58  , myUUID(DtUUID::nullUUID())
59  {
60  }
61 
63  : myName(orig.myName)
64  , myLabel(orig.myLabel)
65  , myColor(orig.myColor)
66  , myOverlayParent(orig.myOverlayParent)
67  , myIsProjected(orig.myIsProjected)
68  , myIsClosedFigure(orig.myIsClosedFigure)
69  , myAppearance(orig.myAppearance)
70  , myAttachedTo(orig.myAttachedTo)
71  , myUserData(orig.myUserData)
72  , myRequestId(orig.myRequestId)
73  , myExtendedData(orig.myExtendedData)
74  , myExtendedLabels(orig.myExtendedLabels)
75  , myPhysicalLineHeight(orig.myPhysicalLineHeight)
76  , myPhysicalLineWidth(orig.myPhysicalLineWidth)
77  , myUUID(orig.myUUID)
78  {
79  }
80 
81  void setExtendedLabels(const std::map<int, DtString>& extendedData)
82  {
83  myExtendedLabels = extendedData;
84  }
85 
86  const std::map<int, DtString>& extendedLabels() const
87  {
88  return myExtendedLabels;
89  }
90 
91  std::map<int, DtString>& extendedLabels()
92  {
93  return myExtendedLabels;
94  }
95 
96  void setExtendedData(const std::map<std::string, std::string>& extendedData)
97  {
98  myExtendedData = extendedData;
99  }
100 
101  const std::map<std::string, std::string>& extendedData() const
102  {
103  return myExtendedData;
104  }
105 
106  std::map<std::string, std::string>& extendedData()
107  {
108  return myExtendedData;
109  }
110 
111  void setPhysicalLineHeight(float h)
112  {
113  myPhysicalLineHeight = h;
114  }
115 
116  float physicalLineHeight() const
117  {
118  return myPhysicalLineHeight;
119  }
120 
121  void setPhysicalLineWidth(float h)
122  {
123  myPhysicalLineWidth = h;
124  }
125 
126  float physicalLineWidth() const
127  {
128  return myPhysicalLineWidth;
129  }
130 
131  void setName(const std::string& n)
132  {
133  myName = n;
134  }
135 
136  const std::string& name() const
137  {
138  return myName;
139  }
140 
141  void setLabel(const std::string& l)
142  {
143  myLabel = l;
144  }
145 
146  const std::string& label() const
147  {
148  return myLabel;
149  }
150 
151  void setColor(int c)
152  {
153  myColor = c;
154  }
155 
156  int color() const
157  {
158  return myColor;
159  }
160 
161  void setOverlayParent(const std::string& s)
162  {
163  myOverlayParent = s;
164  }
165 
166  const std::string& overlayParent() const
167  {
168  return myOverlayParent;
169  }
170 
171  void setIsProjected(bool b)
172  {
173  myIsProjected = b;
174  }
175 
176  bool isProjected() const
177  {
178  return myIsProjected;
179  }
180 
181  void setIsClosedFigure(bool b)
182  {
183  myIsClosedFigure = b;
184  }
185 
186  bool isClosedFigure() const
187  {
188  return myIsClosedFigure;
189  }
190 
191  void setAppearance(int i)
192  {
193  myAppearance = lineWidth() | (i & DtAppearanceMask);
194  }
195 
196  int appearance() const
197  {
198  return (rawAppearance() & DtAppearanceMask);
199  }
200 
201  void setAttachedTo(const std::string& a)
202  {
203  myAttachedTo = a;
204  }
205 
206  const std::string& attachedTo() const
207  {
208  return myAttachedTo;
209  }
210 
211  void setUserData(const std::string& u)
212  {
213  myUserData = u;
214  }
215 
216  const std::string& userData() const
217  {
218  return myUserData;
219  }
220 
221  void setRequestId(unsigned int id)
222  {
223  myRequestId = id;
224  }
225 
226  int requestId() const
227  {
228  return myRequestId;
229  }
230 
231  int rawAppearance() const
232  {
233  return myAppearance;
234  }
235 
236  void setPenStyle(int i)
237  {
238  myAppearance = (rawAppearance() & 0xFFFFF0FF) | (i << 8);
239  }
240 
241  int penStyle() const
242  {
243  int appearance = rawAppearance();
244 
245  return DtPenStyleFromAppearance(appearance);
246  }
247 
251  void setFillStyle(int i)
252  {
253  myAppearance = (rawAppearance() & 0xFFFF0FFF) | (i << 12);
254  }
255 
256  int fillStyle() const
257  {
258  int appearance = rawAppearance();
259 
260  return DtFillStyleFromAppearance(appearance);
261  }
262 
263  void setLineWidth(int i)
264  {
265  myAppearance = appearance() | (i << 28);
266  }
267 
268  int lineWidth() const
269  {
270  return DtLineWidthFromAppearance(myAppearance);
271  }
272 
273  void setUUID(const DtUUID& uuid)
274  {
275  myUUID = uuid;
276  }
277 
278  const DtUUID& uuid() const
279  {
280  return myUUID;
281  }
282 
283  protected:
284  std::string myName;
285  std::string myLabel;
286  int myColor;
287  std::string myOverlayParent;
291  std::string myAttachedTo;
292  std::string myUserData;
293  unsigned int myRequestId;
294  std::map<std::string, std::string> myExtendedData;
295  std::map<int, DtString> myExtendedLabels;
298 
300  };
301 }

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)