Go to the documentation of this file.
5 #include <RobotAPI/interface/ArViz/Elements.h>
7 #include <SimoxUtility/color/GlasbeyLUT.h>
8 #include <SimoxUtility/math/convert/rpy_to_quat.h>
11 #include <Eigen/Geometry>
18 using data::ColoredPoint;
28 static const AxesFlags AXES_X = {
true,
false,
false,
false};
29 static const AxesFlags AXES_Y = {
false,
true,
false,
false};
30 static const AxesFlags AXES_Z = {
false,
false,
true,
false};
31 static const AxesFlags AXES_XY = {
true,
true,
false,
false};
32 static const AxesFlags AXES_YZ = {
false,
true,
true,
false};
33 static const AxesFlags AXES_XZ = {
true,
false,
true,
false};
34 static const AxesFlags AXES_XYZ = {
true,
true,
true,
false};
42 data_.enableFlags = 0;
48 data_.enableFlags |= data::InteractionEnableFlags::SELECT;
54 data_.enableFlags |= data::InteractionEnableFlags::CONTEXT_MENU;
55 data_.contextMenuOptions = options;
62 data_.enableFlags |= (axes.x ? data::InteractionEnableFlags::TRANSLATION_X : 0);
63 data_.enableFlags |= (axes.y ? data::InteractionEnableFlags::TRANSLATION_Y : 0);
64 data_.enableFlags |= (axes.z ? data::InteractionEnableFlags::TRANSLATION_Z : 0);
71 data_.enableFlags |= (axes.x ? data::InteractionEnableFlags::ROTATION_X : 0);
72 data_.enableFlags |= (axes.y ? data::InteractionEnableFlags::ROTATION_Y : 0);
73 data_.enableFlags |= (axes.z ? data::InteractionEnableFlags::ROTATION_Z : 0);
80 data_.enableFlags |= (axes.x ? data::InteractionEnableFlags::SCALING_X : 0);
81 data_.enableFlags |= (axes.y ? data::InteractionEnableFlags::SCALING_Y : 0);
82 data_.enableFlags |= (axes.z ? data::InteractionEnableFlags::SCALING_Z : 0);
94 data_.enableFlags |= data::InteractionEnableFlags::TRANSFORM_HIDE;
98 data::InteractionDescription
data_;
107 template <
typename DerivedT,
typename ElementT>
112 :
data_(new ElementT)
115 data_->scale.e0 = 1.0f;
116 data_->scale.e1 = 1.0f;
117 data_->scale.e2 = 1.0f;
120 DerivedT&
id(
const std::string&
id)
124 return *
static_cast<DerivedT*
>(
this);
133 return *
static_cast<DerivedT*
>(
this);
137 return position(pos.x(), pos.y(), pos.z());
148 return *
static_cast<DerivedT*
>(
this);
156 return orientation(simox::math::rpy_to_quat(r, p, y));
161 return position(
pose.block<3, 1>(0, 3)).orientation(
pose.block<3, 3>(0, 0));
176 return this->
position(pose.translation()).orientation(
pose.linear());
181 auto& p =
data_->pose;
186 m.topLeftCorner<3, 3>() =
Eigen::Quaternionf{p.qw, p.qx, p.qy, p.qz}.toRotationMatrix();
199 return *
static_cast<DerivedT*
>(
this);
205 return color({std::forward<Ts>(ts)...});
217 data_->flags |= data::ElementFlags::OVERRIDE_MATERIAL;
221 data_->flags &= ~
data::ElementFlags::OVERRIDE_MATERIAL;
224 return *
static_cast<DerivedT*
>(
this);
233 return *
static_cast<DerivedT*
>(
this);
235 DerivedT&
scale(
float x,
float y,
float z)
241 return *
static_cast<DerivedT*
>(
this);
250 data_->flags |= data::ElementFlags::HIDDEN;
252 return *
static_cast<DerivedT*
>(
this);
257 data_->flags &= ~
data::ElementFlags::HIDDEN;
259 return *
static_cast<DerivedT*
>(
this);
276 data_->interaction = interactionDescription.
data_;
277 return *
static_cast<DerivedT*
>(
this);
data::InteractionDescription data_
DerivedT & pose(Eigen::Vector3f const &position, Eigen::Matrix3f const &orientation)
InteractionDescription interaction()
DerivedT & id(const std::string &id)
Self & translation(AxesFlags const &axes=AXES_XYZ)
DerivedT & pose(Eigen::Vector3f const &position, Eigen::Quaternionf const &orientation)
static Color fromRGBA(int r, int g, int b, int a=255)
Construct a byte color from R, G, B and optional alpha.
Self & rotation(AxesFlags const &axes=AXES_XYZ)
DerivedT & orientation(Eigen::Matrix3f const &ori)
DerivedT & position(Eigen::Vector3f const &pos)
Self & scaling(AxesFlags const &axes=AXES_XYZ)
IceInternal::Handle< ElementT > data_
DerivedT & colorGlasbeyLUT(std::size_t id, int alpha=255)
ElementOps(std::string const &id)
DerivedT & position(float x, float y, float z)
DerivedT & orientation(float r, float p, float y)
void Identity(MatrixXX< N, N, T > *a)
std::shared_ptr< Value > value()
Eigen::Matrix4f pose() const
Self & contextMenu(std::vector< std::string > const &options)
DerivedT & orientation(Eigen::Quaternionf const &ori)
Self & hideDuringTransform()
DerivedT & overrideMaterial(bool value)
DerivedT & transformPose(Eigen::Matrix4f const &p)
DerivedT & scale(float s)
DerivedT & pose(const Eigen::Affine3f &pose)
MatrixXX< 3, 3, float > Matrix3f
MatrixXX< 4, 4, float > Matrix4f
DerivedT & pose(Eigen::Matrix4f const &pose)
DerivedT & scale(Eigen::Vector3f scale)
DerivedT & color(Color color)
DerivedT & scale(float x, float y, float z)
DerivedT & color(Ts &&...ts)
double s(double t, double s0, double v0, double a0, double j)
This file is part of ArmarX.
DerivedT & enable(InteractionDescription const &interactionDescription)
DerivedT & visible(bool visible)