VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtCigiBaseEntity.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2016 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCigi/vrvCigi.h>
13 
14 #include <vrvCore/DtUniqueID.h>
17 
18 #include <matrix/geodeticCoord.h>
19 #include <matrix/vlTaitBryan.h>
20 
21 namespace makVrv
22 {
23  class DtAgentManagerInterface;
24  class DtCigiConnection;
25  class DtModelAgent;
26  class DtSceneObjectAgent;
27  class DtGroundClampingUpdaterAgent;
28  class DtDeadReckonUpdaterAgent;
29  class DtEmbarkationUpdaterAgent;
30 
31 
37  {
38  public:
42  DtAgentManagerInterface& sceneInterface, int entityId,
43  int entityType);
44 
46  virtual ~DtCigiBaseEntity();
47 
50  virtual DtUniqueID uniqueId() const;
51 
53  virtual DtUniqueID elementId() const;
54 
56  virtual int cigiId() const;
57 
58  // Do anything that needs to happen AFTER the entity is constructed
59  // The base class pushes the uniqueID down to the scene object
60  virtual void init();
61 
63  virtual int entityType() const;
64 
66  virtual void setVisible(bool yesNo);
67 
69  virtual bool isVisible() const;
70 
72  virtual void setDeadReckoningOn(bool onOff);
73 
75  virtual bool isDeadReckoning() const;
76 
80  virtual void setPosition(const DtGeodeticCoord& pos, bool force=false);
81 
83  virtual const DtGeodeticCoord& position() const;
84 
86  virtual const DtVector& localPosition() const;
87 
91  virtual void setOrientation(const DtTaitBryan& orientation, bool force=false);
92 
94  virtual const DtTaitBryan& orientation() const;
95 
97  virtual const DtTaitBryan& localOrientation() const;
98 
100  virtual const DtTaitBryan& geocentricOrientation() const;
101 
106  virtual void setLinearRate(const DtVector& rate, bool useWorldCoordinates, bool force=false);
107 
109  virtual const DtVector& linearRate() const;
110 
115  virtual void setAngularRate(const DtVector& rate, bool useWorldCoordinates, bool force=false);
116 
118  virtual const DtVector& angularRate() const;
119 
121 
122 
124  virtual void setRelativeTo(DtCigiBaseEntity* parent);
125 
127  virtual void setRelativePosition(const DtVector& pos);
128 
131  virtual void setRelativeOrientation(const DtTaitBryan& orient);
132 
134  virtual bool isEmbarked() const;
135 
138  virtual DtUniqueID embarkedParentId() const;
140 
145  virtual void slot_deadReckoningAllowed(bool allowed);
146 
148  virtual void setAlpha(int alpha);
149 
152  virtual int alpha() const;
153 
155  virtual void setInheritAlpha(bool inherit);
156 
158  virtual bool isInheritingAlpha() const;
159 
161  virtual void slot_alphaChanged(int alpha, DtUniqueID id);
162 
164  virtual void setGroundClampingOn( DtGroundClampingUpdater::GroundClampingMode clampType );
165 
167  virtual DtGroundClampingUpdater::GroundClampingMode groundClampingType() const;
168 
170  virtual void setArtPartTranslation(int partId, float xOffset, float yOffset,
171  float zOffset, bool xEnable, bool yEnable, bool zEnable);
172 
175  virtual bool getArtPartTranslation( int partId, int& mappedPartId, DtVector& translation );
176 
178  virtual void setArtPartOrientation(int partId, float yaw, float pitch, float roll,
179  bool yawEnable, bool pitchEnable, bool rollEnable);
180 
181  // Get the art part orientation from a specified CIGI part id.
183  virtual bool getArtPartOrientation( int partId, int& mappedPartId, DtTaitBryan& orientation );
184 
186  virtual void setArtPartLinearRate(int partId, float xRate, float yRate,
187  float zRate);
188 
191  virtual bool getArtPartLinearRate( int partId, int& mappedPartId, DtVector& rate );
192 
195  virtual bool getArtPartTranslationAndRate( int partId, int& mappedPartId, DtVector& translation, DtVector& rate );
196 
198  virtual void setArtPartAngularRate(int partId, float yawRate, float pitchRate,
199  float rollRate);
200 
201  // Get the art part orientation rate from a specified CIGI part id.
203  virtual bool getArtPartAngularRate( int partId, int& mappedPartId, DtVector& rate );
204 
205  // Get the art part orientation and rate from a specified CIGI part id.
207  virtual bool getArtPartOrientationAndRate( int partId, int& mappedPartId, DtTaitBryan& orientation, DtVector& rate );
208 
210  virtual void setArtPartEnable(int partId, bool trueFalse);
212  boost::signal<void (int, DtUniqueID)> signal_alphaChanged;
213 
214  protected:
216  virtual void startDeadReckoning();
217 
219  virtual void endDeadReckoning();
220 
222  virtual void startEmbarked();
223 
225  virtual void endEmbarked();
226 
228  virtual void startGroundClamping();
229 
231  virtual void endGroundClamping();
232 
233  virtual void buildGroundClampingUpdater();
234 
235  protected:
236  DtSceneObjectAgent* mySceneObject;
237  DtModelAgent* myModel;
238 
239  DtDeadReckonUpdaterAgent* myDeadReckonUpdaterAgent;
240  DtGroundClampingUpdaterAgent* myGroundClampingUpdaterAgent;
241  DtEmbarkationUpdaterAgent* myEmbarkationUpdaterAgent;
242 
246 
247  DtGeodeticCoord myLastPosition;
249 
250  DtTaitBryan myLastOrientation;
253 
256 
259 
260  // This is the CIGI id
263 
265 
266  // This is the parent's element ID
268 
270  int myAlpha;
272 
273  // Note that while not all entity types can have art parts, there are multiple
274  // entity types that derive from baseEntity that do; this avoids duplication in
275  // those classes...
276  std::map<int, DtTaitBryan> myLastArtPartOrientation;
277  std::map<int, DtVector> myLastArtPartTranslation;
278  std::map<int, DtVector> myArtPartAngularRate;
279  std::map<int, DtVector> myArtPartLinearRate;
280 
282  };
283 
284 
288  {
289  public:
290 
293  {
294  }
295 
298  {
299  }
300 
302  virtual DtCigiObjectCreator* clone() const = 0;
303 
305  virtual DtCigiBaseEntity* create(DtCigiConnection& connection,
306  DtAgentManagerInterface& sceneInterface, int entityId,
307  int entityType) const = 0;
308 
309  };
310 
311  template <typename CigiObject>
313  {
314  public:
315 
318  {
319  }
320 
323  {
324  }
325 
326  virtual DtCigiObjectCreator* clone() const
327  {
329  }
330 
332  virtual DtCigiBaseEntity* create( DtCigiConnection& connection,
333  DtAgentManagerInterface& sceneInterface, int entityId,
334  int entityType ) const
335  {
336  return new CigiObject (connection, sceneInterface, entityId,
337  entityType );
338  }
339  };
340 }

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)