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

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)