VR-Forces 4.10 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 
64  static void setSpeedRequiredCallback(DtSimMessage * msg, void * usr);
65  virtual void processSetSpeedRequired(DtSimMessage* msg);
66 
70  static DtSimComponent * creator(const DtString& name,
71  DtVrfObject* owner,
72  DtSimManager* simManager,
73  DtComponentDescriptor* desc = 0,
74  DtReaderWriterRegistry* parentRegistry = 0);
75 
76 protected:
78  virtual void registerTaskMsgCallbacks();
79 
80  virtual bool createPorts();
81 
87  virtual bool createPSR();
88 
91  virtual void createTimeEstimator();
92 
95  static void taskCompleteReportCallback(DtSimMessage * msg, void * usr);
96  virtual void processTaskComplete(DtSimMessage * msg);
97 
99  static void moveAlongWithActionsTaskCallback(DtSimMessage* msg, void* usr);
100  virtual void processMoveAlongWithActionsTask(DtSimMessage* msg);
101 
104  static void deleteVrfObjectCallback(const DtVrfObject* msg, void * usr);
105  virtual void processDeleteVrfObjectCallback(const DtVrfObject* obj);
106 
109  static void routeChangedCallback(const DtVrfObject* obj, void* usr);
110  virtual void processRouteChanged(const DtVrfObject* obj);
111 
114  virtual void preFirstTickInit();
115 
117  virtual void executeCurrentAction();
118 
120  virtual void executeAction(DtRouteAction* routeAction);
121 
123  virtual void executeHold();
124 
127  virtual void executeTargetAction();
128 
130  virtual void updateCurrentAction();
131 
133  virtual void proceedToNextLeg(const DtVector& position);
134 
138  virtual bool passedPosition(const DtVector& position);
139 
142  virtual void traverseLegActions(bool stop = false);
143 
145  virtual void getActionLocalPosition(double routePosition, const DtVector& startPoint, const DtVector& endPoint, DtVector& localPosition);
146 
148  virtual bool passedHoldPosition();
149 
151  virtual bool passedTargetPosition();
152 
155  virtual void estimateTimeOnTarget();
156 
159  virtual void updateHoldAndTargetPointLocations();
160 
162  virtual double timeOnTargetWindow() const;
163 
165  virtual void updateTaskVisualizations();
166 
167 private:
168 
171 
174 
177 
178 protected:
179 
183 
190 
193 
195 
197 
199 
201 
202  double myMinSpeed;
203  double myMaxSpeed;
204 
208  std::vector<double> myEstVertexTimes;
209 };
210 
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:198
double myMaxSpeed
Definition: moveAlongWithActionsController.h:203
double myHoldUntilTime
Definition: moveAlongWithActionsController.h:205
virtual void registerTaskMsgCallbacks()
double myEstTimeOnTarget
Definition: moveAlongWithActionsController.h:207
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:182
Definition: readerWriterRegistry.h:39
virtual const char * type() const =0
Returns a string identifies the class type of component.
double myEstRequiredSpeed
Definition: moveAlongWithActionsController.h:206
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:487
std::vector< double > myEstVertexTimes
Definition: moveAlongWithActionsController.h:208
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:189
bool myEnableActions
Definition: moveAlongWithActionsController.h:196
virtual bool createPorts()
Called by init.
Definition: moveAlongWithActionsController.h:35
DtVector myCurrentActionPosition
Definition: moveAlongWithActionsController.h:194
DtMoveAlongRouteTimeEstimator * myEstimator
Definition: moveAlongWithActionsController.h:200
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:202
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:103
DtVector myCurrentVertexLocation
current vertex position
Definition: moveAlongWithActionsController.h:192
A DtTaskMsg is a DtRadioMsg with a pointer to a task.
Definition: taskMessage.h:19

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)