VR-Forces 4.7 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(DtVrfObject* obj, void * usr);
62  virtual void processRouteChanged(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(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(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 };

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)