RobWorkProject  23.9.11-
Public Member Functions | Friends | List of all members
ReferencedTriangle Class Reference

The ReferencedTriangle contains a reference to the mesh it has been created from. Therefore any changes to the triangle wil be reflected in the original mesh. More...

#include <ReferencedTriangle.hpp>

Public Member Functions

 ReferencedTriangle (TriMeshData::Ptr ref, uint32_t triangle)
 Construct a new Referenced Triangle a mesh and the index of the triangle in the mesh. More...
 
ReferencedVertice operator[] (size_t i) const
 Acces the vertices of the triangle. More...
 
uint32_t & idx (size_t i)
 get the indexes of the vertices that constetutes this triangle More...
 
uint32_t idx (size_t i) const
 get the mesh index of the vertexes belonging to this triangle More...
 
ReferencedEdge edge (size_t i) const
 get one of the 3 edges that makes up this triangle More...
 
bool has (const ReferencedEdge &edge) const
 check if triangle got edge More...
 
bool has (const ReferencedVertice &vertice) const
 check if triangle got vertice More...
 
ReferencedVertice opposit (const ReferencedEdge &edge) const
 get the vertice oposit the edge More...
 
ReferencedEdge opposit (const ReferencedVertice &vertice) const
 get the edge oposit the vertice More...
 
bool intersects (const ReferencedTriangle &t) const
 Check if this triangle intersects t. More...
 
bool sameMesh (const ReferencedTriangle &t) const
 Check if the triangles are part of the same mesh. More...
 
ReferencedTriangleoperator= (rw::geometry::Triangle< double > rhs)
 assignment operator. Over writes the values of the vertices of this triangle with the values of rhs. These changes will directly propergate the the mesh of this triangle More...
 
ReferencedTriangleoperator= (rw::geometry::Triangle< float > rhs)
 assignment operator. Over writes the values of the vertices of this triangle with the values of rhs. These changes will directly propergate the the mesh of this triangle More...
 
ReferencedTriangleoperator= (rw::math::Vector3D< int > rhs)
 assignment operator. Over writes the values of which verticies this triangle points at. These changes will directly propergate the the mesh of this triangle More...
 
 operator rw::geometry::Triangle< double > () const
 conversion operator to non-referenced triangle. This creates a copy of the values in this triangle, for making the new triangle More...
 
 operator rw::geometry::Triangle< float > () const
 conversion operator to non-referenced triangle. This creates a copy of the values in this triangle, for making the new triangle More...
 
 operator int () const
 convert the refrenced triangle to the index of the triangle in the mesh More...
 

Friends

std::ostream & operator<< (std::ostream &os, const ReferencedTriangle &t)
 Serilization operator for converting to string. More...
 

Detailed Description

The ReferencedTriangle contains a reference to the mesh it has been created from. Therefore any changes to the triangle wil be reflected in the original mesh.

Constructor & Destructor Documentation

◆ ReferencedTriangle()

ReferencedTriangle ( TriMeshData::Ptr  ref,
uint32_t  triangle 
)

Construct a new Referenced Triangle a mesh and the index of the triangle in the mesh.

Parameters
ref[in] the TriMesh the triangle is a part of
triangle[in] the index of the triangle in the mesh

Member Function Documentation

◆ edge()

ReferencedEdge edge ( size_t  i) const

get one of the 3 edges that makes up this triangle

Parameters
i[in] index of the edge
Returns
ReferencedEdge

◆ has() [1/2]

bool has ( const ReferencedEdge edge) const

check if triangle got edge

Parameters
edge[in] the edge
Returns
true if got edge
false if dosen't have edge or don't share mesh

◆ has() [2/2]

bool has ( const ReferencedVertice vertice) const

check if triangle got vertice

Parameters
vertice[in] the vertice
Returns
true if got vertice
false if dosen't have vertice or don't share mesh

◆ idx() [1/2]

uint32_t& idx ( size_t  i)

get the indexes of the vertices that constetutes this triangle

Parameters
i[in] which of the 3 vertices to access
Returns
reference to the trangle index. Changing this value will modefiy the mesh

◆ idx() [2/2]

uint32_t idx ( size_t  i) const

get the mesh index of the vertexes belonging to this triangle

Parameters
i[in] index of the wanted mesh index
Returns
uint32_t&

◆ intersects()

bool intersects ( const ReferencedTriangle t) const

Check if this triangle intersects t.

Parameters
t[in] other triangle to check for intersections
Returns
true if intersects
false if don't intersect or if they are not part of the same mesh

◆ operator int()

operator int ( ) const

convert the refrenced triangle to the index of the triangle in the mesh

Returns
int

◆ operator rw::geometry::Triangle< double >()

operator rw::geometry::Triangle< double > ( ) const

conversion operator to non-referenced triangle. This creates a copy of the values in this triangle, for making the new triangle

Returns
rw::geometry::Triangle< double >

◆ operator rw::geometry::Triangle< float >()

operator rw::geometry::Triangle< float > ( ) const

conversion operator to non-referenced triangle. This creates a copy of the values in this triangle, for making the new triangle

Returns
rw::geometry::Triangle< double >

◆ operator=() [1/3]

ReferencedTriangle& operator= ( rw::geometry::Triangle< double >  rhs)

assignment operator. Over writes the values of the vertices of this triangle with the values of rhs. These changes will directly propergate the the mesh of this triangle

Parameters
rhs[in] the new values of this triangle
Returns
ReferencedTriangle&

◆ operator=() [2/3]

ReferencedTriangle& operator= ( rw::geometry::Triangle< float >  rhs)

assignment operator. Over writes the values of the vertices of this triangle with the values of rhs. These changes will directly propergate the the mesh of this triangle

Parameters
rhs[in] the new values of this triangle
Returns
ReferencedTriangle&

◆ operator=() [3/3]

ReferencedTriangle& operator= ( rw::math::Vector3D< int >  rhs)

assignment operator. Over writes the values of which verticies this triangle points at. These changes will directly propergate the the mesh of this triangle

Parameters
rhs[in] the new values of this triangle
Returns
ReferencedTriangle&

◆ operator[]()

ReferencedVertice operator[] ( size_t  i) const

Acces the vertices of the triangle.

Parameters
i[in] which of the 3 vertices to access
Returns
ReferencedVertice. Any changes to the vertice will modify the mesh

◆ opposit() [1/2]

ReferencedVertice opposit ( const ReferencedEdge edge) const

get the vertice oposit the edge

Parameters
edge[in] the edge
Returns
ReferencedVertice
Exceptions
rw::core::Exceptionif edge not part of triangle

◆ opposit() [2/2]

ReferencedEdge opposit ( const ReferencedVertice vertice) const

get the edge oposit the vertice

Parameters
vertice[in] the vertice
Returns
ReferencedEdge
Exceptions
rw::core::Exceptionif vertice not part of triangle

◆ sameMesh()

bool sameMesh ( const ReferencedTriangle t) const

Check if the triangles are part of the same mesh.

Parameters
t[in] the other triangle
Returns
true if part of the same mesh
false if not part of the same mesh

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const ReferencedTriangle t 
)
friend

Serilization operator for converting to string.

Parameters
os[in/out] the output stream
t[in] the triangle
Returns
std::ostream&

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