VR-Forces 4.8 Class Documentation
 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 private:
35 public:
38  DtSimManager* simManager, DtComponentDescriptor* desc=0,
39  DtReaderWriterRegistry *parentRegistry=0);
40 
43 
45  virtual bool init();
46 
48  virtual const char* type() const;
49 
53  virtual void preFirstTickInit();
54 
56  virtual void tick();
57 
61  static void routeChangedCallback(const DtVrfObject* obj, void * usr);
62  virtual void processRouteChanged(const DtVrfObject* 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 void objectAddedCb(const DtVrfObject * vrfObject, void * usr);
99 
101  static DtSimComponent* creator(const DtString& name, DtVrfObject* owner,
102  DtSimManager* simManager, DtComponentDescriptor* desc=0,
103  DtReaderWriterRegistry* parentRegistry=0);
104 
106  virtual bool createPorts();
107 
109  virtual bool createPortGroups();
110 
116  virtual bool createPSR();
117 
121  virtual void doMoving();
122 
128  virtual double findDesiredHeading(DtVector& dest);
129 
131  //virtual bool destinationIsInsideObstruction(
133 
136  //virtual bool decideToGiveUpTask() const;
137 
138 protected:
139  virtual void processMoveAlong(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
140  virtual void processMoveAlongRetrograde(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
141 
145  //virtual void buildLocalRoute();
146 
149  virtual void emptyVertexList();
150 
154  virtual void processObjectAdded(const DtVrfObject * vrfObject);
155 
158  virtual void clearTask();
159 
161  virtual void moveToDestination();
162 
166  virtual double distanceToDestinationSquared() const;
167 
176  virtual bool atDestination();
177 
184  virtual bool passedDestination();
185 
194  virtual bool getDestination(DtVector & destination);
195 
197  virtual DtVector destinationVector() const;
198 
203  virtual double atDistance() const;
204 
210  virtual bool stayOnRoute() const;
211 
216  virtual double minCorrectionDistance() const;
217 
225  virtual double maxCorrectionDistance() const;
226 
230  virtual double correctionAngle(const double distanceFromLine) const;
231 
240  virtual void computePointToSegmentGeometry(
241  const DtVector& localPoint,
242  const DtVector& localLinePt1, const DtVector& localLinePt2,
243  const Coordinate_System& coordinateSystemRef,
244  double& r, bool &leftSide, double &distanceToSegment);
245 
249  virtual bool getCurrentRouteSegment(DtVector& routeSegmentStart,
250  DtVector& routeSegmentEnd) const;
251 
253 
255  virtual void calculateRadius();
256 
257 protected:
258 
259  const Coordinate_System* localCS() const;
260 
269 
275 
282 
284 
288 
293 
296  double myUnitRadius;
297 
300 };
DtVectorOutputPort * myDestinationOutputPort
Output Port Name: destination Output Port Description: Specifies the current destination of the entit...
Definition: aggregatedMoveAlongController.h:281
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtBooleanOutputPort * myRetrogradeOutputPort
Definition: aggregatedMoveAlongController.h:299
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
DtVector myWorldDestination
Definition: aggregatedMoveAlongController.h:295
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
Definition: aggregatedMoveAlongController.h:283
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:42
DtVector myLocalDestination
Definition: aggregatedMoveAlongController.h:294
Definition: readerWriterRegistry.h:39
virtual const char * type() const =0
Returns a string identifies the class type of component.
DtOutputPortGroup is a data port group of a data provider.
Definition: outputPortGroup.h:30
virtual bool init()
Calls setRadio()
virtual void clearTask()
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
DtAggregatedMoveToDescriptor * myAggregatedMoveToDescriptor
Definition: aggregatedMoveAlongController.h:298
DtBoost::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
bool myResetVertex
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:274
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component.
DtOutputPortGroup * myMovementControlPortGroup
Definition: aggregatedMoveAlongController.h:263
virtual DtSimTaskStatePtr currentTaskState() const
virtual bool createPorts()
Called by init.
virtual bool createPortGroups()
Called by init.
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
double myUnitRadius
Definition: aggregatedMoveAlongController.h:296
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
DtAggregatedMoveToDescriptor; descriptor for the DtAggregatedMoveToDescriptor component.
Definition: aggregatedMoveToDescriptor.h:21
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
DtAnalogOutputPort * mySpeedPort
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:268
Definition: vrfAggregateStateRepository.h:22
An instance of DtCgf is an object representing a CGF (Computer Generated Forces). ...
Definition: cgf.h:115
DtAggregatedMoveAlongPSR * myProcessState
Container for state data associated with this component.
Definition: aggregatedMoveAlongController.h:287
bool myRouteHasChanged
This gets set to true when a modifyRoute message for the route we&#39;re following is received...
Definition: aggregatedMoveAlongController.h:291
A DtTaskMsg is a DtRadioMsg with a pointer to a task.
Definition: taskMessage.h:19
End User Description: Controller for executing DtMoveAlongTask for aggregated aggregates.
Definition: aggregatedMoveAlongController.h:25
char * dest
Definition: lz4.h:434

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)