RobWorkProject
24.8.23-
|
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< TriMesh > | Ptr |
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< GeometryData > | Ptr |
smart pointer type to this class | |
typedef rw::core::Ptr< const GeometryData > | CPtr |
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< TriMesh > | clone () 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< TriMesh > | getTriMesh (bool forceCopy=true) |
gets a trimesh representation of this geometry data. More... | |
rw::core::Ptr< const TriMesh > | getTriMesh (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... | |
interface of a triangle mesh. The interface defines a way to get triangles from a triangle array/mesh.
|
pure virtual |
make a clone of this triangle mesh
Implemented in SimpleTriMesh, PlainTriMesh< TRI >, Object3D< T >, IndexedTriMeshN0< T, S >, and IndexedTriArray< T >.
|
pure virtual |
gets the triangle at index idx.
idx | [in] the index of the triangle. |
Implemented in Object3DGeneric, SimpleTriMesh, PlainTriMesh< TRI >, Object3D< T >, IndexedTriArray< T >, and IndexedTriMeshN0< T, S >.
|
pure virtual |
gets the triangle at index idx.
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 >.
|
pure virtual |
gets the triangle at index idx. Using Floating point presicion
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 >.
|
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.
Implements GeometryData.
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.
|
inlinevirtual |