The spica renderer
sceneparser.h
1 #ifdef _MSC_VER
2 #pragma once
3 #endif
4 
5 #ifndef _SPICA_SCENE_PARSER_
6 #define _SPICA_SCENE_PARSER_
7 
8 #include <string>
9 #include <tinyxml2.h>
10 
11 #include "core/cobject.h"
12 #include "core/renderparams.h"
13 #include "core/scene.h"
14 
15 namespace spica {
16 
17 class SceneParser {
18 public:
19  SceneParser();
20  SceneParser(const std::string &file);
21 
22  void parse();
23 
24 private:
25  void parseChildren(const tinyxml2::XMLElement *node);
26  Transform parseTransform(const tinyxml2::XMLElement *node);
27 
28  std::shared_ptr<Primitive> createPrimitive(const std::shared_ptr<Shape> &shape,
29  const Transform &transform,
30  const std::shared_ptr<Material> &material,
31  const std::shared_ptr<Medium> &medium);
32 
33  void storeToParam(const tinyxml2::XMLElement *node);
34 
35  std::string xmlFile_;
36  PluginManager &plugins_;
37  RenderParams &params_;
38 
39  std::shared_ptr<Camera> camera_ = nullptr;
40  std::vector<std::shared_ptr<Primitive>> primitives_;
41  std::vector<std::shared_ptr<Light>> lights_;
42  std::vector<std::shared_ptr<Medium>> mediums_;
43  bool waitAreaLight_ = false;
44 };
45 
46 }
47 
48 #endif // _SPICA_SCENE_PARSER_
The transformation operator class.
Definition: transform.h:17
Definition: renderparams.h:27
Definition: cobject.h:30
Definition: sceneparser.h:17