spatial-dyn
graphics.h
1 
10 #ifndef SPATIAL_DYN_STRUCTS_GRAPHICS_H_
11 #define SPATIAL_DYN_STRUCTS_GRAPHICS_H_
12 
13 #include <iostream> // std::istream, std::ostream
14 #include <string> // std::string
15 
16 #include "spatial_dyn/eigen/spatial_math.h"
17 
18 namespace spatial_dyn {
19 
20 // TODO: Finish
21 
29 struct Graphics {
31  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
33 
39  struct Geometry {
41  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
43 
47  enum class Type {
48  kUndefined,
49  kBox,
50  kCapsule,
51  kCylinder,
52  kSphere,
53  kMesh
54  };
55 
60 
64  Eigen::Vector3d scale = Eigen::Vector3d::Ones();
65 
69  double radius = 0;
70 
74  double length = 0;
75 
79  std::string mesh;
80  };
81 
82  struct Material {
83  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
84  std::string name;
85  Eigen::Vector4d rgba = Eigen::Vector4d::Ones();
86  std::string texture; // Texture filename
87  };
88 
89  Graphics(const std::string& name = "") : name(name) {}
90 
91  std::string name;
92  Eigen::Isometry3d T_to_parent = Eigen::Isometry3d::Identity();
93  Geometry geometry;
94  Material material;
95 };
96 
103 std::ostream& operator<<(std::ostream& os, const Graphics::Geometry::Type& type);
104 
111 std::istream& operator>>(std::istream& is, Graphics::Geometry::Type& type);
112 
113 } // namespace spatial_dyn
114 
115 #endif // SPATIAL_DYN_STRUCTS_RIGID_BODY_H_
std::ostream & operator<<(std::ostream &os, const ArticulatedBody &ab)
Definition: articulated_body.cc:346
Definition: discrete_dynamics.cc:21
std::istream & operator>>(std::istream &is, Graphics::Geometry::Type &type)
Definition: graphics.cc:41
Definition: graphics.h:39
Type
Definition: graphics.h:47
Type type
Definition: graphics.h:59
Eigen::Vector3d scale
Definition: graphics.h:64
double radius
Definition: graphics.h:69
std::string mesh
Definition: graphics.h:79
double length
Definition: graphics.h:74
Definition: graphics.h:82
Definition: graphics.h:29