VR-Forces 4.10 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 
28 private:
36 public:
39  DtSimManager* 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  static void routeChangedCallback(const DtVrfObject* obj, void * usr);
63  virtual void processRouteChanged(const DtVrfObject* obj);
64 
66  virtual void registerTaskMsgCallbacks();
67 
68  static void moveAlongCallback(DtSimMessage* msg, void* usr, DtSimTaskStatePtr taskStatePtr);
69  static void moveAlongRetrogradeCallback(DtSimMessage* msg, void* usr, DtSimTaskStatePtr taskStatePtr);
70 
78  virtual bool setupRoute();
79 
86  virtual bool setupDestination();
87 
89  virtual double findDesiredSpeed();
90 
96  virtual void stop();
97 
99  static void objectAddedCb(const DtVrfObject * vrfObject, void * usr);
100 
102  static DtSimComponent* creator(const DtString& name, DtVrfObject* owner,
103  DtSimManager* simManager, DtComponentDescriptor* desc=0,
104  DtReaderWriterRegistry* parentRegistry=0);
105 
107  virtual bool createPorts();
108 
110  virtual bool createPortGroups();
111 
117  virtual bool createPSR();
118 
122  virtual void doMoving();
123 
129  virtual double findDesiredHeading(DtVector& dest);
130 
132  //virtual bool destinationIsInsideObstruction(
134 
137  //virtual bool decideToGiveUpTask() const;
138 
139 protected:
140  virtual void processMoveAlong(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
141  virtual void processMoveAlongRetrograde(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
142 
146  //virtual void buildLocalRoute();
147 
150  virtual void emptyVertexList();
151 
155  virtual void processObjectAdded(const DtVrfObject * vrfObject);
156 
159  virtual void clearTask();
160 
162  virtual void moveToDestination();
163 
167  virtual double distanceToDestinationSquared() const;
168 
177  virtual bool atDestination();
178 
185  virtual bool passedDestination();
186 
195  virtual bool getDestination(DtVector & destination);
196 
198  virtual DtVector destinationVector() const;
199 
204  virtual double atDistance() const;
205 
211  virtual bool stayOnRoute() const;
212 
217  virtual double minCorrectionDistance() const;
218 
226  virtual double maxCorrectionDistance() const;
227 
231  virtual double correctionAngle(const double distanceFromLine) const;
232 
241  virtual void computePointToSegmentGeometry(
242  const DtVector& localPoint,
243  const DtVector& localLinePt1, const DtVector& localLinePt2,
244  const Coordinate_System& coordinateSystemRef,
245  double& r, bool &leftSide, double &distanceToSegment);
246 
250  virtual bool getCurrentRouteSegment(DtVector& routeSegmentStart,
251  DtVector& routeSegmentEnd) const;
252 
254 
256  virtual void calculateRadius();
257 
258 protected:
259 
260  const Coordinate_System* localCS() const;
261 
270 
276 
283 
285 
289 
294 
297  double myUnitRadius;
298 
301 };
DtVectorOutputPort * myDestinationOutputPort
Output Port Name: destination Output Port Description: Specifies the current destination of the entit...
Definition: aggregatedMoveAlongController.h:282
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtBooleanOutputPort * myRetrogradeOutputPort
Definition: aggregatedMoveAlongController.h:300
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:296
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:284
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:295
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:299
DtBoost::shared_ptr< DtSimTaskState > DtSimTaskStatePtr
Definition: taskAndTaskStateDefines.h:18
bool myResetVertex
Definition: aggregatedMoveAlongController.h:293
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:275
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component.
DtOutputPortGroup * myMovementControlPortGroup
Definition: aggregatedMoveAlongController.h:264
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:297
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:103
DtAnalogOutputPort * mySpeedPort
Output Port Name: desired-speed Output Port Description: Output Port Range: Output Group Parent: mo...
Definition: aggregatedMoveAlongController.h:269
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:288
bool myRouteHasChanged
This gets set to true when a modifyRoute message for the route we&#39;re following is received...
Definition: aggregatedMoveAlongController.h:292
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:440

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)