1 #ifndef TYPES_H_INCLUDED
2 #define TYPES_H_INCLUDED
27 #include <boost/weak_ptr.hpp>
28 #include <boost/enable_shared_from_this.hpp>
29 #include <boost/exception/all.hpp>
30 #include <boost/graph/adjacency_list.hpp>
40 #define TO_RAD 3.141592654/180
41 #define TO_DEG 180/3.141592654
42 #define PI 3.141592654
88 struct exception :
virtual public boost::exception,
virtual public std::exception {};
91 typedef boost::error_info<struct tag_exceprion_error,std::string>
exception_error;
105 ONN,ONL,OLN,OLL,NNN,NNL,NLN,NLL,LNN,LNL,LLN,LLL
133 typedef boost::shared_ptr<Visual> Visual_p;
134 typedef boost::shared_ptr<const Visual> Visual_c;
145 typedef boost::shared_ptr<Scenegraph> Scenegraph_p;
146 typedef boost::shared_ptr<const Scenegraph> Scenegraph_c;
149 typedef boost::shared_ptr<Scenenode> Scenenode_p;
150 typedef boost::shared_ptr<const Scenenode> Scenenode_c;
153 typedef boost::shared_ptr<Camera> Camera_p;
154 typedef boost::shared_ptr<const Camera> Camera_c;
157 typedef boost::shared_ptr<Light> Light_p;
158 typedef boost::shared_ptr<const Light> Light_c;
161 typedef boost::shared_ptr<Material> Material_p;
162 typedef boost::shared_ptr<const Material> Material_c;
165 typedef boost::shared_ptr<Mesh> Mesh_p;
166 typedef boost::shared_ptr<const Mesh> Mesh_c;
169 typedef boost::shared_ptr<Pose> Pose_p;
170 typedef boost::shared_ptr<const Pose> Pose_c;
173 typedef boost::shared_ptr<Texture> Texture_p;
174 typedef boost::shared_ptr<const Texture> Texture_c;
226 specular(Eigen::Vector4d(0.0,0.0,0.0,1.0)),
position(Eigen::Vector4d(0.0,0.0,0.0,1.0)),
229 inline light_attribs_t(
const Eigen::Vector4d &_ambient,
const Eigen::Vector4d &_diffuse,
const Eigen::Vector4d _specular,
230 const Eigen::Vector4d &_position,
const Eigen::Vector4d &_direction,
float64 _exponent,
float64 _cutoff,
252 inline material_attribs_t(
const Eigen::Vector4d &_ambient,
const Eigen::Vector4d &_diffuse,
const Eigen::Vector4d _specular,
253 const Eigen::Vector4d &_emission,
float64 _shininess) :
261 std::vector<Eigen::Vector4d>
v;
263 std::vector<Eigen::Vector3d>
vn;
265 std::vector<Eigen::Vector4d>
vt;
267 std::vector<Eigen::Vector4d>
vc;
269 inline mesh_attribs_t(
const std::vector<Eigen::Vector4d> &_v,
const std::vector<Eigen::Vector3d> &_vn,
270 const std::vector<Eigen::Vector4d> &_vt,
const std::vector<Eigen::Vector4d> &_vc) :
271 v(_v),
vn(_vn),
vt(_vt),
vc(_vc) {
return; };
296 uint8 _anisotropic_filter,
uint8 _unit,
const std::vector<uint8> &_data) :
305 std::vector<scene::Scenenode_c>
nodes;
309 inline scenegraph_attribs_t(
const std::vector<scene::Scenenode_c> &_nodes,
const boost::adjacency_list<> &_edges) :
341 typedef boost::shared_ptr<Beziercurve> Beziercurve_p;
342 typedef boost::shared_ptr<const Beziercurve> Beziercurve_c;
345 typedef boost::shared_ptr<Bezierpatch> Bezierpatch_p;
346 typedef boost::shared_ptr<const Bezierpatch> Bezierpatch_c;
349 typedef boost::shared_ptr<NURBScurve> NURBScurve_p;
350 typedef boost::shared_ptr<const NURBScurve> NURBScurve_c;
353 typedef boost::shared_ptr<NURBSpatch> NURBSpatch_p;
354 typedef boost::shared_ptr<const NURBSpatch> NURBSpatch_c;
357 typedef boost::shared_ptr<Normal_Grid> Normal_Grid_p;
358 typedef boost::shared_ptr<const Normal_Grid> Normal_Grid_c;
361 typedef boost::shared_ptr<Pol_Int> Pol_Int_p;
362 typedef boost::shared_ptr<const Pol_Int> Pol_Int_c;
364 class Aitken_Neville;
365 typedef boost::shared_ptr<Aitken_Neville> Aitken_Neville_p;
366 typedef boost::shared_ptr<const Aitken_Neville> Aitken_Neville_c;
380 std::map<std::string,scene::Scenenode_p>
nodes;
393 inline io_objects_t(
const std::map<std::string,scene::Scenenode_p> &_nodes,
394 const std::map<std::string,scene::Scenegraph_p> &_scenegraphs,
395 const std::map<std::string,math::Beziercurve_p> &_beziercurves,
396 const std::map<std::string,math::Bezierpatch_p> &_bezierpatches,
397 const std::map<std::string,math::NURBScurve_p> &_nurbscurves,
398 const std::map<std::string,math::NURBSpatch_p> &_nurbspatches) :
404 typedef boost::shared_ptr<Buffer> Buffer_p;
405 typedef boost::shared_ptr<const Buffer> Buffer_c;
417 typedef boost::shared_ptr<Renderer> Renderer_p;
418 typedef boost::shared_ptr<const Renderer> Renderer_c;
421 typedef boost::shared_ptr<Context> Context_p;
422 typedef boost::shared_ptr<const Context> Context_c;
425 typedef boost::shared_ptr<Renderable> Renderable_p;
426 typedef boost::shared_ptr<const Renderable> Renderable_c;
443 inline context_attribs_t(
const Eigen::Vector4i &_color_depth,
const Eigen::Vector4i &_accum_depth,
444 int32 _depth_buffer_size,
int32 _stencil_buffer_size,
bool _doublebuffer) :
546 static scene::Light_p
create_light(
const std::string &_id,
const Eigen::Vector4d &_a,
const Eigen::Vector4d &_d,
547 const Eigen::Vector4d &_s,
const Eigen::Vector4d &_p,
const Eigen::Vector4d &_sd,
585 static scene::Material_p
create_material(
const std::string &_id,
const Eigen::Vector4d &_a,
const Eigen::Vector4d &_d,
586 const Eigen::Vector4d &_s,
const Eigen::Vector4d &_e,
float64 _sh);
621 static scene::Mesh_p
create_mesh(
const std::string &_id,
const std::vector<Eigen::Vector4d> &_v,
622 const std::vector<Eigen::Vector3d> &_vn,
const std::vector<Eigen::Vector4d> &_vt,
623 const std::vector<Eigen::Vector4d> &_vc);
633 static scene::Mesh_p
create_mesh(scene::Mesh_c _m);
652 static scene::Pose_p
create_pose(
const std::string &_id,
const Eigen::Matrix4d &_m);
662 static scene::Pose_p
create_pose(scene::Pose_c _p);
727 static scene::Scenegraph_p
create_scenegraph(
const std::vector<scene::Scenenode_c> &_n,
const boost::adjacency_list<> &_e);
756 static math::Beziercurve_p
create_beziercurve(
const std::vector<Eigen::Vector4d> &_p);
785 static math::Bezierpatch_p
create_bezierpatch(
const std::vector<math::Beziercurve_p> &_c);
877 static boost::weak_ptr<display::Visual> current_visual;
878 static boost::weak_ptr<renderer::Context> current_context;
892 static void init(display::Visual_p _v);
901 static void init(renderer::Context_p _c);
911 static void make_current(display::Visual_p _v,renderer::Context_p _c);
935 static bool is_current(renderer::Context_p _c);
939 #endif // TYPES_H_INCLUDED