VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
automotivePSR.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
15 #include "vrfobjcore/simObject.h"
16 #include <readerWriter/rwReal.h>
17 #include <readerWriter/rwInt.h>
18 #include <readerWriter/rwBoolean.h>
19 #include <readerWriter/rwString.h>
20 #include "readerWriter/rwVector.h"
23 
25 {
30 };
31 
33 
37 {
38 public:
39 
41  DtAutomotivePSR(DtLocalObject* vrfObject,
42  const DtString& rwName = DtString::nullString(),
43  DtReaderWriterRegistry* parentRegistry = 0);
44 
46  DtAutomotivePSR(const DtAutomotivePSR& orig,
47  const DtString& rwName = DtString::nullString(),
48  DtReaderWriterRegistry* parentRegistry = 0);
49 
51  virtual ~DtAutomotivePSR();
52 
55 
58  const DtString& rwName = DtString::nullString(),
59  DtReaderWriterRegistry* parentRegistry = 0) const;
60 
63  virtual DtString type() const;
64 
67  virtual void setCurrentGear(DtAutoTransmissionGear gear);
68  virtual DtAutoTransmissionGear currentGear() const;
70 
73  virtual void setHeadingToTurnTo(double headingToTurnTo);
74  virtual double headingToTurnTo() const;
76 
79  virtual void setTurnToMode(int);
80  virtual int turnToMode() const;
82 
87  virtual void setKTurnReverseGoalHeading(double kTurnReverseGoalHeading);
88  virtual double kTurnReverseGoalHeading() const;
90 
93  void setCurrentRouteIndex(int currentRouteIndex);
94  int currentRouteIndex() const;
96 
101  virtual void setKTurnReverseComplete(bool kTurnReverseComplete);
102  virtual bool kTurnReverseComplete() const;
104 
108  virtual void setControlObject(const DtUUID& object);
109 
111  virtual DtSimObjectReference controlObject() const;
113 
118  virtual void setContinueFlag(bool flag);
119  virtual bool continueFlag() const;
121 
127  virtual void setWorldDestination(const DtVector& destination);
128  virtual const DtVector& worldDestination() const;
130 
136  virtual bool intermediateWorldDestinationValid() const;
137  virtual void invalidateIntermediateWorldDestination();
138  virtual void setIntermediateWorldDestination(const DtVector& destination);
139  virtual const DtVector& intermediateWorldDestination() const;
141 
144  virtual void setEntityToFollow(const DtUUID& objectName);
145  virtual DtSimObjectReference entityToFollow() const;
147 
151  virtual void setFollowingOffsetVector(const DtVector& offsetVector);
152  virtual const DtVector& followingOffsetVector() const;
154 
157  virtual void setEntityToInterceptAndDestroy(const DtUUID&);
158  virtual DtSimObjectReference entityToInterceptAndDestroy() const;
160 
163  virtual void setStandOffDistance(const double distance);
164  virtual const double standOffDistance() const;
166 
170  virtual void setRoute(const DtUUID& route);
171 
173  virtual DtSimObjectReference route() const;
175 
179  virtual void setRouteVertices(const DtLocalVectorIterator& routeIterator);
180  virtual const DtLocalVertexList& routeVertices() const;
182 
184  virtual void emptyRouteVertices();
185 
188  virtual DtLocalVectorIterator* routeState() const;
189 
192  virtual void setReversePatrol(bool flag);
193  virtual bool reversePatrol() const;
195 
198  virtual void setFirstWaypoint(const DtUUID& waypoint);
199  virtual DtSimObjectReference firstWaypoint() const;
201 
204  virtual void setSecondWaypoint(const DtUUID& waypoint);
205  virtual DtSimObjectReference secondWaypoint() const;
207 
210  virtual void setIsColliding(bool colliding);
211  virtual bool isColliding() const;
213 
216  virtual void setIsClearing(bool clearing);
217  virtual bool isClearing() const;
219 
222  virtual void setAvoidingLeft(bool avoidingLeft);
223  virtual bool avoidingLeft() const;
225 
229  virtual void setCheckForTerrainCollisions(bool checkForCollisions);
230  virtual bool checkForTerrainCollisions() const;
232 
233 
244  virtual void setUseHighFidelityGroundClamping(bool yesOrNo);
245  virtual bool useHighFidelityGroundClamping() const;
247 
248 
253  virtual void setRoadStartPoint(const DtVector& point);
254  virtual DtVector roadStartPoint() const;
255 
256  virtual void setRoadEndPoint(const DtVector& point);
257  virtual DtVector roadEndPoint() const;
259 
262  virtual void unspecifyRoadPoints();
265  virtual bool roadPointsSpecified() const;
266 
269  virtual void setRouteIsDiscovered(bool value);
270  virtual bool routeIsDiscovered() const;
272 
275  virtual void setUseTaskSpeed(bool value);
276  virtual bool useTaskSpeed() const;
277 
278  virtual void setTaskSpeed(double value);
279  virtual double taskSpeed() const;
281 
284  virtual int currentVertex() const;
285 
287  virtual void putSelf(std::string& fp, int indentLevel = 0, bool writeUnspecified = false,
288  const DtFilename& path = DtReaderWriter::appPath());
289 
290 public:
291 
293  static DtVrfProcessStateRepository* creator (const DtString& rwName,
294  DtLocalObject* vrfObject, DtReaderWriterRegistry* parentRegistry);
295 
296 protected:
297 
307 
314 
321 
335 
340 
349 
352 
361 
364 
367 
369 
373 
379 
381 
388 
394 
396 };
UUID is a unique ID wrapper class.
Definition: rwUUID.h:226
DtRwBoolean myReverseFlag
From DtGroundPatrolRouteController (gndPtrlRtCtl.h)
Definition: automotivePSR.h:339
Definition: automotivePSR.h:27
DtRwInt myCurrentRouteIndex
From DtGroundAutoController (gndAutoCntlr.h) (enum DtAutoTransmissionGear)
Definition: automotivePSR.h:302
DtRwSimObjectReference myEntityToFollow
From DtGroundFollowEntityController (gndFollwCtl.h)
Definition: automotivePSR.h:319
DtLocalVertexList myVertices
my copy of the current route
Definition: automotivePSR.h:332
DtRwInt myCurrentVertex
Read/write variables to capture route state.
Definition: automotivePSR.h:334
DtRwSimObjectReference myEntityToInterceptAndDestroy
Definition: automotivePSR.h:351
File: lclVecIter.h.
Definition: localVectorIterator.h:25
DtRwBoolean myIsColliding
From DtGroundCollisionAvoidanceController (gndColAvoid.h)
Definition: automotivePSR.h:358
DtRwBoolean myCheckForTerrainCollisions
Definition: automotivePSR.h:368
DtRwBoolean myIsClearing
Definition: automotivePSR.h:359
DtRwVector myWorldDestination
World point for move to location tasks.
Definition: automotivePSR.h:363
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
DtRwReal myKTurnReverseGoalHeading
Definition: automotivePSR.h:305
DtRwVector myIntermediateWorldDestination
Intermediate world point for move to location tasks.
Definition: automotivePSR.h:366
DtRwBoolean myUseHighFidelityGroundClamping
Used by the automotive actuator when determining the orientation of the entity.
Definition: automotivePSR.h:372
Definition: readerWriterRegistry.h:39
DtAutoTransmissionGearEnum DtAutoTransmissionGear
Definition: automotivePSR.h:32
DtRwBoolean myRouteIsDiscovered
Determines whether we will keep moving after this task is done and hence shouldn&#39;t slow down...
Definition: automotivePSR.h:386
DtRwBoolean myContinueFlag
Definition: automotivePSR.h:380
DtRwSimObjectReference myControlObject
From DtGroundMoveToControllerComponent (gndMvToCntlr.h)
Definition: automotivePSR.h:313
DtRwReal myTaskSpeed
Are we using speed from task message, or default ordered speed?
Definition: automotivePSR.h:391
Definition: rwVector.h:23
DtRwBoolean myAvoidingLeft
Definition: automotivePSR.h:360
Specialized reader/writer version of the shared object reference that will encapsulate the actual sha...
Definition: simObjectReference.h:74
Instances of DtAutomotivePSR are used to hold the shared/checkpointable data for an automotive system...
Definition: automotivePSR.h:36
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points. Coordinates are in local database coordinates The coordinat...
Definition: automotivePSR.h:28
Description: Readable, Writable int.
Definition: rwInt.h:25
virtual DtVrfProcessStateRepository * clone(const DtString &rwName=DtString::nullString(), DtReaderWriterRegistry *parentRegistry=0) const =0
DtRwVector myRoadEndPoint
Road currently being used by DtGroundMoveToDestinationControllerComponent.
Definition: automotivePSR.h:377
DtRwSimObjectReference myRoute
From DtGroundMoveAlongController (gndMvAlgCtl.h)
Definition: automotivePSR.h:327
DtRwVector myOffsetVector
Definition: automotivePSR.h:320
DtRwInt myTurnToMode
Definition: automotivePSR.h:395
virtual void putSelf(std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
Top level call to write itself to file. If write unspecified is true, will write entries that are uns...
DtRwSimObjectReference myFirstWaypoint
From DtGroundPatrolBetweenController.
Definition: automotivePSR.h:345
Description: Readable, Writable DtReal (double)
Definition: rwReal.h:27
Definition: automotivePSR.h:26
DtRwReal myHeadingToTurnTo
Definition: automotivePSR.h:304
Class DtVrfProcessStateRepository: Abstract base class for all process state repositories. Process state repositories represent (potentially) shared, savable information for one or more components functioning together to achieve some process or set of processes; such as aiming and firing a weapon; moving an object; or just waiting a specified amount of time.
Definition: vrfProcessStateRepository.h:45
Description: Readable, Writable bool.
Definition: rwBoolean.h:26
DtAutoTransmissionGearEnum
Definition: automotivePSR.h:24
DtRwReal myStandOffInterceptDistance
Reuse above myReverseFlag from DtGroundPatrolRouteController bool myReverseFlag;. ...
Definition: automotivePSR.h:350
DtRwSimObjectReference mySecondWaypoint
Definition: automotivePSR.h:346
virtual DtString type() const =0
Returns the string type of the repository, as defined in procSRTypes.h.
Definition: automotivePSR.h:29
DtLocalVectorIterator * myRouteState
Route state used to get info about the current route we&#39;re trying to follow (e.g. which vertex to mov...
Definition: automotivePSR.h:330
class DtLocalVertexList:
Definition: localVertexList.h:20
DtRwBoolean myKTurnReverseComplete
Definition: automotivePSR.h:306
DtRwVector myRoadStartPoint
Road currently being used by DtGroundMoveToDestinationControllerComponent.
Definition: automotivePSR.h:376
File: rwVector.h.
static const DtFilename & appPath()
Gets the current working directory. The first time this accessor is called, it determines the current...
const DtVrfProcessStateRepository & operator=(const DtVrfProcessStateRepository &orig)
DtRwInt myCurrentGear
Definition: automotivePSR.h:303
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86
DtRwBoolean myUseTaskSpeed
Are we using speed from task message, or default ordered speed?
Definition: automotivePSR.h:392

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)