RobWorkProject  23.9.11-
Classes | Public Types | Public Member Functions | List of all members
IndexedFaceArray Class Reference

An indexed face array is a proxy to a Shell, that makes it possible to easily sort faces and take subsets without modifying the underlying Shell. More...

#include <IndexedFaceArray.hpp>

Inherits Shell.

Classes

struct  IndexedFace
 Structure that holds information for each face. More...
 

Public Types

typedef rw::core::Ptr< IndexedFaceArrayPtr
 Smart pointer type to IndexedFaceArray.
 
typedef rw::core::Ptr< const IndexedFaceArrayCPtr
 Smart pointer type for a const IndexedFaceArray.
 
- Public Types inherited from Shell
typedef rw::core::Ptr< ShellPtr
 Smart pointer type to Shell.
 
typedef rw::core::Ptr< const ShellCPtr
 Smart pointer type to const Shell.
 
- Public Types inherited from GeometryData
enum  GeometryType {
  PointCloud , LineMesh , PlainTriMesh , IdxTriMesh ,
  SpherePrim , BoxPrim , OBBPrim , AABBPrim ,
  LinePrim , PointPrim , PyramidPrim , ConePrim ,
  TrianglePrim , CylinderPrim , TubePrim , PlanePrim ,
  RayPrim , Implicit , Quadratic , UserType
}
 geometry data types
 
typedef rw::core::Ptr< GeometryDataPtr
 smart pointer type to this class
 
typedef rw::core::Ptr< const GeometryDataCPtr
 const smart pointer type to this class
 

Public Member Functions

 IndexedFaceArray (rw::core::Ptr< const Shell > shell)
 Construct new indexed face array. More...
 
 IndexedFaceArray (rw::core::Ptr< const Shell > shell, const std::vector< IndexedFace > &faces, std::size_t first, std::size_t last)
 Construct new indexed face array. More...
 
virtual ~IndexedFaceArray ()
 Destructor.
 
virtual GeometryType getType () const
 the type of this primitive More...
 
virtual bool isConvex ()
 test if this geometry data is convex More...
 
virtual std::size_t size () const
 Get the number of surface patches in this shell. More...
 
IndexedFace getIndexedFace (std::size_t idx) const
 Get the indexed face. More...
 
void getIndexedFace (std::size_t idx, IndexedFace &dst) const
 Get the indexed face. More...
 
void sortAxis (int axis, const rw::math::Transform3D<> &t3d)
 Sort the faces according to their extent in the direction along axis. More...
 
IndexedFaceArray getSubRange (std::size_t first, std::size_t last) const
 Take out a subrange of faces. More...
 
std::size_t getGlobalIndex (std::size_t idx) const
 Get the original face index. More...
 
- Public Member Functions inherited from Shell
 Shell ()
 Constructor.
 
virtual ~Shell ()
 Destructor.
 
virtual rw::core::Ptr< TriMeshgetTriMesh (bool forceCopy=true)
 gets a trimesh representation of this geometry data. More...
 
virtual rw::core::Ptr< TriMeshgetTriMesh (bool forceCopy=true) const
 gets a trimesh representation of this geometry data. More...
 
rw::core::Ptr< const FacegetFace (std::size_t idx) const
 Get a surface patch. More...
 
virtual void getFace (std::size_t idx, GenericFace &face) const
 Get a surface patch. More...
 
virtual std::pair< double, double > extremums (const rw::math::Vector3D< double > &dir) const
 Get the minimum and maximum values of the shell in a certain direction. More...
 
virtual OBB obb () const
 Create Oriented Bounding Box (OBB) as a bounding volume for the shell. More...
 
- Public Member Functions inherited from GeometryData
virtual ~GeometryData ()
 Destructor.
 

Additional Inherited Members

- Static Public Member Functions inherited from GeometryData
static std::string toString (GeometryType type)
 format GeometryType to string More...
 

Detailed Description

An indexed face array is a proxy to a Shell, that makes it possible to easily sort faces and take subsets without modifying the underlying Shell.

Constructor & Destructor Documentation

◆ IndexedFaceArray() [1/2]

IndexedFaceArray ( rw::core::Ptr< const Shell shell)

Construct new indexed face array.

Parameters
shell[in] the underlying Shell.

◆ IndexedFaceArray() [2/2]

IndexedFaceArray ( rw::core::Ptr< const Shell shell,
const std::vector< IndexedFace > &  faces,
std::size_t  first,
std::size_t  last 
)

Construct new indexed face array.

Parameters
shell[in] the underlying Shell.
faces[in] the faces to include in the proxy.
first[in] skip the first faces.
last[in] last index of faces to include.

Member Function Documentation

◆ getGlobalIndex()

std::size_t getGlobalIndex ( std::size_t  idx) const

Get the original face index.

Parameters
idx[in] the indexed face index.
Returns
the original index.

◆ getIndexedFace() [1/2]

IndexedFace getIndexedFace ( std::size_t  idx) const

Get the indexed face.

Parameters
idx[in] index of indexed face.
Returns
the indexed face.

◆ getIndexedFace() [2/2]

void getIndexedFace ( std::size_t  idx,
IndexedFace dst 
) const

Get the indexed face.

Parameters
idx[in] index of indexed face.
dst[out] existing object to copy data into.

◆ getSubRange()

IndexedFaceArray getSubRange ( std::size_t  first,
std::size_t  last 
) const

Take out a subrange of faces.

Parameters
first[in] first index.
last[in] last index.
Returns
a new indexed face array.

◆ getType()

virtual GeometryType getType ( ) const
virtual

the type of this primitive

Implements Shell.

◆ isConvex()

virtual bool isConvex ( )
virtual

test if this geometry data is convex

Returns
true if convex

Implements Shell.

◆ size()

virtual std::size_t size ( ) const
virtual

Get the number of surface patches in this shell.

Returns
the number of surface patches.

Implements Shell.

◆ sortAxis()

void sortAxis ( int  axis,
const rw::math::Transform3D<> &  t3d 
)

Sort the faces according to their extent in the direction along axis.

Parameters
axis[in] axis to sort.
t3d[in] transform giving the position and axis directions.

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