VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
aggregatedMovementActuator.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
9 #pragma once
10 
14 
16 #include "features/featureSet.h"
17 #include "features/proj.h"
18 
19 #include <boost/ptr_container/ptr_vector.hpp>
20 
21 class DtInputPortGroup;
22 class DtAnalogInputPort;
26 class DtTerrainInterface;
27 class DtSetDataManager;
28 class DtBooleanInputPort;
29 class DtVectorInputPort;
31 
34 #define ALTITUDE_CHANGE_INCREMENT 304.8
35 
36 namespace MAKVRinTerra
37 {
38  class DtFeatureGeometry;
39 }
40 
47 {
48 public:
49 
52  DtSimManager* simManager, DtComponentDescriptor* compDescriptor,
53  DtReaderWriterRegistry* parentRegistry = 0);
54 
57 
59  virtual bool init();
60 
62  virtual bool createPSR();
63 
65  virtual DtString type() const;
66 
68  virtual void tick();
69 
71  virtual void parallelTick();
72 
79  virtual void setOrderedAltitude(double altitude, bool aboveGroundLevel = false);
80 
81 public:
82 
85  static DtSimComponent* creator(const DtString& name, DtVrfObject* object,
86  DtSimManager* simManager, DtComponentDescriptor* compDescriptor,
87  DtReaderWriterRegistry* parentRegistry);
88 
94  static bool setHaltMovementForObstacles(void* controller, DtReaderWriter* value);
95 
99  static bool setObstacleQueryName(void* controller, DtReaderWriter* value);
100 
104  static DtReaderWriter* isHalted(void* controller);
105 
109  static DtReaderWriter* blockingObstacle(void* controller);
110 
114  static DtReaderWriter* timeHalted(void* controller);
116 
117 protected:
118 
119  virtual DtVector calculateProjectedLocation(
120  const DtVector& oldLocalPosition, const DtVector& newBodyVelocity,
121  double newHeading);
122 
124  virtual std::string calculateOrientationAndPosition(
125  const DtVector& newLocalProjectedLocation, double newHeading,
126  DtDcm& newLocalOrientation, DtVector& newLocalPosition);
127 
129  virtual std::string adjustToTerrain(
130  double heading, const DtVector& location, DtVector& newNormal);
131 
132  virtual void updateRepository(const DtVector & position,
133  const DtVector & velocity, const DtVector & acceleration,
134  const DtTaitBryan & localOrientation, const DtVector& rotationalVelocity);
135 
138  virtual bool isObstructedByObstacles(const MAKVRinTerra::DtFeatureGeometry& location);
139 
141  static void setObstacleToIgnore(DtSimMessage* msg, void* usr);
142 
145  virtual void processObstacleToIgnore(DtSimMessage* msg);
146 
147 protected:
149  virtual bool createPorts();
150 
152  virtual bool createPortGroups();
153 
154  class ErrorStream;
158  virtual bool haveSupplies(ErrorStream &errorStream) const;
159 
164  virtual double scriptModifier() const;
165 
168  virtual double scriptAdjustment() const;
169 
173  virtual double maximumSpeedModifierFromFeatures(const MAKVRinTerra::DtFeatureGeometry&,
174  double& slope) const;
175 
177  virtual double retrogradeMovementModifier() const;
178 
181 
184 
188  virtual bool checkPassedDestination(const DtVector& currentPosition, DtVector& newLocalProjectedPosition);
189 
192  virtual bool setHaltMovementForObstacles(DtReaderWriter* value);
193 
197  virtual bool setObstacleQueryName(DtReaderWriter* value);
198 
206  virtual void setAircraftAirborne(const DtVector& location);
207 
211  virtual DtReaderWriter* isHalted();
212 
215  virtual DtReaderWriter* blockingObstacle();
216 
219  virtual DtReaderWriter* timeHalted();
220 
221 protected:
222 
234 
236 
239 
247 
254 
259 
267 
272 
278 
281 
284 
287 
289  class MobilityArea : boost::noncopyable
290  {
291  public:
292  typedef boost::ptr_vector<MobilityArea> Vector;
293 
295 
296  const MobilityEntry& entry() const;
297  const FeatureSet& featureSet() const;
298 
299  private:
301  std::auto_ptr<FeatureSet> myFeatureSet;
302  };
303 
306 
307 
310  {
311  public:
312  ErrorStream() : myEmptyFlag(true) { }
313 
314  template <typename T>
315  ErrorStream& operator<< (const T& value)
316  {
317  myEmptyFlag = false;
318  myStream << value;
319  return *this;
320  }
321  std::string str() const
322  {
323  return myStream.str();
324  }
325  bool empty() const
326  {
327  return myEmptyFlag;
328  }
329 
330  private:
331  std::stringstream myStream;
333  };
334 
338 
340  std::auto_ptr<FeatureSet> myEngineeringObjFeatureSet;
341 
344  std::auto_ptr<FeatureSet> myEngineeringObjObstacleFeatureSet;
345 
347 
351 };
352 
353 

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)