VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtMetaFileManager.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2014 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtMetaFileManager.h,v $ $Revision: 1.0 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #pragma once
14 
15 #include <vrvCore/vrvCore.h>
17 #include <vector>
18 #include <string>
19 #include <map>
20 #include <rapidjson/document.h> // rapidjson's DOM-style API
21 
22 namespace makVrv
23 {
24  class DtDe;
25  class DtModelDefinition;
26 
35  {
36  public:
38  struct NodeLinkage
39  {
40  std::string myNodeName;
41  std::string myAnnotation;
42  };
43 
45  typedef std::map<std::string, rapidjson::Document*> FileDocumentMap;
47  typedef std::pair<NodeLinkage, std::vector<const rapidjson::Value*> > LinkageValuePair;
50  typedef std::vector<LinkageValuePair> LinkageValueVec;
51 
55 
57  virtual ~DtMetaFileManager();
58 
60  std::string convertPathToMeta(const std::string& inPath);
61 
65  std::string convertModelDefToMeta(const DtModelDefinition* modelDef);
66 
68  bool pathHasMeta(const std::string& inPath);
69 
74  bool convertLoadAndParse(const DtModelDefinition* modelDef);
75 
80  bool convertLoadAndParse(const std::string& fileName);
81 
83  rapidjson::Document* retrieveFileData(const std::string& fileName);
84 
88  LinkageValueVec makeLinkagesAndFeaturesArray(
89  rapidjson::Document* linkagesFeaturesDocument);
90 
91  public:
92  //{@
95  static const char* theTagFeatureName;
96  static const char* theTagFeatureData;
97  static const char* theTagNodeFeaturesTag;
98  static const char* theTagTextureFeature;
99  static const char* theTagComment;
100  static const char* theTagLinkage;
101  static const char* theTagLinkageNodeName;
102  static const char* theTagLinkageAnnotationTag;
104 
105  protected:
106 
108  bool parseMetaFile(const std::string& fileName);
109 
111  DtMetaFileManager(DtDe& de);
112 
113  protected:
115 
117  };
118 
122  {
123 
124  public:
125 
128  static DtMetaFileManagerCreator& instance(DtDe& de);
129 
131  static void registerInstance(DtDe& de, DtMetaFileManagerCreator* instance);
132 
134  virtual DtMetaFileManager* create(DtDe& de);
135 
136  };
137 
138 }

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)