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 
152 protected:
161 
171 
172  std::list<DtEntityType> myAdditionalMatchTypes;
173  DtEntityType myMatchType;
175 
177 };
178 
180 {
181  return myIconLists;
182 }
183 
185 {
186  return myIconLists;
187 }
188 
190 {
191  myIconLists = l;
192 }
193 
194 inline void DtModelSetEntry::setIconForList(const DtString& icon, const DtString& list)
195 {
197  DtRwStringAttribute atr(list, list, icon);
199 }
200 
202 {
203  return myIconLists.value(key);
204 }
205 
206 inline void DtModelSetEntry::setLabel(const DtString& s)
207 {
208  myLabel = s;
209 }
210 
212 {
213  return myLabel;
214 }
215 
217 {
218  myPlatform = s;
219 }
220 
222 {
223  return myPlatform;
224 }
225 
227 {
228  myMenuIcon = s;
229 }
230 
232 {
233  return myMenuIcon;
234 }
235 
237 {
238  myKeywords = s;
239 }
240 
242 {
243  return myKeywords;
244 }
245 
247 {
249 }
250 
252 {
253  return myDefaultOverlayLayer;
254 }
255 
257 {
258  myUniqueID = s;
259 }
260 
262 {
263  return myUniqueID;
264 }
265 
266 inline void DtModelSetEntry::setCanCreate(bool b)
267 {
268  myCanCreate = b;
269 }
270 
271 inline bool DtModelSetEntry::canCreate() const
272 {
273  return myCanCreate;
274 }
275 
277 {
278  myCanAggregate = b;
279 }
280 
281 inline bool DtModelSetEntry::canAggregate() const
282 {
283  return myCanAggregate;
284 }
285 
286 inline void DtModelSetEntry::setObjectType(const DtEntityType& o)
287 {
288  myObjectType = o;
289 }
290 
291 inline const DtEntityType& DtModelSetEntry::objectType() const
292 {
293  return myObjectType;
294 }
295 
296 inline const std::list<DtEntityType>& DtModelSetEntry::additionalMatchTypes() const
297 {
298  return myAdditionalMatchTypes;
299 }
300 
301 inline std::list<DtEntityType>& DtModelSetEntry::additionalMatchTypes()
302 {
303  return myAdditionalMatchTypes;
304 }
305 
306 inline void DtModelSetEntry::setMatchType(const DtEntityType& o)
307 {
308  myMatchType = o;
309 }
310 
311 inline const DtEntityType& DtModelSetEntry::matchType() const
312 {
313  return myMatchType;
314 }
315 
317 {
318  myForces = f;
319 }
320 
321 inline const DtRwForces& DtModelSetEntry::forces() const
322 {
323  return myForces;
324 }
325 
327 {
328  return myForces;
329 }
330 
332 {
333  myCategories = c;
334 }
335 
337 {
338  return myCategories;
339 }
340 
342 {
344 }
345 
347 {
348  return myDeployableCountries;
349 }
350 
352 {
354 }
355 
357 {
358  return myIncludeInBVSPCalcs;
359 }
360 
362 {
363  myIsRandomized = b;
364 }
365 
366 inline bool DtModelSetEntry::isRandomized() const
367 {
368  return myIsRandomized;
369 }
370 
372 {
373  myInternalNotes = s;
374 }
375 
377 {
378  return myInternalNotes;
379 }
380 
381 inline bool DtModelSetEntry::hasCategory(const DtString& cat) const
382 {
383  return (myCategories.indexOfValue(cat) != -1);
384 }
bool operator==(const DtReaderWriter &) const
Equivalence operator.
DtRwNLengthStringVector myDeployableCountries
Definition: modelSetEntry.h:165
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:281
void setDefaultOverlayLayer(const DtString &)
Definition: modelSetEntry.h:246
virtual int indexOfValue(const DtString &value) const
const DtRwForces & forces() const
Definition: modelSetEntry.h:321
const std::list< DtEntityType > & additionalMatchTypes() const
Definition: modelSetEntry.h:296
void setCategories(const DtRwNLengthStringVector &)
Definition: modelSetEntry.h:331
void setIncludeInBVSPCalcs(bool)
Whether or not to include in bounding volume or support point calcs from the entity editor...
Definition: modelSetEntry.h:351
DtRwString myUniqueID
Definition: modelSetEntry.h:156
bool canCreate() const
Definition: modelSetEntry.h:271
void setIconForList(const DtString &, const DtString &)
Definition: modelSetEntry.h:194
DtRwBoolean myCanAggregate
Definition: modelSetEntry.h:154
#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:157
void setDeployableCountries(const DtRwNLengthStringVector &)
Definition: modelSetEntry.h:341
void setPlatform(const DtString &)
Definition: modelSetEntry.h:216
DtRwNLengthStringVector myCategories
Definition: modelSetEntry.h:164
bool hasCategory(const DtString &) const
Definition: modelSetEntry.h:381
DtRwBoolean myIncludeInBVSPCalcs
Definition: modelSetEntry.h:167
DtString defaultOverlayLayer() const
Definition: modelSetEntry.h:251
DtRwString myMenuIcon
Definition: modelSetEntry.h:158
const DtRwNLengthStringVector & categories() const
Definition: modelSetEntry.h:336
void setUniqueID(const DtString &)
Definition: modelSetEntry.h:256
DtRwForces myForces
Definition: modelSetEntry.h:163
Definition: readerWriter.h:85
DtString myShortName
Definition: modelSetEntry.h:169
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:366
DtString label() const
Definition: modelSetEntry.h:211
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:306
DtRwBoolean myCanCreate
Definition: modelSetEntry.h:153
Definition: readerWriterRegistry.h:39
void setKeywords(const DtString &)
Definition: modelSetEntry.h:236
DtString keywords() const
Definition: modelSetEntry.h:241
void setCanAggregate(bool)
Definition: modelSetEntry.h:276
DtRwStringAttributeList myIconLists
Definition: modelSetEntry.h:166
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:371
DtString menuIcon() const
Definition: modelSetEntry.h:231
Definition: modelSetEntry.h:34
static DtModelSetEntryCreatorFcn theModelSetEntryCreatorFcn
Definition: modelSetEntry.h:174
bool operator!=(const DtReaderWriter &rhs) const
Definition: readerWriter.h:121
DtString myInternalNotes
Definition: modelSetEntry.h:176
void setMenuIcon(const DtString &)
Definition: modelSetEntry.h:226
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:179
DtString platform() const
Definition: modelSetEntry.h:221
void setObjectType(const DtEntityType &)
Definition: modelSetEntry.h:286
std::list< DtEntityType > myAdditionalMatchTypes
Definition: modelSetEntry.h:172
DtEntityType myMatchType
Definition: modelSetEntry.h:173
DtString uniqueID() const
Definition: modelSetEntry.h:261
const DtString & internalNotes() const
Definition: modelSetEntry.h:376
Description: A readable, writable list of DtForceType.
Definition: rwForces.h:34
File: rwEntType.h.
Definition: rwEntityType.h:26
DtRwEntityType myObjectType
Definition: modelSetEntry.h:162
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:291
bool includeInBVSPCalcs() const
Definition: modelSetEntry.h:356
const DtRwNLengthStringVector & deployableCountries() const
Definition: modelSetEntry.h:346
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:361
DtString iconForList(const DtString &) const
Definition: modelSetEntry.h:201
DT_DLL_readerWriter std::shared_ptr< DtEnvironment > DtEnvironmentSP
Definition: readerWriter.h:30
DtRwString myDescription
Definition: modelSetEntry.h:160
void setIconLists(const DtRwStringAttributeList &)
Definition: modelSetEntry.h:189
DtRwString myLabel
Definition: modelSetEntry.h:155
DtRwString myDefaultOverlayLayer
Definition: modelSetEntry.h:159
void setForces(const DtRwForces &)
Definition: modelSetEntry.h:316
void setLabel(const DtString &)
Definition: modelSetEntry.h:206
void setCanCreate(bool)
Definition: modelSetEntry.h:266
class DtRwStringAttributeList:
Definition: rwStringAttributeList.h:29
const DtEntityType & matchType() const
Definition: modelSetEntry.h:311
DtRwBoolean myIsRandomized
Definition: modelSetEntry.h:170
DtString myPlatform
Definition: modelSetEntry.h:168

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)