![]() |
RobWorkProject
24.12.4-
|
Interface for indexed triangle meshes. More...
#include <IndexedTriMesh.hpp>
Inherits TriMesh.
Public Types | |
typedef T | value_type |
the basic value type of this mesh (for instance double or float) | |
typedef std::vector< rw::math::Vector3D< T > > | VertexArray |
the vertex array type | |
typedef rw::core::Ptr< rw::geometry::IndexedTriMesh< T > > | Ptr |
the smart pointer type of this triangle mesh | |
![]() | |
typedef rw::core::Ptr< TriMesh > | Ptr |
smart pointer type to this class | |
![]() | |
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 | |
const std::vector< rw::math::Vector3D< T > > & | getNormals () const |
Get vector of normals. More... | |
std::vector< rw::math::Vector3D< T > > & | getNormals () |
Get vector of normals. More... | |
const std::vector< rw::math::Vector3D< T > > & | getVertices () const |
Get vector of vertices. More... | |
std::vector< rw::math::Vector3D< T > > & | getVertices () |
Get vector of vertices. More... | |
uint8_t | getTriangleStride () const |
The stride of a triangle. More... | |
uint8_t | getIndexSize () const |
The size of the index type used. More... | |
uint8_t * | getIndexPtr () |
Pointer to the start of the index array. More... | |
virtual size_t | size () const |
gets the number of triangles in the triangle array. More... | |
rw::math::Vector3D< T > & | getVertex (size_t i) |
Get vertex from vertex list. More... | |
const rw::math::Vector3D< T > & | getVertex (size_t i) const |
Get vertex from vertex list. More... | |
bool | hasVertexNormals () const |
Check if trimesh has vertex normals defined. More... | |
bool | hasFaceNormals () const |
Check if trimesh has face normals defined. More... | |
virtual const rw::math::Vector3D< T > & | getVertexNormal (size_t i, VertexIdx vidx) const =0 |
Get normal of vertex vidx of triangle at index i. More... | |
virtual rw::math::Vector3D< T > & | getVertexNormal (size_t i, VertexIdx vidx)=0 |
Get normal of vertex vidx of triangle at index i. More... | |
virtual const rw::math::Vector3D< T > & | getVertex (size_t i, VertexIdx vidx) const =0 |
get vertex vidx of triangle at index i. More... | |
virtual rw::math::Vector3D< T > & | getVertex (size_t i, VertexIdx vidx)=0 |
get vertex vidx of triangle at index i. More... | |
virtual rw::geometry::IndexedTriangle< uint32_t > | getIndexedTriangle (size_t i) const =0 |
get the indexed triangle at index i More... | |
virtual int | getNrTris () const =0 |
The number of triangles in the mesh. More... | |
GeometryData::GeometryType | getType () const |
the type of this primitive More... | |
void * | getIndices () |
Get pointer to first element of index array. More... | |
void | scale (double scale) |
Scale all vertices in the mesh. More... | |
![]() | |
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 rw::core::Ptr< TriMesh > | clone () const =0 |
make a clone of this triangle mesh More... | |
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 | |
![]() | |
virtual | ~GeometryData () |
Destructor. | |
Protected Member Functions | |
IndexedTriMesh (rw::core::Ptr< VertexArray > vertices, rw::core::Ptr< VertexArray > normals, uint8_t triStride, uint8_t idxsize) | |
generic constructor More... | |
~IndexedTriMesh () | |
Destructor. | |
void | setTriArray (uint8_t *triarray) |
Sets the indice array. More... | |
Protected Attributes | |
VertexArray * | _vertices |
pointer to vertice array | |
rw::core::Ptr< VertexArray > | _vertPtr |
Smart pointer to maintain ownership of vertice array. | |
VertexArray * | _normals |
pointer to normal array | |
rw::core::Ptr< VertexArray > | _normPtr |
Smart pointer to maintain ownership of normals array. | |
uint8_t * | _triIdxArr |
pointer to indice array | |
const uint8_t | _stride |
The stride. | |
const uint8_t | _idxsize |
Size of index. | |
Additional Inherited Members | |
![]() | |
static std::string | toString (GeometryType type) |
format GeometryType to string More... | |
Interface for indexed triangle meshes.
An indexed triangle mesh has a list of vertices and a list of indicies. The indicies is used as reference into the vertex list. Indicies are grouped into threes such that one triangle is defined by three following indicies.
In the IndexedTriMesh classes the indice list is hidden under a list of IndexedTriangle.
|
inlineprotected |
generic constructor
vertices | [in] pointer to vertice array (ownership taken) |
normals | [in] pointer to normal array (NULL if not used) (ownership taken) |
triStride | [in] the stride of the indice array (set using setTriArray). |
idxsize | [in] the size in bytes of an indice in the indice array |
|
pure virtual |
get the indexed triangle at index i
i | [in] the index of the triangle |
Implemented in IndexedTriMeshN0< T, S >.
|
inline |
Pointer to the start of the index array.
|
inline |
The size of the index type used.
|
inline |
Get pointer to first element of index array.
|
inline |
Get vector of normals.
|
inline |
Get vector of normals.
|
pure virtual |
The number of triangles in the mesh.
Implemented in IndexedTriMeshN0< T, S >.
|
inline |
The stride of a triangle.
|
inlinevirtual |
the type of this primitive
Implements GeometryData.
|
inline |
Get vertex from vertex list.
i | [in] the vertex id (NOT the triangle id). |
|
inline |
Get vertex from vertex list.
i | [in] the vertex id (NOT the triangle id). |
|
pure virtual |
get vertex vidx of triangle at index i.
i | [in] the index of the triangle |
vidx | [in] the index of the triangle vertex |
Implemented in IndexedTriMeshN0< T, S >.
|
pure virtual |
get vertex vidx of triangle at index i.
i | [in] the index of the triangle |
vidx | [in] the index of the triangle vertex |
Implemented in IndexedTriMeshN0< T, S >.
|
pure virtual |
Get normal of vertex vidx of triangle at index i.
i | [in] the index of the triangle. |
vidx | [in] the triangle vertex. |
Implemented in IndexedTriMeshN0< T, S >.
|
pure virtual |
Get normal of vertex vidx of triangle at index i.
i | [in] the index of the triangle. |
vidx | [in] the triangle vertex. |
Implemented in IndexedTriMeshN0< T, S >.
|
inline |
Get vector of vertices.
|
inline |
Get vector of vertices.
|
inline |
Check if trimesh has face normals defined.
|
inline |
Check if trimesh has vertex normals defined.
|
inlinevirtual |
Scale all vertices in the mesh.
Implements TriMesh.
|
inlineprotected |
Sets the indice array.
triarray | [in] the array. |
|
inlinevirtual |
gets the number of triangles in the triangle array.
Implements TriMesh.