TDME2  1.9.200
SceneReader.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
6 #include <tdme/tdme.h>
11 #include <tdme/engine/model/Node.h>
14 #include <tdme/math/Matrix4x4.h>
16 
17 #include <ext/rapidjson/document.h>
18 
19 using std::string;
20 using std::vector;
21 
29 
30 using rapidjson::Value;
31 
32 /**
33  * Scene reader
34  * @author Andreas Drewke
35  */
37 {
38 
39 public:
40  /**
41  * Reads a scene
42  * @param pathName path name
43  * @param fileName file name
44  * @param progressCallback progress callback
45  * @param prototypeTransformFilter prototype transform filter
46  * @throws tdme::os::filesystem::FileSystemException
47  * @throws tdme::engine::fileio::models::ModelFileIOException
48  * @return scene
49  */
50  static Scene* read(const string& pathName, const string& fileName, ProgressCallback* progressCallback = nullptr, PrototypeTransformFilter* prototypeTransformFilter = nullptr);
51 
52  /**
53  * Reads a scene
54  * @param pathName path name
55  * @param fileName file name
56  * @param objectIdPrefix object id prefix
57  * @param progressCallback progress callback
58  * @param prototypeTransformFilter prototype transform filter
59  * @throws tdme::os::filesystem::FileSystemException
60  * @throws tdme::engine::fileio::models::ModelFileIOException
61  * @return scene
62  */
63  static Scene* read(const string& pathName, const string& fileName, const string& objectIdPrefix, ProgressCallback* progressCallback = nullptr, PrototypeTransformFilter* prototypeTransformFilter = nullptr);
64 
65  /**
66  * Reads a scene
67  * @param pathName path name
68  * @param fileName file name
69  * @param progressCallback progress callback
70  * @throws tdme::os::filesystem::FileSystemException
71  * @throws tdme::engine::fileio::models::ModelFileIOException
72  * @return scene
73  */
74  static Scene* readFromModel(const string& pathName, const string& fileName, ProgressCallback* progressCallback = nullptr);
75 
76 private:
78  string id;
79  string name;
82  };
83 
84  /**
85  * Determine mesh nodes in node hierarchy
86  * @param scene scene
87  * @param node node
88  * @param parentName parent node
89  * @param parentTransformMatrix parent transform matrix
90  * @param meshNodes mesh nodes
91  */
92  static void determineMeshNodes(Scene* scene, Node* node, const string& parentName, const Matrix4x4& parentTransformMatrix, vector<PrototypeMeshNode>& meshNodes);
93 };
static Scene * read(const string &pathName, const string &fileName, ProgressCallback *progressCallback=nullptr, PrototypeTransformFilter *prototypeTransformFilter=nullptr)
Reads a scene.
Definition: SceneReader.cpp:90
static Scene * readFromModel(const string &pathName, const string &fileName, ProgressCallback *progressCallback=nullptr)
Reads a scene.
static void determineMeshNodes(Scene *scene, Node *node, const string &parentName, const Matrix4x4 &parentTransformMatrix, vector< PrototypeMeshNode > &meshNodes)
Determine mesh nodes in node hierarchy.
Model node.
Definition: Node.h:32
Scene definition.
Definition: Scene.h:50
Matrix4x4 class representing matrix4x4 mathematical structure and operations for 3d space.
Definition: Matrix4x4.h:23