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 
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  virtual void createManagers() override;
165 
166  explicit DtVrfOsgRenderer(makVrv::DtDe&);
167 };
168 
170 {
171 public:
173 
175 
176 };
177 
179 {
180 public:
181  DtDisabledIndirectManager(makVrv::DtDe& de, makVrv::DtOsgTerrainPatchObject& terrainPatchObject, bool adjustLodStart, bool connectToPagingSignals);
182 
183  virtual ~DtDisabledIndirectManager();
184 
186  virtual void nodePagedIn(const osg::Node* node, const std::string& fileName, osg::NodePath& parentalNodePath, bool oceanExtracted) override;
187 
189  virtual void nodePagingOut(const osg::Node* node) override;
190 
192  virtual void addTextureLoaderToSceneGraph(osg::Group& myTerrainGroup) override;
193 
194 protected:
195 
197  virtual void slot_childLoaded(const osg::Group* page, const osg::Node* child, const std::string& fileName, osg::Node*& returnedNode) override;
198 
200  virtual void slot_childPagedIn(const osg::Group* page, const osg::Node* child) override;
201 
203  virtual void slot_childAboutToPageOut(const osg::Group* page, const osg::Node* child) override;
204 
205 };
206 
207 template <>
208 inline const char* makVrv::creatorTypeName<DtDisabledIndirectManager>(void) { return "DtPagedTilesIndirectManagerCreator"; }
209 
211 
213 
215 {
216 public:
217  DtVrfModelSetStringProvider(makVrv::DtDe& de) : DtModelSetStringProvider(de) {};
218 
219  virtual void getModelSetList(StringList& outList) const {};
220 
223 
225  virtual int stringToModelSet(const makVrv::DtUnicode& modelSetString) const { return 0; };
226 
228  virtual int numModelSets() const { return 0; };
229 
232  virtual void setModelSetName(int modelSet, const makVrv::DtUnicode& name) {}
233 };
234 
238 {
239 public:
241 
243 
245  virtual void addArticulatedModel(DtVrfOsgArticulatedModel*);
246 
249  virtual int state(int stateNumber) const;
250 
252  virtual void setState(int stateNumber, int stateValue);
253 
254 protected:
255  std::vector<DtVrfOsgArticulatedModel*> myArticulatedModels;
257 };
258 
261 {
262 public:
264 
266  virtual void addModel(makVrv::DtOsgArticulatedModel& model, makVrv::DtUniqueID uniqueId, makVrv::DtUniqueID elementId) override;
267 
270  virtual void removeModel(makVrv::DtOsgArticulatedModel& model) override;
271 
272 protected:
273  tbb::spin_rw_mutex myMutex;
274 };
275 
277 {
278 public:
280 
282  virtual void addModel(makVrv::DtOsgArticulatedModel& model, makVrv::DtUniqueID uniqueId, makVrv::DtUniqueID elementId) override;
283 
286  virtual void removeModel(makVrv::DtOsgArticulatedModel& model) override;
287 
288 protected:
289  tbb::spin_rw_mutex myMutex;
290 };
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:90
A unicode string. DtUnicode stores a UTF-16 encoded unicode string. Code Point, a Unicode character...
Definition: DtUnicode.h:33
Definition: vrfVrvOverrides.h:169
Currently these are not thread safe in Vantage, so, override here to provide thread safety around add...
Definition: vrfVrvOverrides.h:260
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:178
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:289
PrintLevel
Definition: DtDebugLog.h:41
An articulated model manipulator for controlling an articulated model. Supports indirect rendering of...
Definition: DtOsgArticulatedModel.h:67
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:225
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:551
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:217
Contains makVrv::DtEntityRotorManager class.
The DtOsgFileCache creator..
Definition: DtOsgFileCache.h:399
Definition: vrfOsgArticulatedModel.h:14
Definition: vrfVrvOverrides.h:276
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:232
Definition: vrfVrvOverrides.h:156
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:212
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:125
osg::ref_ptr< makVrv::DtRenderToggleTransform > myTransform
Definition: vrfVrvOverrides.h:256
virtual void getModelSetList(StringList &outList) const
Get the list of model set names.
Definition: vrfVrvOverrides.h:219
The DtDeSharedState represents all the data that is shared between the master and its slaves...
Definition: DtDeSharedState.h:45
A DtOsgTerrainPatchObject contains the methods for loading a file as a terrain. When loading a file a...
Definition: DtOsgTerrainPatchObject.h:54
virtual makVrv::DtUnicode modelSetToString(makVrv::DtModelSetId modelSet) const
Get the string that&#39;s mapped to the specified model set.
Definition: vrfVrvOverrides.h:222
virtual void addModel(DtOsgArticulatedModel &model, DtUniqueID uniqueId, DtUniqueID elementId)
Add a model which will have its wheel rotating.
Definition: vrfVrvOverrides.h:214
std::vector< DtUnicode > StringList
Definition: DtModelSetStringProvider.h:30
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:484
Definition: DtFileCache.h:45
VRV creator.
Definition: vrfVrvOverrides.h:91
Contains makVrv::DtOsgSceneConnector class.
Creator class for DtDeSharedState.
Definition: DtDeSharedState.h:1280
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:273
Contains makVrv::DtIndirectGeometryCallbackConnector class.
std::vector< DtVrfOsgArticulatedModel * > myArticulatedModels
Definition: vrfVrvOverrides.h:255
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...
virtual int numModelSets() const
Get the current number of model set names on the model set list.
Definition: vrfVrvOverrides.h:228
This special class will allow for multiple articulated models to be added to the same transform...
Definition: vrfVrvOverrides.h:237
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:72
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
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
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 Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)