Go to the documentation of this file.
43 Eigen::Vector3f
initial = Eigen::Vector3f::Zero();
56 float boxSize = 50.0f;
59 x.box.position(
x.initial).color(
x.color).size(boxSize).enable(
82 float arrowWidth = 10.0f;
117 std::string
const& element =
interaction.element();
119 Eigen::Vector3f translation =
transform.block<3, 1>(0, 3);
122 if (element ==
"BoxX")
126 else if (element ==
"BoxY")
130 else if (element ==
"BoxZ")
146 Eigen::Vector3f spherePosition(
x.initial.x() +
x.translation.x(),
204 float boxSize = 50.0f;
237 float arrowWidth = 10.0f;
273 bool needsLayerUpdate =
false;
276 needsLayerUpdate |=
y.handle(
interaction).needsLayerUpdate;
277 needsLayerUpdate |=
z.handle(
interaction).needsLayerUpdate;
278 if (needsLayerUpdate)
287 ARMARX_INFO <<
"The x slider was transformed: " <<
x.getCurrentPose().col(3).x();
296 Eigen::Vector3f spherePosition(
x.getCurrentPose().col(3).x(),
297 y.getCurrentPose().col(3).y(),
298 z.getCurrentPose().col(3).z());
335 Eigen::Vector3f
position = Eigen::Vector3f::Zero();
344 {
"Delete All",
"Delete All of Type"});
385 Eigen::Vector3f
scale = Eigen::Vector3f::Ones();
392 ARMARX_WARNING <<
"Tried to visualize a spawned object that does not have a source";
452 spawner.
position =
origin + Eigen::Vector3f(750.0f, 500.0f, 0.5f * size);
458 spawner.
position =
origin + Eigen::Vector3f(1250.0f, 500.0f, 0.5f * size);
464 spawner.
position =
origin + Eigen::Vector3f(1000.0f, 750.0f, 0.5f * size);
499 for (
int i = 0; i < (int)
spawners.size(); ++i)
508 if (spawner ==
nullptr)
517 auto newEnd = std::remove_if(
objects.begin(),
522 "Object_" + std::to_string(object.index);
523 return interaction.element() == name;
584 auto newEnd = std::remove_if(
objects.begin(),
587 { return obj.source == spawner; });
662 return "ArVizInteractExample";
688 const bool join =
true;
704 Eigen::Vector3f origin1(-2000.0f, 0.0f, 0.0f);
705 Eigen::Vector3f origin2(0.0f, 0.0f, 0.0f);
706 Eigen::Vector3f origin3(-2000.0f, -2000.0f, 0.0f);
707 Eigen::Vector3f origin4(0.0f, -2000.0f, 0.0f);
711 .
fromTo(origin1, origin1 + 4000.0f * Eigen::Vector3f::UnitX())
713 regions.
add(separatorX);
717 .
fromTo(origin4, origin4 + 4000.0f * Eigen::Vector3f::UnitY())
719 regions.
add(separatorY);
725 SlidersState sliders(origin1 + Eigen::Vector3f(500.0f, 500.0f, 0.0f));
726 SlidersState2 sliders2(origin3 + Eigen::Vector3f(500.0f, 500.0f, 0.0f));
745 while (!
task->isStopped())
775 c.waitForCycleDuration();
static Color black(int a=255)
CommitResult commit(StagedCommit const &commit)
void add(Layer const &layer)
Stage a layer to be committed later via client.apply(*this)
void onConnectComponent() override
Pure virtual hook for the subclass.
@ ContextMenuChosen
A context menu entry was chosen.
Cylinder & radius(float r)
InteractionDescription interaction()
Cylinder & fromTo(Eigen::Vector3f from, Eigen::Vector3f to)
MatrixXX< 4, 4, float > Matrix4f
static Color blue(int b=255, int a=255)
This util class helps with keeping a cycle time during a control cycle.
void visualize(int i, viz::Layer &layer)
Eigen::Matrix4f transform
Cylinder & height(float h)
Self & scaling(AxesFlags const &axes=AXES_XYZ)
void add(ElementT const &element)
A staged commit prepares multiple layers to be committed.
DerivedT & position(float x, float y, float z)
void reset()
Reset all staged layers and interaction requests.
Eigen::Vector3f translation
void Identity(MatrixXX< N, N, T > *a)
ARMARX_DECOUPLED_REGISTER_COMPONENT(JsonStorage)
Provides a ready-to-use ArViz client arviz as member variable.
uint32_t Color
RGBA color.
void onInitComponent() override
Pure virtual hook for the subclass.
@ Select
An element was selected.
InteractionFeedbackRange interactions() const
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
static Color yellow(int y=255, int a=255)
Red + Green.
Self & contextMenu(std::vector< std::string > const &options)
@ Transform
The element was transformed (translated or rotated).
void requestInteraction(Layer const &layer)
Request interaction feedback for a particular layer.
RunningTask< ArVizInteractExample >::pointer_type task
static Color red(int r=255, int a=255)
static Color cyan(int c=255, int a=255)
Green + Blue.
const std::string & to_string(const std::string &s)
SingleSlider(std::string const &name, viz::Color color)
void onDisconnectComponent() override
Hook for subclass.
Baseclass for all ArmarX ManagedIceObjects requiring properties.
auto transform(const Container< InputT, Alloc > &in, OutputT(*func)(InputT const &)) -> Container< OutputT, typename std::allocator_traits< Alloc >::template rebind_alloc< OutputT >>
Convenience function (with less typing) to transform a container of type InputT into the same contain...
An example for how to use ArViz.
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Arrow & fromTo(const Eigen::Vector3f &from, const Eigen::Vector3f &to)
@ Deselect
An element was deselected.
Default component property definition container.
static Color magenta(int m=255, int a=255)
Red + Blue.
DerivedT & pose(Eigen::Matrix4f const &pose)
armarx::viz::Client arviz
DerivedT & scale(Eigen::Vector3f scale)
void visualize(viz::Layer &layer)
Box & size(Eigen::Vector3f const &s)
DerivedT & color(Color color)
static Color orange(int o=255, int a=255)
2 Red + 1 Green
int DecoupledMain(int argc, char *argv[])
int main(int argc, char *argv[])
void onExitComponent() override
Hook for subclass.
std::string getDefaultName() const override
Retrieve default name of component.
static Color green(int g=255, int a=255)
Layer layer(std::string const &name) const
This file is part of ArmarX.
This file offers overloads of toIce() and fromIce() functions for STL container types.
DerivedT & enable(InteractionDescription const &interactionDescription)