libalmath  2.8.7.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
colladabuilder.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Aldebaran. All rights reserved.
3  *
4  */
5 
6 #ifndef LIB_ALMATH_SCENEGRAPH_COLLADABUILDER_H
7 #define LIB_ALMATH_SCENEGRAPH_COLLADABUILDER_H
8 
9 #include <almath/api.h>
10 #include <Eigen/Geometry>
11 #include <vector>
12 #include <string>
13 #include <boost/property_tree/ptree_fwd.hpp>
14 
15 namespace AL {
16 
17 class Mesh;
18 
19 // A low-level class for building a COLLADA tree as a
20 // boost::property_tree::ptree
21 //
22 // This class is for internal use, one is expected to use higher-level
23 // ColladaSceneBuilder instead.
24 //
25 // Possible future developments:
26 // * maybe create an object for "id/target/url"
27 // * let addGeometryMesh() support meshes with texture coordinates.
28 class ALMATH_API ColladaBuilder {
29  public:
31  ptree &addEffectColor(ptree &parent, const std::string &id, float red,
32  float green, float blue, float alpha);
33  ptree &addMaterial(ptree &parent, const std::string &id,
34  const std::string &effect_id);
35  void addMaterialEffectColor(ptree &root, float r, float g, float b, float a,
36  const ::std::string &id);
37  ptree createNode(const std::string &id, const Eigen::Affine3f &tf);
38  ptree &addNode(ptree &parent, const std::string &id,
39  const Eigen::Affine3f &tf);
40  ptree &addVisualScene(ptree &parent, const std::string &id);
41  ptree &addInstanceVisualScene(ptree &parent, const std::string &scene_id);
42  ptree &addSourceXYZ(ptree &parent, const std::vector<float> &data,
43  const std::string &id);
44 
45  ptree &addInput(ptree &parent, const std::string &semantic,
46  const std::string &source_id, int offset);
47  // add a geometry element containing a mesh. The mesh should not contain
48  // texture coordinates.
49  ptree &addGeometryMesh(ptree &parent, const std::string &id,
50  const Mesh &mesh);
51  ptree &addInstanceGeometry(ptree &parent, const std::string &geometry_id,
52  const std::string &material_id);
53 
54  ptree createDoc();
55 };
56 }
57 #endif
boost::property_tree::ptree ptree
boost::property_tree::ptree ptree
Definition: qianim.h:22
Definition: mesh.h:89