VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
persistentTracksCommand.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
11 #include "vrfplan/simCommand.h"
12 #include "vrfplan/vrfplanDefines.h"
13 #include "vrfutil/rwKeyValueList.h"
14 #include "vrfutil/rwVectorList.h"
15 
16 #include <readerWriter/rwInt.h>
17 #include <readerWriter/rwReal.h>
18 
22 {
23 public:
26 
28  DtPersistentTracksCommand(const DtString& writeName,
29  DtReaderWriterRegistry* parentRegistry = NULL);
30 
32  DtPersistentTracksCommand(const DtString & writeName, const DtPersistentTracksCommand& orig,
33  DtReaderWriterRegistry* parentRegistry = NULL);
34 
36  virtual ~DtPersistentTracksCommand();
37 
40 
42  virtual DtString stringRep() const = 0; //Purely virtual due to different string reps
43  virtual int netRepSize() const;
44 
46  virtual bool setFromNet(const char* contentBuffer, unsigned contentSize);
47 
49  virtual bool setToNet();
50 
52 
53  virtual const DtRwVectorList& vertices() const;
54  virtual void addVertexToVector(const DtRwVector&);
55  virtual void setVertices(const DtRwVectorList&);
57 
58 protected:
60 
61 };
62 
63 template<class CommandType>
65 {
66  return new CommandType();
67 }
68 
72 {
73 public:
75  static std::vector<DtString> theTrackTypesStringRep;
76  static std::vector<DtString> theTrackDepthsStringRep;
77  static std::vector<DtString> theTrackAmountsStringRep;
78 
80  static DtString getTrackType(int);
81  static int getTrackType(const DtString&);
82 
83  static DtString getTrackDepth(int);
84  static int getTrackDepth(const DtString&);
85 
86  static DtString getTrackAmount(int);
87  static int getTrackAmount(const DtString&);
88 
91 
93  DtAddPersistentTracksCommand(const DtString& writeName,
94  DtReaderWriterRegistry* parentRegistry = NULL);
95 
97  DtAddPersistentTracksCommand(const DtString & writeName,
98  const DtAddPersistentTracksCommand& orig,
99  DtReaderWriterRegistry* parentRegistry = NULL);
100 
103 
106 
108 
109  virtual void setTrackType(DtString);
110  virtual DtString trackType() const;
112 
114 
115  virtual void setTrackAmount(DtString);
116  virtual DtString trackAmount() const;
118 
120 
121  virtual void setTrackDepth(DtString);
122  virtual DtString trackDepth() const;
124 
126  virtual DtString stringRep() const;
127  virtual int netRepSize() const;
128 
130  virtual bool setFromNet(const char* contentBuffer, unsigned contentSize);
131 
133  virtual bool setToNet();
134 
136 
137  virtual DtSimCommand* clone(const DtString & name, DtReaderWriterRegistry * parentRegistry = 0) const
138  {
139  return new DtAddPersistentTracksCommand(name, *this, parentRegistry);
140  }
141 
142 protected:
146 
147 };
148 
152 {
153 public:
156 
159  DtReaderWriterRegistry* parentRegistry = NULL)
160  : DtPersistentTracksCommand(writeName, parentRegistry) {};
161 
164  DtReaderWriterRegistry* parentRegistry = NULL)
165  : DtPersistentTracksCommand(writeName, orig, parentRegistry) {};
166 
169 
171  virtual DtString stringRep() const;
172 
174 
175  virtual DtSimCommand* clone(const DtString & name, DtReaderWriterRegistry * parentRegistry = 0) const
176  {
177  return new DtRemovePersistentTracksCommand(name, *this, parentRegistry);
178  }
179 };
DtPersistentTracksCommand & operator=(const DtPersistentTracksCommand &)
Assignment operator.
virtual int netRepSize() const
Returns the size in bytes of the network representation of the class.
DtRemovePersistentTracksCommand(const DtString &writeName, const DtRemovePersistentTracksCommand &orig, DtReaderWriterRegistry *parentRegistry=NULL)
Copy constructor.
Definition: persistentTracksCommand.h:163
virtual const DtSimCommandMessageType & type() const
Definition: persistentTracksCommand.h:173
virtual bool setToNet()
Calls netRep() to create the network buffer.
DtSimCommand * persistentTracksCommandCreator()
Definition: persistentTracksCommand.h:64
Description: Readable, Writable DtString Variable substitutions are done on this object when it is re...
Definition: rwString.h:20
virtual DtString stringRep() const =0
Returns a human-readable string representation of the command.
Definition: readerWriterRegistry.h:39
DtRwString myTrackType
Definition: persistentTracksCommand.h:143
const DtSimCommandMessageType DtAddPersistentTracksCommandType("add-persistent-tracks-command")
DtSimCommand which causes a specific list of dynamic terrain changes to take place at the specified g...
Definition: persistentTracksCommand.h:71
Definition: rwVector.h:23
static std::vector< DtString > theTrackAmountsStringRep
Definition: persistentTracksCommand.h:77
virtual DtSimCommand * clone(const DtString &name, DtReaderWriterRegistry *parentRegistry=0) const
Make a copy of this sim command.
Definition: persistentTracksCommand.h:175
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize)
Sets mySubsimCommand member from the incoming contentBuffer (cast to type DtNetSimSimCommand).
DtSimCommand which causes a specific list of dynamic terrain changes to take place at the specified g...
Definition: persistentTracksCommand.h:151
virtual int netRepSize() const
Returns the size in bytes of the network representation of the class.
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize)
Sets mySubsimCommand member from the incoming contentBuffer (cast to type DtNetSimSimCommand).
const DtSimCommandMessageType DtRemovePersistentTracksCommandType("remove-persistent-tracks-command")
virtual DtString stringRep() const =0
Command type (string)
virtual const DtSimCommandMessageType & type() const
Definition: persistentTracksCommand.h:135
DtRwVectorList myVertices
Definition: persistentTracksCommand.h:59
const DtSimCommand & operator=(const DtSimCommand &orig)
assignment operator; same as copy constructor
DtSimCommand is an abstract base class from which commands can derive.
Definition: simCommand.h:32
DtRwString myTrackDepth
Definition: persistentTracksCommand.h:145
Base class for any DtSimCommand which persistent changes to be added or removed.
Definition: persistentTracksCommand.h:21
virtual ~DtRemovePersistentTracksCommand()
Destructor.
Definition: persistentTracksCommand.h:168
DtRwString myTrackAmount
Definition: persistentTracksCommand.h:144
virtual bool setToNet()
Calls netRep() to create the network buffer.
static std::vector< DtString > theTrackDepthsStringRep
Definition: persistentTracksCommand.h:76
#define DT_DLL_vrfplan
This file is used to determine how to build.
Definition: vrfplanDefines.h:28
static std::vector< DtString > theTrackTypesStringRep
Static Vectors.
Definition: persistentTracksCommand.h:75
DtRemovePersistentTracksCommand(const DtString &writeName, DtReaderWriterRegistry *parentRegistry=NULL)
Usual constructor.
Definition: persistentTracksCommand.h:158
class DtRwVectorList:
Definition: rwVectorList.h:22
DtRemovePersistentTracksCommand()
Default constructor.
Definition: persistentTracksCommand.h:155
virtual DtSimCommand * clone(const DtString &name, DtReaderWriterRegistry *parentRegistry=0) const
Make a copy of this sim command.
Definition: persistentTracksCommand.h:137
virtual ~DtAddPersistentTracksCommand()
Destructor.
Definition: persistentTracksCommand.h:102

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)