33#ifndef DART_GUI_OSG_DETAIL_UTILS_IMPL_HPP_
34#define DART_GUI_OSG_DETAIL_UTILS_IMPL_HPP_
44 if constexpr (std::is_same_v<T, float>)
48 else if constexpr (std::is_same_v<T, double>)
59template <
typename Scalar>
61 const Eigen::Transform<Scalar, 3, Eigen::Isometry>& tf)
83template <
typename Derived>
106template <
typename Derived>
109 return ::osg::Vec3f(vec[0], vec[1], vec[2]);
113template <
typename Derived>
116 return ::osg::Vec3d(vec[0], vec[1], vec[2]);
120template <
typename Derived>
121typename std::conditional<
122 std::is_same<typename Derived::Scalar, float>::value,
127 using Vec3 =
typename std::conditional<
128 std::is_same<typename Derived::Scalar, float>::value,
132 return Vec3(vec[0], vec[1], vec[2]);
136template <
typename Derived>
139 return ::osg::Vec4f(vec[0], vec[1], vec[2], vec[3]);
143template <
typename Derived>
146 return ::osg::Vec4d(vec[0], vec[1], vec[2], vec[3]);
150template <
typename Derived>
152 std::is_same<typename Derived::Scalar, float>::value,
157 return std::conditional<
158 std::is_same<typename Derived::Scalar, float>::value,
160 ::osg::Vec4d>(vec[0], vec[1], vec[2], vec[3]);
std::string type
Definition SdfParser.cpp:82
Definition DefaultEventHandler.cpp:49
::osg::Vec3f eigToOsgVec3f(const Eigen::MatrixBase< Derived > &vec)
Converts Eigen::MatrixBase to osg::Vec3f.
Definition Utils-impl.hpp:107
::osg::Vec4f eigToOsgVec4f(const Eigen::MatrixBase< Derived > &vec)
Converts Eigen::MatrixBase to osg::Vec4f.
Definition Utils-impl.hpp:137
constexpr T getAlphaThreshold()
Returns the alpha threshold for demining if the object is a transparent object or not.
Definition Utils-impl.hpp:42
::osg::Matrix eigToOsgMatrix(const Eigen::Transform< Scalar, 3, Eigen::Isometry > &tf)
Converts Eigen::Isometry to osg::Matrix.
Definition Utils-impl.hpp:60
std::conditional< std::is_same< typename Derived::Scalar, float >::value, ::osg::Vec4f, ::osg::Vec4d > eigToOsgVec4(const Eigen::MatrixBase< Derived > &vec)
Converts Eigen::MatrixBase to osg::Vec4f or osg::Vec4d based on the scalar type.
Definition Utils-impl.hpp:155
::osg::Vec3d eigToOsgVec3d(const Eigen::MatrixBase< Derived > &vec)
Converts Eigen::MatrixBase to osg::Vec3d.
Definition Utils-impl.hpp:114
::osg::Vec4d eigToOsgVec4d(const Eigen::MatrixBase< Derived > &vec)
Converts Eigen::MatrixBase to osg::Vec4d.
Definition Utils-impl.hpp:144
std::conditional< std::is_same< typenameDerived::Scalar, float >::value,::osg::Vec3f,::osg::Vec3d >::type eigToOsgVec3(const Eigen::MatrixBase< Derived > &vec)
Converts Eigen::MatrixBase to osg::Vec3f or osg::Vec3d based on the scalar type.
Definition Utils-impl.hpp:125