RobWorkProject
23.9.11-
|
a triangle mesh representation that maintains a list of simple triangles. More...
#include <PlainTriMesh.hpp>
Inherits TriMesh.
Public Types | |
typedef rw::core::Ptr< PlainTriMesh< TRI > > | Ptr |
smart pointer type of this class | |
typedef TRI::value_type | value_type |
the triangle type | |
Public Types inherited from TriMesh | |
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 | |
PlainTriMesh (std::size_t initSize=0) | |
constructor | |
PlainTriMesh (const std::vector< TRI > &tris) | |
constructor | |
void | scale (double scale) |
Scale all vertices in the mesh. More... | |
void | add (const TRI &triangle) |
add a triangle to the triangle mesh. More... | |
void | add (typename rw::geometry::PlainTriMesh< TRI >::Ptr triangles) |
Add all triangles in the mesh triangles to this. More... | |
void | clear () |
Clears the list of triangles. | |
std::vector< TRI > & | getTriangles () |
the vector of triangles More... | |
const TRI & | operator[] (size_t i) const |
returns triangle at index i | |
TRI & | operator[] (size_t i) |
returns triangle at index i | |
void | resize (size_t i) |
resize the triangle mesh More... | |
rw::geometry::Triangle< double > | getTriangle (size_t idx) const |
gets the triangle at index idx. More... | |
void | getTriangle (size_t idx, rw::geometry::Triangle< double > &dst) const |
gets the triangle at index idx. More... | |
void | getTriangle (size_t idx, rw::geometry::Triangle< float > &dst) const |
gets the triangle at index idx. 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. More... | |
rw::geometry::GeometryData::GeometryType | getType () const |
the type of this primitive More... | |
rw::core::Ptr< rw::geometry::TriMesh > | clone () const |
make a clone of this triangle mesh More... | |
Public Member Functions inherited from TriMesh | |
virtual | ~TriMesh () |
destructor | |
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. | |
Additional Inherited Members | |
Static Public Member Functions inherited from GeometryData | |
static std::string | toString (GeometryType type) |
format GeometryType to string More... | |
a triangle mesh representation that maintains a list of simple triangles.
This class is templated and can be setup with different types of triangle storage. Mainly this concerns single or double precision but also number of normals in each Triangle. Check out Triangle.hpp to get an idea of the different types.
The PlainTriMesh can be used as follows
To convert the plain trimesh to a more efficient mesh representation take a look at TriangleUtil::toIndexedTriMesh().
|
inline |
add a triangle to the triangle mesh.
triangle | [in] Triangle to add. The triangle is copied. |
|
inline |
Add all triangles in the mesh triangles to this.
[in] | triangles | Triangle mesh for which to add triangles |
|
inlinevirtual |
|
inlinevirtual |
gets the number of triangles in the triangle array.
Reimplemented from TriMesh.
|
inlinevirtual |
gets the triangle at index idx.
idx | [in] the index of the triangle. |
Implements TriMesh.
|
inlinevirtual |
gets the triangle at index idx.
idx | [in] the index of the triangle. |
Implements TriMesh.
|
inlinevirtual |
gets the triangle at index idx.
idx | [in] the index of the triangle. |
Implements TriMesh.
|
inline |
the vector of triangles
|
inlinevirtual |
the type of this primitive
Implements GeometryData.
|
inline |
resize the triangle mesh
i | [in] new size of mesh. |
|
inlinevirtual |
Scale all vertices in the mesh.
Implements TriMesh.
|
inlinevirtual |
gets the number of triangles in the triangle array.
Implements TriMesh.