VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
disaggregatedMoveAlongController.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;
33 
67 {
68 public:
69 
73  DtLocalObject* owner,
74  DtSimulationServices* simManager,
75  DtComponentDescriptor* desc = 0,
76  DtReaderWriterRegistry* parentRegistry = 0);
77 
78 
81 
84  virtual const char* type() const;
85 
91  virtual bool init();
92 
98  virtual void registerTaskMsgCallbacks();
99 
109  virtual void tick();
110 
116  virtual void clearTask();
117 
123  virtual bool createPSR();
124 
127  virtual DtSimTaskStatePtr currentTaskState() const;
128 
129  static void moveAlongCallback(DtSimMessage* msg, void* usr, DtSimTaskStatePtr taskStatePtr);
130 
137  static void taskCompleteReportCallback(DtSimMessage * msg, void * usr);
138 
146  static void formationChangedCallback(const DtFormationState& formationState,
147  void* usr);
148 
152  static DtSimComponent * creator(const DtString& name,
153  DtLocalObject* owner,
154  DtSimulationServices* simManager,
155  DtComponentDescriptor* desc = 0,
156  DtReaderWriterRegistry* parentRegistry = 0);
157 
158 protected:
159  virtual void processMoveAlong(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
160 
176  virtual void initializeMoveAlongTask(DtIteratorDirection traversalDirection,
177  bool startAtClosestPoint, double speed, DtSimTaskStatePtr taskState);
178 
184  virtual void processFormationChanged(const DtFormationState& formationState);
185 
191  virtual void processTaskComplete(DtSimMessage * msg);
192 
196  virtual void processRouteChanged();
197 
203  virtual void moveTo(const DtUUID& route,
204  bool traverseForward);
205 
217  virtual void beginMoveAlong(const DtUUID& route,
218  bool traverseForward,
219  bool startAtClosestPoint,
220  double speed);
221 
230  virtual bool generateFormationRoutes(const DtSimObject& route,
231  bool reverseDirection);
232 
238  virtual void buildEntityRouteFollowingMap(std::map<const DtSimObject*, DtEntityRouteFollowingData>& map);
239 
246  virtual void sendTaskToSubordinate(const DtSimTask& task,
247  const DtUUID& subordinate) const;
248 
255  virtual void sendSetDataToSubordinate(const DtSetDataRequest& setData,
256  const DtUUID& subordinate) const;
257 
259  virtual void deleteFormationRoutes();
260 
273  virtual bool calculateInitialPositionAndHeadingAlongRoute(const DtSimObject& route,
274  bool traverseForward, DtVector& initialPosition, double& initialHeading);
275 
282  virtual void sendVrfObjectModifyMsg(const DtUUID& object, DtList* vertices) const;
283 
286  virtual void initializeNextRouteIndex();
287 
289  virtual unsigned int nextRouteIndex();
290 
311  virtual bool buildOffsetRoute(const DtList& localRouteVertexList,
312  const DtVector& bodyOffset,
313  bool reverseDirection,
314  bool generateRoutesWithRoundedCorners,
315  double vertexSpacingAlongRoundedCorners,
316  DtList& geocentricOffsetRouteVertexList,
317  bool& dataAvailable);
318 
319 
325  virtual void initializeMemberDataFromDescriptor(
326  const DtAggregateMoveAlongDescriptor& desc);
327 
333  virtual void maintainMovementInFormation();
334 
340  virtual void reevaluateMoveAlongAssignments();
341 
343  virtual void reevaluateFormationMoveAlongAssignments();
344 
351  virtual void sendClearTask(const DtUUID& recipient, const DtSimTaskMessageType& taskType) const;
352 
359  virtual bool adjustOffsetRouteStart(std::vector<DtVector>& route,
360  bool& dataAvailable) const;
361 
368  virtual bool adjustOffsetRouteEnd(std::vector<DtVector>& route,
369  bool& dataAvailable) const;
370 
376  virtual bool extendRouteStart(std::vector<DtVector>& route,
377  double distance) const;
378 
385  virtual bool clipRouteEnd(std::vector<DtVector>& route, double distance) const;
386 
391  virtual DtMaintainFormationMonitor* createFormationMonitor(DtLocalObject* entity) const;
392 
395  virtual bool publishFormationRoutes() const;
396 
399  virtual bool shouldGroundClamp() const;
400 
401 private:
402 
405 
408 
411 
412 protected:
413 
415  std::map<int, DtString> myPromotionIndexRouteNameMap;
416 
422 
426 
429 
431  std::map<const DtSimObject*, DtEntityRouteFollowingData> myEntityRouteFollowingMap;
432 
434  std::map<const DtSimObject*, DtEntityRouteTraversalState> myEntityRouteTraversalStateMap;
435 
439 
443 
448 
452 
456 
460 
463 
467 
470 
473  unsigned int myNextRouteIndex;
474 
476 
478 
480 
482 };
483 
UUID is a unique ID wrapper class.
Definition: rwUUID.h:229
DtVrfAggregateStateRepository * myAggregateStateRepository
Pointer to aggregate&#39;s state repository, cached in this class for convenience.
Definition: disaggregatedMoveAlongController.h:438
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
class DtLocalObjectManager:
Definition: localObjectManager.h:151
DtFormationState * myFormationState
Pointer to aggregate&#39;s formation state object, cached in this class for convenience.
Definition: disaggregatedMoveAlongController.h:442
Definition: formationState.h:41
double myMaintainFormationTickInterval
Simulation time interval at which myMaintainFormationMonitor should be ticked.
Definition: disaggregatedMoveAlongController.h:425
DtAggregateLocalObjectFacade myAggregateLocalObjectFacade
Definition: disaggregatedMoveAlongController.h:481
virtual void registerTaskMsgCallbacks()
DtAggregateMoveAlongPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: disaggregatedMoveAlongController.h:459
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:20
DtCompatibilityRadio * myCommandRadio
Pointer to aggregate&#39;s command radio, cached in this class for convenience. Aggregates must be config...
Definition: disaggregatedMoveAlongController.h:447
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
std::map< const DtSimObject *, DtEntityRouteTraversalState > myEntityRouteTraversalStateMap
Map of subordinate and current route traversal state.
Definition: disaggregatedMoveAlongController.h:434
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
Definition: readerWriterRegistry.h:39
Class DtDisaggregatedMoveAlongController is a task controller that models aggregate entity move-along...
Definition: disaggregatedMoveAlongController.h:66
virtual const char * type() const =0
Returns a string identifies the class type of component. Type values are defined in compTypes...
Class DtAggregateMoveAlongDescriptor holds all of the readable/writeable parameters used to configure...
Definition: aggregateMoveAlongDescriptor.h:30
virtual bool init()
Calls setRadio()
DtSimObjectReference myRoute
Definition: disaggregatedMoveAlongController.h:479
bool mySetObjectToBeRemovedCallbacks
Definition: disaggregatedMoveAlongController.h:477
virtual void clearTask()
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
DtBoost::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
DtMaintainFormationMonitor * myMaintainFormationMonitor
Object that monitors current subordinate positions and adjusts them if necessary to maintain correct ...
Definition: disaggregatedMoveAlongController.h:421
DtIteratorDirection
Definition: iteratorBase.h:23
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
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...
unsigned int myNextRouteIndex
Counter used in naming generated routes. Routes are assigned unique object names using the convention...
Definition: disaggregatedMoveAlongController.h:473
File: simMsg.h.
Definition: simMessage.h:35
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 ...
bool myRegisteredFormationChangedCallback
Flag used to indicate whether formation changed callback has been registered yet. ...
Definition: disaggregatedMoveAlongController.h:466
const DtAggregateMoveAlongDescriptor * myAggregateMoveAlongDescriptor
Pointer to descriptor used to configure this object.
Definition: disaggregatedMoveAlongController.h:462
DtSimTaskStatePtr myCachedTaskState
Definition: disaggregatedMoveAlongController.h:475
virtual DtSimTaskStatePtr currentTaskState() const
double myVertexSpacingAlongRoundedCorners
Spacing in meters between extra vertices inserted in generated routes to form rounded turns...
Definition: disaggregatedMoveAlongController.h:455
std::map< const DtSimObject *, DtEntityRouteFollowingData > myEntityRouteFollowingMap
Map of subordinates and route following data.
Definition: disaggregatedMoveAlongController.h:431
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:90
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:79
bool myGenerateRoutesWithRoundedCorners
Flag indicating all generated route should have rounded turns. Default is true.
Definition: disaggregatedMoveAlongController.h:451
std::map< int, DtString > myPromotionIndexRouteNameMap
Map of formation positions to generated route object names.
Definition: disaggregatedMoveAlongController.h:415
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
bool myFirstTick
Flag used to indicate first non-zero dT() tick.
Definition: disaggregatedMoveAlongController.h:469
class DtMaintainFormationMonitor:
Definition: maintainFormationMonitor.h:30
DtSimTask is an abstract base class from which real tasks can derive. It manages the read/write capab...
Definition: simTask.h:30
double myTimeToNextMaintainFormationTick
Simulation time for next tick of myMaintainFormationMonitor.
Definition: disaggregatedMoveAlongController.h:428
file aggregateMoveAlongPSR.h
Definition: aggregateMoveAlongPSR.h:31
Definition: vrfAggregateStateRepository.h:20
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
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

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)