VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends
makVrv::DtMetaFileManager Class Reference

Handles the set up and processing of .meta files. Meta files contain extra information about nodes in a scene graph. As the scene graph is traversed, the nodes are matched based on annotation or node name. Then the specific settings to use during processing of the node are extracted from the parsed .meta file. .meta files are in JSON format.

Classes

struct  NodeLinkage
 

Public Types

typedef std::map< std::string,
rapidjson::Document * > 
FileDocumentMap
 
typedef std::pair< NodeLinkage,
std::vector< const
rapidjson::Value * > > 
LinkageValuePair
 
typedef std::vector
< LinkageValuePair
LinkageValueVec
 

Public Member Functions

virtual ~DtMetaFileManager ()
 
std::string convertPathToMeta (const std::string &inPath)
 
std::string convertModelDefToMeta (const DtModelDefinition *modelDef)
 
bool pathHasMeta (const std::string &inPath)
 
bool convertLoadAndParse (const DtModelDefinition *modelDef)
 
bool convertLoadAndParse (const std::string &fileName)
 
rapidjson::Document * retrieveFileData (const std::string &fileName)
 
LinkageValueVec makeLinkagesAndFeaturesArray (rapidjson::Document *linkagesFeaturesDocument)
 

Static Public Attributes

static const chartheTagFeatureName
 
static const chartheTagFeatureData
 
static const chartheTagNodeFeaturesTag
 
static const chartheTagTextureFeature
 
static const chartheTagComment
 
static const chartheTagLinkage
 
static const chartheTagLinkageNodeName
 
static const chartheTagLinkageAnnotationTag
 

Protected Member Functions

bool parseMetaFile (const std::string &fileName)
 
 DtMetaFileManager (DtDe &de)
 

Protected Attributes

FileDocumentMap myDocumentMap
 
DtDemyDe
 
boost::mutex myMapMutex
 

Friends

class DtMetaFileManagerCreator
 

Member Typedef Documentation

typedef std::map<std::string, rapidjson::Document*> makVrv::DtMetaFileManager::FileDocumentMap

ex. FileDocumentMap["Makland.meta"] = <parsed json="" data>="">

typedef std::pair<NodeLinkage, std::vector<const rapidjson::Value*> > makVrv::DtMetaFileManager::LinkageValuePair

ex. (node name/annotation, node JSON data*)

ex. vector of node names/annotations and JSON data for those node names/annotations

Constructor & Destructor Documentation

virtual makVrv::DtMetaFileManager::~DtMetaFileManager ( )
virtual

DTOR.

makVrv::DtMetaFileManager::DtMetaFileManager ( DtDe de)
protected

Protected CTOR. Must be called by creator.

Member Function Documentation

std::string makVrv::DtMetaFileManager::convertPathToMeta ( const std::string &  inPath)

Convert a path (chop off extension, replace with .meta)

std::string makVrv::DtMetaFileManager::convertModelDefToMeta ( const DtModelDefinition modelDef)

Look in a model definition file for .meta info or use the filename path in the model definition to get .meta file path.

bool makVrv::DtMetaFileManager::pathHasMeta ( const std::string &  inPath)

Does this string end with '.meta'?

bool makVrv::DtMetaFileManager::convertLoadAndParse ( const DtModelDefinition modelDef)

Take a model definition (ex. PolesWindsock), look for 'metaFileName', read .meta file contents as string and store the string, then parse the string into a rapidjson Document* return false if any of those steps fail.

bool makVrv::DtMetaFileManager::convertLoadAndParse ( const std::string &  fileName)

Take a file (ex. makland.medf), convert to makland.meta read .meta file contents as string and store the string, then parse the string into a rapidjson Document* return false if any of those steps fail.

rapidjson::Document* makVrv::DtMetaFileManager::retrieveFileData ( const std::string &  fileName)

Retrieve the parsed JSON data for the .meta file.

LinkageValueVec makVrv::DtMetaFileManager::makeLinkagesAndFeaturesArray ( rapidjson::Document *  linkagesFeaturesDocument)

Given the parsed data for a file, convert it to an array as [ {node1 name or annotation , JSON data for node2 } ... { node2 nane or annotation, JSON data for node2 }.

bool makVrv::DtMetaFileManager::parseMetaFile ( const std::string &  fileName)
protected

Load .meta file.

Friends And Related Function Documentation

friend class DtMetaFileManagerCreator
friend

This allows the protected constructor to be called by the DtMetaFileManagerCreator.

Member Data Documentation

const char* makVrv::DtMetaFileManager::theTagFeatureName
static

Strings to get the different parts of the meta file Use these instead of hardcoded strings.

const char* makVrv::DtMetaFileManager::theTagFeatureData
static
const char* makVrv::DtMetaFileManager::theTagNodeFeaturesTag
static
const char* makVrv::DtMetaFileManager::theTagTextureFeature
static
const char* makVrv::DtMetaFileManager::theTagComment
static
const char* makVrv::DtMetaFileManager::theTagLinkage
static
const char* makVrv::DtMetaFileManager::theTagLinkageNodeName
static
const char* makVrv::DtMetaFileManager::theTagLinkageAnnotationTag
static
FileDocumentMap makVrv::DtMetaFileManager::myDocumentMap
protected
DtDe& makVrv::DtMetaFileManager::myDe
protected
boost::mutex makVrv::DtMetaFileManager::myMapMutex
protected

The documentation for this class was generated from the following file:

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)