VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtIndirectModelsContainer.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
16 
18 
20 
21 #include <boost/unordered_map.hpp>
22 #include <tbb/concurrent_unordered_map.h>
23 
24 #include <osg/Node>
25 
26 namespace osgDB
27 {
28  class Options;
29 }
30 
31 namespace makVrv
32 {
33  class DtIndirectTextureCollectionPolicy;
34  class DtIndirectGeometryRegistrar;
35  class DtIndirectTextureCollectionPolicyFactory;
36  class DtIndirectGeometryRegistrarCreator;
37 
38 #define DTINDIRECTMODELSCONTAINER_DEBUG 0
39 
40  class DtIndirectModelsContainerCreator;
41  class DtAggregatedGeometryCreator;
42  class DtIndirectGeometryAggregatorCreator;
43  class DtCoreGlBufferCreator;
48  {
49  public:
51  virtual ~DtIndirectModelsContainer();
52 
53  protected:
54 
55  //friend class so it can be created by its creator
57 
60  DtIndirectTextureCollectionPolicyFactory& indirectTextureCollectionPolicyFactory,
61  DtIndirectGeometryRegistrarCreator& indirectGeomRegistrarCreator,
62  DtAggregatedGeometryCreator& aggregatedGeometryCreator,
63  DtIndirectGeometryAggregatorCreator& indirectGeometryAggregatorCreator,
64  DtCoreGlBufferCreator& coreGlBufferCreator);
65 
66  private:
67 
74 
75 
76  public:
77 
83  virtual bool getModelNode(const std::string& modelName, const osg::Node*& modelNode, int & modelId, float minRange = -1, float maxRange = -1, osgDB::Options *options = 0);
84 
86  virtual bool addModelNodeIfNeeded(const osg::Node* modelNode, int& modelId, const std::string& modelNameSuffix,
87  bool cullFaceEnabled = true,
88  const DtIndirectPolygonOffset& polygonOffset = DtIndirectPolygonOffset(0.0f,0.0f));
89 
91  virtual void registerModelWithRegistrar(const osg::Node* modelNode, const std::string& modelName, const DtModelInfo& modelInfo,
92  bool cullFaceEnabled = true,
93  const DtIndirectPolygonOffset& polygonOffset = DtIndirectPolygonOffset(0.0f, 0.0f));
94 
96  virtual DtIndirectGeometryRegistrar* registrar(void);
97 
98  protected:
99 
101  bool checkGeometriesOk(const osg::Node* modelNode, const std::string& modelName);
102 
103  protected:
106 
107  typedef boost::unordered_map<std::string, osg::ref_ptr< const osg::Node > > MapMarkerNameToModelNode;
110 
111  typedef tbb::concurrent_unordered_map<std::string, DtModelInfo> ModelsToModelInfo;
113  tbb::atomic<int> myNextModelId;
114 
116 
117 #if DTINDIRECTMODELSCONTAINER_DEBUG
118  static tbb::atomic<int> myRefCount;
119 #endif
120  };
121 
125  {
126  public:
129 
132 
133  private:
134 
141 
142 
143  public:
145  virtual DtIndirectModelsContainer* create(DtAggregatedGeometryCreator& aggregatedGeometryCreator,
146  DtIndirectGeometryAggregatorCreator& indirectGeometryAggregatorCreator,
147  DtCoreGlBufferCreator& coreGlBufferCreator) const;
148 
151  static DtIndirectModelsContainerCreator& instance(DtDe& de);
152 
154  static const std::string& theClassName();
155 
156  protected:
158 
161  };
162 }
The DtAggregatedGeometry creator for the DtAggregatedGeometryCreator class.
Definition: DtAggregatedGeometry.h:274
tbb::concurrent_unordered_map< std::string, DtModelInfo > ModelsToModelInfo
Definition: DtIndirectModelsContainer.h:111
Virtual base class.
Definition: DtVirtualBaseClass.h:22
DtDe & myDe
Definition: DtIndirectModelsContainer.h:157
DtIndirectTextureCollectionPolicy * myTextureCollectionPolicy
Definition: DtIndirectModelsContainer.h:104
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
DtModelInfo is a mapping of a &#39;model&#39; name to a &#39;model&#39; id A &#39;model&#39; can have a number of lods...
Definition: DtModelInfo.h:25
creator for DtCoreGlBuffer
Definition: DtCoreGlBuffer.h:58
Indirect geometry can have multiple models and their corresponding ids registered in it...
Definition: DtIndirectGeometryRegistrar.h:101
MapMarkerNameToModelNode myMapMarkerNameToModelNode
Definition: DtIndirectModelsContainer.h:108
Abstract class to look in the stateset and collect textures specified via its template The effect tex...
Definition: DtIndirectTextureCollectionPolicy.h:38
creator for DtIndirectGeometryAggregator
Definition: DtIndirectGeometryAggregator.h:211
class for holding an indirect geometry registrar (which holds the information about how to draw model...
Definition: DtIndirectModelsContainer.h:47
Contains makVrv::DtVirtualBaseClass class.
ModelsToModelInfo myModelsToModelInfo
Definition: DtIndirectModelsContainer.h:112
DtIndirectGeometryRegistrarCreator & myIndirectGeomRegistrarCreator
Definition: DtIndirectModelsContainer.h:160
OpenThreads::Mutex Mutex
Definition: DtOsgThreadingUtils.h:12
Factory for creating different collection policies.
Definition: DtIndirectTextureCollectionPolicy.h:104
creator for DtIndirectModelsContainer
Definition: DtIndirectModelsContainer.h:124
DtIndirectTextureCollectionPolicyFactory & myIndirectTextureCollectionPolicyFactory
Definition: DtIndirectModelsContainer.h:159
DtModelInfo class declaration.
tbb::atomic< int > myNextModelId
Definition: DtIndirectModelsContainer.h:113
osg::ref_ptr< DtIndirectGeometryRegistrar > myIndirectGeometryRegistrar
Definition: DtIndirectModelsContainer.h:105
creator for DtIndirectGeometryRegistrar
Definition: DtIndirectGeometryRegistrar.h:288
non virtual container class for defining a polygon offset state
Definition: DtIndirectPolygonOffset.h:18
Contains DLL export macros.
boost::unordered_map< std::string, osg::ref_ptr< const osg::Node > > MapMarkerNameToModelNode
Definition: DtIndirectModelsContainer.h:107
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
Threading::Mutex myMapMarkerNameToModelNodeMutex
Definition: DtIndirectModelsContainer.h:109
Contains the DtIndirectPolygonOffset class declaration.
DtDe & myDe
Definition: DtIndirectModelsContainer.h:115

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)