public

Inheritance Graph

graph BT
	ConnectivityAccessor
	ConnectivityAccessor --> ReferenceCounter
	click ConnectivityAccessor "classRendering_1_1MeshUtils_1_1ConnectivityAccessor"
	click ReferenceCounter "classUtil_1_1ReferenceCounter"

Description

Allows to get connectivity informations of vertices and triangles of a mesh.

Based on ‘Random-Accessible Compressed Triangle Meshes’ by Yoon et al.

See also: http://dx.doi.org/10.1109/TVCG.2007.70585

Author: Sascha Brandt

*      v2
*       X
*      / \
*     / c1\      /
*    /-----\____/
*   /  t0  /\c2/
*  /      /c0\/
* X------/----X
* v0          v1
*
* t0 - triangle (see getTriangle)
* v0,v1,v2 - vertices (see getVertex)
* c0,c1,c2 - corners (see getCorner)
* c0 - corner of v1 and t0 (see getCorner, getVertexCorner, getCornerVertex, getTriangleCorner, getCornerTriangle)
* c1 - corner of t0 and next triangle corner of c0 (see getNextTriangleCorner)
* c2 - corner of v1 and next vertex corner of c0 (see getNextVertexCorner)
*

Protected Functions

   
   
void assertCornerRange(uint32_t cIndex) const
   
void assertVertexRange(uint32_t vIndex) const
   
void assertTriangleRange(uint32_t tIndex) const
   
  ConnectivityAccessor( Mesh * mesh)

Public Static Functions

   
   
Util::Reference < ConnectivityAccessor > create( Mesh * mesh)

Public Functions

   
   
  ~ConnectivityAccessor()
   
Geometry::Vec3 getVertex(uint32_t vIndex) const
   
TriangleAccessor::TriangleIndices_t getTriangle(uint32_t tIndex) const
   
uint32_t getCorner(uint32_t vIndex, uint32_t tIndex) const
   
uint32_t getVertexCorner(uint32_t vIndex) const
   
uint32_t getTriangleCorner(uint32_t tIndex) const
   
uint32_t getCornerVertex(uint32_t cIndex) const
   
uint32_t getCornerTriangle(uint32_t cIndex) const
   
uint32_t getNextVertexCorner(uint32_t cIndex) const
   
uint32_t getNextTriangleCorner(uint32_t cIndex) const
   
std::vector< uint32_t > getVertexAdjacentTriangles(uint32_t vIndex) const
   
std::vector< uint32_t > getVertexAdjacentVertices(uint32_t vIndex) const
   
std::vector< uint32_t > getAdjacentTriangles(uint32_t tIndex) const
   
bool isBorderEdge(uint32_t vIndex1, uint32_t vIndex2) const
   
bool isBorderTriangle(uint32_t tIndex) const

Documentation

function
Rendering::MeshUtils::ConnectivityAccessor::assertCornerRange

protected const
     
     
void assertCornerRange( uint32_t cIndex ) const

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:73


function
Rendering::MeshUtils::ConnectivityAccessor::assertVertexRange

protected const
     
     
void assertVertexRange( uint32_t vIndex ) const

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:74


function
Rendering::MeshUtils::ConnectivityAccessor::assertTriangleRange

protected const
     
     
void assertTriangleRange( uint32_t tIndex ) const

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:75


function
Rendering::MeshUtils::ConnectivityAccessor::ConnectivityAccessor

protected
     
     
ConnectivityAccessor( Mesh * mesh )

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:76


function
Rendering::MeshUtils::ConnectivityAccessor::create

public static
     
     
Util::Reference < ConnectivityAccessor > create( Mesh * mesh )

(static factory) Create a ConnectivityAccessor for the given Mesh . If no Accessor can be created, an std::invalid_argument exception is thrown.

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:81


function
Rendering::MeshUtils::ConnectivityAccessor::~ConnectivityAccessor

public inline virtual
   
   
~ConnectivityAccessor( )

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:83


function
Rendering::MeshUtils::ConnectivityAccessor::getVertex

public const
     
     
Geometry::Vec3 getVertex( uint32_t vIndex ) const

Return the coordinates of a vertex.

Parameters

vIndex
the vertex index

Returns

the vertex position

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:90


function
Rendering::MeshUtils::ConnectivityAccessor::getTriangle

public const
     
     
TriangleAccessor::TriangleIndices_t getTriangle( uint32_t tIndex ) const

