RobWorkProject
Classes | Public Types | Public Member Functions | List of all members
TriMesh Class Referenceabstract

interface of a triangle mesh. The interface defines a way to get triangles from a triangle array/mesh. More...

#include <TriMesh.hpp>

Inherits GeometryData, and GeometryData.

Inherited by IndexedTriMesh< float >, PlainTriMesh< rw::geometry::Triangle<> >, IndexedTriArray< T >, IndexedTriMesh< T >, and PlainTriMesh< TRI >.

Classes

struct  TriCenterIterator
 struct for iterating over the centers of triangles in a mesh More...
 
struct  VerticeIterator
 struct for iterating over the centers of triangles in a mesh More...
 

Public Types

typedef rw::common::Ptr< TriMeshPtr
 smart pointer type to this class
 
typedef rw::common::Ptr< TriMeshPtr
 smart pointer type to this class
 
- Public Types inherited from GeometryData
enum  GeometryType {
  PointCloud, LineMesh, PlainTriMesh, IdxTriMesh,
  SpherePrim, BoxPrim, OBBPrim, AABBPrim,
  LinePrim, PointPrim, PyramidPrim, ConePrim,
  TrianglePrim, CylinderPrim, TubePrim, PlanePrim,
  RayPrim, Quadratic, UserType
}
 geometry data types
 
typedef rw::common::Ptr< GeometryDataPtr
 smart pointer type to this class
 

Public Member Functions

virtual ~TriMesh ()
 destructor
 
virtual Triangle< double > getTriangle (size_t idx) const =0
 gets the triangle at index idx.
 
virtual void getTriangle (size_t idx, Triangle< double > &dst) const =0
 
virtual void getTriangle (size_t idx, Triangle< float > &dst) const =0
 gets the triangle at index idx, but with floating precision
 
virtual size_t getSize () const =0
 gets the number of triangles in the triangle array.
 
virtual size_t size () const =0
 gets the number of triangles in the triangle array.
 
virtual rw::common::Ptr< TriMeshclone () const =0
 make a clone of this triangle mesh More...
 
rw::common::Ptr< TriMeshgetTriMesh (bool forceCopy=true)
 gets a trimesh representation of this geometry data. More...
 
rw::common::Ptr< const TriMeshgetTriMesh (bool forceCopy=true) const
 gets a trimesh representation of this geometry data. More...
 
virtual ~TriMesh ()
 destructor
 
virtual Triangle< double > getTriangle (size_t idx) const =0
 gets the triangle at index idx.
 
virtual void getTriangle (size_t idx, Triangle< double > &dst) const =0
 
virtual void getTriangle (size_t idx, Triangle< float > &dst) const =0
 gets the triangle at index idx, but with floating precision
 
virtual size_t getSize () const =0
 gets the number of triangles in the triangle array.
 
virtual size_t size () const =0
 gets the number of triangles in the triangle array.
 
virtual rw::common::Ptr< TriMeshclone () const =0
 make a clone of this triangle mesh More...
 
virtual void scale (double scale)=0
 Scale all vertices in the mesh.
 
rw::common::Ptr< TriMeshgetTriMesh (bool forceCopy=true)
 gets a trimesh representation of this geometry data. More...
 
rw::common::Ptr< const TriMeshgetTriMesh (bool forceCopy=true) const
 gets a trimesh representation of this geometry data. More...
 
virtual bool isConvex ()
 test if this geometry data is convex More...
 
void setConvexEnabled (bool isConvex)
 
double getVolume () const
 calculate a volume of this triangle mesh
 
- Public Member Functions inherited from GeometryData
virtual ~GeometryData ()
 Destructor.
 
virtual GeometryType getType () const =0
 the type of this primitive
 

Additional Inherited Members

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

Detailed Description

interface of a triangle mesh. The interface defines a way to get triangles from a triangle array/mesh.

Member Function Documentation

◆ clone() [1/2]

virtual rw::common::Ptr<TriMesh> clone ( ) const
pure virtual

make a clone of this triangle mesh

Returns
clone of this trimesh

Implemented in IndexedTriMeshN0< T, S >, IndexedTriMeshN0< float >, IndexedTriArray< T >, PlainTriMesh< TRI >, and PlainTriMesh< rw::geometry::Triangle<> >.

◆ clone() [2/2]

virtual rw::common::Ptr<TriMesh> clone ( ) const
pure virtual

make a clone of this triangle mesh

Returns
clone of this trimesh

Implemented in IndexedTriMeshN0< T, S >, IndexedTriMeshN0< float >, IndexedTriArray< T >, PlainTriMesh< TRI >, and PlainTriMesh< rw::geometry::Triangle<> >.

◆ getTriMesh() [1/4]

rw::common::Ptr<TriMesh> getTriMesh ( bool  forceCopy = true)
virtual

gets a trimesh representation of this geometry data.

The trimesh that is returned is by default a copy, which means ownership is transfered to the caller. Specifying forceCopy to false will enable copy by reference and ownership is not necesarilly transfered. This is more efficient, though pointer is only alive as long as this GeometryData is alive.

Returns
TriMesh representation of this GeometryData

Implements GeometryData.

◆ getTriMesh() [2/4]

rw::common::Ptr<const TriMesh> getTriMesh ( bool  forceCopy = true) const

gets a trimesh representation of this geometry data.

The trimesh that is returned is by default a copy, which means ownership is transfered to the caller. Specifying forceCopy to false will enable copy by reference and ownership is not necesarilly transfered. This is more efficient, though pointer is only alive as long as this GeometryData is alive.

Returns
TriMesh representation of this GeometryData

◆ getTriMesh() [3/4]

rw::common::Ptr<TriMesh> getTriMesh ( bool  forceCopy = true)
virtual

gets a trimesh representation of this geometry data.

The trimesh that is returned is by default a copy, which means ownership is transfered to the caller. Specifying forceCopy to false will enable copy by reference and ownership is not necesarilly transfered. This is more efficient, though pointer is only alive as long as this GeometryData is alive.

Returns
TriMesh representation of this GeometryData

Implements GeometryData.

◆ getTriMesh() [4/4]

rw::common::Ptr<const TriMesh> getTriMesh ( bool  forceCopy = true) const

gets a trimesh representation of this geometry data.

The trimesh that is returned is by default a copy, which means ownership is transfered to the caller. Specifying forceCopy to false will enable copy by reference and ownership is not necesarilly transfered. This is more efficient, though pointer is only alive as long as this GeometryData is alive.

Returns
TriMesh representation of this GeometryData

◆ isConvex()

virtual bool isConvex ( )
inlinevirtual

test if this geometry data is convex

Returns

Reimplemented from GeometryData.


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