VR-Forces 5.0.3 Developer's Guide
 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 }
bool myIsProjected
Definition: environmentalCreationData.h:288
UUID is a unique ID wrapper class.
Definition: rwUUID.h:229
int lineWidth() const
Definition: environmentalCreationData.h:268
static const int DtAppearanceMask
Definition: environmentalCreationData.h:23
std::string myName
Definition: environmentalCreationData.h:284
int myColor
Definition: environmentalCreationData.h:286
Definition: environmentalCreationData.h:27
bool myIsClosedFigure
Definition: environmentalCreationData.h:289
const std::string & userData() const
Definition: environmentalCreationData.h:216
void setColor(int c)
Definition: environmentalCreationData.h:151
const std::string & name() const
Definition: environmentalCreationData.h:136
void setIsProjected(bool b)
Definition: environmentalCreationData.h:171
#define DtFillStyleFromAppearance(theAppr)
Definition: environmentalCreationData.h:33
std::string myLabel
Definition: environmentalCreationData.h:285
int fillStyle() const
Definition: environmentalCreationData.h:256
void setUUID(const DtUUID &uuid)
Definition: environmentalCreationData.h:273
const std::string & overlayParent() const
Definition: environmentalCreationData.h:166
DtEnvironmentalCreationData(const std::string &name="", const std::string &label="", int color=0, const std::string &overlayParent="", bool projected=false, bool closed=false, int appearance=0, const std::string &attachedTo="", const std::string &userData="", const std::map< std::string, std::string > &extendedData=std::map< std::string, std::string >(), const std::map< int, DtString > &extendedLabels=std::map< int, DtString >(), unsigned int rId=0)
Definition: environmentalCreationData.h:37
float myPhysicalLineWidth
Definition: environmentalCreationData.h:297
DtUUID myUUID
Definition: environmentalCreationData.h:299
int color() const
Definition: environmentalCreationData.h:156
Contains the DtUUID class declaration.
float physicalLineHeight() const
Definition: environmentalCreationData.h:116
int myAppearance
Definition: environmentalCreationData.h:290
#define DT_DLL_VRFGUICORE
Contains DLL export macros.
Definition: vrfGuiCore.h:25
std::string myUserData
Definition: environmentalCreationData.h:292
float myPhysicalLineHeight
Definition: environmentalCreationData.h:296
void setExtendedLabels(const std::map< int, DtString > &extendedData)
Definition: environmentalCreationData.h:81
void setPenStyle(int i)
Definition: environmentalCreationData.h:236
void setPhysicalLineHeight(float h)
Definition: environmentalCreationData.h:111
void setName(const std::string &n)
Definition: environmentalCreationData.h:131
void setIsClosedFigure(bool b)
Definition: environmentalCreationData.h:181
static const int DtLineWidthMask
Contains makVrf::DtEnvironmentalCreationData class.
Definition: environmentalCreationData.h:22
void setAttachedTo(const std::string &a)
Definition: environmentalCreationData.h:201
int requestId() const
Definition: environmentalCreationData.h:226
std::map< std::string, std::string > & extendedData()
Definition: environmentalCreationData.h:106
void setOverlayParent(const std::string &s)
Definition: environmentalCreationData.h:161
DtEnvironmentalCreationData(const DtEnvironmentalCreationData &orig)
Definition: environmentalCreationData.h:62
void setFillStyle(int i)
The fill style, as defined by makVrv::vrvTacticalGraphicUtilities::FillStyle in vrvCore\DtTacticalGra...
Definition: environmentalCreationData.h:251
int appearance() const
Definition: environmentalCreationData.h:196
const std::string & label() const
Definition: environmentalCreationData.h:146
const DtUUID & uuid() const
Definition: environmentalCreationData.h:278
bool isProjected() const
Definition: environmentalCreationData.h:176
unsigned int myRequestId
Definition: environmentalCreationData.h:293
std::string myAttachedTo
Definition: environmentalCreationData.h:291
void setLineWidth(int i)
Definition: environmentalCreationData.h:263
void setLabel(const std::string &l)
Definition: environmentalCreationData.h:141
std::map< std::string, std::string > myExtendedData
Definition: environmentalCreationData.h:294
bool isClosedFigure() const
Definition: environmentalCreationData.h:186
std::map< int, DtString > & extendedLabels()
Definition: environmentalCreationData.h:91
const std::map< std::string, std::string > & extendedData() const
Definition: environmentalCreationData.h:101
int rawAppearance() const
Definition: environmentalCreationData.h:231
void setUserData(const std::string &u)
Definition: environmentalCreationData.h:211
int penStyle() const
Definition: environmentalCreationData.h:241
void setExtendedData(const std::map< std::string, std::string > &extendedData)
Definition: environmentalCreationData.h:96
const std::string & attachedTo() const
Definition: environmentalCreationData.h:206
void setRequestId(unsigned int id)
Definition: environmentalCreationData.h:221
#define DtPenStyleFromAppearance(theAppr)
Definition: environmentalCreationData.h:31
std::string myOverlayParent
Definition: environmentalCreationData.h:287
#define DtLineWidthFromAppearance(theAppr)
Definition: environmentalCreationData.h:29
std::map< int, DtString > myExtendedLabels
Definition: environmentalCreationData.h:295
void setPhysicalLineWidth(float h)
Definition: environmentalCreationData.h:121
const std::map< int, DtString > & extendedLabels() const
Definition: environmentalCreationData.h:86
void setAppearance(int i)
Definition: environmentalCreationData.h:191
float physicalLineWidth() const
Definition: environmentalCreationData.h:126

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)