VR-Forces 4.3 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  {
56  }
57 
59  : myName(orig.myName)
60  , myLabel(orig.myLabel)
61  , myColor(orig.myColor)
62  , myOverlayParent(orig.myOverlayParent)
63  , myIsProjected(orig.myIsProjected)
64  , myIsClosedFigure(orig.myIsClosedFigure)
65  , myAppearance(orig.myAppearance)
66  , myAttachedTo(orig.myAttachedTo)
67  , myUserData(orig.myUserData)
68  , myRequestId(orig.myRequestId)
69  , myExtendedData(orig.myExtendedData)
70  , myExtendedLabels(orig.myExtendedLabels)
71  {
72  }
73 
74  void setExtendedLabels(const std::map<int, DtString>& extendedData)
75  {
76  myExtendedLabels = extendedData;
77  }
78 
79  const std::map<int, DtString>& extendedLabels() const
80  {
81  return myExtendedLabels;
82  }
83 
84  std::map<int, DtString>& extendedLabels()
85  {
86  return myExtendedLabels;
87  }
88 
89  void setExtendedData(const std::map<std::string, std::string>& extendedData)
90  {
91  myExtendedData = extendedData;
92  }
93 
94  const std::map<std::string, std::string>& extendedData() const
95  {
96  return myExtendedData;
97  }
98 
99  std::map<std::string, std::string>& extendedData()
100  {
101  return myExtendedData;
102  }
103 
104  void setName(const std::string& n)
105  {
106  myName = n;
107  }
108 
109  const std::string& name() const
110  {
111  return myName;
112  }
113 
114  void setLabel(const std::string& l)
115  {
116  myLabel = l;
117  }
118 
119  const std::string& label() const
120  {
121  return myLabel;
122  }
123 
124  void setColor(int c)
125  {
126  myColor = c;
127  }
128 
129  int color() const
130  {
131  return myColor;
132  }
133 
134  void setOverlayParent(const std::string& s)
135  {
136  myOverlayParent = s;
137  }
138 
139  const std::string& overlayParent() const
140  {
141  return myOverlayParent;
142  }
143 
144  void setIsProjected(bool b)
145  {
146  myIsProjected = b;
147  }
148 
149  bool isProjected() const
150  {
151  return myIsProjected;
152  }
153 
154  void setIsClosedFigure(bool b)
155  {
156  myIsClosedFigure = b;
157  }
158 
159  bool isClosedFigure() const
160  {
161  return myIsClosedFigure;
162  }
163 
164  void setAppearance(int i)
165  {
166  myAppearance = lineWidth() | (i & DtAppearanceMask);
167  }
168 
169  int appearance() const
170  {
171  return (rawAppearance() & DtAppearanceMask);
172  }
173 
174  void setAttachedTo(const std::string& a)
175  {
176  myAttachedTo = a;
177  }
178 
179  const std::string& attachedTo() const
180  {
181  return myAttachedTo;
182  }
183 
184  void setUserData(const std::string& u)
185  {
186  myUserData = u;
187  }
188 
189  const std::string& userData() const
190  {
191  return myUserData;
192  }
193 
194  void setRequestId(unsigned int id)
195  {
196  myRequestId = id;
197  }
198 
199  int requestId() const
200  {
201  return myRequestId;
202  }
203 
204  int rawAppearance() const
205  {
206  return myAppearance;
207  }
208 
209  void setPenStyle(int i)
210  {
211  myAppearance = (rawAppearance() & 0xFFFFF0FF) | (i << 8);
212  }
213 
214  int penStyle() const
215  {
216  int appearance = rawAppearance();
217 
218  return DtPenStyleFromAppearance(appearance);
219  }
220 
224  void setFillStyle(int i)
225  {
226  myAppearance = (rawAppearance() & 0xFFFF0FFF) | (i << 12);
227  }
228 
229  int fillStyle() const
230  {
231  int appearance = rawAppearance();
232 
233  return DtFillStyleFromAppearance(appearance);
234  }
235 
236  void setLineWidth(int i)
237  {
238  myAppearance = appearance() | (i << 28);
239  }
240 
241  int lineWidth() const
242  {
243  return DtLineWidthFromAppearance(myAppearance);
244  }
245 
246  protected:
247  std::string myName;
248  std::string myLabel;
249  int myColor;
250  std::string myOverlayParent;
254  std::string myAttachedTo;
255  std::string myUserData;
256  unsigned int myRequestId;
257  std::map<std::string, std::string> myExtendedData;
258  std::map<int, DtString> myExtendedLabels;
259  };
260 }

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)