20 #include <vlutil/vlString.h>
22 #include <osg/Matrixd>
24 #include <unordered_map>
28 #include <boost/thread/mutex.hpp>
43 class DtDynamicTerrainSequenceNode;
94 std::size_t
operator()(
const std::tuple<unsigned int, std::string, std::string>& tuple )
const
97 boost::hash_combine( seed, std::get<0>( tuple ) );
98 boost::hash_combine( seed, std::get<1>( tuple ) );
99 boost::hash_combine( seed, std::get<2>( tuple ) );
133 const osg::Matrix& matrix = osg::Matrix::identity());
139 const osg::Matrix& matrix = osg::Matrix::identity());
146 static std::string parserFormat();
150 virtual void apply( osg::Group& group )
override;
151 virtual void apply( osgSim::MultiSwitch& multiswitch )
override;
153 virtual void apply( osg::Sequence& sequence )
override;
159 const StateLocationList& stateLocations()
const;
160 void addStateLocation(
const osg::Vec3d& vec);
162 const TerrainSwitchList& terrainSwitches()
const;
165 const StateIndexList& stateIndices()
const;
170 const DtDamageStateMappings& getDamageStateMappings()
const;
176 virtual void runVisitor(osg::Node&,
const osg::Matrix&);
182 virtual bool parseSwitchNames(
const std::string& desc,
183 osgSim::MultiSwitch& multiswitch, std::list<DtString>& stateNames );
189 virtual bool parseSwitchPosition(
const std::string& desc,
190 osgSim::MultiSwitch& multiswitch,
DtString& positionStr);
194 virtual void parseSwitchValues(
const osg::Node& node, std::list<DtString>& valueNames );
195 virtual void addSwitchValueFromMappings(
unsigned int childCount,
196 std::list<DtString>& stateNames, std::list<DtString>& valueNames );
200 virtual void parseValueListString(
const std::string& valueList, std::list<DtString>& valueNames );
203 virtual void popSwitch();
207 virtual void popSwitchIndex();
210 virtual void pushSwitchChildCount(
int child );
211 virtual void popSwitchChildCount();
212 virtual int findCurrentSwitchChildCount()
const;
213 virtual void incrementSwitchChildCount();
214 virtual void decrementSwitchChildCount();
230 typedef std::unordered_map<DynamicTerrain::NodePathHash, DynamicTerrain::NodePathHash>
ParentHashMap;
250 static void registerCreator(
DtDe& de);
279 const unsigned int& getNumberOfVrvDamageStates();
285 virtual bool loadDamageStateMappings();
DtDynamicTerrainWorld & myWorld
Definition: DtDynamicTerrainParser.h:217
Implementation of the model parser for Dynamic Terrain The DtDynamicTerrainParser visits all the node...
Definition: DtDynamicTerrainParser.h:65
std::stack< std::string > myStateNames
Definition: DtDynamicTerrainParser.h:222
StateIndexList myStateIndexList
Definition: DtDynamicTerrainParser.h:220
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
std::vector< osg::ref_ptr< DtDynamicTerrainSwitchNode > > TerrainSwitchList
TerrainSwitchList defines a vector of all the dynamic terrain switches discovered. Note that there are many duplicates here. The transforms, nodePath hashes and terrain switches in these lists correspond one to one. So a hundred references to the same switch would result in a hundred different transforms in the transform list; a hundred different node path hashes, one for each reference; and then a hundred osg::ref_ptrs to the same underlying switch node used to manage those one hundred references.
Definition: DtDynamicTerrainParser.h:84
DtDynamicTerrainSwitchNode replaces an osgSim::multiswitch in a terrain patch (or page) that is tagge...
Definition: DtDynamicTerrainSwitchNode.h:74
size_t NodePathHash
Typedef used to represent a hash of an OSG Node path to a referenced node.
Definition: DtMultiReferencedNodeContainer.h:26
DtDynamicTerrainWorld::FeatureHandle myFeatureHandles
Definition: DtDynamicTerrainParser.h:233
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
Abstract base class used to parse a model.
Definition: DtModelParser.h:22
std::vector< DynamicTerrain::NodePathHash > StateIndexList
StateIndexList defines a vector of a NodePathHash values associated with each switch reference discov...
Definition: DtDynamicTerrainParser.h:77
DtDamageStateMappings is loaded from appData/importConfig/damage_state_mappings.csv The Key is a tupl...
Definition: DtDynamicTerrainParser.h:92
static boost::mutex theParserMutex
Definition: DtDynamicTerrainParser.h:235
std::vector< osg::Vec3d > StateLocationList
StateLocationList defines a vector of the world locations of each dynamic terrain switch reference di...
Definition: DtDynamicTerrainParser.h:73
std::stack< osg::ref_ptr< DtDynamicTerrainSwitchNode > > myCurrentSwitchStack
Definition: DtDynamicTerrainParser.h:223
const DtDynamicTerrainParser::DtDamageStateMappings & myDamageStateMappings
Definition: DtDynamicTerrainParser.h:239
std::unordered_map< DynamicTerrain::NodePathHash, DynamicTerrain::NodePathHash > ParentHashMap
Definition: DtDynamicTerrainParser.h:230
Contains makVrv::DtDynamicTerrainStateManipulatorFactory class.
unsigned int myNumberOfVrvDamageStates
Definition: DtDynamicTerrainParser.h:289
StateLocationList myStateLocationList
Definition: DtDynamicTerrainParser.h:219
Create an articulated model parser.
Definition: DtDynamicTerrainParser.h:244
DtDynamicTerrainParser::DtDamageStateMappings myDamageStateMappings
Definition: DtDynamicTerrainParser.h:288
Factory for creating objects which implement some kind of manipulation of the state of dynamically ch...
Definition: DtDynamicTerrainStateManipulatorFactory.h:64
std::stack< int > myCurrentSwitchChildCountStack
Definition: DtDynamicTerrainParser.h:225
std::size_t operator()(const std::tuple< unsigned int, std::string, std::string > &tuple) const
Definition: DtDynamicTerrainParser.h:94
ParentHashMap myParentHashMap
Definition: DtDynamicTerrainParser.h:231
std::string myAppDataPath
Definition: DtDynamicTerrainParser.h:287
bool myAddInstances
Definition: DtDynamicTerrainParser.h:237
Settings for DtDynamicTerrainParser Singleton so that settings can be shared across multiple parser i...
Definition: DtDynamicTerrainParser.h:264
DtDynamicTerrainWorld::FeatureHandle featureHandle() const
Accessor the handle to the features which have been paged in by calls to parse.
Definition: DtDynamicTerrainParser.h:142
Contains makVrv::DtArticulatedModelParser class.
DtDynamicTerrainSequenceNode replaces an osg::Sequence in a terrain patch (or page) that is tagged wi...
Definition: DtDynamicTerrainSequenceNode.h:62
Contains makVrv::DtDynamicTerrainWorld class.
std::unordered_map< std::tuple< unsigned int, std::string, std::string >, std::string, TupleHasher > DtDamageStateMappings
Definition: DtDynamicTerrainParser.h:103
Contains DLL export macros.
Feature Insertion/Removal/Paging Features represent parts of the terrain which are individually ident...
Definition: DtDynamicTerrainWorld.h:97
Contains makVrv::DtDynamicTerrainSwitchNode class.
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
TerrainSwitchList myTerrainSwitchList
Definition: DtDynamicTerrainParser.h:221
An abstract creator class for the model parser.
Definition: DtModelParser.h:35
std::string mySwitchPosTag
Definition: DtDynamicTerrainParser.h:227
Container for dynamic terrain features, change requests, and queries.
Definition: DtDynamicTerrainWorld.h:69
The DtModelSemanticsMapper object is responsible for mapping Names of model semantics declarations (f...
Definition: DtModelSemanticsMapper.h:27
std::stack< DynamicTerrain::NodePathHash > myCurrentSwitchIndexStack
Definition: DtDynamicTerrainParser.h:224
Default implementation of the model parser for Articulated models.
Definition: DtArticulatedModelParser.h:38