VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
vrfVrvOverrides.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
14 
16 #include <vrvCore/DtTerrain.h>
19 #include <vrvOsg/DtOsgFileCache.h>
20 #include <vrvOsg/DtOsgRenderer.h>
22 #include <vrvUtil/DtDebugLog.h>
23 #include <vrvUtil/DtUnicode.h>
27 
31 
32 #include <tbb/spin_rw_mutex.h>
33 
34 namespace osg
35 {
36  class Node;
37 }
38 
39 namespace makVrv
40 {
41  class DtDe;
42 }
43 
46 {
47 public:
48  DtVrfDe();
49 
50  virtual ~DtVrfDe();
51 
52  virtual void setModelDefinitionsDirectory(const DtFilename& f);
53  virtual const DtFilename& modelDefinitionsDirectory() const;
54 
55  virtual void createDebugLog(const std::string& fileName, makVrv::DtDebugLog::PrintLevel level);
56 
57 protected:
58  virtual void postInitialize();
59 
60 protected:
62 };
63 
66 {
67 public:
70  {
71  public:
73  virtual makVrv::DtDeSharedState* create(makVrv::DtDe& de);
74  };
75 
76  friend class Creator;
77 
78 protected:
81 
83  virtual void initialize();
84 };
85 
88 {
89 public:
92  {
93  public:
95  };
96 
97  friend class Creator;
98 
99 protected:
101 
103  makVrv::DtFeatureLayer& addFeatureLayer(
104  const std::string& featureLayerFilename,
106 };
107 
110 {
111 public:
113 
115 
116  void cleanup();
117 
118  virtual void loadDefaults();
119 };
120 
122  : public makVrv::DtOsgFileCache
123 {
124 public:
126  {
127  public:
128  makVrv::DtFileCache* create(makVrv::DtDe& de);
129  };
130 
131  friend class Creator;
132 
133  bool needsShaderGeneration(
134  const std::string& filename,
135  const LoadFileOptions& options) const;
136 
137  void encodeOptionsString(
138  const LoadFileOptions& loadFileOptions,
139  osgDB::ReaderWriter::Options& options) const;
140 
141  void decodeOptions(
142  const osgDB::ReaderWriter::Options& options,
143  LoadFileOptions& loadFileOptions) const;
144 
145  osg::ref_ptr<osg::Image> ts_readImageFile(
146  const std::string& inputFilename,
147  const LoadFileOptions& loadFileOptions);
148 
149 protected:
150  explicit DtVrfOsgFileCache(makVrv::DtDe& de);
151 };
152 
154 {
155 public:
157  {
158  public:
159  virtual makVrv::DtRenderer* create(makVrv::DtDe&);
160  };
161 
162  osg::Node* terrainNode();
163  osg::Node* propNode();
164 
165  explicit DtVrfOsgRenderer(makVrv::DtDe&);
166 };
167 
169 {
170 public:
172 
174 
175 };
176 
178 {
179 public:
180  DtDisabledIndirectManager(makVrv::DtDe& de, bool adjustLodStart, bool connectToPagingSignals);
181 
182  virtual ~DtDisabledIndirectManager();
183 
185  virtual void nodePagedIn(const osg::Node* node, const std::string& fileName, osg::NodePath& parentalNodePath, bool oceanExtracted) override;
186 
188  virtual void nodePagingOut(const osg::Node* node) override;
189 
191  virtual void addTextureLoaderToSceneGraph(osg::Group& myTerrainGroup) override;
192 
193 protected:
194 
196  virtual void slot_childLoaded(const osg::Group* page, const osg::Node* child, const std::string& fileName, osg::Node*& returnedNode) override;
197 
199  virtual void slot_childPagedIn(const osg::Group* page, const osg::Node* child) override;
200 
202  virtual void slot_childAboutToPageOut(const osg::Group* page, const osg::Node* child) override;
203 
204 };
205 
206 template <>
207 inline const char* makVrv::creatorTypeName<DtDisabledIndirectManager>(void) { return "DtPagedTilesIndirectManagerCreator"; }
208 
210 
212 
214 {
215 public:
216  DtVrfModelSetStringProvider(makVrv::DtDe& de) : DtModelSetStringProvider(de) {};
217 
218  virtual void getModelSetList(StringList& outList) const {};
219 
221  virtual makVrv::DtUnicode modelSetToString(int modelSet) const { return makVrv::DtUnicode::fromAscii("VRF"); }
222 
224  virtual int stringToModelSet(const makVrv::DtUnicode& modelSetString) const { return 0; };
225 
227  virtual int numModelSets() const { return 0; };
228 
231  virtual void setModelSetName(int modelSet, const makVrv::DtUnicode& name) {}
232 };
233 
237 {
238 public:
240 
242 
244  virtual void addArticulatedModel(DtVrfOsgArticulatedModel*);
245 
248  virtual int state(int stateNumber) const;
249 
251  virtual void setState(int stateNumber, int stateValue);
252 
253 protected:
254  std::vector<DtVrfOsgArticulatedModel*> myArticulatedModels;
256 };
257 
260 {
261 public:
263 
265  virtual void addModel(makVrv::DtOsgArticulatedModel& model, makVrv::DtUniqueID uniqueId, makVrv::DtUniqueID elementId) override;
266 
269  virtual void removeModel(makVrv::DtOsgArticulatedModel& model) override;
270 
271 protected:
272  tbb::spin_rw_mutex myMutex;
273 };
274 
276 {
277 public:
279 
281  virtual void addModel(makVrv::DtOsgArticulatedModel& model, makVrv::DtUniqueID uniqueId, makVrv::DtUniqueID elementId) override;
282 
285  virtual void removeModel(makVrv::DtOsgArticulatedModel& model) override;
286 
287 protected:
288  tbb::spin_rw_mutex myMutex;
289 };
virtual void slot_childAboutToPageOut(const osg::Group *page, const osg::Node *child)
slot for when paged tile is about to page out called in the main thread just before a tile has been p...
Replaces DtTerrain so we can supply our own DtFeatureLayer type.
Definition: vrfVrvOverrides.h:87
Contains makVrv::DtModelSetRealizationManager class.
The feature layer is a type of terrain layer which contains features, such as points, lines, areas, and props created from them.
Definition: DtFeatureLayer.h:25
virtual void slot_childPagedIn(const osg::Group *page, const osg::Node *child)
slot for when paged tile has already been paged in only called in the main thread. Called after a tile has been added to the scenegraph does not update the signal count since it is only called in the main thread NOTE: each time the signature of this function change the same change needs to be made in JrmDisabledIndirectManager.h
virtual void removeModel(DtOsgArticulatedModel &model)
Remove the art part ids associated with this model from the DtEntityWheelManager. ...
The DtOsgRenderer is the component responsible for rendering 3D images onto the screen via OpenSceneG...
Definition: DtOsgRenderer.h:87
A unicode string. DtUnicode stores a UTF-16 encoded unicode string. Code Point, a Unicode character...
Definition: DtUnicode.h:33
Definition: vrfVrvOverrides.h:168
Currently these are not thread safe in Vantage, so, override here to provide thread safety around add...
Definition: vrfVrvOverrides.h:259
handles the management of paged tiles and terrain patches being added to the indirect rendering syste...
Definition: DtPagedTilesIndirectManager.h:67
DtModelSetStringProvider is an interface for a class to provide strings for model sets...
Definition: DtModelSetStringProvider.h:24
virtual void addTextureLoaderToSceneGraph(osg::Group &myTerrainGroup)
Add a texture loader node to the scenegraph. It processes textures and gets them to loaded (onto the ...
Definition: vrfVrvOverrides.h:177
Display engine.
Definition: vrfVrvOverrides.h:45
virtual void removeModel(DtOsgArticulatedModel &model)
Remove the art part ids associated with this model from the DtEntityWheelManager. ...
DT_DLL_VRVCORE DtTaitBryan level(const DtCoordinateSystem &cs, const DtVector &localOrigin, double topoHeading)
Returns a level orientation with the topographic heading.
DtFilename myModelDefinitionsDirectory
Definition: vrfVrvOverrides.h:61
Definition: vrfVrvOverrides.h:108
Variadic templated creator class for creating a custom version of a DtVirtualBaseClassCreator This cl...
Definition: DtVirtualBaseClassCustomCreator.h:25
Contains makVrv::DtEntityWheelManager class.
tbb::spin_rw_mutex myMutex
Definition: vrfVrvOverrides.h:288
PrintLevel
Definition: DtDebugLog.h:41
An articulated model manipulator for controlling an articulated model. Supports indirect rendering of...
Definition: DtOsgArticulatedModel.h:69
Contains makVrv::DtDeSharedState class.
virtual int stringToModelSet(const makVrv::DtUnicode &modelSetString) const
Get the model set that&#39;s mapped to the specified string.
Definition: vrfVrvOverrides.h:224
Definition: vrfVrvOverrides.h:153
Contains makVrv::DtTerrain class.
The element type manager is responsible for knowing about the types of elements as well as owning the...
Definition: DtElementDefinitionManager.h:500
virtual int state(int stateNumber) const
Get a state of the model Returns -1 if no such state exists.
DtVrfModelSetStringProvider(makVrv::DtDe &de)
Definition: vrfVrvOverrides.h:216
Contains makVrv::DtEntityRotorManager class.
The DtOsgFileCache creator..
Definition: DtOsgFileCache.h:388
Definition: vrfOsgArticulatedModel.h:14
Definition: vrfVrvOverrides.h:275
virtual void setModelSetName(int modelSet, const makVrv::DtUnicode &name)
Change the string associated with a model set (if it exists) or add a new string to model set mapping...
Definition: vrfVrvOverrides.h:231
Definition: vrfVrvOverrides.h:156
virtual void addModel(DtOsgArticulatedModel &model, DtUniqueID uniqueId, DtUniqueID elementId)
Add a model which will have some rotors.
The OSG implementation of makVrv::DtOsgFileCache. This will cache files as .ive&#39;s for quicker load ti...
Definition: DtOsgFileCache.h:54
Definition: vrfVrvOverrides.h:125
osg::ref_ptr< makVrv::DtRenderToggleTransform > myTransform
Definition: vrfVrvOverrides.h:255
virtual void getModelSetList(StringList &outList) const
Get the list of model set names.
Definition: vrfVrvOverrides.h:218
The DtDeSharedState represents all the data that is shared between the master and its slaves...
Definition: DtDeSharedState.h:44
virtual void addModel(DtOsgArticulatedModel &model, DtUniqueID uniqueId, DtUniqueID elementId)
Add a model which will have its wheel rotating.
Definition: vrfVrvOverrides.h:213
std::vector< DtUnicode > StringList
Definition: DtModelSetStringProvider.h:29
The DtEntityWheelManager class is responsible for collecting art part ids related to wheels and then ...
Definition: DtEntityWheelManager.h:39
The terrain creator for the DtTerrain class.
Definition: DtTerrain.h:483
Definition: DtFileCache.h:44
VRV creator.
Definition: vrfVrvOverrides.h:91
Contains makVrv::DtOsgSceneConnector class.
Creator class for DtDeSharedState.
Definition: DtDeSharedState.h:1248
The DtRenderer is the component responsible for rendering 3D images onto the screen.
Definition: DtRenderer.h:43
virtual void nodePagedIn(const osg::Node *node, const std::string &fileName, osg::NodePath &parentalNodePath, bool oceanExtracted)
Indirect a node directly (utility function) can be used to indirect a scenegraph, so whole openflight...
tbb::spin_rw_mutex myMutex
Definition: vrfVrvOverrides.h:272
Contains makVrv::DtIndirectGeometryCallbackConnector class.
std::vector< DtVrfOsgArticulatedModel * > myArticulatedModels
Definition: vrfVrvOverrides.h:254
Contains makVrv::DtOsgFileCache class.
Contains makVrv::DtPagedTilesIndirectManager class.
Contains makVrv::DtModelSetStringProvider class.
Abstract creator base class.
Definition: DtRenderer.h:164
virtual void loadDefaults()
Load the default definitions.
#define DT_DLL_vantageTerrainImplementation
This file is used to determine how to build.
Definition: vantageTerrainImplementationDefines.h:28
virtual void setState(int stateNumber, int stateValue)
Set the state on the model.
TargetApplication
Definition: DtTerrainOperationRecord.h:26
The abstract interface necessary for agents.
Definition: DtAgentManagerInterface.h:33
virtual void postInitialize()
Connect initialized components and call postInit signal.
makVrv::DtVirtualBaseClassCustomCreator< DtDisabledIndirectManager, makVrv::DtPagedTilesIndirectManagerCreator, const bool &, const bool & > DtDisabledIndirectManagerCreator
Definition: vrfVrvOverrides.h:211
virtual void nodePagingOut(const osg::Node *node)
Let the manger know a node is paging out should only be called in the main thread&#39; NOTE: each time th...
virtual int numModelSets() const
Get the current number of model set names on the model set list.
Definition: vrfVrvOverrides.h:227
This special class will allow for multiple articulated models to be added to the same transform...
Definition: vrfVrvOverrides.h:236
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
Shared state.
Definition: vrfVrvOverrides.h:65
virtual void createDebugLog(const std::string &fileName, DtDebugLog::PrintLevel level)
create the debug log for logging information to a file
Definition: vrfVrvOverrides.h:121
VRV Creator.
Definition: vrfVrvOverrides.h:69
static DtUnicode fromAscii(const std::string &ascii)
Create a unicode string from an ascii string, the string MUST be zero terminated if the length is not...
Contains makVrv::DtOsgRenderer class.
virtual makVrv::DtUnicode modelSetToString(int modelSet) const
Get the string that&#39;s mapped to the specified model set.
Definition: vrfVrvOverrides.h:221
Contains makVrv::DtIGLogger class.
A connector class to listen in on signal_terrainPatchCreated and install the DtIndirectGeometryCallba...
Definition: DtIndirectGeometryCallbackConnector.h:25
Handles the caching of files. Includes functions for excluding files with certain extensions from bei...
Definition: DtFileCache.h:36
DtTerrain is a facade around terrain functionality.
Definition: DtTerrain.h:58
virtual void slot_childLoaded(const osg::Group *page, const osg::Node *child, const std::string &fileName, osg::Node *&returnedNode)
slot for when a paged tile is loaded (but not added to the scenegraph) called by the paged in a backg...
class to manage rotors of each model and their corresponding rotors&#39; states
Definition: DtEntityRotorManager.h:29

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)