VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
disaggregatedManeuverAlongController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2004 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
12 
13 #pragma once
14 
15 #include <vlutil/vlConfig.h>
16 #include <vector>
17 
22 
24 class DtFormationState;
25 class DtMoveAlongTask;
26 class DtSimMessage;
29 class DtSetDataRequest;
30 class DtVrfObjectManager;
32 
64 {
65 public:
66 
70  DtLocalObject* owner,
71  DtSimulationServices* simManager,
72  DtComponentDescriptor* desc = 0,
73  DtReaderWriterRegistry* parentRegistry = 0);
74 
75 
77  virtual ~DtDisaggregatedManeuverAlongController() override;
78 
81  virtual const char* type() const override;
82 
88  virtual bool init() override;
89 
95  virtual void registerTaskMsgCallbacks() override;
96 
98  virtual void preFirstTickInit() override;
99 
102  virtual void tick() override;
103 
108  virtual void clearTask() override;
109 
115  virtual bool createPSR();
116 
119  virtual DtSimTaskStatePtr currentTaskState() const override;
120 
122  static void maneuverAlongCallback(DtSimMessage* msg, void* usr, DtSimTaskStatePtr taskStatePtr);
123 
130  static void taskCompleteReportCallback(DtSimMessage * msg, void * usr);
131 
139  static void formationChangedCallback(const DtFormationState& formationState,
140  void* usr);
141 
145  static DtSimComponent * creator(const DtString& name,
146  DtLocalObject* owner,
147  DtSimulationServices* simManager,
148  DtComponentDescriptor* desc = 0,
149  DtReaderWriterRegistry* parentRegistry = 0);
150 
151 protected:
154  virtual bool originalIsSpeedSpecified() const;
155  virtual double originalSpeed() const;
156  virtual bool originalStartAtClosest() const;
157  virtual bool originalUseForwardDirection() const;
158  virtual DtUUID originalRouteUUID() const;
160 
163  virtual const DtSimTaskMessageType& originalTaskType() const;
164 
166  virtual void processManeuverAlong(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
167 
171  virtual void processFormationChanged(const DtFormationState& formationState);
172 
178  virtual void processTaskComplete(DtSimMessage * msg);
179 
183  virtual void processRouteChanged();
184 
192  virtual int sendTaskToSubordinate(const DtSimTask& task,
193  const DtUUID& subordinate);
194 
201  virtual void sendSetDataToSubordinate(const DtSetDataRequest& setData,
202  const DtUUID& subordinate) const;
203 
207  virtual void beginManeuverAlong(const DtUUID& routeName,
208  const bool startAtClosestPoint, const bool traverseForward);
209 
222  virtual int findClosestSegmentIndex(DtVector testPoint, std::vector<DtVector> testRoute,
223  DtPoint& closestSegmentLoc, double& distanceToSegment, int indexSegmentFloor = 0);
224 
234  virtual bool createSubordinateOffsetRoute(
235  const std::vector<DtVector>& localPoints,
236  const double rightOffset, const double forwardOffset,
237  DtUUID& routeUUID, DtUUID subordinateId);
238 
240  virtual bool isPlatform(const DtSimObjectReference& subject) const;
241 
244  virtual bool isSubordinateCapable(const DtUUID& sub) const;
245 
247  virtual bool isSubUnit(const DtSimObjectReference& subject) const;
248 
252  virtual int taskLeader(const DtUUID& leader, const DtSimObjectReferenceList& subs,
253  const DtUUID& leaderRoute,
254  const double formationWidth, const double formationLength);
255 
259  virtual int taskFollower(const DtUUID& subEntity, const DtUUID& formationLeader,
260  const DtUUID& unitRouteUUID, const double leaderForwardOffset,
261  const bool doReverseRoute, const double vertexStartIndex);
262 
267  virtual int taskSubunit(const DtUUID& subUnitId);
268 
271  virtual int taskSubunit(const DtUUID& subUnitId, const DtUUID& routeId);
272 
279  virtual void sendVrfObjectModifyMsg(const DtUUID& object, DtList* vertices) const;
280 
282  virtual void initializeMemberDataFromDescriptor(
283  const DtAggregateMoveAlongDescriptor& desc);
284 
292  virtual bool isUnitMovementExhausted();
293 
300  virtual void sendClearTask(const DtUUID& recipient, const DtSimTaskMessageType& taskType) const;
301 
304  virtual bool publishFormationRoutes() const;
305 
306  virtual double dist2D(const DtVector& position1, const DtVector& position2,
307  const Coordinate_System& coordinateSystem);
308 
309 
310 private:
311 
314 
317 
320 
321 protected:
322 
324  std::map<int, DtString> myPromotionIndexRouteNameMap;
325 
327  std::map<const DtSimObject*, DtEntityRouteFollowingData> myEntityRouteFollowingMap;
328 
330  std::map<const DtSimObject*, DtEntityRouteTraversalState> myEntityRouteTraversalStateMap;
331 
335 
339 
344 
348 
352 
356 
359 
363 
366  unsigned int myNextRouteIndex;
367 
369 
371 
373 
375 
382 };
383 
UUID is a unique ID wrapper class.
Definition: uuid.h:59
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
bool myRegisteredFormationChangedCallback
Flag used to indicate whether formation changed callback has been registered yet. ...
Definition: disaggregatedManeuverAlongController.h:362
class DtLocalObjectManager:
Definition: localObjectManager.h:157
DtFormationState * myFormationState
Pointer to aggregate&#39;s formation state object, cached in this class for convenience.
Definition: disaggregatedManeuverAlongController.h:338
bool mySetObjectToBeRemovedCallbacks
Definition: disaggregatedManeuverAlongController.h:370
Definition: formationState.h:40
virtual const char * type() const override=0
Returns a string identifies the class type of component. Type values are defined in compTypes...
std::map< const DtSimObject *, DtEntityRouteFollowingData > myEntityRouteFollowingMap
Map of subordinates and route following data.
Definition: disaggregatedManeuverAlongController.h:327
DtTime myStuckSubordinatesGiveUpSimTime
Give up time for isUnitMovementExhausted(). No need for this to go into a PSR. Loading a checkpoint e...
Definition: disaggregatedManeuverAlongController.h:381
virtual void registerTaskMsgCallbacks()
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:22
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Class DtDisaggregatedManeuverAlongController is a task controller that models aggregate entity maneuv...
Definition: disaggregatedManeuverAlongController.h:63
Definition: readerWriterRegistry.h:39
std::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
std::map< int, DtString > myPromotionIndexRouteNameMap
Map of formation positions to generated route object names.
Definition: disaggregatedManeuverAlongController.h:324
DtAggregateMoveAlongPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: disaggregatedManeuverAlongController.h:355
Class DtAggregateMoveAlongDescriptor holds all of the readable/writeable parameters used to configure...
Definition: aggregateMoveAlongDescriptor.h:30
const DtAggregateMoveAlongDescriptor * myAggregateMoveAlongDescriptor
Pointer to descriptor used to configure this object.
Definition: disaggregatedManeuverAlongController.h:358
bool myRestartTaskOnFormationUpdate
Definition: disaggregatedManeuverAlongController.h:374
DtSimObjectReference myRoute
Definition: disaggregatedManeuverAlongController.h:372
virtual bool init() override
Calls setRadio()
double myVertexSpacingAlongRoundedCorners
Spacing in meters between extra vertices inserted in generated routes to form rounded turns...
Definition: disaggregatedManeuverAlongController.h:351
DtSetDataRequest is an abstract base class from which real setDataRequests can derive. It manages the read/write capability; derived classes need only use and register read/writatble data types for derived information.
Definition: setDataRequest.h:41
Definition: coordSystem.h:54
File: simMsg.h.
Definition: simMessage.h:35
DtVrfAggregateStateRepository * myAggregateStateRepository
Pointer to aggregate&#39;s state repository, cached in this class for convenience.
Definition: disaggregatedManeuverAlongController.h:334
DtMoveAlongTask represents a Move Along Route task for an entity to perform. It inherits read/writabl...
Definition: moveAlongTasks.h:46
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
virtual DtSimTaskStatePtr currentTaskState() const
std::map< const DtSimObject *, DtEntityRouteTraversalState > myEntityRouteTraversalStateMap
Map of subordinate and current route traversal state.
Definition: disaggregatedManeuverAlongController.h:330
unsigned int myNextRouteIndex
Counter used in naming generated routes. Routes are assigned unique object names using the convention...
Definition: disaggregatedManeuverAlongController.h:366
DtSimTaskStatePtr myCachedTaskState
Definition: disaggregatedManeuverAlongController.h:368
This is a convenience list that will add DtSimObjectReference objects and modify the list as objects ...
Definition: simObjectReferenceList.h:25
bool myGenerateRoutesWithRoundedCorners
Flag indicating all generated route should have rounded turns. Default is true.
Definition: disaggregatedManeuverAlongController.h:347
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
DtSimTask is an abstract base class from which real tasks can derive. It manages the read/write capab...
Definition: simTask.h:30
virtual void clearTask() override
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
file aggregateMoveAlongPSR.h
Definition: aggregateMoveAlongPSR.h:33
Definition: vrfAggregateStateRepository.h:21
DtCompatibilityRadio.
Definition: compatibilityRadio.h:30
A DtTaskMsg is a DtRadioMsg with a pointer to a task. The type of the taskMsg is just the type of the...
Definition: taskMessage.h:21
Definition: point.h:34
DtCompatibilityRadio * myCommandRadio
Pointer to aggregate&#39;s command radio, cached in this class for convenience. Aggregates must be config...
Definition: disaggregatedManeuverAlongController.h:343
A locally simulated VRF object.
Definition: localObject.h:98

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)