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>
10 #include <vrfutil/rwEntityType.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() override;
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 DtEntityType&);
83  const DtEntityType& objectType() const;
84 
87  void setMatchType(const DtEntityType&);
88  const DtEntityType& matchType() const;
89 
90  const std::list<DtEntityType>& additionalMatchTypes() const;
91  std::list<DtEntityType>& 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 
112  void setInternalNotes(const DtString&);
113  const DtString& internalNotes() const;
114 
115  void setForces(const DtRwForces&);
116  const DtRwForces& forces() const;
117  DtRwForces& forces();
118 
119  void setCategories(const DtRwNLengthStringVector&);
120  const DtRwNLengthStringVector& categories() const;
121  bool hasCategory(const DtString&) const;
122 
123  void setDefaultOverlayLayer(const DtString&);
124  DtString defaultOverlayLayer() const;
125 
126  void setDeployableCountries(const DtRwNLengthStringVector&);
127  const DtRwNLengthStringVector& deployableCountries() const;
128 
131  const DtRwStringAttributeList& iconLists() const;
132  DtRwStringAttributeList& iconLists();
133  void setIconLists(const DtRwStringAttributeList&);
134  void setIconForList(const DtString&, const DtString&);
135  DtString iconForList(const DtString&) const;
136 
137  virtual bool operator==(const DtModelSetEntry&) const;
138  virtual bool operator!=(const DtModelSetEntry&) const;
139 
143  virtual void readFromEnvironment(DtEnvironmentSP, DtEnvValueSP objectNode, bool keepCurrentData = false);
144 
148  virtual void writeToEnvironment(DtEnvironmentSP, DtEnvValueSP objectNode, std::vector<DtString>* = nullptr, DtModelSetEntry* = nullptr) const;
149 
150  virtual void updateImageData(char from, char to) const;
151 
153  virtual const DtFilename& filename() const;
154  virtual void setFilename(const DtFilename&);
155 
156 protected:
157  DtFilename myFilename;
166 
176 
177  std::list<DtEntityType> myAdditionalMatchTypes;
178  DtEntityType myMatchType;
180 
182 };
183 
185 {
186  return myIconLists;
187 }
188 
190 {
191  return myIconLists;
192 }
193 
195 {
196  myIconLists = l;
197 }
198 
199 inline void DtModelSetEntry::setIconForList(const DtString& icon, const DtString& list)
200 {
202  DtRwStringAttribute atr(list, list, icon);
204 }
205 
207 {
208  return myIconLists.value(key);
209 }
210 
211 inline void DtModelSetEntry::setLabel(const DtString& s)
212 {
213  myLabel = s;
214 }
215 
217 {
218  return myLabel;
219 }
220 
222 {
223  myPlatform = s;
224 }
225 
227 {
228  return myPlatform;
229 }
230 
232 {
233  myMenuIcon = s;
234 }
235 
237 {
238  return myMenuIcon;
239 }
240 
242 {
243  myKeywords = s;
244 }
245 
247 {
248  return myKeywords;
249 }
250 
252 {
254 }
255 
257 {
258  return myDefaultOverlayLayer;
259 }
260 
262 {
263  myUniqueID = s;
264 }
265 
267 {
268  return myUniqueID;
269 }
270 
271 inline void DtModelSetEntry::setCanCreate(bool b)
272 {
273  myCanCreate = b;
274 }
275 
276 inline bool DtModelSetEntry::canCreate() const
277 {
278  return myCanCreate;
279 }
280 
282 {
283  myCanAggregate = b;
284 }
285 
286 inline bool DtModelSetEntry::canAggregate() const
287 {
288  return myCanAggregate;
289 }
290 
291 inline void DtModelSetEntry::setObjectType(const DtEntityType& o)
292 {
293  myObjectType = o;
294 }
295 
296 inline const DtEntityType& DtModelSetEntry::objectType() const
297 {
298  return myObjectType;
299 }
300 
301 inline const std::list<DtEntityType>& DtModelSetEntry::additionalMatchTypes() const
302 {
303  return myAdditionalMatchTypes;
304 }
305 
306 inline std::list<DtEntityType>& DtModelSetEntry::additionalMatchTypes()
307 {
308  return myAdditionalMatchTypes;
309 }
310 
311 inline void DtModelSetEntry::setMatchType(const DtEntityType& o)
312 {
313  myMatchType = o;
314 }
315 
316 inline const DtEntityType& DtModelSetEntry::matchType() const
317 {
318  return myMatchType;
319 }
320 
322 {
323  myForces = f;
324 }
325 
326 inline const DtRwForces& DtModelSetEntry::forces() const
327 {
328  return myForces;
329 }
330 
332 {
333  return myForces;
334 }
335 
337 {
338  myCategories = c;
339 }
340 
342 {
343  return myCategories;
344 }
345 
347 {
349 }
350 
352 {
353  return myDeployableCountries;
354 }
355 
357 {
359 }
360 
362 {
363  return myIncludeInBVSPCalcs;
364 }
365 
367 {
368  myIsRandomized = b;
369 }
370 
371 inline bool DtModelSetEntry::isRandomized() const
372 {
373  return myIsRandomized;
374 }
375 
377 {
378  myInternalNotes = s;
379 }
380 
382 {
383  return myInternalNotes;
384 }
385 
386 inline bool DtModelSetEntry::hasCategory(const DtString& cat) const
387 {
388  return (myCategories.indexOfValue(cat) != -1);
389 }
bool operator==(const DtReaderWriter &) const
Equivalence operator.
DtRwNLengthStringVector myDeployableCountries
Definition: modelSetEntry.h:170
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:286
void setDefaultOverlayLayer(const DtString &)
Definition: modelSetEntry.h:251
virtual int indexOfValue(const DtString &value) const
DtFilename myFilename
Definition: modelSetEntry.h:157
const DtRwForces & forces() const
Definition: modelSetEntry.h:326
const std::list< DtEntityType > & additionalMatchTypes() const
Definition: modelSetEntry.h:301
void setCategories(const DtRwNLengthStringVector &)
Definition: modelSetEntry.h:336
void setIncludeInBVSPCalcs(bool)
Whether or not to include in bounding volume or support point calcs from the entity editor...
Definition: modelSetEntry.h:356
DtRwString myUniqueID
Definition: modelSetEntry.h:161
bool canCreate() const
Definition: modelSetEntry.h:276
void setIconForList(const DtString &, const DtString &)
Definition: modelSetEntry.h:199
DtRwBoolean myCanAggregate
Definition: modelSetEntry.h:159
#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:162
void setDeployableCountries(const DtRwNLengthStringVector &)
Definition: modelSetEntry.h:346
void setPlatform(const DtString &)
Definition: modelSetEntry.h:221
DtRwNLengthStringVector myCategories
Definition: modelSetEntry.h:169
const char * filename
Definition: ioapi.h:38
bool hasCategory(const DtString &) const
Definition: modelSetEntry.h:386
DtRwBoolean myIncludeInBVSPCalcs
Definition: modelSetEntry.h:172
DtString defaultOverlayLayer() const
Definition: modelSetEntry.h:256
DtRwString myMenuIcon
Definition: modelSetEntry.h:163
const DtRwNLengthStringVector & categories() const
Definition: modelSetEntry.h:341
void setUniqueID(const DtString &)
Definition: modelSetEntry.h:261
DtRwForces myForces
Definition: modelSetEntry.h:168
Definition: readerWriter.h:85
DtString myShortName
Definition: modelSetEntry.h:174
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:371
DtString label() const
Definition: modelSetEntry.h:216
void setMatchType(const DtEntityType &)
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:311
DtRwBoolean myCanCreate
Definition: modelSetEntry.h:158
Definition: readerWriterRegistry.h:39
void setKeywords(const DtString &)
Definition: modelSetEntry.h:241
DtString keywords() const
Definition: modelSetEntry.h:246
void setCanAggregate(bool)
Definition: modelSetEntry.h:281
DtRwStringAttributeList myIconLists
Definition: modelSetEntry.h:171
void setInternalNotes(const DtString &)
Not saved or read from a file. This can be used for temporary storage of information about this entry...
Definition: modelSetEntry.h:376
DtString menuIcon() const
Definition: modelSetEntry.h:236
Definition: modelSetEntry.h:34
static DtModelSetEntryCreatorFcn theModelSetEntryCreatorFcn
Definition: modelSetEntry.h:179
bool operator!=(const DtReaderWriter &rhs) const
Definition: readerWriter.h:121
DtString myInternalNotes
Definition: modelSetEntry.h:181
void setMenuIcon(const DtString &)
Definition: modelSetEntry.h:231
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:184
DtString platform() const
Definition: modelSetEntry.h:226
void setObjectType(const DtEntityType &)
Definition: modelSetEntry.h:291
std::list< DtEntityType > myAdditionalMatchTypes
Definition: modelSetEntry.h:177
DtEntityType myMatchType
Definition: modelSetEntry.h:178
DtString uniqueID() const
Definition: modelSetEntry.h:266
const DtString & internalNotes() const
Definition: modelSetEntry.h:381
Description: A readable, writable list of DtForceType.
Definition: rwForces.h:34
File: rwEntType.h.
Definition: rwEntityType.h:26
DtRwEntityType myObjectType
Definition: modelSetEntry.h:167
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)
const DtEntityType & objectType() const
Definition: modelSetEntry.h:296
bool includeInBVSPCalcs() const
Definition: modelSetEntry.h:361
const DtRwNLengthStringVector & deployableCountries() const
Definition: modelSetEntry.h:351
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:366
DtString iconForList(const DtString &) const
Definition: modelSetEntry.h:206
DT_DLL_readerWriter std::shared_ptr< DtEnvironment > DtEnvironmentSP
Definition: readerWriter.h:30
DtRwString myDescription
Definition: modelSetEntry.h:165
void setIconLists(const DtRwStringAttributeList &)
Definition: modelSetEntry.h:194
DtRwString myLabel
Definition: modelSetEntry.h:160
DtRwString myDefaultOverlayLayer
Definition: modelSetEntry.h:164
void setForces(const DtRwForces &)
Definition: modelSetEntry.h:321
void setLabel(const DtString &)
Definition: modelSetEntry.h:211
void setCanCreate(bool)
Definition: modelSetEntry.h:271
class DtRwStringAttributeList:
Definition: rwStringAttributeList.h:29
const DtEntityType & matchType() const
Definition: modelSetEntry.h:316
DtRwBoolean myIsRandomized
Definition: modelSetEntry.h:175
DtString myPlatform
Definition: modelSetEntry.h:173

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)