Drake
RenderEngineVtk Class Reference

Detailed Description

See documentation of MakeRenderEngineVtk().

#include <drake/geometry/render/render_engine_vtk.h>

Public Member Functions

 RenderEngineVtk (const RenderEngineVtkParams &parameters=RenderEngineVtkParams())
 Constructs the render engine from the given parameters. More...
 
void UpdateViewpoint (const math::RigidTransformd &X_WR) override
 
Does not allow copy, move, or assignment
 RenderEngineVtk (const RenderEngineVtk &)=delete
 
RenderEngineVtkoperator= (const RenderEngineVtk &)=delete
 
 RenderEngineVtk (RenderEngineVtk &&)=delete
 
RenderEngineVtkoperator= (RenderEngineVtk &&)=delete
 
Shape reification
void ImplementGeometry (const Sphere &sphere, void *user_data) override
 
void ImplementGeometry (const Cylinder &cylinder, void *user_data) override
 
void ImplementGeometry (const HalfSpace &half_space, void *user_data) override
 
void ImplementGeometry (const Box &box, void *user_data) override
 
void ImplementGeometry (const Capsule &capsule, void *user_data) override
 
void ImplementGeometry (const Ellipsoid &ellipsoid, void *user_data) override
 
void ImplementGeometry (const Mesh &mesh, void *user_data) override
 
void ImplementGeometry (const Convex &convex, void *user_data) override
 
Access the default properties

Provides access to the default values this instance of the render engine is using.

These values must be set at construction.

const Eigen::Vector4d & default_diffuse () const
 
RenderLabel default_render_label () const
 Reports the render label value this render engine has been configured to use. More...
 
- Public Member Functions inherited from RenderEngine
 RenderEngine (const RenderLabel &default_label=RenderLabel::kUnspecified)
 Constructs a RenderEngine with the given default render label. More...
 
virtual ~RenderEngine ()=default
 
std::unique_ptr< RenderEngineClone () const
 Clones the render engine – making the RenderEngine compatible with copyable_unique_ptr. More...
 
bool RegisterVisual (GeometryId id, const Shape &shape, const PerceptionProperties &properties, const math::RigidTransformd &X_WG, bool needs_updates=true)
 Requests registration of the given shape with this render engine. More...
 
bool RemoveGeometry (GeometryId id)
 Removes the geometry indicated by the given id from the engine. More...
 
bool has_geometry (GeometryId id) const
 Reports true if a geometry with the given id has been registered with this engine. More...
 
template<typename T >
void UpdatePoses (const std::unordered_map< GeometryId, math::RigidTransform< T >> &X_WGs)
 Updates the poses of all geometries marked as "needing update" (see RegisterVisual()). More...
 
RenderLabel default_render_label () const
 Reports the render label value this render engine has been configured to use. More...
 
void RenderColorImage (const ColorRenderCamera &camera, systems::sensors::ImageRgba8U *color_image_out) const
 Renders the registered geometry into the given color (rgb) image based on a fully specified camera. More...
 
void RenderDepthImage (const DepthRenderCamera &camera, systems::sensors::ImageDepth32F *depth_image_out) const
 Renders the registered geometry into the given depth image based on a fully specified camera. More...
 
void RenderLabelImage (const ColorRenderCamera &camera, systems::sensors::ImageLabel16I *label_image_out) const
 Renders the registered geometry into the given label image based on a fully specified camera. More...
 
- Public Member Functions inherited from ShapeReifier
virtual ~ShapeReifier ()=default
 

Protected Member Functions

const std::unordered_map< GeometryId, std::array< vtkSmartPointer< vtkActor >, 3 > > & actors () const
 Returns all actors registered with the engine, keyed by the SceneGraph GeometryId. More...
 
 RenderEngineVtk (const RenderEngineVtk &other)
 Copy constructor for the purpose of cloning. More...
 
- Protected Member Functions inherited from RenderEngine
RenderLabel GetRenderLabelOrThrow (const PerceptionProperties &properties) const
 Extracts the (label, id) RenderLabel property from the given properties and validates it (or the configured default if no such property is defined). More...
 
 RenderEngine (const RenderEngine &)=default
 
RenderEngineoperator= (const RenderEngine &)=default
 
 RenderEngine (RenderEngine &&)=default
 
