VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
modelSetEntry.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2022 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
8 #include <vlutil/vlString.h>
11 #include <readerWriter/rwBoolean.h>
12 #include <readerWriter/rwString.h>
13 #include "vrfutil/rwForces.h"
18 #include "mtl/envValue.h"
19 #include "vrfXmlTypes.h"
20 
24 
31 class DtModelSetEntry;
32 typedef DtModelSetEntry* (*DtModelSetEntryCreatorFcn)(const DtString&, DtReaderWriterRegistry* parentRegistry);
33 
35 {
36 public:
39 
41  DtModelSetEntry(const DtString& name, DtReaderWriterRegistry* const parentRegistry = nullptr);
42 
44  DtModelSetEntry(const DtModelSetEntry& orig, DtReaderWriterRegistry* const parentRegistry = nullptr);
45 
47  virtual DtModelSetEntry& operator=(const DtModelSetEntry & orig);
48 
49  virtual ~DtModelSetEntry();
50 
51  virtual DtModelSetEntry* clone();
52 
53  virtual const char* readerWriterType();
54 
57  static DtModelSetEntryCreatorFcn SetModelSetEntryCreatorFcn(DtModelSetEntryCreatorFcn);
58  static DtModelSetEntryCreatorFcn ModelSetEntryCreatorFcn();
59  static DtModelSetEntry* Create(const DtString& name = "model-set-entry", DtReaderWriterRegistry* const parentRegistry = nullptr);
61 
62  DtString label() const;
63  void setLabel(const DtString&);
64 
65  DtString platform() const;
66  void setPlatform(const DtString&);
67 
68  DtString uniqueID() const;
69  void setUniqueID(const DtString&);
70 
73  void setIsRandomized(bool);
74  bool isRandomized() const;
75 
76  bool canCreate() const;
77  void setCanCreate(bool);
78 
79  bool canAggregate() const;
80  void setCanAggregate(bool);
81 
82  void setObjectType(const DtObjectType&);
83  const DtObjectType& objectType() const;
84 
87  void setMatchType(const DtObjectType&);
88  const DtObjectType& matchType() const;
89 
90  const std::list<DtObjectType>& additionalMatchTypes() const;
91  std::list<DtObjectType>& additionalMatchTypes();
92 
93  DtString menuIcon() const;
94  void setMenuIcon(const DtString&);
95 
96  void setKeywords(const DtString&);
97  DtString keywords() const;
98 
100  void setShortName(const DtString&);
101  const DtString& shortName() const;
102 
105  void setIncludeInBVSPCalcs(bool);
106  bool includeInBVSPCalcs() const;
107 
108  virtual void setDescription(const DtString&);
109  virtual const DtString& description() const;
110 
111  void setForces(const DtRwForces&);
112  const DtRwForces& forces() const;
113  DtRwForces& forces();
114 
115  void setCategories(const DtRwNLengthStringVector&);
116  const DtRwNLengthStringVector& categories() const;
117  bool hasCategory(const DtString&) const;
118 
119  void setDefaultOverlayLayer(const DtString&);
120  DtString defaultOverlayLayer() const;
121 
122  void setDeployableCountries(const DtRwNLengthStringVector&);
123  const DtRwNLengthStringVector& deployableCountries() const;
124 
127  const DtRwStringAttributeList& iconLists() const;
128  DtRwStringAttributeList& iconLists();
129  void setIconLists(const DtRwStringAttributeList&);
130  void setIconForList(const DtString&, const DtString&);
131  DtString iconForList(const DtString&) const;
132 
133  virtual bool operator==(const DtModelSetEntry&) const;
134  virtual bool operator!=(const DtModelSetEntry&) const;
135 
139  virtual void readFromEnvironment(DtEnvironmentSP, DtEnvValueSP objectNode, bool keepCurrentData = false);
140 
144  virtual void writeToEnvironment(DtEnvironmentSP, DtEnvValueSP objectNode, std::vector<DtString>* = nullptr, DtModelSetEntry* = nullptr) const;
145 
146  virtual void updateImageData(char from, char to) const;
147 
148 protected:
157 
167 
168  std::list<DtObjectType> myAdditionalMatchTypes;
171 };
172 
174 {
175  return myIconLists;
176 }
177 
179 {
180  return myIconLists;
181 }
182 
184 {
185  myIconLists = l;
186 }
187 
188 inline void DtModelSetEntry::setIconForList(const DtString& icon, const DtString& list)
189 {
191  DtRwStringAttribute atr(list, list, icon);
193 }
194 
196 {
197  return myIconLists.value(key);
198 }
199 
200 inline void DtModelSetEntry::setLabel(const DtString& s)
201 {
202  myLabel = s;
203 }
204 
206 {
207  return myLabel;
208 }
209 
211 {
212  myPlatform = s;
213 }
214 
216 {
217  return myPlatform;
218 }
219 
221 {
222  myMenuIcon = s;
223 }
224 
226 {
227  return myMenuIcon;
228 }
229 
231 {
232  myKeywords = s;
233 }
234 
236 {
237  return myKeywords;
238 }
239 
241 {
243 }
244 
246 {
247  return myDefaultOverlayLayer;
248 }
249 
251 {
252  myUniqueID = s;
253 }
254 
256 {
257  return myUniqueID;
258 }
259 
260 inline void DtModelSetEntry::setCanCreate(bool b)
261 {
262  myCanCreate = b;
263 }
264 
265 inline bool DtModelSetEntry::canCreate() const
266 {
267  return myCanCreate;
268 }
269 
271 {
272  myCanAggregate = b;
273 }
274 
275 inline bool DtModelSetEntry::canAggregate() const
276 {
277  return myCanAggregate;
278 }
279 
281 {
282  myObjectType = o;
283 }
284 
286 {
287  return myObjectType;
288 }
289 
290 inline const std::list<DtObjectType>& DtModelSetEntry::additionalMatchTypes() const
291 {
292  return myAdditionalMatchTypes;
293 }
294 
295 inline std::list<DtObjectType>& DtModelSetEntry::additionalMatchTypes()
296 {
297  return myAdditionalMatchTypes;
298 }
299 
301 {
302  myMatchType = o;
303 }
304 
306 {
307  return myMatchType;
308 }
309 
311 {
312  myForces = f;
313 }
314 
315 inline const DtRwForces& DtModelSetEntry::forces() const
316 {
317  return myForces;
318 }
319 
321 {
322  return myForces;
323 }
324 
326 {
327  myCategories = c;
328 }
329 
331 {
332  return myCategories;
333 }
334 
336 {
338 }
339 
341 {
342  return myDeployableCountries;
343 }
344 
346 {
348 }
349 
351 {
352  return myIncludeInBVSPCalcs;
353 }
354 
356 {
357  myIsRandomized = b;
358 }
359 
360 inline bool DtModelSetEntry::isRandomized() const
361 {
362  return myIsRandomized;
363 }
364 
365 inline bool DtModelSetEntry::hasCategory(const DtString& cat) const
366 {
367  return (myCategories.indexOfValue(cat) != -1);
368 }
bool operator==(const DtReaderWriter &) const
Equivalence operator.
DtRwNLengthStringVector myDeployableCountries
Definition: modelSetEntry.h:161
virtual DtString value(const DtString &) const
Given the key, return the value.
virtual const char * readerWriterType() const
Used to supply a string type that this reader writer type is. This can be used in place of dynamic-ca...
bool canAggregate() const
Definition: modelSetEntry.h:275
void setDefaultOverlayLayer(const DtString &)
Definition: modelSetEntry.h:240
virtual int indexOfValue(const DtString &value) const
const DtRwForces & forces() const
Definition: modelSetEntry.h:315
void setCategories(const DtRwNLengthStringVector &)
Definition: modelSetEntry.h:325
void setIncludeInBVSPCalcs(bool)
Whether or not to include in bounding volume or support point calcs from the entity editor...
Definition: modelSetEntry.h:345
DtRwString myUniqueID
Definition: modelSetEntry.h:152
bool canCreate() const
Definition: modelSetEntry.h:265
void setIconForList(const DtString &, const DtString &)
Definition: modelSetEntry.h:188
DtRwBoolean myCanAggregate
Definition: modelSetEntry.h:150
class DtRwObjectType:
Definition: rwObjectType.h:18
#define DT_DLL_vrfobjparam
This file is used to determine how to build.
Definition: vrfobjparamDefines.h:28
DtRwNLengthStringVector is a named, readable/writable vector of strings of arbitrary length...
Definition: rwNLengthStringVector.h:28
DtRwString myKeywords
Definition: modelSetEntry.h:153
void setDeployableCountries(const DtRwNLengthStringVector &)
Definition: modelSetEntry.h:335
void setPlatform(const DtString &)
Definition: modelSetEntry.h:210
DtRwNLengthStringVector myCategories
Definition: modelSetEntry.h:160
DT_DLL_readerWriter DtBoost::shared_ptr< DtEnvironment > DtEnvironmentSP
Definition: readerWriter.h:30
bool hasCategory(const DtString &) const
Definition: modelSetEntry.h:365
DtRwBoolean myIncludeInBVSPCalcs
Definition: modelSetEntry.h:163
DtString defaultOverlayLayer() const
Definition: modelSetEntry.h:245
void setObjectType(const DtObjectType &)
Definition: modelSetEntry.h:280
DtRwString myMenuIcon
Definition: modelSetEntry.h:154
const DtRwNLengthStringVector & categories() const
Definition: modelSetEntry.h:330
void setUniqueID(const DtString &)
Definition: modelSetEntry.h:250
DtRwForces myForces
Definition: modelSetEntry.h:159
Definition: readerWriter.h:85
DtString myShortName
Definition: modelSetEntry.h:165
Description: Readable, Writable DtString Variable substitutions are done on this object when it is re...
Definition: rwString.h:20
bool isRandomized() const
Definition: modelSetEntry.h:360
DtString label() const
Definition: modelSetEntry.h:205
DtRwBoolean myCanCreate
Definition: modelSetEntry.h:149
Definition: readerWriterRegistry.h:39
DtRwObjectType myObjectType
Definition: modelSetEntry.h:158
const DtObjectType & objectType() const
Definition: modelSetEntry.h:285
void setKeywords(const DtString &)
Definition: modelSetEntry.h:230
DtString keywords() const
Definition: modelSetEntry.h:235
void setCanAggregate(bool)
Definition: modelSetEntry.h:270
DtRwStringAttributeList myIconLists
Definition: modelSetEntry.h:162
Definition: objectType.h:27
DtString menuIcon() const
Definition: modelSetEntry.h:225
Definition: modelSetEntry.h:34
const DtObjectType & matchType() const
Definition: modelSetEntry.h:305
void setMatchType(const DtObjectType &)
The match type is a second entry that can be used to match against an object type. When finding this entry in a model set by matching by pattern, this match type (if specified) will be looked at first, then the more general object type for pattern matching.
Definition: modelSetEntry.h:300
DtObjectType myMatchType
Definition: modelSetEntry.h:169
static DtModelSetEntryCreatorFcn theModelSetEntryCreatorFcn
Definition: modelSetEntry.h:170
void setMenuIcon(const DtString &)
Definition: modelSetEntry.h:220
const DtRwStringAttributeList & iconLists() const
Accesor/mutator for list icons that can be applied to a category of list selected. If the object does not have an icon for the list then the default font (or menu image) will be used as a display.
Definition: modelSetEntry.h:173
DtString platform() const
Definition: modelSetEntry.h:215
DtString uniqueID() const
Definition: modelSetEntry.h:255
Description: A readable, writable list of DtForceType.
Definition: rwForces.h:34
class DtRwStringAttribute:
Definition: rwStringAttribute.h:19
DtModelSetEntry *(* DtModelSetEntryCreatorFcn)(const DtString &, DtReaderWriterRegistry *parentRegistry)
Definition: modelSetEntry.h:32
Description: Readable, Writable bool.
Definition: rwBoolean.h:26
virtual void removeStringAttribute(const DtString &key)
bool includeInBVSPCalcs() const
Definition: modelSetEntry.h:350
const DtRwNLengthStringVector & deployableCountries() const
Definition: modelSetEntry.h:340
virtual DtRwStringAttribute * addStringAttribute(const DtRwStringAttribute &stringAttribute)
const DtReaderWriter & operator=(const DtReaderWriter &orig)
assignment operator
void setIsRandomized(bool)
Whether or not this model represents a randomized object type. Randomized object types are just conta...
Definition: modelSetEntry.h:355
DtString iconForList(const DtString &) const
Definition: modelSetEntry.h:195
bool operator!=(const DtReaderWriter &rhs)
Definition: readerWriter.h:121
DtRwString myDescription
Definition: modelSetEntry.h:156
const std::list< DtObjectType > & additionalMatchTypes() const
Definition: modelSetEntry.h:290
void setIconLists(const DtRwStringAttributeList &)
Definition: modelSetEntry.h:183
DtRwString myLabel
Definition: modelSetEntry.h:151
DtRwString myDefaultOverlayLayer
Definition: modelSetEntry.h:155
void setForces(const DtRwForces &)
Definition: modelSetEntry.h:310
void setLabel(const DtString &)
Definition: modelSetEntry.h:200
std::list< DtObjectType > myAdditionalMatchTypes
Definition: modelSetEntry.h:168
void setCanCreate(bool)
Definition: modelSetEntry.h:260
class DtRwStringAttributeList:
Definition: rwStringAttributeList.h:29
DtRwBoolean myIsRandomized
Definition: modelSetEntry.h:166
DtString myPlatform
Definition: modelSetEntry.h:164

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)