Drake
InternalGeometry Class Reference

The internal representation of the fixed portion of the scene graph geometry. More...

#include <drake/geometry/internal_geometry.h>

Public Member Functions

 InternalGeometry ()
 Default constructor. More...
 
 InternalGeometry (SourceId source_id, std::unique_ptr< Shape > shape, FrameId frame_id, GeometryId geometry_id, std::string name, const Isometry3< double > &X_FG, GeometryIndex index, const VisualMaterial &material)
 Constructs the internal geometry as an immediate child of the frame. More...
 
bool operator== (const InternalGeometry &other) const
 Compares two InternalGeometry instances for "equality". More...
 
bool operator!= (const InternalGeometry &other) const
 Compares two InternalGeometry instances for inequality. More...
 
ProximityIndex proximity_index () const
 Returns this geometry's valid index in the proximity engine iff this geometry has a proximity role. More...
 
void set_proximity_index (ProximityIndex index)
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 InternalGeometry (const InternalGeometry &)=default
 
InternalGeometryoperator= (const InternalGeometry &)=default
 
 InternalGeometry (InternalGeometry &&)=default
 
InternalGeometryoperator= (InternalGeometry &&)=default
 
Geometry properties
const Shapeshape () const
 Returns the shape specification for this geometry. More...
 
GeometryId id () const
 Returns the globally unique identifier for this geometry. More...
 
const std::string & name () const
 Returns the name of this geometry. More...
 
GeometryIndex index () const
 Returns the index of this geometry in the full scene graph. More...
 
SourceId source_id () const
 Returns the source id that registered the geometry. More...
 
bool belongs_to_source (SourceId id) const
 Returns true if this geometry belongs to the source with the given id. More...
 
const VisualMaterialvisual_material () const
 Returns the geometry visual material. More...
 
Scene Graph topology
FrameId frame_id () const
 Reports the frame this internal geometry is rigidly attached to. More...
 
bool is_child_of_frame (FrameId frame_id) const
 Returns true if the geometry is affixed to the frame with the given frame_id. More...
 
const Isometry3< double > & X_PG () const
 Returns the pose of this geometry in the declared parent frame – note if this geometry was registered as a child of another geometry it will not be the same as X_FG(). More...
 
const Isometry3< double > & X_FG () const
 Returns the pose of this geometry in the frame to which it is ultimately rigidly attached. More...
 
optional< GeometryIdparent_id () const
 Returns the declared parent geometry (if one exists). More...
 
void set_geometry_parent (GeometryId id, const Isometry3< double > &X_FG)
 Sets this geometry to have another geometry as parent. More...
 
bool is_child_of_geometry (GeometryId geometry_id) const
 Returns true if this geometry has a geometry parent and the parent has the given geometry_id. More...
 
const std::unordered_set< GeometryId > & child_geometry_ids () const
 Returns a list of identifiers of geometries that have this geometry as a parent. More...
 
bool has_child (GeometryId geometry_id) const
 Returns true if this geometry has a child geometry with the given geometry_id. More...
 
void add_child (GeometryId geometry_id)
 Adds a geometry with the given geometry_id to this geometry's set of children. More...
 
bool is_dynamic () const
 Returns true if the geometry is not attached to the world frame – or, in other words, it is attached to a movable frame. More...
 

Detailed Description

The internal representation of the fixed portion of the scene graph geometry.

This includes those aspects that do not depend on computed values. It includes things like the topology (which frame is a geometry attached to), internal bookkeeping (how do we identify a proximity-engine representation of the registered geometry), its name, and its declared geometry.

Constructor & Destructor Documentation

◆ InternalGeometry() [1/4]

InternalGeometry ( const InternalGeometry )
default

◆ InternalGeometry() [2/4]

◆ InternalGeometry() [3/4]

InternalGeometry ( )
inline

Default constructor.

The geometry id will be invalid, the shape will be nullptr, and the pose will be uninitialized.

◆ InternalGeometry() [4/4]

InternalGeometry ( SourceId  source_id,
std::unique_ptr< Shape shape,
FrameId  frame_id,
GeometryId  geometry_id,
std::string  name,
const Isometry3< double > &  X_FG,
GeometryIndex  index,
const VisualMaterial material 
)

