VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
moveAlongWithActionsController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
14 
15 class DtString;
16 class DtSimManager;
17 class DtTaskMessage;
19 class DtVectorInputPort;
21 
29 
31 
32 class DtRouteAction;
34 
36 {
37 public:
38 
42  DtVrfObject* owner,
43  DtSimManager* simManager,
44  DtComponentDescriptor* desc = 0,
45  DtReaderWriterRegistry* parentRegistry = 0);
46 
49 
51  virtual bool init();
52 
55  virtual const char* type() const;
56 
58  virtual void tick();
59 
61  virtual void clearTask();
62 
66  static DtSimComponent * creator(const DtString& name,
67  DtVrfObject* owner,
68  DtSimManager* simManager,
69  DtComponentDescriptor* desc = 0,
70  DtReaderWriterRegistry* parentRegistry = 0);
71 
72 protected:
74  virtual void registerTaskMsgCallbacks();
75 
76  virtual bool createPorts();
77 
83  virtual bool createPSR();
84 
87  virtual void createTimeEstimator();
88 
91  static void taskCompleteReportCallback(DtSimMessage * msg, void * usr);
92  virtual void processTaskComplete(DtSimMessage * msg);
93 
95  static void moveAlongWithActionsTaskCallback(DtSimMessage* msg, void* usr);
96  virtual void processMoveAlongWithActionsTask(DtSimMessage* msg);
97 
100  static void deleteVrfObjectCallback(const DtVrfObject* msg, void * usr);
101  virtual void processDeleteVrfObjectCallback(const DtVrfObject* obj);
102 
105  static void routeChangedCallback(const DtVrfObject* obj, void* usr);
106  virtual void processRouteChanged(const DtVrfObject* obj);
107 
110  virtual void preFirstTickInit();
111 
113  virtual void executeCurrentAction();
114 
116  virtual void executeAction(DtRouteAction* routeAction);
117 
119  virtual void executeHold();
120 
123  virtual void executeTargetAction();
124 
126  virtual void updateCurrentAction();
127 
129  virtual void proceedToNextLeg(const DtVector& position);
130 
134  virtual bool passedPosition(const DtVector& position);
135 
138  virtual void traverseLegActions(bool stop = false);
139 
141  virtual void getActionLocalPosition(double routePosition, const DtVector& startPoint, const DtVector& endPoint, DtVector& localPosition);
142 
144  virtual bool passedHoldPosition();
145 
147  virtual bool passedTargetPosition();
148 
151  virtual void estimateTimeOnTarget();
152 
155  virtual void updateHoldAndTargetPointLocations();
156 
158  virtual double timeOnTargetWindow() const;
159 
161  virtual void updateTaskVisualizations();
162 
163 private:
164 
167 
170 
173 
174 protected:
175 
179 
186 
189 
191 
193 
195 
197 
198  double myMinSpeed;
199  double myMaxSpeed;
200 
204  std::vector<double> myEstVertexTimes;
205 };
206 
UUID is a unique ID wrapper class.
Definition: rwUUID.h:222
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
Performs time estimates for move along route with actions tasks.
Definition: moveAlongRouteTimeEstimator.h:50
DtUUID myActionObj
Definition: moveAlongWithActionsController.h:194
double myMaxSpeed
Definition: moveAlongWithActionsController.h:199
double myHoldUntilTime
Definition: moveAlongWithActionsController.h:201
virtual void registerTaskMsgCallbacks()
double myEstTimeOnTarget
Definition: moveAlongWithActionsController.h:203
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
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:42
Definition: moveAlongWithActionsPSR.h:34
DtMoveAlongWithActionsPSR * myProcessState
Container for state data associated with this component.
Definition: moveAlongWithActionsController.h:178
Definition: readerWriterRegistry.h:39
virtual const char * type() const =0
Returns a string identifies the class type of component.
double myEstRequiredSpeed
Definition: moveAlongWithActionsController.h:202
virtual bool init()
Calls setRadio()
virtual void clearTask()
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
Contains class declarations for DtVectorInputPort, DtVectorOutputPort, and DtVectorPortData.
Definition: vectorIOPort.h:27
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick.
Definition: simComponent.h:485
std::vector< double > myEstVertexTimes
Definition: moveAlongWithActionsController.h:204
Definition: routeLegActionsEntry.h:29
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component.
DtVectorInputPort * myCurrentVertexLocationInputPort
Input Port Name: current-vertex-location Input Port Description: Specifies the current vertex locatio...
Definition: moveAlongWithActionsController.h:185
bool myEnableActions
Definition: moveAlongWithActionsController.h:192
virtual bool createPorts()
Called by init.
Definition: moveAlongWithActionsController.h:35
DtVector myCurrentActionPosition
Definition: moveAlongWithActionsController.h:190
DtMoveAlongRouteTimeEstimator * myEstimator
Definition: moveAlongWithActionsController.h:196
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
Definition: routeAction.h:35
double myMinSpeed
Definition: moveAlongWithActionsController.h:198
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
DtVector myCurrentVertexLocation
current vertex position
Definition: moveAlongWithActionsController.h:188
A DtTaskMsg is a DtRadioMsg with a pointer to a task.
Definition: taskMessage.h:19

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)