RobWorkProject  23.9.11-
Classes | Public Member Functions | List of all members
IndexedTriArray< T > Class Template Reference

this class is a proxy to a triangle mesh where the triangles can be indirectly copied in an efficient manner. More...

#include <IndexedTriArray.hpp>

Inherits TriMesh.

Public Member Functions

 IndexedTriArray (TriMesh::Ptr objArr)
 constructor - creates a proxy that initially maps triangles from [0:0,1:1,2:2,....,i:i] More...
 
 IndexedTriArray (TriMesh::Ptr objArr, rw::core::Ptr< std::vector< T >> idxArr)
 constructor - creates a proxy where the initial mapping is determined by idxArr. More...
 
 IndexedTriArray (TriMesh::Ptr objArr, rw::core::Ptr< std::vector< T >> idxArr, rw::core::Ptr< std::vector< rw::math::Vector3D< float >>> centerArr, rw::core::Ptr< std::vector< float >> valArr, rw::core::Ptr< std::vector< boost::tuple< T, float, rw::math::Vector3D< float >>>> valCenterArr, size_t first, size_t last)
 constructor - creates a proxy that only references part of the triangle mesh. the part is specified in the range from first to last More...
 
virtual ~IndexedTriArray ()
 destructor
 
const std::vector< T > & getIndexes () const
 get the index mapping
 
void sortAxis (int axis)
 sorts the triangles in the range [first,last[. the vertices of the triangles are projected onto the axis and then sorted in regard to the projected value from small to high More...
 
void sortAxis (int axis, const rw::math::Transform3D<> &t3d)
 
IndexedTriArray< T > getSubRange (size_t first, size_t last)
 
rw::core::Ptr< TriMeshclone () const
 make a clone of this triangle mesh More...
 
void scale (double s)
 Scale all vertices in the mesh. More...
 
size_t getGlobalIndex (int idx) const
 
rw::geometry::Triangle< double > operator[] (size_t i) const
 
rw::geometry::Triangle< double > getTriangle (size_t idx) const
 gets the triangle at index idx. More...
 
void getTriangle (size_t i, rw::geometry::Triangle< double > &dst) const
 gets the triangle at index idx. More...
 
void getTriangle (size_t i, rw::geometry::Triangle< float > &dst) const
 gets the triangle at index idx. More...
 
rw::geometry::GeometryData::GeometryType getType () const
 the type of this primitive More...
 
size_t getSize () const
 gets the number of triangles in the triangle array. More...
 
size_t size () const
 gets the number of triangles in the triangle array.
 
- Public Member Functions inherited from TriMesh
virtual ~TriMesh ()
 destructor
 
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.
 

Additional Inherited Members

- Public Types inherited from TriMesh
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
 
- Static Public Member Functions inherited from GeometryData
static std::string toString (GeometryType type)
 format GeometryType to string More...
 

Detailed Description

template<class T = size_t>
class rw::geometry::IndexedTriArray< T >

this class is a proxy to a triangle mesh where the triangles can be indirectly copied in an efficient manner.

Each "virtual" triangle index is mapped to the actual triangle index. By rearanging the mapping the order of the triangles in the mesh are rearanged to the proxy user, without changing the actual triangle mesh.

Constructor & Destructor Documentation

◆ IndexedTriArray() [1/3]

IndexedTriArray ( TriMesh::Ptr  objArr)
inline

constructor - creates a proxy that initially maps triangles from [0:0,1:1,2:2,....,i:i]

Parameters
objArr[in] the triangle mesh on which to create a proxy

◆ IndexedTriArray() [2/3]

IndexedTriArray ( TriMesh::Ptr  objArr,
rw::core::Ptr< std::vector< T >>  idxArr 
)
inline

constructor - creates a proxy where the initial mapping is determined by idxArr.

idxArr must be same length as the number of triangles.

Parameters
objArr[in] the triangle mesh on which to create a proxy
idxArr[in] the index mapping

◆ IndexedTriArray() [3/3]

IndexedTriArray ( TriMesh::Ptr  objArr,
rw::core::Ptr< std::vector< T >>  idxArr,
rw::core::Ptr< std::vector< rw::math::Vector3D< float >>>  centerArr,
rw::core::Ptr< std::vector< float >>  valArr,
rw::core::Ptr< std::vector< boost::tuple< T, float, rw::math::Vector3D< float >>>>  valCenterArr,
size_t  first,
size_t  last 
)
inline

constructor - creates a proxy that only references part of the triangle mesh. the part is specified in the range from first to last

Parameters
objArr[in] the triangle mesh on which to create a proxy
idxArr[in] the index mapping
first[in] the first index
centerArr
valArr
valCenterArr
last

Member Function Documentation

◆ clone()

rw::core::Ptr<TriMesh> clone ( ) const
inlinevirtual

make a clone of this triangle mesh

Returns
clone of this trimesh

Implements TriMesh.

◆ getSize()

size_t getSize ( ) const
inlinevirtual

gets the number of triangles in the triangle array.

Reimplemented from TriMesh.

◆ getTriangle() [1/3]

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

gets the triangle at index idx.

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

Implements TriMesh.

◆ getTriangle() [2/3]

void getTriangle ( size_t  i,
rw::geometry::Triangle< float > &  dst 
) const
inlinevirtual

gets the triangle at index idx.

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

Implements TriMesh.

◆ getTriangle() [3/3]

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

gets the triangle at index idx.

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

Implements TriMesh.

◆ getType()

rw::geometry::GeometryData::GeometryType getType ( ) const
inlinevirtual

the type of this primitive

Implements GeometryData.

◆ scale()

void scale ( double  s)
inlinevirtual

Scale all vertices in the mesh.

Implements TriMesh.

◆ sortAxis()

void sortAxis ( int  axis)
inline

sorts the triangles in the range [first,last[. the vertices of the triangles are projected onto the axis and then sorted in regard to the projected value from small to high

Parameters
axis

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