VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtDynamicTerrainObject.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCore/DtTickable.h>
13 #include <vrvCore/DtUniqueID.h>
15 
16 #include <matrix/vlVector.h>
17 
18 #include <utility> // std::pair
19 #include <string>
20 #include <vector>
21 
22 namespace makVrv
23 {
24  class DtDe;
25 
36  {
37  protected:
38 
43  {
44  public:
46  : myIsDirty(false)
47  , myPriority(0)
48  , myChangeId((DtUniqueID)-1)
49  {
50  }
51  virtual ~DynamicTerrainItem() {}
52 
53  std::list< std::pair<std::string, std::string> > myData;
54  // Sent with the dynamic terrain change but not currently used
55  double myPriority;
56  // Handle to the dynamic terrain world change request for this item. May be 'empty'
57  std::vector<DtDynamicTerrainWorld::RequestHandle> myRequestHandles;
58  // keep track so we don't get processed multiple times
59  bool myIsDirty;
60  // Since these dynamic terrain items may represent items added to the terrain,
61  // such as craters or persistent tracks, an id is generated to support removal
63 
64  };
65 
68  {
69  public:
72  , myRadius(1)
73 
74  {
75  }
76 
78  double myRadius;
79  };
80 
83  {
84  public:
87  {
88  }
89  std::vector<DtVector> myVertices;
90  };
91 
93  typedef std::vector<DynamicTerrainItem*> DynamicTerrainVector;
94 
95  public:
96 
101 
102  //Not copyable
104 
105  //Not assignable
106  DtDynamicTerrainObject& operator =(const DtDynamicTerrainObject& copy);
107 
108  private:
111 
112  public:
114  virtual ~DtDynamicTerrainObject();
115 
118  virtual void update( DtTime tNow );
119 
130  virtual bool needsUpdate( DtTime tNow );
131 
133  inline DtUniqueID uniqueId() const
134  {
135  return myUniqueId;
136  }
138 
146  virtual void addSphericalGeometry( int index, const DtVector& location, double radius, double priority );
147 
154  virtual void addLinearGeometry(int index, int vtx, const DtVector& location, double priority, int vertexCount);
155 
158  virtual void changeSphericalGeometry( int index, const DtVector& location, double radius, double priority );
159 
163  virtual void changeLinearGeometry(int index, int vtx, const DtVector& location, double priority, int vertexCount);
164 
169  virtual void clearData( int index );
170 
177  virtual void removeItem( int index );
178 
180  virtual void addData( int index, const std::string& key, const std::string& value, double priority );
181 
183 
184  protected:
186 
190  virtual void makeDirty( DynamicTerrainItem* item, int index );
191 
194  virtual DynamicTerrainItem* getDynamicTerrainItem( int index );
196 
197  protected:
198 
201 
204 
206  typedef std::list<int> DirtyList;
208  };
209 }
DtUniqueID myChangeId
Definition: DtDynamicTerrainObject.h:62
virtual ~DynamicTerrainItem()
Definition: DtDynamicTerrainObject.h:51
DtUniqueID myUniqueId
This distributed object&#39;s unique identifier.
Definition: DtDynamicTerrainObject.h:203
DtUniqueID uniqueId() const
Returns the distributed object id of this dynamic terrain object.
Definition: DtDynamicTerrainObject.h:133
An abstract base class for objects that require updates. This object automatically adds itself to a D...
Definition: DtTickable.h:26
Specialized DynamicTerrainItem to represent items with linear geometry.
Definition: DtDynamicTerrainObject.h:82
bool myIsDirty
Definition: DtDynamicTerrainObject.h:59
std::list< int > DirtyList
Definition: DtDynamicTerrainObject.h:206
std::vector< DynamicTerrainItem * > DynamicTerrainVector
Type definition for a vector of DynamicTerrainItems.
Definition: DtDynamicTerrainObject.h:93
std::vector< DtDynamicTerrainWorld::RequestHandle > myRequestHandles
Definition: DtDynamicTerrainObject.h:57
DynamicTerrainLineItem()
Definition: DtDynamicTerrainObject.h:85
DynamicTerrainVector myDynamicTerrainVector
Definition: DtDynamicTerrainObject.h:205
double myRadius
Definition: DtDynamicTerrainObject.h:78
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
DynamicTerrainSphereItem()
Definition: DtDynamicTerrainObject.h:70
double myPriority
Definition: DtDynamicTerrainObject.h:55
DtDe & myDe
The display engine.
Definition: DtDynamicTerrainObject.h:200
std::vector< DtVector > myVertices
Definition: DtDynamicTerrainObject.h:89
DynamicTerrainItem()
Definition: DtDynamicTerrainObject.h:45
Contains the declaration for makVrv::DtTickable.
Contains makVrv::DtDynamicTerrainWorld class.
DtVector myLocation
Definition: DtDynamicTerrainObject.h:77
Contains makVrv::DtUniqueID type.
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
Specialized DynamicTerrainItem to represent items with spherical geometry.
Definition: DtDynamicTerrainObject.h:67
DirtyList myDirtyList
Definition: DtDynamicTerrainObject.h:207
std::list< std::pair< std::string, std::string > > myData
Definition: DtDynamicTerrainObject.h:53
Abstract rotorWash object updater interface.
Definition: DtDynamicTerrainObject.h:35
Local class used only by DtDynamicTerrainObject for representing geometry and data. A single network dynamic terrain object holds a list of dynamic terrain events This class holds the local representation of one of those events.
Definition: DtDynamicTerrainObject.h:42

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)