RenderEngineoperator= (RenderEngine &&)=default
 
- Protected Member Functions inherited from ShapeReifier
 ShapeReifier ()=default
 
virtual void ThrowUnsupportedGeometry (const std::string &shape_name)
 Derived ShapeReifiers can replace the default message for unsupported geometries by overriding this method. More...
 
 ShapeReifier (const ShapeReifier &)=default
 
ShapeReifieroperator= (const ShapeReifier &)=default
 
 ShapeReifier (ShapeReifier &&)=default
 
ShapeReifieroperator= (ShapeReifier &&)=default
 

Additional Inherited Members

- Static Protected Member Functions inherited from RenderEngine
template<typename ImageType >
static void ThrowIfInvalid (const systems::sensors::CameraInfo &intrinsics, const ImageType *image, const char *image_type)
 
static RenderLabel LabelFromColor (const systems::sensors::ColorI &color)
 Transforms the given byte-valued RGB color value into its corresponding RenderLabel. More...
 
static systems::sensors::ColorI GetColorIFromLabel (const RenderLabel &label)
 Transforms this render label into a byte-valued RGB color. More...
 
static systems::sensors::ColorD GetColorDFromLabel (const RenderLabel &label)
 Transforms this render label into a double-valued RGB color. More...
 

Constructor & Destructor Documentation

◆ RenderEngineVtk() [1/4]

RenderEngineVtk ( const RenderEngineVtk )
delete

◆ RenderEngineVtk() [2/4]

◆ RenderEngineVtk() [3/4]

Constructs the render engine from the given parameters.

When one of the optional parameters is omitted, the constructed value will be as documented elsewhere in this class.

◆ RenderEngineVtk() [4/4]

RenderEngineVtk ( const RenderEngineVtk other)
protected

Copy constructor for the purpose of cloning.

Member Function Documentation

◆ actors()

const std::unordered_map<GeometryId, std::array<vtkSmartPointer<vtkActor>, 3> >& actors ( ) const
protected

Returns all actors registered with the engine, keyed by the SceneGraph GeometryId.

Each GeometryId maps to a triple of actors: color, depth, and label.

◆ default_diffuse()

const Eigen::Vector4d& default_diffuse ( ) const

◆ default_render_label()

RenderLabel default_render_label

Reports the render label value this render engine has been configured to use.

◆ ImplementGeometry() [1/8]

void ImplementGeometry ( const Sphere sphere,
void *  user_data 
)
overridevirtual

Reimplemented from ShapeReifier.

◆ ImplementGeometry() [2/8]

void ImplementGeometry ( const Cylinder cylinder,
void *  user_data 
)
overridevirtual

Reimplemented from ShapeReifier.

◆ ImplementGeometry() [3/8]

void ImplementGeometry ( const HalfSpace half_space,
void *  user_data 
)
overridevirtual

Reimplemented from ShapeReifier.

◆ ImplementGeometry() [4/8]

void ImplementGeometry ( const Box box,
void *  user_data 
)
overridevirtual

Reimplemented from ShapeReifier.

◆ ImplementGeometry() [5/8]

void ImplementGeometry ( const Capsule capsule,
void *  user_data 
)
overridevirtual

Reimplemented from ShapeReifier.

◆ ImplementGeometry() [6/8]

void ImplementGeometry ( const Ellipsoid ellipsoid,
void *  user_data 
)
overridevirtual

Reimplemented from ShapeReifier.

◆ ImplementGeometry() [7/8]

void ImplementGeometry ( const Mesh mesh,
void *  user_data 
)
overridevirtual

Reimplemented from ShapeReifier.

◆ ImplementGeometry() [8/8]

void ImplementGeometry ( const Convex convex,
void *  user_data 
)
overridevirtual

Reimplemented from ShapeReifier.

◆ operator=() [1/2]

RenderEngineVtk& operator= ( const RenderEngineVtk )
delete

◆ operator=() [2/2]

RenderEngineVtk& operator= ( RenderEngineVtk &&  )
delete

◆ UpdateViewpoint()

void UpdateViewpoint ( const math::RigidTransformd &  X_WR)
overridevirtual

The documentation for this class was generated from the following file: