OpenVDB  12.1.0
Classes | Public Member Functions | List of all members
TriangleMeshEdgeConnectivity< ValueT > Class Template Reference

Class representing the connectivity of edges in a triangle mesh, where each edge is associated with the cells (triangles) sharing it. Provides methods to retrieve adjacent cells, vertex coordinates, normals, and other geometric properties. More...

#include <openvdb/tools/impl/LevelSetDilatedMeshImpl.h>

Public Member Functions

 TriangleMeshEdgeConnectivity (const std::vector< Vec3T > &coords, const std::vector< Vec3I > &cells)
 Constructs the TriangleMeshEdgeConnectivity object with given coordinates and cell data. Populates edge-to-cell adjacency and computes cell normals. More...
 
bool getAdjacentCells (const Index &v1, const Index &v2, std::vector< Index > &cellIds) const
 Retrieves the IDs of cells adjacent to an edge formed by two vertices. More...
 
template<typename T >
const Vec3TgetCoord (const T &i) const
 Retrieves the 3D coordinate at a given index. More...
 
template<typename T >
const Vec3IgetCell (const T &i) const
 Retrieves the cell (triangle) at a given index. More...
 
template<typename T >
std::vector< Vec3TgetPrimitive (const T &i) const
 Retrieves the 3D coordinates of the vertices forming a primitive (triangle) at a given cell index. More...
 
template<typename T >
Vec3T getNormal (const T &i) const
 Retrieves the unit normal vector of a cell (triangle) at a given index. More...
 
Index64 coordCount () const
 Retrieves the total number of coordinates in the mesh. More...
 
Index64 cellCount () const
 Retrieves the total number of cells (triangles) in the mesh. More...
 

Detailed Description

template<typename ValueT>
class openvdb::v12_1::tools::lvlset::TriangleMeshEdgeConnectivity< ValueT >

Class representing the connectivity of edges in a triangle mesh, where each edge is associated with the cells (triangles) sharing it. Provides methods to retrieve adjacent cells, vertex coordinates, normals, and other geometric properties.

Constructor & Destructor Documentation

TriangleMeshEdgeConnectivity ( const std::vector< Vec3T > &  coords,
const std::vector< Vec3I > &  cells 
)
inline

Constructs the TriangleMeshEdgeConnectivity object with given coordinates and cell data. Populates edge-to-cell adjacency and computes cell normals.

Parameters
coordsVector of vertex coordinates.
cellsVector of cell (triangle) indices.

Member Function Documentation

Index64 cellCount ( ) const
inline

Retrieves the total number of cells (triangles) in the mesh.

Returns
The number of cells as an Index.
Index64 coordCount ( ) const
inline

Retrieves the total number of coordinates in the mesh.

Returns
The number of coordinates as an Index.
bool getAdjacentCells ( const Index v1,
const Index v2,
std::vector< Index > &  cellIds 
) const
inline

Retrieves the IDs of cells adjacent to an edge formed by two vertices.

Parameters
v1First vertex index.
v2Second vertex index.
cellIdsOutput vector to hold the IDs of adjacent cells.
Returns
True if adjacent cells are found, false otherwise.
const Vec3I& getCell ( const T &  i) const
inline

Retrieves the cell (triangle) at a given index.

Template Parameters
TAny integral type (int, unsigned int, size_t, etc.)
Parameters
iIndex of the cell.
Returns
Constant reference to the triangle's vertex indices.
const Vec3T& getCoord ( const T &  i) const
inline

Retrieves the 3D coordinate at a given index.

Template Parameters
TAny integral type (int, unsigned int, size_t, etc.)
Parameters
iIndex of the vertex.
Returns
The 3D coordinate as a constant reference to Vec3T.
Vec3T getNormal ( const T &  i) const
inline

Retrieves the unit normal vector of a cell (triangle) at a given index.

Template Parameters
TAny integral type (int, unsigned int, size_t, etc.)
Parameters
iIndex of the cell.
Returns
The normal vector of the triangle as a Vec3T.
std::vector<Vec3T> getPrimitive ( const T &  i) const
inline

Retrieves the 3D coordinates of the vertices forming a primitive (triangle) at a given cell index.

Template Parameters
TAny integral type (int, unsigned int, size_t, etc.)
Parameters
iIndex of the cell (triangle).
Returns
A vector of three Vec3T representing the coordinates of the triangle's vertices.