RobWorkProject  23.9.11-
Public Types | Public Member Functions | Protected Attributes | List of all members
Face Class Referenceabstract

Abstract interface for geometric faces. More...

#include <Face.hpp>

Inherited by GenericFace, ImplicitFace, and QuadraticFace.

Public Types

typedef rw::core::Ptr< rw::geometry::FacePtr
 Smart pointer type to Face.
 
typedef rw::core::Ptr< const rw::geometry::FaceCPtr
 Smart pointer type to const Face.
 

Public Member Functions

 Face ()
 Constructor.
 
virtual ~Face ()
 Destructor.
 
virtual const rw::geometry::Surfacesurface () const =0
 Get the surface of the face. More...
 
virtual std::size_t curveCount () const =0
 Get the number of curves in the face. More...
 
virtual const rw::geometry::CurvegetCurve (std::size_t i) const =0
 Get a curve of the face. More...
 
virtual const std::vector< rw::math::Vector3D< double > > & vertices () const =0
 Get the vertices of the face. More...
 
virtual void transform (const rw::math::Transform3D<> &T)=0
 Transform the face. More...
 
virtual void transform (const rw::math::Vector3D< double > &P)=0
 Translation of face. More...
 
virtual rw::core::Ptr< rw::geometry::TriMeshgetTriMesh (bool forceCopy=true) const
 Create a TriMesh representation of the face. More...
 
virtual std::pair< double, double > extremums (const rw::math::Vector3D< double > &dir) const
 Find the extent of the surface along a specific direction. More...
 
virtual rw::geometry::OBB< double > obb ()
 Create Oriented Bounding Box. More...
 
void setMeshResolution (double resolution)
 Set the resolution used for discretization in the getTriMesh and faceTriMesh functions. More...
 

Protected Attributes

double _resolution
 Resolution used for discretization into triangle meshes.
 

Detailed Description

Abstract interface for geometric faces.

A face consist of a surface and curves that form the boundary of the face.

For all faces there must be the same number of vertices and curves. The order of vertices and curves are ordered such that a curve at a certain index will have a corresponding start vertex at the same vertex index.

Member Function Documentation

◆ curveCount()

virtual std::size_t curveCount ( ) const
pure virtual

Get the number of curves in the face.

Returns
the number of curves.

Implemented in QuadraticFace, ImplicitFace, and GenericFace.

◆ extremums()

virtual std::pair<double, double> extremums ( const rw::math::Vector3D< double > &  dir) const
virtual

Find the extent of the surface along a specific direction.

Parameters
dir[in] a normalized direction vector.
Returns
the minimum and maximum values along the given direction.

◆ getCurve()

virtual const rw::geometry::Curve& getCurve ( std::size_t  i) const
pure virtual

Get a curve of the face.

Parameters
i[in] the curve index, which should be less than the number returned by curveCount().
Returns
a reference to the curve data.

Implemented in QuadraticFace, ImplicitFace, and GenericFace.

◆ getTriMesh()

virtual rw::core::Ptr<rw::geometry::TriMesh> getTriMesh ( bool  forceCopy = true) const
virtual

Create a TriMesh representation of the face.

This function relies on the resolution set with setMeshResolution. The resolution is passed on to Curve::discretizeAdaptive and Surface::setDiscretizationResolution.

Parameters
forceCopy[in] (not currently used in default implementation)
Returns
a new TriMesh.

◆ obb()

virtual rw::geometry::OBB<double> obb ( )
virtual

Create Oriented Bounding Box.

The default implementation forms a TriMesh in order to estimate the directions for the OBB.

Returns
an OBB around the Face.

◆ setMeshResolution()

void setMeshResolution ( double  resolution)
inline

Set the resolution used for discretization in the getTriMesh and faceTriMesh functions.

The meaning of this parameter depends on the type of surface.

Parameters
resolution[in] the resolution parameter.

◆ surface()

virtual const rw::geometry::Surface& surface ( ) const
pure virtual

Get the surface of the face.

Returns
a reference to the surface data.

Implemented in QuadraticFace, ImplicitFace, and GenericFace.

◆ transform() [1/2]

virtual void transform ( const rw::math::Transform3D<> &  T)
pure virtual

Transform the face.

Parameters
T[in] transform.

Implemented in QuadraticFace, ImplicitFace, and GenericFace.

◆ transform() [2/2]

virtual void transform ( const rw::math::Vector3D< double > &  P)
pure virtual

Translation of face.

Parameters
P[in] translation vector.

Implemented in QuadraticFace, ImplicitFace, and GenericFace.

◆ vertices()

virtual const std::vector<rw::math::Vector3D<double> >& vertices ( ) const
pure virtual

Get the vertices of the face.

Returns
a reference to the vertex vector.

Implemented in QuadraticFace, ImplicitFace, and GenericFace.


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