16 #ifndef SURGSIM_MATH_MATHCONVERT_H 17 #define SURGSIM_MATH_MATHCONVERT_H 20 #include <Eigen/Geometry> 22 #include <yaml-cpp/yaml.h> 23 #include <boost/any.hpp> 25 #include "SurgSim/Framework/Macros.h" 26 #include "SurgSim/Math/LinearSparseSolveAndInverse.h" 27 #include "SurgSim/Math/OdeSolver.h" 36 void toBytes(
double d, std::vector<uint8_t>* result);
39 size_t fromBytes(
const std::vector<uint8_t>& bytes,
double* out,
size_t start = 0);
63 SURGSIM_DOUBLE_SPECIALIZATION
64 template <
typename Type,
int Rows,
int Cols,
int MOpt>
65 struct convert<typename
Eigen::Matrix<Type, Rows, Cols, MOpt>>
67 static Node encode(
const typename Eigen::Matrix<Type, Rows, Cols, MOpt>& rhs);
68 static bool decode(
const Node& node,
typename Eigen::Matrix<Type, Rows, Cols, MOpt>& rhs);
72 SURGSIM_DOUBLE_SPECIALIZATION
73 template <
class Type,
int QOpt>
74 struct convert<typename
Eigen::Quaternion<Type, QOpt>>
76 static Node encode(
const typename Eigen::Quaternion<Type, QOpt>& rhs);
77 static bool decode(
const Node& node,
typename Eigen::Quaternion<Type, QOpt>& rhs);
81 SURGSIM_DOUBLE_SPECIALIZATION
82 template <
class Type,
int Dim,
int TMode,
int TOptions>
83 struct convert<typename
Eigen::Transform<Type, Dim, TMode, TOptions>>
85 static Node encode(
const typename Eigen::Transform<Type, Dim, TMode, TOptions>& rhs);
86 static bool decode(
const Node& node,
typename Eigen::Transform<Type, Dim, TMode, TOptions>& rhs);
90 SURGSIM_DOUBLE_SPECIALIZATION
91 template <
typename Type>
92 struct convert<typename
Eigen::AngleAxis<Type>>
94 static Node encode(
const typename Eigen::AngleAxis<Type>& rhs);
95 static bool decode(
const Node& node,
typename Eigen::AngleAxis<Type>& rhs);
99 struct convert<
std::shared_ptr<SurgSim::Math::Shape>>
101 static Node encode(
const std::shared_ptr<SurgSim::Math::Shape>& rhs);
102 static bool decode(
const Node& node, std::shared_ptr<SurgSim::Math::Shape>& rhs);
106 struct convert<
SurgSim::Math::IntegrationScheme>
108 static Node encode(
const SurgSim::Math::IntegrationScheme& rhs);
109 static bool decode(
const Node& node, SurgSim::Math::IntegrationScheme& rhs);
115 static Node encode(
const SurgSim::Math::LinearSolver& rhs);
116 static bool decode(
const Node& node, SurgSim::Math::LinearSolver& rhs);
120 bool tryConvert(
const boost::any& any, YAML::Node* node);
125 static Node encode(
const boost::any rhs);
131 #include "SurgSim/Math/MathConvert-inl.h" 133 #endif // SURGSIM_MATH_MATHCONVERT_H Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Definition: ApplicationData.h:23
Definition: MockObjects.h:47
Eigen::Matrix< double, 3, 1 > Vector3d
A 3D vector of doubles.
Definition: Vector.h:57
Definition: DataStructuresConvert.h:28