VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
disaggregatedLeadFollowInFormationController.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 
60 {
61 public:
62 
66  DtLocalObject* owner,
67  DtSimulationServices* simManager,
68  DtComponentDescriptor* desc = 0,
69  DtReaderWriterRegistry* parentRegistry = 0);
70 
71 
74 
77  virtual const char* type() const;
78 
84  virtual bool init();
85 
91  virtual void registerTaskMsgCallbacks();
92 
94  virtual void preFirstTickInit();
95 
98  virtual void tick();
99 
105  virtual void clearTask();
106 
112  virtual bool createPSR();
113 
116  virtual DtSimTaskStatePtr currentTaskState() const;
117 
118  static void moveAlongCallback(DtSimMessage* msg, void* usr, DtSimTaskStatePtr taskStatePtr);
119 
126  static void taskCompleteReportCallback(DtSimMessage * msg, void * usr);
127 
135  static void formationChangedCallback(const DtFormationState& formationState,
136  void* usr);
137 
141  static DtSimComponent * creator(const DtString& name,
142  DtLocalObject* owner,
143  DtSimulationServices* simManager,
144  DtComponentDescriptor* desc = 0,
145  DtReaderWriterRegistry* parentRegistry = 0);
146 
147 protected:
148  virtual void processMoveAlong(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
149 
161  virtual void initializeMoveAlongTask(DtIteratorDirection traversalDirection,
162  bool startAtClosestPoint, DtSimTaskStatePtr taskState);
163 
168  virtual void processFormationChanged(const DtFormationState& formationState);
169 
175  virtual void processTaskComplete(DtSimMessage * msg);
176 
181  virtual void processRouteChanged();
182 
189  virtual void sendTaskToSubordinate(const DtSimTask& task,
190  const DtUUID& subordinate) const;
191 
198  virtual void sendSetDataToSubordinate(const DtSetDataRequest& setData,
199  const DtUUID& subordinate) const;
200 
202  virtual void deleteFormationRoutes();
203 
207  virtual void beginFollowInFormation(const DtUUID& routeName, bool traverseForward);
208 
215  virtual bool createLeaderOffsetRoute(const std::vector<DtVector>& localPoints, float rightOffset, float forwardOffset, DtUUID& routeUUID, DtUUID);
216 
218  virtual void taskLeader(const DtUUID& leader, const DtSimObjectReferenceList& subs,
219  const DtUUID& leaderRoute,
220  const double formationWidth, const double formationLength,
221  const bool doReverseRoute);
222 
224  virtual void taskFollower(const DtUUID& subEntity, const DtUUID& formationLeader,
225  const DtUUID& unitRouteUUID, const double leaderForwardOffset,
226  const bool doReverseRoute);
227 
234  virtual void sendVrfObjectModifyMsg(const DtUUID& object, DtList* vertices) const;
235 
241  virtual void initializeMemberDataFromDescriptor(
242  const DtAggregateMoveAlongDescriptor& desc);
243 
250  virtual void sendClearTask(const DtUUID& recipient, const DtSimTaskMessageType& taskType) const;
251 
254  virtual bool publishFormationRoutes() const;
255 
256 private:
257 
260 
263 
266 
267 protected:
268 
270  std::map<int, DtString> myPromotionIndexRouteNameMap;
271 
273  std::map<const DtSimObject*, DtEntityRouteFollowingData> myEntityRouteFollowingMap;
274 
276  std::map<const DtSimObject*, DtEntityRouteTraversalState> myEntityRouteTraversalStateMap;
277 
281 
285 
290 
294 
298 
302 
305 
309 
312  unsigned int myNextRouteIndex;
313 
315 
317 
319 };
320 
UUID is a unique ID wrapper class.
Definition: rwUUID.h:229
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
class DtLocalObjectManager:
Definition: localObjectManager.h:151
Definition: formationState.h:41
std::map< const DtSimObject *, DtEntityRouteFollowingData > myEntityRouteFollowingMap
Map of subordinates and route following data.
Definition: disaggregatedLeadFollowInFormationController.h:273
bool mySetObjectToBeRemovedCallbacks
Definition: disaggregatedLeadFollowInFormationController.h:316
DtFormationState * myFormationState
Pointer to aggregate&#39;s formation state object, cached in this class for convenience.
Definition: disaggregatedLeadFollowInFormationController.h:284
std::map< const DtSimObject *, DtEntityRouteTraversalState > myEntityRouteTraversalStateMap
Map of subordinate and current route traversal state.
Definition: disaggregatedLeadFollowInFormationController.h:276
const DtAggregateMoveAlongDescriptor * myAggregateMoveAlongDescriptor
Pointer to descriptor used to configure this object.
Definition: disaggregatedLeadFollowInFormationController.h:304
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:20
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
DtSimObjectReference myRoute
Definition: disaggregatedLeadFollowInFormationController.h:318
Definition: readerWriterRegistry.h:39
virtual const char * type() const =0
Returns a string identifies the class type of component. Type values are defined in compTypes...
bool myRegisteredFormationChangedCallback
Flag used to indicate whether formation changed callback has been registered yet. ...
Definition: disaggregatedLeadFollowInFormationController.h:308
Class DtAggregateMoveAlongDescriptor holds all of the readable/writeable parameters used to configure...
Definition: aggregateMoveAlongDescriptor.h:30
virtual bool init()
Calls setRadio()
virtual void clearTask()
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
std::map< int, DtString > myPromotionIndexRouteNameMap
Map of formation positions to generated route object names.
Definition: disaggregatedLeadFollowInFormationController.h:270
DtBoost::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
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
DtAggregateMoveAlongPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: disaggregatedLeadFollowInFormationController.h:301
File: simMsg.h.
Definition: simMessage.h:35
Class DtDisaggregatedLeadFollowInFormationController is a task controller that models aggregate entit...
Definition: disaggregatedLeadFollowInFormationController.h:59
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 ...
DtCompatibilityRadio * myCommandRadio
Pointer to aggregate&#39;s command radio, cached in this class for convenience. Aggregates must be config...
Definition: disaggregatedLeadFollowInFormationController.h:289
virtual DtSimTaskStatePtr currentTaskState() const
unsigned int myNextRouteIndex
Counter used in naming generated routes. Routes are assigned unique object names using the convention...
Definition: disaggregatedLeadFollowInFormationController.h:312
DtSimTaskStatePtr myCachedTaskState
Definition: disaggregatedLeadFollowInFormationController.h:314
This is a convenience list that will add DtSimObjectReference objects and modify the list as objects ...
Definition: simObjectReferenceList.h:22
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
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
DtVrfAggregateStateRepository * myAggregateStateRepository
Pointer to aggregate&#39;s state repository, cached in this class for convenience.
Definition: disaggregatedLeadFollowInFormationController.h:280
DtSimTask is an abstract base class from which real tasks can derive. It manages the read/write capab...
Definition: simTask.h:30
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
bool myGenerateRoutesWithRoundedCorners
Flag indicating all generated route should have rounded turns. Default is true.
Definition: disaggregatedLeadFollowInFormationController.h:293
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
double myVertexSpacingAlongRoundedCorners
Spacing in meters between extra vertices inserted in generated routes to form rounded turns...
Definition: disaggregatedLeadFollowInFormationController.h:297

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)