VR-Forces Development_Version 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 const char* type() const;
66 
68  virtual void tick();
69 
76  virtual void setOrderedAltitude(double altitude, bool aboveGroundLevel = false);
77 
78 public:
79 
82  static DtSimComponent* creator(const DtString& name, DtVrfObject* object,
83  DtSimManager* simManager, DtComponentDescriptor* compDescriptor,
84  DtReaderWriterRegistry* parentRegistry);
85 
91  static bool setHaltMovementForObstacles(void* controller, DtReaderWriter* value);
92 
96  static bool setObstacleQueryName(void* controller, DtReaderWriter* value);
97 
101  static DtReaderWriter* isHalted(void* controller);
102 
106  static DtReaderWriter* blockingObstacle(void* controller);
107 
111  static DtReaderWriter* timeHalted(void* controller);
113 
114 protected:
115  virtual DtVector calculateProjectedLocation(
116  const DtVector& oldLocalPosition, const DtVector& newBodyVelocity,
117  double newHeading);
118 
120  virtual std::string calculateOrientationAndPosition(
121  const DtVector& newLocalProjectedLocation, double newHeading,
122  DtDcm& newLocalOrientation, DtVector& newLocalPosition);
123 
125  virtual std::string adjustToTerrain(
126  double heading, const DtVector& location, DtVector& newNormal);
127 
128  virtual void updateRepository(const DtVector & position,
129  const DtVector & velocity, const DtVector & acceleration,
130  const DtTaitBryan & localOrientation, const DtVector& rotationalVelocity);
131 
134  virtual bool isObstructedByObstacles(const MAKVRinTerra::DtFeatureGeometry& location);
135 
137  static void setObstacleToIgnore(DtSimMessage* msg, void* usr);
138 
141  virtual void processObstacleToIgnore(DtSimMessage* msg);
142 
143 protected:
145  virtual bool createPorts();
146 
148  virtual bool createPortGroups();
149 
150  class ErrorStream;
154  virtual bool haveSupplies(ErrorStream &errorStream) const;
155 
160  virtual double scriptModifier() const;
161 
164  virtual double scriptAdjustment() const;
165 
169  virtual double maximumSpeedModifierFromFeatures(const MAKVRinTerra::DtFeatureGeometry&,
170  double& slope) const;
171 
173  virtual double retrogradeMovementModifier() const;
174 
177 
180 
184  virtual bool checkPassedDestination(const DtVector& currentPosition, DtVector& newLocalProjectedPosition);
185 
188  virtual bool setHaltMovementForObstacles(DtReaderWriter* value);
189 
193  virtual bool setObstacleQueryName(DtReaderWriter* value);
194 
202  virtual void setAircraftAirborne(const DtVector& location);
203 
207  virtual DtReaderWriter* isHalted();
208 
211  virtual DtReaderWriter* blockingObstacle();
212 
215  virtual DtReaderWriter* timeHalted();
216 
217 protected:
218 
230 
232 
235 
243 
250 
255 
263 
268 
274 
277 
280 
283 
285  class MobilityArea : boost::noncopyable
286  {
287  public:
288  typedef boost::ptr_vector<MobilityArea> Vector;
289 
291 
292  const MobilityEntry& entry() const;
293  const FeatureSet& featureSet() const;
294 
295  private:
297  std::auto_ptr<FeatureSet> myFeatureSet;
298  };
299 
302 
303 
306  {
307  public:
308  ErrorStream() : myEmptyFlag(true) { }
309 
310  template <typename T>
311  ErrorStream& operator<< (const T& value)
312  {
313  myEmptyFlag = false;
314  myStream << value;
315  return *this;
316  }
317  std::string str() const
318  {
319  return myStream.str();
320  }
321  bool empty() const
322  {
323  return myEmptyFlag;
324  }
325 
326  private:
327  std::stringstream myStream;
329  };
330 
334 
336  std::auto_ptr<FeatureSet> myEngineeringObjFeatureSet;
337 
340  std::auto_ptr<FeatureSet> myEngineeringObjObstacleFeatureSet;
341 
343 
347 };
348 
349 

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)