libalmath  2.5.7.1
 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 <Eigen/Geometry>
10 #include <vector>
11 #include <string>
12 #include <boost/property_tree/ptree_fwd.hpp>
13 
14 namespace AL {
15 
16 class Mesh;
17 
18 // A low-level class for building a COLLADA tree as a
19 // boost::property_tree::ptree
20 //
21 // This class is for internal use, one is expected to use higher-level
22 // ColladaSceneBuilder instead.
23 //
24 // Possible future developments:
25 // * maybe create an object for "id/target/url"
26 // * let addGeometryMesh() support meshes with texture coordinates.
28  public:
30  ptree &addEffectColor(ptree &parent, const std::string &id, float red,
31  float green, float blue, float alpha);
32  ptree &addMaterial(ptree &parent, const std::string &id,
33  const std::string &effect_id);
34  void addMaterialEffectColor(ptree &root, float r, float g, float b, float a,
35  const ::std::string &id);
36  ptree createNode(const std::string &id, const Eigen::Affine3f &tf);
37  ptree &addNode(ptree &parent, const std::string &id,
38  const Eigen::Affine3f &tf);
39  ptree &addVisualScene(ptree &parent, const std::string &id);
40  ptree &addInstanceVisualScene(ptree &parent, const std::string &scene_id);
41  ptree &addSourceXYZ(ptree &parent, const std::vector<float> &data,
42  const std::string &id);
43 
44  ptree &addInput(ptree &parent, const std::string &semantic,
45  const std::string &source_id, int offset);
46  // add a geometry element containing a mesh. The mesh should not contain
47  // texture coordinates.
48  ptree &addGeometryMesh(ptree &parent, const std::string &id,
49  const Mesh &mesh);
50  ptree &addInstanceGeometry(ptree &parent, const std::string &geometry_id,
51  const std::string &material_id);
52 
53  ptree createDoc();
54 };
55 }
56 #endif
boost::property_tree::ptree ptree
ptree & addEffectColor(ptree &parent, const std::string &id, float red, float green, float blue, float alpha)
ptree & addSourceXYZ(ptree &parent, const std::vector< float > &data, const std::string &id)
ptree createNode(const std::string &id, const Eigen::Affine3f &tf)
ptree & addNode(ptree &parent, const std::string &id, const Eigen::Affine3f &tf)
ptree & addInput(ptree &parent, const std::string &semantic, const std::string &source_id, int offset)
void addMaterialEffectColor(ptree &root, float r, float g, float b, float a, const ::std::string &id)
ptree & addInstanceGeometry(ptree &parent, const std::string &geometry_id, const std::string &material_id)
Definition: mesh.h:88
ptree & addMaterial(ptree &parent, const std::string &id, const std::string &effect_id)
boost::property_tree::ptree ptree
Definition: urdf.h:55
ptree & addInstanceVisualScene(ptree &parent, const std::string &scene_id)
ptree & addVisualScene(ptree &parent, const std::string &id)
ptree & addGeometryMesh(ptree &parent, const std::string &id, const Mesh &mesh)