VR-Forces 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 #include <osg/Referenced>
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() override;
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) override;
56 
57 protected:
58  virtual void postInitialize() override;
59 
60 protected:
62 };
63 
66 {
67 public:
70  {
71  public:
73  virtual makVrv::DtDeSharedState* create(makVrv::DtDe& de) override;
74  };
75 
76  friend class Creator;
77 
78 protected:
81 
83  virtual void initialize() override;
84 };
85 
88 {
89 public:
92  {
93  public:
94  virtual makVrv::DtTerrain* create(makVrv::DtDe& de, makVrv::DtAgentManagerInterface&) override;
95  };
96 
97  friend class Creator;
98 
99 protected:
101 
103  virtual makVrv::DtFeatureLayer& addFeatureLayer(const std::string& featureLayerFilename,
105 };
106 
109 {
110 public:
112 
113  virtual ~DtVrfElementDefinitionTypeManager() override;
114 
115  void cleanup();
116 
117  virtual void loadDefaults() override;
118 };
119 
121  : public makVrv::DtOsgFileCache
122 {
123 public:
125  {
126  public:
127  virtual makVrv::DtFileCache* create(makVrv::DtDe& de) override;
128  };
129 
130  friend class Creator;
131 
132  virtual bool needsShaderGeneration(const std::string& filename, const LoadFileOptions& options) const override;
133 
134  virtual void encodeOptionsString(
135  const LoadFileOptions& loadFileOptions, osgDB::ReaderWriter::Options& options) const override;
136 
137  virtual void decodeOptions(
138  const osgDB::ReaderWriter::Options& options, LoadFileOptions& loadFileOptions) const override;
139 
140  osg::ref_ptr<osg::Image> ts_readImageFile(
141  const std::string& inputFilename,
142  const LoadFileOptions& loadFileOptions);
143 
144 protected:
145  explicit DtVrfOsgFileCache(makVrv::DtDe& de);
146 };
147 
149 {
150 public:
152  {
153  public:
154  virtual makVrv::DtRenderer* create(makVrv::DtDe&) override;
155  };
156 
157  osg::Node* terrainNode();
158  osg::Node* propNode();
159  virtual void createManagers() override;
160 
161  explicit DtVrfOsgRenderer(makVrv::DtDe&);
162 };
163 
165 {
166 public:
168 
169  virtual ~DtDisabledIndirectGeometryManager() override;
170 
171 };
172 
174 {
175 public:
176  DtDisabledIndirectManager(makVrv::DtDe& de, makVrv::DtOsgTerrainPatchObject& terrainPatchObject, bool adjustLodStart, bool connectToPagingSignals);
177 
178  virtual ~DtDisabledIndirectManager() override;
179 
181  virtual void nodePagedIn(const osg::Node* node, const std::string& fileName, osg::NodePath& parentalNodePath, bool oceanExtracted) override;
182 
184  virtual void nodePagingOut(const osg::Node* node) override;
185 
187  virtual void addTextureLoaderToSceneGraph(osg::Group& myTerrainGroup) override;
188 
189 protected:
190 
192  virtual void slot_childLoaded(const osg::Group* page, const osg::Node* child, const std::string& fileName, osg::Node*& returnedNode) override;
193 
195  virtual void slot_childPagedIn(const osg::Group* page, const osg::Node* child) override;
196 
198  virtual void slot_childAboutToPageOut(const osg::Group* page, const osg::Node* child) override;
199 
200 };
201 
202 template <>
203 inline const char* makVrv::creatorTypeName<DtDisabledIndirectManager>(void) { return "DtPagedTilesIndirectManagerCreator"; }
204 
206 
208 
210 {
211 public:
212  DtVrfModelSetStringProvider(makVrv::DtDe& de) : DtModelSetStringProvider(de) {};
213 
214  virtual void getModelSetList(StringList& outList) const override {};
215 
217  virtual makVrv::DtUnicode modelSetToString(makVrv::DtModelSetId modelSet) const override
218  { return makVrv::DtUnicode::fromAscii("VRF"); }
219 
221  virtual int stringToModelSet(const makVrv::DtUnicode& modelSetString) const override { return 0; };
222 
224  virtual int numModelSets() const override { return 0; };
225 
228  virtual void setModelSetName(int modelSet, const makVrv::DtUnicode& name) override {}
229 };
230 
234 {
235 public:
237 
238  virtual ~DtVrfOsgMultipleArticulatedModel() override;
239 
241  virtual void addArticulatedModel(DtVrfOsgArticulatedModel*);
242 
245  virtual int state(int stateNumber) const override;
246 
248  virtual void setState(int stateNumber, int stateValue) override;
249 
250 protected:
251  std::vector<DtVrfOsgArticulatedModel*> myArticulatedModels;
253 };
254 
257 {
258 public:
260 
262  virtual void addModel(makVrv::DtOsgArticulatedModel& model, makVrv::DtUniqueID uniqueId, makVrv::DtUniqueID elementId) override;
263 
266  virtual void removeModel(makVrv::DtOsgArticulatedModel& model) override;
267 
268 protected:
269  tbb::spin_rw_mutex myMutex;
270 };
271 
273 {
274 public:
276 
278  virtual void addModel(makVrv::DtOsgArticulatedModel& model, makVrv::DtUniqueID uniqueId, makVrv::DtUniqueID elementId) override;
279 
282  virtual void removeModel(makVrv::DtOsgArticulatedModel& model) override;
283 
284 protected:
285  tbb::spin_rw_mutex myMutex;
286 };
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:91
A unicode string. DtUnicode stores a UTF-16 encoded unicode string. Code Point, a Unicode character...
Definition: DtUnicode.h:33
Definition: vrfVrvOverrides.h:164
Currently these are not thread safe in Vantage, so, override here to provide thread safety around add...
Definition: vrfVrvOverrides.h:256
handles the management of paged tiles and terrain patches being added to the indirect rendering syste...
Definition: DtPagedTilesIndirectManager.h:69
DtModelSetStringProvider is an interface for a class to provide strings for model sets...
Definition: DtModelSetStringProvider.h:25
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:173
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:107
Variadic templated creator class for creating a custom version of a DtVirtualBaseClassCreator This cl...
Definition: DtVirtualBaseClassCustomCreator.h:25
Contains makVrv::DtEntityWheelManager class.
virtual void getModelSetList(StringList &outList) const override
Get the list of model set names.
Definition: vrfVrvOverrides.h:214
tbb::spin_rw_mutex myMutex
Definition: vrfVrvOverrides.h:285
PrintLevel
Definition: DtDebugLog.h:42
An articulated model manipulator for controlling an articulated model. Supports indirect rendering of...
Definition: DtOsgArticulatedModel.h:67
Contains makVrv::DtDeSharedState class.
Definition: vrfVrvOverrides.h:148
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:561
DtVrfModelSetStringProvider(makVrv::DtDe &de)
Definition: vrfVrvOverrides.h:212
Contains makVrv::DtEntityRotorManager class.
The DtOsgFileCache creator..
Definition: DtOsgFileCache.h:460
Definition: vrfOsgArticulatedModel.h:14
Definition: vrfVrvOverrides.h:272
Definition: vrfVrvOverrides.h:151
virtual int stringToModelSet(const makVrv::DtUnicode &modelSetString) const override
Get the model set that&#39;s mapped to the specified string.
Definition: vrfVrvOverrides.h:221
virtual void addModel(DtOsgArticulatedModel &model, DtUniqueID uniqueId, DtUniqueID elementId)
Add a model which will have some rotors.
makVrv::DtVirtualBaseClassCustomCreator< DtDisabledIndirectManager, makVrv::DtPagedTilesIndirectManagerCreator, makVrv::DtOsgTerrainPatchObject &, const bool &, const bool & > DtDisabledIndirectManagerCreator
Definition: vrfVrvOverrides.h:207
The OSG implementation of makVrv::DtOsgFileCache. This will cache files as .ive&#39;s for quicker load ti...
Definition: DtOsgFileCache.h:56
Definition: vrfVrvOverrides.h:124
osg::ref_ptr< makVrv::DtRenderToggleTransform > myTransform
Definition: vrfVrvOverrides.h:252
The DtDeSharedState represents all the data that is shared between the master and its slaves...
Definition: DtDeSharedState.h:47
A DtOsgTerrainPatchObject contains the methods for loading a file as a terrain. When loading a file a...
Definition: DtOsgTerrainPatchObject.h:54
virtual void addModel(DtOsgArticulatedModel &model, DtUniqueID uniqueId, DtUniqueID elementId)
Add a model which will have its wheel rotating.
Definition: vrfVrvOverrides.h:209
virtual makVrv::DtUnicode modelSetToString(makVrv::DtModelSetId modelSet) const override
Get the string that&#39;s mapped to the specified model set.
Definition: vrfVrvOverrides.h:217
std::vector< DtUnicode > StringList
Definition: DtModelSetStringProvider.h:30
virtual void setModelSetName(int modelSet, const makVrv::DtUnicode &name) override
Change the string associated with a model set (if it exists) or add a new string to model set mapping...
Definition: vrfVrvOverrides.h:228
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:486
Definition: DtFileCache.h:45
VRV creator.
Definition: vrfVrvOverrides.h:91
Contains makVrv::DtOsgSceneConnector class.
Creator class for DtDeSharedState.
Definition: DtDeSharedState.h:1306
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
The DtRenderer is the component responsible for rendering 3D images onto the screen.
Definition: DtRenderer.h:49
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:269
Contains makVrv::DtIndirectGeometryCallbackConnector class.
std::vector< DtVrfOsgArticulatedModel * > myArticulatedModels
Definition: vrfVrvOverrides.h:251
Contains makVrv::DtOsgFileCache class.
Contains makVrv::DtPagedTilesIndirectManager class.
Contains makVrv::DtModelSetStringProvider class.
Abstract creator base class.
Definition: DtRenderer.h:184
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.
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...
This special class will allow for multiple articulated models to be added to the same transform...
Definition: vrfVrvOverrides.h:233
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:76
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:120
VRV Creator.
Definition: vrfVrvOverrides.h:69
DtModelSetId
Definition: DtModelSetEnums.h:19
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.
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:37
virtual int state(int stateNumber) const override
Get a state of the model Returns -1 if no such state exists.
DtTerrain is a facade around terrain functionality.
Definition: DtTerrain.h:57
virtual int numModelSets() const override
Get the current number of model set names on the model set list.
Definition: vrfVrvOverrides.h:224
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 Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)