VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtMetaFileManager.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 <vector>
13 #include <string>
14 #include <map>
15 
16 #include <boost/thread/mutex.hpp>
17 
18 #include <vrvCore/vrvCore.h>
20 
21 
22 #include <rapidjson/document.h> // rapidjson's DOM-style API
23 
24 namespace makVrv
25 {
26  class DtDe;
27  class DtModelDefinition;
28 
37  {
38  public:
40  struct NodeLinkage
41  {
42  std::string myNodeName;
43  std::string myAnnotation;
44  };
45 
47  typedef std::map<std::string, rapidjson::Document*> FileDocumentMap;
49  typedef std::pair<NodeLinkage, std::vector<const rapidjson::Value*> > LinkageValuePair;
52  typedef std::vector<LinkageValuePair> LinkageValueVec;
53 
57 
59  virtual ~DtMetaFileManager();
60 
62  std::string convertPathToMeta(const std::string& inPath);
63 
67  std::string convertModelDefToMeta(const DtModelDefinition* modelDef);
68 
70  bool pathHasMeta(const std::string& inPath);
71 
76  bool convertLoadAndParse(const DtModelDefinition* modelDef);
77 
82  bool convertLoadAndParse(const std::string& fileName);
83 
85  rapidjson::Document* retrieveFileData(const std::string& fileName);
86 
90  LinkageValueVec makeLinkagesAndFeaturesArray(
91  rapidjson::Document* linkagesFeaturesDocument);
92 
93  public:
94  //{@
97  static const char* theTagFeatureName;
98  static const char* theTagFeatureData;
99  static const char* theTagNodeFeaturesTag;
100  static const char* theTagTextureFeature;
101  static const char* theTagComment;
102  static const char* theTagLinkage;
103  static const char* theTagLinkageNodeName;
104  static const char* theTagLinkageAnnotationTag;
106 
107  protected:
108 
110  bool parseMetaFile(const std::string& fileName);
111 
113  DtMetaFileManager(DtDe& de);
114 
115  protected:
117 
119  boost::mutex myMapMutex;
120  };
121 
125  {
126 
127  public:
128 
131  static DtMetaFileManagerCreator& instance(DtDe& de);
132 
134  static void registerInstance(DtDe& de, DtMetaFileManagerCreator* instance);
135 
137  virtual DtMetaFileManager* create(DtDe& de);
138 
139  };
140 
141 }
The abstract creator for the abstract DtMetaFileManager class.
Definition: DtMetaFileManager.h:124
Virtual base class. Allows for RTTI and proper virtual destruction. Used by Creators, Factories, Providers, Assemblers and User Interfaces.
Definition: DtVirtualBaseClass.h:19
std::pair< NodeLinkage, std::vector< const rapidjson::Value * > > LinkageValuePair
ex. (node name/annotation, node JSON data*)
Definition: DtMetaFileManager.h:49
std::string myAnnotation
Definition: DtMetaFileManager.h:43
std::map< std::string, rapidjson::Document * > FileDocumentMap
ex. FileDocumentMap[&quot;Makland.meta&quot;] = &lt;parsed json=&quot;&quot; data&gt;=&quot;&quot;&gt;
Definition: DtMetaFileManager.h:47
NodeLinkage structure contains the name and annotation strings for a node.
Definition: DtMetaFileManager.h:40
A model definition Interaction any number of named parameters, and also can be used to store cached d...
Definition: DtModelDefinition.h:42
static const char * theTagLinkage
Definition: DtMetaFileManager.h:102
Handles the set up and processing of .meta files. Meta files contain extra information about nodes in...
Definition: DtMetaFileManager.h:36
Contains makVrv::DtVirtualBaseClass class.
std::vector< LinkageValuePair > LinkageValueVec
ex. vector of node names/annotations and JSON data for those node names/annotations ...
Definition: DtMetaFileManager.h:52
static const char * theTagLinkageNodeName
Definition: DtMetaFileManager.h:103
#define DT_DLL_VRVCORE
Definition: vrvCore.h:20
FileDocumentMap myDocumentMap
Definition: DtMetaFileManager.h:116
static const char * theTagLinkageAnnotationTag
Definition: DtMetaFileManager.h:104
static const char * theTagComment
Definition: DtMetaFileManager.h:101
std::string myNodeName
Definition: DtMetaFileManager.h:42
DtDe & myDe
Definition: DtMetaFileManager.h:118
static const char * theTagTextureFeature
Definition: DtMetaFileManager.h:100
static const char * theTagFeatureData
Definition: DtMetaFileManager.h:98
boost::mutex myMapMutex
Definition: DtMetaFileManager.h:119
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
static const char * theTagNodeFeaturesTag
Definition: DtMetaFileManager.h:99
static const char * theTagFeatureName
Strings to get the different parts of the meta file Use these instead of hardcoded strings...
Definition: DtMetaFileManager.h:97
Contains DLL export macros.

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)