VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
aggregatedMoveToController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
11 
12 #pragma once
13 
16 
17 class DtCgf;
19 class DtSimMessage;
21 class DtOutputPortGroup;
23 class DtVectorOutputPort;
25 class DtAnalogOutputPort;
26 class DtSetDataRequest;
27 class DtSetDataManager;
28 
43 {
44 private:
51 public:
54 
56  virtual ~DtAggregatedMoveToController() override;
57 
59  virtual bool init() override;
60 
62  virtual const char* type() const override;
63 
65  virtual void tick() override;
66 
71  static void moveToCallback(DtSimMessage * msg, void * usr);
72  static void moveToRetrogradeCallback(DtSimMessage * msg, void * usr);
73 
78  static void setLocationCallback(DtSimMessage* msg, void* usr);
79 
84  static void moveIntoFormationCallback(DtSimMessage * msg, void * usr);
85 
90  static void turnToHeadingCallback(DtSimMessage* msg, void* usrData);
91 
93  static DtSimComponent* creator(const DtString& name, DtLocalObject* owner, DtSimulationServices* simManager, DtComponentDescriptor* desc=0, DtReaderWriterRegistry* parentRegistry=0);
94 
96  static void modifyVrfObjectCallback(DtSimMessage* msg, void* usr);
97 
98  virtual void updateTaskVisualizations() override;
99 
100 protected:
101 
104  virtual void processMoveToTask(DtSimMessage * msg);
105  virtual void processMoveToRetrogradeTask(DtSimMessage * msg);
106  virtual void preFirstTickInit() override;
107 
112  virtual void processDestinationChanged();
113 
117  virtual bool setupDestination();
118 
127  virtual void setupDestinationVector() const;
128 
130  virtual void invalidateDestinationVector() const;
131 
140  virtual bool atDestination();
141 
143  virtual void doMoving();
144 
146  virtual double findDesiredHeading();
147 
149  virtual void moveToDestination();
150 
152  virtual void stop();
153 
155  virtual void registerTaskMsgCallbacks() override;
156 
160  virtual void processModifyVrfObject(DtSimMessage* msg);
161 
164  virtual void processSetLocation(DtSimMessage* msg);
165 
167  virtual bool createPortGroups() override;
168 
170  virtual bool createPorts() override;
171 
177  virtual bool createPSR();
178 
179  virtual double distanceToDestination() const;
180 
182  virtual void clearTask() override;
183 
188  virtual double atDistance() const;
189 
193  virtual void processMoveIntoFormationTask(DtSimMessage* msg);
194 
197  virtual void processTurnToHeadingTask(DtSimMessage* msg);
198 
200  virtual void sendRequestToSelf(const DtSetDataRequest& request) const;
201 
203  virtual void processEstimatedTotCalculation();
204 
205 protected:
206 
209 
215 
221 
224 
231 
233 
237 
240 
241  mutable DtVector myDestinationVector;
243 
248 
250  const double DtEstimatedTotCalcInterval = 5.0;
251 
254 
256 
260 
262 
266 
268 };
269 
DtAggregatedMoveToDescriptor * myAggregatedMoveToDescriptor
Definition: aggregatedMoveToController.h:261
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtAggregatedMoveToController is a controller that models movement to a <location> or <waypoint> for a...
Definition: aggregatedMoveToController.h:42
double myEstimatedTotValue
Definition: aggregatedMoveToController.h:246
class DtAggregatedMoveToPSR:
Definition: aggregatedMoveToPSR.h:28
DtAggregatedMoveToPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: aggregatedMoveToController.h:259
virtual const char * type() const override=0
Returns a string identifies the class type of component. Type values are defined in compTypes...
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
bool myDestinationVectorIsValid
Definition: aggregatedMoveToController.h:242
virtual void registerTaskMsgCallbacks()
DtVectorOutputPort * myDestinationOutputPort
Output Port Name: destination Output Port Description: Specifies the current destination of the entit...
Definition: aggregatedMoveToController.h:230
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
DtVector myWorldDestination
Definition: aggregatedMoveToController.h:239
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
DtOutputPortGroup * myOutputPortGroup
Output Group Name: movement-control .
Definition: aggregatedMoveToController.h:223
Definition: readerWriterRegistry.h:39
DtVector myEstimatedTotTextPos
tot text position
Definition: aggregatedMoveToController.h:253
DtOutputPortGroup is a data port group of a data provider. It may contain any number of DtOutputPorts...
Definition: outputPortGroup.h:34
DtSimObjectReference myControlPoint
This is looked up once per tick - assumed unchanging while we have control.
Definition: aggregatedMoveToController.h:236
DtBooleanOutputPort * myRetrogradeOutputPort
Definition: aggregatedMoveToController.h:267
DtVrfAggregateStateRepository * myAggregateStateRepository
Definition: aggregatedMoveToController.h:255
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick. Implemented by subclasses. ...
Definition: simComponent.h:443
virtual bool init() override
Calls setRadio()
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
Instances of DtAnalogOutputPort are input ports through which data producers can send real numbers...
Definition: analogIOPort.h:45
Instances of DtVectorOutputPort are output ports through which data producers can send a DtVector...
Definition: vectorIOPort.h:52
File: simMsg.h.
Definition: simMessage.h:35
DtVector myLocalDestination
Definition: aggregatedMoveToController.h:238
DtVector myDestinationVector
Definition: aggregatedMoveToController.h:241
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
DtAnalogOutputPort * myMovementDirectionOutputPort
Output Port Name: desired-movement-direction Output Port Description: Specifies the current movement ...
Definition: aggregatedMoveToController.h:214
virtual bool createPortGroups()
Called by init. Derived classes should override this method to create all their input/output port gro...
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
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
bool myAtDestination
Definition: aggregatedMoveToController.h:244
DtAggregatedMoveToDescriptor; descriptor for the DtAggregatedMoveToDescriptor component.
Definition: aggregatedMoveToDescriptor.h:21
DtAnalogOutputPort * mySpeedOutputPort
Output Port Name: desired-speed Output Port Description: Specifies the current speed of the entity in...
Definition: aggregatedMoveToController.h:220
virtual void clearTask() override
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
DtSetDataManager * mySetDataManager
Pointer to aggregate's DtSetDataManager, cached in this class for convenience.
Definition: aggregatedMoveToController.h:265
double myDistanceSquared
Definition: aggregatedMoveToController.h:245
void processSetLocation(DtSetDataRequest *set, const DtVertexList &vertices, double position, DtMoveAlongRouteTimeEstimator *est)
Definition: vrfAggregateStateRepository.h:21
The top level class of a VR-Forces Simulation Engine, representing a Computer Generated Forces instan...
Definition: cgf.h:156
double myEstimatedTotLastCalcTime
Definition: aggregatedMoveToController.h:247
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)