Go to the documentation of this file.
6 #include <Eigen/Geometry>
8 #include <SimoxUtility/color/GlasbeyLUT.h>
9 #include <SimoxUtility/math/convert/rpy_to_quat.h>
11 #include <RobotAPI/interface/ArViz/Elements.h>
17 using data::ColoredPoint;
27 static const AxesFlags AXES_X = {
true,
false,
false,
false};
28 static const AxesFlags AXES_Y = {
false,
true,
false,
false};
29 static const AxesFlags AXES_Z = {
false,
false,
true,
false};
30 static const AxesFlags AXES_XY = {
true,
true,
false,
false};
31 static const AxesFlags AXES_YZ = {
false,
true,
true,
false};
32 static const AxesFlags AXES_XZ = {
true,
false,
true,
false};
33 static const AxesFlags AXES_XYZ = {
true,
true,
true,
false};
42 data_.enableFlags = 0;
49 data_.enableFlags |= data::InteractionEnableFlags::SELECT;
56 data_.enableFlags |= data::InteractionEnableFlags::CONTEXT_MENU;
57 data_.contextMenuOptions = options;
65 data_.enableFlags |= (axes.x ? data::InteractionEnableFlags::TRANSLATION_X : 0);
66 data_.enableFlags |= (axes.y ? data::InteractionEnableFlags::TRANSLATION_Y : 0);
67 data_.enableFlags |= (axes.z ? data::InteractionEnableFlags::TRANSLATION_Z : 0);
75 data_.enableFlags |= (axes.x ? data::InteractionEnableFlags::ROTATION_X : 0);
76 data_.enableFlags |= (axes.y ? data::InteractionEnableFlags::ROTATION_Y : 0);
77 data_.enableFlags |= (axes.z ? data::InteractionEnableFlags::ROTATION_Z : 0);
85 data_.enableFlags |= (axes.x ? data::InteractionEnableFlags::SCALING_X : 0);
86 data_.enableFlags |= (axes.y ? data::InteractionEnableFlags::SCALING_Y : 0);
87 data_.enableFlags |= (axes.z ? data::InteractionEnableFlags::SCALING_Z : 0);
101 data_.enableFlags |= data::InteractionEnableFlags::TRANSFORM_HIDE;
115 template <
typename DerivedT,
typename ElementT>
122 data_->scale.e0 = 1.0f;
123 data_->scale.e1 = 1.0f;
124 data_->scale.e2 = 1.0f;
128 id(
const std::string&
id)
132 return *
static_cast<DerivedT*
>(
this);
142 return *
static_cast<DerivedT*
>(
this);
148 return position(pos.x(), pos.y(), pos.z());
160 return *
static_cast<DerivedT*
>(
this);
172 return orientation(simox::math::rpy_to_quat(r, p, y));
178 return position(
pose.block<3, 1>(0, 3)).orientation(
pose.block<3, 3>(0, 0));
196 return this->
position(pose.translation()).orientation(
pose.linear());
202 auto& p =
data_->pose;
207 m.topLeftCorner<3, 3>() =
Eigen::Quaternionf{p.qw, p.qx, p.qy, p.qz}.toRotationMatrix();
222 return *
static_cast<DerivedT*
>(
this);
225 template <
class... Ts>
229 return color({std::forward<Ts>(ts)...});
243 data_->flags |= data::ElementFlags::OVERRIDE_MATERIAL;
247 data_->flags &= ~
data::ElementFlags::OVERRIDE_MATERIAL;
250 return *
static_cast<DerivedT*
>(
this);
260 return *
static_cast<DerivedT*
>(
this);
270 return *
static_cast<DerivedT*
>(
this);
282 data_->flags |= data::ElementFlags::HIDDEN;
284 return *
static_cast<DerivedT*
>(
this);
290 data_->flags &= ~
data::ElementFlags::HIDDEN;
292 return *
static_cast<DerivedT*
>(
this);
311 data_->interaction = interactionDescription.
data_;
312 return *
static_cast<DerivedT*
>(
this);
data::InteractionDescription data_
DerivedT & pose(Eigen::Vector3f const &position, Eigen::Matrix3f const &orientation)
InteractionDescription interaction()
MatrixXX< 4, 4, float > Matrix4f
DerivedT & color(Ts &&... ts)
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)
InteractionDescription Self
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)
DerivedT & pose(Eigen::Matrix4f const &pose)
DerivedT & scale(Eigen::Vector3f scale)
DerivedT & color(Color color)
DerivedT & scale(float x, float y, float z)
MatrixXX< 3, 3, float > Matrix3f
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)