Return the three vertex indices of a triangle.

Parameters

tIndex
the triangle index

Returns

a tuple of 3 vertex indices

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:97


function
Rendering::MeshUtils::ConnectivityAccessor::getCorner

public const
     
     
uint32_t getCorner( uint32_t vIndex,
  uint32_t tIndex
) const    

Return the corner joining a vertex with a triangle

Parameters

vIndex
the vertex index
tIndex
the triangle index

Returns

the corner index joining the vertex with the triangle

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:105


function
Rendering::MeshUtils::ConnectivityAccessor::getVertexCorner

public const
     
     
uint32_t getVertexCorner( uint32_t vIndex ) const

Return one of the corners incident to a vertex

Parameters

vIndex
the vertex index

Returns

the corner index incident to the vertex

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:112


function
Rendering::MeshUtils::ConnectivityAccessor::getTriangleCorner

public const
     
     
uint32_t getTriangleCorner( uint32_t tIndex ) const

Return one of the corners of a triangle.

Parameters

tIndex
the triangle index

Returns

the corner index incident to the triangle

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:119


function
Rendering::MeshUtils::ConnectivityAccessor::getCornerVertex

public const
     
     
uint32_t getCornerVertex( uint32_t cIndex ) const

Return the vertex associated with a corner.

Parameters

cIndex
the corner index

Returns

the vertex index associated with the corner.

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:126


function
Rendering::MeshUtils::ConnectivityAccessor::getCornerTriangle

public const
     
     
uint32_t getCornerTriangle( uint32_t cIndex ) const

Return the triangle associated with a corner.

Parameters

cIndex
the corner index

Returns

the triangle index associated with the corner.

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:133


function
Rendering::MeshUtils::ConnectivityAccessor::getNextVertexCorner

public const
     
     
uint32_t getNextVertexCorner( uint32_t cIndex ) const

Return the next corner incident on the vertex associated with a corner.

Parameters

cIndex
the corner index

Returns

the next corner index incident on the vertex associated with the corner

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:140


function
Rendering::MeshUtils::ConnectivityAccessor::getNextTriangleCorner

public const
     
     
uint32_t getNextTriangleCorner( uint32_t cIndex ) const

Return the next corner within the triangle associated with a corner.

Parameters

cIndex
the corner index

Returns

the next corner within the triangle associated with the corner.

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:147


function
Rendering::MeshUtils::ConnectivityAccessor::getVertexAdjacentTriangles

public const
     
     
std::vector< uint32_t > getVertexAdjacentTriangles( uint32_t vIndex ) const

Return the triangles that are adjacent to a vertex.

Parameters

vIndex
the vertex index

Returns

list of adjacent triangle indices

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:154


function
Rendering::MeshUtils::ConnectivityAccessor::getVertexAdjacentVertices

public const
     
     
std::vector< uint32_t > getVertexAdjacentVertices( uint32_t vIndex ) const

Return the vertices that are adjacent to a vertex.

Parameters

vIndex
the vertex index

Returns

list of adjacent vertex indices

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:161


function
Rendering::MeshUtils::ConnectivityAccessor::getAdjacentTriangles

public const
     
     
std::vector< uint32_t > getAdjacentTriangles( uint32_t tIndex ) const

Return the triangles that share an edge with a triangle. Triangles are only adjacent, if the directions of the shared edge are opposite to each other.

Parameters

tIndex
the triangle index

Returns

list of adjacent triangle indices

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:169


function
Rendering::MeshUtils::ConnectivityAccessor::isBorderEdge

public const
     
     
bool isBorderEdge( uint32_t vIndex1,
  uint32_t vIndex2
) const    

Tests if an edge is a border edge. An edge is a border edge if it is not shared with an edge in opposite direction.

Parameters

vIndex1
the first vertex index
vIndex2
the second vertex index

Returns

true, if the edge is a border edge (and is, in fact, an edge)

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:178


function
Rendering::MeshUtils::ConnectivityAccessor::isBorderTriangle

public const
     
     
bool isBorderTriangle( uint32_t tIndex ) const

Tests if a triangle is a border triangle. A triangle is a border triangle if it has at least one border edge.

Parameters

tIndex
the triangle index

Returns

true, if the triangle is a border triangle.

Defined in Rendering/MeshUtils/ConnectivityAccessor.h:186