VR-Forces 4.6.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
railPathController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
11 
12 #pragma once
13 
15 #include <matrix/vlVector.h>
17 #include "vrfutil/railSegment.h"
18 
19 #include <boost/shared_ptr.hpp>
20 
21 class DtRailPathTask;
24 class DtAsyncJobMapEntry;
25 
57 {
58 private:
65 
66 public:
67 
70  DtRailPathController(const DtString& name,
71  DtVrfObject* owner,
72  DtSimManager* simManager,
73  DtComponentDescriptor* desc = NULL,
74  DtReaderWriterRegistry* parentRegistry = NULL);
75 
76  virtual ~DtRailPathController();
77 
79  virtual bool init();
80 
86  virtual bool createPSR();
87 
88  virtual void preFirstTickInit();
89 
90  static void railTaskCallback(DtSimMessage* msg, void* usr, DtSimTaskStatePtr taskStatePtr);
91 
92  virtual DtSimTaskStatePtr currentTaskState() const;
93 
96  virtual const char* type() const;
97 
99  virtual void registerTaskMsgCallbacks();
100 
101  static void taskCompleteReportCallback(DtSimMessage* msg, void* usr);
102 
103  virtual void processTaskCompleteReport(DtSimMessage* msg);
104 
105  static void destinationChangedCallback(DtVrfObject* obj, void* usrData);
106 
111  virtual void processDestinationChanged(DtVrfObject* obj);
112 
115 
116  static void objectAboutToBeRemovedCallback(DtVrfObject* obj, void* usr);
117  virtual void processObjectAboutToBeRemoved(DtVrfObject* obj);
119 
123 
124  static void setLocationCompleteCallback(DtVrfObject*, void* usr);
125  virtual void processSetLocationComplete();
127 
129  virtual void tick();
130 
131 protected:
132  virtual void processRailTask(const DtTaskMessage& msg, DtSimTaskStatePtr taskStatePtr);
133 
134  virtual void clearCurrentPath();
135  virtual bool setupPathFromRailList(DtRailSegmentList*, bool testRange = true);
136  virtual bool setupPathFromRoute(DtVrfObject* route, bool startClosestPoint, DtIteratorDirection traversalDirection);
137 
139  virtual bool isEntityCloseEnoughToRoad(
140  DtRailSegment* railSegment, double distance, double& actualDistSq) const;
141 
143  virtual bool isEntityOnRoad(DtRailSegment* railSegment) const;
144 
145  double maxSearchRadius(const DtVector& start, const DtVector& end);
146 
150  virtual void registerDestinationChangedCallback();
151 
154  virtual void unregisterDestinationChangedCallback();
155 
159  virtual DtVrfObject* publishDebugPath(DtRailSegmentList*);
160 
163  virtual void removeDebugPath();
164 
166  virtual bool setupPathToDestination(const DtVector& start, const DtVector& end);
167 
171  virtual void clearTask();
172 
173  static void destinationDiscovered(void*);
174  virtual void processDestinationDiscovered();
175 
176 public:
177 
181  static DtSimComponent * creator(const DtString& name,
182  DtVrfObject* owner,
183  DtSimManager* simManager,
184  DtComponentDescriptor* desc = 0,
185  DtReaderWriterRegistry* parentRegistry = 0);
186 
187 protected:
189  boost::shared_ptr<DtAsyncJobMapEntry> myPathJobEntry;
190 
194 
197 };
198 

Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)