RobWorkProject  23.9.11-
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.

Inherited by IndexedTriMesh< double >, IndexedTriArray< T >, IndexedTriMesh< T >, Object3DGeneric, PlainTriMesh< TRI >, and SimpleTriMesh.

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::core::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 , 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

virtual ~TriMesh ()
 destructor
 
virtual rw::geometry::Triangle< double > getTriangle (size_t idx) const =0
 gets the triangle at index idx. More...
 
virtual void getTriangle (size_t idx, rw::geometry::Triangle< double > &dst) const =0
 gets the triangle at index idx. More...
 
virtual void getTriangle (size_t idx, rw::geometry::Triangle< float > &dst) const =0
 gets the triangle at index idx. Using Floating point presicion More...
 
virtual size_t getSize () const
 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::core::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::core::Ptr< TriMeshgetTriMesh (bool forceCopy=true)
 gets a trimesh representation of this geometry data. More...
 
rw::core::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()

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

make a clone of this triangle mesh

Returns
clone of this trimesh

Implemented in SimpleTriMesh, PlainTriMesh< TRI >, Object3D< T >, IndexedTriMeshN0< T, S >, and IndexedTriArray< T >.

◆ getTriangle() [1/3]

virtual rw::geometry::Triangle<double> getTriangle ( size_t  idx) const
pure virtual

gets the triangle at index idx.

Parameters
idx[in] the index of the triangle.
Returns
the triangle at index idx

Implemented in Object3DGeneric, SimpleTriMesh, PlainTriMesh< TRI >, Object3D< T >, IndexedTriArray< T >, and IndexedTriMeshN0< T, S >.

◆ getTriangle() [2/3]

virtual void getTriangle ( size_t  idx,
rw::geometry::Triangle< double > &  dst 
) const
pure virtual

gets the triangle at index idx.

Parameters
idx[in] the index of the triangle.
dst[out] where to store the triangle at index idx

Implemented in SimpleTriMesh, PlainTriMesh< TRI >, Object3DGeneric, IndexedTriMeshN0< T, S >, and IndexedTriArray< T >.

◆ getTriangle() [3/3]

virtual void getTriangle ( size_t  idx,
rw::geometry::Triangle< float > &  dst 
) const
pure virtual

gets the triangle at index idx. Using Floating point presicion

Parameters
idx[in] the index of the triangle.
dst[out] where to store the triangle at index idx

Implemented in SimpleTriMesh, PlainTriMesh< TRI >, Object3DGeneric, IndexedTriMeshN0< T, S >, and IndexedTriArray< T >.

◆ getTriMesh() [1/2]

rw::core::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/2]

rw::core::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
true if convex

Reimplemented from GeometryData.


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