iDynTree::IShapeVisualization class

Interface to the visualization of generic solid shapes.

Constructors, destructors, conversion operators

~IShapeVisualization() pure virtual
Destructor.

Public functions

auto addShape(const iDynTree::SolidShape& shape, const std::string& modelName = "", const std::string& frameName = "") -> size_t pure virtual
Add a shape in the visualization.
auto setVisible(size_t shapeIndex, bool isVisible) -> bool pure virtual
Set the specified shape visible or not.
auto getNrOfShapes() const -> size_t pure virtual
Get the number of visualized shapes.
auto getShapeTransform(size_t shapeIndex, Transform& currentTransform) const -> bool pure virtual
Get shape transform with respect the parent frame (world if the shape is attached to the world).
auto setShapeTransform(size_t shapeIndex, const Transform& transformation) -> bool pure virtual
Set the shape transform with respect the parent frame (world if the shape is attached to the world).
auto setShapeColor(size_t shapeIndex, const ColorViz& shapeColor) -> bool pure virtual
Set the color of the shape.
auto changeShape(size_t shapeIndex, const iDynTree::SolidShape& newShape) -> bool pure virtual
Change the shape.
auto getShapeParent(size_t shapeIndex) const -> std::pair<std::string, std::string> pure virtual
Get the parent of a shape.
auto setShapeParent(size_t shapeIndex, const std::string& modelName, const std::string& frameName) -> bool pure virtual
Set the parent of a shape.
auto getShapeLabel(size_t shapeIndex) -> ILabel* pure virtual
Get the label of a shape.

Function documentation

size_t iDynTree::IShapeVisualization::addShape(const iDynTree::SolidShape& shape, const std::string& modelName = "", const std::string& frameName = "") pure virtual

Add a shape in the visualization.

If the modelName and linkName are specified, the shape is attached to the specific frame. If they are not specified, or cannot be found, the shape is attached to the world. If the model name is specified, but not the frame name, it is attached to the root link of the model. The initial transform is specified by the shape itself (Link_H_geometry). Returns the shape index.

bool iDynTree::IShapeVisualization::setVisible(size_t shapeIndex, bool isVisible) pure virtual

Set the specified shape visible or not.

Returns true in case of success, false otherwise (for example if the shape does not exists).

bool iDynTree::IShapeVisualization::setShapeColor(size_t shapeIndex, const ColorViz& shapeColor) pure virtual

Set the color of the shape.

Returns true in case of success, false otherwise (for example if the shape does not exists).

bool iDynTree::IShapeVisualization::changeShape(size_t shapeIndex, const iDynTree::SolidShape& newShape) pure virtual

Change the shape.

The previous shape is removed. Returns true in case of success, false otherwise (for example if the shape index is out of bounds).

std::pair<std::string, std::string> iDynTree::IShapeVisualization::getShapeParent(size_t shapeIndex) const pure virtual

Get the parent of a shape.

Returns a pair with the first element being the model name, and the second the frame name. If the shape is attached to the world, both elements are empty strings.

bool iDynTree::IShapeVisualization::setShapeParent(size_t shapeIndex, const std::string& modelName, const std::string& frameName) pure virtual

Set the parent of a shape.

Returns true in case of success, false otherwise (for example if the shape index is out of bounds). If the modelName and frameName are empty strings, the shape is attached to the world. If the model name is specified, but not the frame name, it is attached to the root link of the model.

ILabel* iDynTree::IShapeVisualization::getShapeLabel(size_t shapeIndex) pure virtual

Get the label of a shape.

Returns nullptr of the shape index is out of bounds.