Constructs the internal geometry as an immediate child of the frame.

Therefore, it is assumed that X_FG = X_PG.

Parameters
source_idThe id for the source that registered this geometry.
shapeThe shape specification for this instance.
frame_idThe id of the frame this belongs to.
geometry_idThe identifier for this geometry.
nameThe name of the geometry.
X_FGThe pose of the geometry G in the parent frame F.
indexThe index of this geometry in the SceneGraph's set of registered geometry.
materialThe visual material to apply to this geometry.

Member Function Documentation

◆ add_child()

void add_child ( GeometryId  geometry_id)
inline

Adds a geometry with the given geometry_id to this geometry's set of children.

◆ belongs_to_source()

bool belongs_to_source ( SourceId  id) const
inline

Returns true if this geometry belongs to the source with the given id.

◆ child_geometry_ids()

const std::unordered_set<GeometryId>& child_geometry_ids ( ) const
inline

Returns a list of identifiers of geometries that have this geometry as a parent.

In other words, for an internal geometry g, g.index() appears in this list iff this->is_child_of_geometry(g.index()) returns true.

◆ frame_id()

FrameId frame_id ( ) const
inline

Reports the frame this internal geometry is rigidly attached to.

◆ has_child()

bool has_child ( GeometryId  geometry_id) const
inline

Returns true if this geometry has a child geometry with the given geometry_id.

◆ id()

GeometryId id ( ) const
inline

Returns the globally unique identifier for this geometry.

◆ index()

GeometryIndex index ( ) const
inline

Returns the index of this geometry in the full scene graph.

◆ is_child_of_frame()

bool is_child_of_frame ( FrameId  frame_id) const
inline

Returns true if the geometry is affixed to the frame with the given frame_id.

◆ is_child_of_geometry()

bool is_child_of_geometry ( GeometryId  geometry_id) const
inline

Returns true if this geometry has a geometry parent and the parent has the given geometry_id.

◆ is_dynamic()

bool is_dynamic ( ) const
inline

Returns true if the geometry is not attached to the world frame – or, in other words, it is attached to a movable frame.

◆ name()

const std::string& name ( ) const
inline

Returns the name of this geometry.

◆ operator!=()

bool operator!= ( const InternalGeometry other) const
inline

Compares two InternalGeometry instances for inequality.

See operator==() for the definition of equality.

◆ operator=() [1/2]

InternalGeometry& operator= ( InternalGeometry &&  )
default

◆ operator=() [2/2]

InternalGeometry& operator= ( const InternalGeometry )
default

◆ operator==()

bool operator== ( const InternalGeometry other) const
inline

Compares two InternalGeometry instances for "equality".

Two internal geometries are considered equal if they have the same geometry identifier.

◆ parent_id()

optional<GeometryId> parent_id ( ) const
inline

Returns the declared parent geometry (if one exists).

◆ proximity_index()

ProximityIndex proximity_index ( ) const
inline

Returns this geometry's valid index in the proximity engine iff this geometry has a proximity role.

If not, the returned index will be invalid.

◆ set_geometry_parent()

void set_geometry_parent ( GeometryId  id,
const Isometry3< double > &  X_FG 
)
inline

Sets this geometry to have another geometry as parent.

In this case, the pose set in the constructor is assumed to be X_PG and the X_FG value must be updated.

Parameters
idThe id of the parent geometry.
X_FGThe new value for X_FG (assuming the constructed value is to be interpreted as X_PG.

◆ set_proximity_index()

void set_proximity_index ( ProximityIndex  index)
inline

◆ shape()

const Shape& shape ( ) const
inline

Returns the shape specification for this geometry.

◆ source_id()

SourceId source_id ( ) const
inline

Returns the source id that registered the geometry.

◆ visual_material()

const VisualMaterial& visual_material ( ) const
inline

Returns the geometry visual material.

◆ X_FG()

const Isometry3<double>& X_FG ( ) const
inline

Returns the pose of this geometry in the frame to which it is ultimately rigidly attached.

This is in contrast to X_PG().

◆ X_PG()

const Isometry3<double>& X_PG ( ) const
inline

Returns the pose of this geometry in the declared parent frame – note if this geometry was registered as a child of another geometry it will not be the same as X_FG().


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