VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
aggregatedMoveAlongController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
12 
13 class DtCgf;
14 class DtAnalogOutputPort;
15 class DtVectorOutputPort;
20 
26 {
27 
28 private:
36 public:
39  DtSimulationServices* simManager, DtComponentDescriptor* desc=0,
40  DtReaderWriterRegistry *parentRegistry=0);
41 
44 
46  virtual bool init();
47 
49  virtual const char* type() const;
50 
54  virtual void preFirstTickInit();
55 
57  virtual void tick();
58 
62  virtual void processRouteChanged(DtSimObjectReference obj);
63 
65  virtual void registerTaskMsgCallbacks();
66 
67  static void moveAlongCallback(DtSimMessage* msg, void* usr, DtSimTaskStatePtr taskStatePtr);
68  static void moveAlongRetrogradeCallback(DtSimMessage* msg, void* usr, DtSimTaskStatePtr taskStatePtr);
69 
77  virtual bool setupRoute();
78 
85  virtual bool setupDestination();
86 
88  virtual double findDesiredSpeed();
89 
95  virtual void stop();
96 
98  static DtSimComponent* creator(const DtString& name, DtLocalObject* owner,
99  DtSimulationServices* simManager, DtComponentDescriptor* desc=0,
100  DtReaderWriterRegistry* parentRegistry=0);
101 
103  virtual bool createPorts();
104 
106  virtual bool createPortGroups();
107 
113  virtual bool createPSR();
114 
118  virtual void doMoving();
119 
125  virtual double findDesiredHeading(DtVector& dest);
126 
128  //virtual bool destinationIsInsideObstruction(
130 
133  //virtual bool decideToGiveUpTask() const;
134 
135 protected:
136  virtual void processMoveAlong(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
137  virtual void processMoveAlongRetrograde(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
138 
142  //virtual void buildLocalRoute();
143 
146  virtual void emptyVertexList();
147 
150  virtual void clearTask();
151 
153  virtual void moveToDestination();
154 
158  virtual double distanceToDestinationSquared() const;
159 
168  virtual bool atDestination();
169 
176  virtual bool passedDestination();
177 
186  virtual bool getDestination(DtVector & destination);
187 
189  virtual DtVector destinationVector() const;
190 
195  virtual double atDistance() const;
196 
202  virtual bool stayOnRoute() const;
203 
208  virtual double minCorrectionDistance() const;
209 
217  virtual double maxCorrectionDistance() const;
218 
222  virtual double correctionAngle(const double distanceFromLine) const;
223 
232  virtual void computePointToSegmentGeometry(
233  const DtVector& localPoint,
234  const DtVector& localLinePt1, const DtVector& localLinePt2,
235  const Coordinate_System& coordinateSystemRef,
236  double& r, bool &leftSide, double &distanceToSegment);
237 
241  virtual bool getCurrentRouteSegment(DtVector& routeSegmentStart,
242  DtVector& routeSegmentEnd) const;
243 
245 
247  virtual void calculateRadius();
248 
249 protected:
250 
251  const Coordinate_System* localCS() const;
252 
261 
267 
274 
276 
280 
285 
288  double myUnitRadius;
289 
293 };
DtVectorOutputPort * myDestinationOutputPort
Output Port Name: destination Output Port Description: Specifies the current destination of the entit...
Definition: aggregatedMoveAlongController.h:273
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtBooleanOutputPort * myRetrogradeOutputPort
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:291
DtVector myWorldDestination
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:287
Instances of DtBooleanOutputPort are output ports through which data producers can send boolean data...
Definition: boolIOPort.h:45
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
DtVrfAggregateStateRepository * myTrueAggregateRepository
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:275
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
DtVector myLocalDestination
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:286
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...
DtOutputPortGroup is a data port group of a data provider. It may contain any number of DtOutputPorts...
Definition: outputPortGroup.h:34
virtual bool init()
Calls setRadio()
virtual void clearTask()
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
DtAggregatedMoveToDescriptor * myAggregatedMoveToDescriptor
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:290
DtBoost::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
bool myResetVertex
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:284
bool myNeedsObjectDiscovery
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:292
Definition: coordSystem.h:54
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
class DtAggregatedMoveAlongPSR:
Definition: aggregatedMoveAlongPSR.h:29
DtAnalogOutputPort * myMovementDirectionPort
Output Port Name: desired-movement-direction Output Port Description: Output Port Range: Output Gro...
Definition: aggregatedMoveAlongController.h:266
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
DtOutputPortGroup * myMovementControlPortGroup
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:255
virtual DtSimTaskStatePtr currentTaskState() const
virtual bool createPorts()
Called by init. Derived classes should override this method to create all their input/output ports an...
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:90
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:70
double myUnitRadius
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:288
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
DtAggregatedMoveToDescriptor; descriptor for the DtAggregatedMoveToDescriptor component.
Definition: aggregatedMoveToDescriptor.h:21
DtAnalogOutputPort * mySpeedPort
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:260
Definition: vrfAggregateStateRepository.h:20
The top level class of a VR-Forces Simulation Engine, representing a Computer Generated Forces instan...
Definition: cgf.h:144
DtAggregatedMoveAlongPSR * myProcessState
Container for state data associated with this component. This state is saved and restored as part of ...
Definition: aggregatedMoveAlongController.h:279
bool myRouteHasChanged
This gets set to true when a modifyRoute message for the route we&#39;re following is received...
Definition: aggregatedMoveAlongController.h:283
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
End User Description: Controller for executing DtMoveAlongTask for aggregated aggregates. This moves the aggregate along a route. Uses Descriptor Type: DtComponentDescriptor.
Definition: aggregatedMoveAlongController.h:25
char * dest
Definition: lz4.h:440
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)