RobWorkProject  24.12.4-
Public Types | Public Member Functions | List of all members
RenderContacts Class Reference

Render for contacts. More...

#include <RenderContacts.hpp>

Inherits Render.

Public Types

typedef rw::core::Ptr< RenderContactsPtr
 smart pointer type to this class
 
- Public Types inherited from Render
typedef rw::core::Ptr< RenderPtr
 smart pointer type to this class
 
typedef DrawableNode::DrawType DrawType
 when calling render on the draw mode or type can be specified. See DrawableNode::DrawType
 

Public Member Functions

 RenderContacts ()
 Construct render with no initial contacts.
 
 RenderContacts (const std::vector< Contact > &contacts)
 Constructs a render for a list of contacts. More...
 
virtual ~RenderContacts ()
 Destructor.
 
void setContacts (const std::vector< Contact > &contacts)
 Set which contacts to draw. More...
 
std::vector< ContactgetContacts () const
 Get list of contacts that are currently used by the render. More...
 
void draw (const rw::graphics::DrawableNode::RenderInfo &info, rw::graphics::DrawableNode::DrawType type, double alpha) const
 
void setColorPoints (float r, float g, float b)
 Sets color of contact points. More...
 
void setColorNormal (float r, float g, float b)
 Sets color of normal arrows. More...
 
rw::math::Vector3D< float > getColorPoint () const
 Get color of contact points. More...
 
rw::math::Vector3D< float > getColorNormal () const
 Get color of contact points. More...
 
double getSphereRadius () const
 Get the sphere radius. More...
 
double getNormalLength () const
 Get the normal length. More...
 
std::pair< bool, bool > showPoints () const
 Check if contact points are shown. More...
 
std::pair< bool, bool > showNormals () const
 Check if contact normals are shown. More...
 
void setSphereRadius (double radius=0.005)
 Set the sphere radius for the contact points. More...
 
void setNormalLength (double length=0.05)
 Set the normal length for the contact normals. More...
 
void showPoints (bool pointA, bool pointB)
 Set if the contact points should be shown. More...
 
void showNormals (bool normalA, bool normalB)
 Set if the contact normals should be shown. More...
 
- Public Member Functions inherited from Render
virtual ~Render ()
 destructor
 

Additional Inherited Members

- Protected Member Functions inherited from Render
 Render ()
 Only instances of classes inheriting Render is allowed.
 

Detailed Description

Render for contacts.

Constructor & Destructor Documentation

◆ RenderContacts()

RenderContacts ( const std::vector< Contact > &  contacts)

Constructs a render for a list of contacts.

Parameters
contacts[in] the list of contacts to draw.

Member Function Documentation

◆ draw()

void draw ( const rw::graphics::DrawableNode::RenderInfo info,
rw::graphics::DrawableNode::DrawType  type,
double  alpha 
) const
virtual

Parameters
info[in] state and rendering specific info
type[in] the drawtype which is being used
alpha[in] the alpha value to render with

Implements Render.

◆ getColorNormal()

rw::math::Vector3D<float> getColorNormal ( ) const

Get color of contact points.

Returns
color of contact point as 3D vector for r-, g-, and b-components (in [0:1]).

◆ getColorPoint()

rw::math::Vector3D<float> getColorPoint ( ) const

Get color of contact points.

Returns
color of contact point as 3D vector for r-, g-, and b-components (in [0:1]).

◆ getContacts()

std::vector<Contact> getContacts ( ) const

Get list of contacts that are currently used by the render.

Returns
list of contacts.

◆ getNormalLength()

double getNormalLength ( ) const
inline

Get the normal length.

Returns
the normal length (in meters).

◆ getSphereRadius()

double getSphereRadius ( ) const
inline

Get the sphere radius.

Returns
the sphere radius (in meters).

◆ setColorNormal()

void setColorNormal ( float  r,
float  g,
float  b 
)

Sets color of normal arrows.

Parameters
r[in] red color component in [0:1]
g[in] green color component in [0:1]
b[in] blue color component in [0:1]

◆ setColorPoints()

void setColorPoints ( float  r,
float  g,
float  b 
)

Sets color of contact points.

Parameters
r[in] red color component in [0:1]
g[in] green color component in [0:1]
b[in] blue color component in [0:1]

◆ setContacts()

void setContacts ( const std::vector< Contact > &  contacts)

Set which contacts to draw.

Parameters
contacts[in] contacts to draw.

◆ setNormalLength()

void setNormalLength ( double  length = 0.05)
inline

Set the normal length for the contact normals.

Parameters
length[in] the new length (default is 5 cm)

◆ setSphereRadius()

void setSphereRadius ( double  radius = 0.005)
inline

Set the sphere radius for the contact points.

Parameters
radius[in] the new radius (default is 5 mm)

◆ showNormals() [1/2]

std::pair<bool, bool> showNormals ( ) const
inline

Check if contact normals are shown.

Returns
a pair with the status for the first and second contact normal respectively.

◆ showNormals() [2/2]

void showNormals ( bool  normalA,
bool  normalB 
)
inline

Set if the contact normals should be shown.

Parameters
normalA[in] true if first contact normal should be shown.
normalB[in] true if second contact normal should be shown.

◆ showPoints() [1/2]

std::pair<bool, bool> showPoints ( ) const
inline

Check if contact points are shown.

Returns
a pair with the status for the first and second contact point respectively.

◆ showPoints() [2/2]

void showPoints ( bool  pointA,
bool  pointB 
)
inline

Set if the contact points should be shown.

Parameters
pointA[in] true if point on first object should be shown.
pointB[in] true if point on second object should be shown.

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