VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
disaggregatedMoveIntoFormationController.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 
17 #include <matrix/vlVector.h>
18 #include <vector>
20 #include <tbb/spin_mutex.h>
21 
23 class DtFormationState;
24 class DtSimMessage;
25 class DtSetDataManager;
26 class DtSetDataRequest;
29 
52 {
53 public:
54 
58  DtLocalObject* owner,
59  DtSimulationServices* simManager,
60  DtComponentDescriptor* desc = 0,
61  DtReaderWriterRegistry* parentRegistry = 0);
62 
64 
67  virtual const char* type() const;
68 
70  virtual bool init();
71 
75  virtual void registerTaskMsgCallbacks();
76 
78  virtual void clearTask();
79 
82  static void taskCompleteReportCallback(DtSimMessage * msg, void * usr);
83 
86  static void formationStateChanged(const DtFormationState& formationState,
87  void* usr);
88 
92  static DtSimComponent * creator(const DtString& name,
93  DtLocalObject* owner,
94  DtSimulationServices* simManager,
95  DtComponentDescriptor* desc = 0,
96  DtReaderWriterRegistry* parentRegistry = 0);
97 
100  static void moveIntoFormationTaskCallback(DtSimMessage * msg, void * usr);
101 
102 protected:
103 
110  virtual void moveIntoFormation(const DtVector& location, double heading, DtString formation);
111 
122  virtual void onTaskComplete(DtSimMessage * msg);
123 
128  virtual void onFormationStateChanged();
129 
131  virtual void sendRequestToSelf(const DtSetDataRequest& request) const;
132 
134  virtual void sendTaskToSubordinate(const DtSimTask& task,
135  const DtUUID& subordinate) const;
136 
138  void sendSetDataRequestToSubordinate(const DtSetDataRequest& request,
139  const DtUUID& subordinate) const;
140 
142  virtual void processMoveIntoFormationTask(DtSimMessage * msg);
143 
149  virtual bool createPSR();
150 
151  virtual void clearDebugWaypointNames();
152 
156  virtual void processSubordinateRemoved(const DtUUID& info);
157 
159  virtual void groundClampLocation(DtVector& location);
160 
163  virtual bool shouldGroundClamp() const;
164 
165 private:
166 
169 
172 
173 protected:
174 
179 
185 
189 
192  std::vector<DtString> myDebugWaypointNames;
193 
197 
202 
207 
208  boost::signals2::scoped_connection mySubordinateRemovedConnection;
210 
211  tbb::spin_mutex myProcessStateRemovalMutex;
212 };
Class DtAggregateMoveIntoFormationDescriptor holds all of the readable/writeable parameters used to c...
Definition: aggregateMoveIntoFormationDescriptor.h:32
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
DtSetDataManager * mySetDataManager
Pointer to aggregate&#39;s DtSetDataManager, cached in this class for convenience.
Definition: disaggregatedMoveIntoFormationController.h:188
Definition: formationState.h:41
std::vector< DtString > myDebugWaypointNames
List of object names of waypoints, generated at target locations. Used for debugging.
Definition: disaggregatedMoveIntoFormationController.h:192
Class DtAggregateMoveIntoFormationController is a task controller that models aggregate entity behavi...
Definition: disaggregatedMoveIntoFormationController.h:51
virtual void registerTaskMsgCallbacks()
This is a process state repository for the DtAggregateMoveToController that stores the list of the uu...
Definition: aggregateMoveToPSR.h:22
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:20
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
virtual const char * type() const =0
Returns a string identifies the class type of component. Type values are defined in compTypes...
virtual bool init()
Calls setRadio()
virtual void clearTask()
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
bool myTurnToHeadingUponArrival
Flag indicating whether or not subordinates should turn to given heading upon arrival at the destinat...
Definition: disaggregatedMoveIntoFormationController.h:206
DtAggregateLocalObjectFacade myAggregateLocalObjectFacade
Definition: disaggregatedMoveIntoFormationController.h:209
DtString myFormation
Definition: disaggregatedMoveIntoFormationController.h:178
boost::signals2::scoped_connection mySubordinateRemovedConnection
Definition: disaggregatedMoveIntoFormationController.h:208
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
File: simMsg.h.
Definition: simMessage.h:35
DtAggregateMoveToPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: disaggregatedMoveIntoFormationController.h:196
bool myStopMovingUponArrival
Flag indicating whether or not subordinates should stop upon arrival at destination. Typically set to true for ground vehicles, set to false for air vehicles. Default is false.
Definition: disaggregatedMoveIntoFormationController.h:201
DtFormationState * myFormationState
Definition: disaggregatedMoveIntoFormationController.h:176
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
This class manages the distribution of DtSetDataRequests within a single DtLocalObject. Components of the object, or other parts of the code, register interested in particular types of set data messages and when such a message is processed by the DtSetDataManager, each of the registered parties is notified.
Definition: setDataManager.h:48
tbb::spin_mutex myProcessStateRemovalMutex
Definition: disaggregatedMoveIntoFormationController.h:211
DtSimTask is an abstract base class from which real tasks can derive. It manages the read/write capab...
Definition: simTask.h:30
const DtAggregateMoveIntoFormationDescriptor * myAggregateMoveIntoFormationDescriptor
Definition: disaggregatedMoveIntoFormationController.h:175
DtCompatibilityRadio.
Definition: compatibilityRadio.h:30
DtVector myLocation
Definition: disaggregatedMoveIntoFormationController.h:177
DtCompatibilityRadio * myCommandRadio
Pointer to aggregate&#39;s command radio, cached in this class for convenience. Aggregate must be configu...
Definition: disaggregatedMoveIntoFormationController.h:184
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 Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)