Go to the documentation of this file.
47 Eigen::Vector3f
initial = Eigen::Vector3f::Zero();
61 float boxSize = 50.0f;
68 .translation(viz::AXES_X)
69 .hideDuringTransform());
76 .translation(viz::AXES_Y)
77 .hideDuringTransform());
84 .translation(viz::AXES_Z)
85 .hideDuringTransform());
98 float arrowWidth = 10.0f;
130 std::string
const& element =
interaction.element();
132 Eigen::Vector3f translation =
transform.block<3, 1>(0, 3);
135 if (element ==
"BoxX")
139 else if (element ==
"BoxY")
143 else if (element ==
"BoxZ")
159 Eigen::Vector3f spherePosition(
179 << slider->
initial.transpose();
224 float boxSize = 50.0f;
259 float arrowWidth = 10.0f;
292 bool needsLayerUpdate =
false;
295 needsLayerUpdate |=
y.handle(
interaction).needsLayerUpdate;
296 needsLayerUpdate |=
z.handle(
interaction).needsLayerUpdate;
297 if (needsLayerUpdate)
306 ARMARX_INFO <<
"The x slider was transformed: " <<
x.getCurrentPose().col(3).x();
315 Eigen::Vector3f spherePosition(
316 x.getCurrentPose().col(3).x(),
317 y.getCurrentPose().col(3).y(),
318 z.getCurrentPose().col(3).z());
355 Eigen::Vector3f
position = Eigen::Vector3f::Zero();
363 .
contextMenu({
"Delete All",
"Delete All of Type"});
404 Eigen::Vector3f
scale = Eigen::Vector3f::Ones();
410 ARMARX_WARNING <<
"Tried to visualize a spawned object that does not have a source";
469 spawner.
position =
origin + Eigen::Vector3f(750.0f, 500.0f, 0.5f * size);
475 spawner.
position =
origin + Eigen::Vector3f(1250.0f, 500.0f, 0.5f * size);
481 spawner.
position =
origin + Eigen::Vector3f(1000.0f, 750.0f, 0.5f * size);
514 for (
int i = 0; i < (int)
spawners.size(); ++i)
523 if (spawner ==
nullptr)
535 std::string name =
"Object_" + std::to_string(object.index);
536 return interaction.element() == name;
596 return obj.source == spawner;
669 return "ArVizInteractExample";
689 const bool join =
true;
703 Eigen::Vector3f origin1(-2000.0f, 0.0f, 0.0f);
704 Eigen::Vector3f origin2(0.0f, 0.0f, 0.0f);
705 Eigen::Vector3f origin3(-2000.0f, -2000.0f, 0.0f);
706 Eigen::Vector3f origin4(0.0f, -2000.0f, 0.0f);
709 .
fromTo(origin1, origin1 + 4000.0f * Eigen::Vector3f::UnitX())
711 regions.
add(separatorX);
714 .
fromTo(origin4, origin4 + 4000.0f * Eigen::Vector3f::UnitY())
716 regions.
add(separatorY);
722 SlidersState sliders(origin1 + Eigen::Vector3f(500.0f, 500.0f, 0.0f));
723 SlidersState2 sliders2(origin3 + Eigen::Vector3f(500.0f, 500.0f, 0.0f));
742 while (!
task->isStopped())
771 c.waitForCycleDuration();
782 int main(
int argc,
char* argv[])
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)
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.
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)
MatrixXX< 4, 4, float > Matrix4f
@ 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)
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...
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)