OpenVDB: TriangleMeshEdgeConnectivity< ValueT > Class Template Reference

OpenVDB 13.0.0

Loading...
Searching...
No Matches
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.
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.
template<typename T>
const Vec3T & | getCoord (const T &i) const
| Retrieves the 3D coordinate at a given index.
template<typename T>
const Vec3I & | getCell (const T &i) const
| Retrieves the cell (triangle) at a given index.
template<typename T>
std::vector< Vec3T > | getPrimitive (const T &i) const
| Retrieves the 3D coordinates of the vertices forming a primitive (triangle) at a given cell index.
template<typename T>
Vec3T | getNormal (const T &i) const
| Retrieves the unit normal vector of a cell (triangle) at a given index.
Index64 | coordCount () const
| Retrieves the total number of coordinates in the mesh.
Index64 | cellCount () const
| Retrieves the total number of cells (triangles) in the mesh.

## Detailed Description

template<typename ValueT>
class openvdb::v13_0::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()

template<typename ValueT>

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

  coords | Vector of vertex coordinates.
  cells | Vector of cell (triangle) indices.

## Member Function Documentation

## ◆ cellCount()

template<typename ValueT>

Index64 cellCount | ( |  | ) | const
| inline

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

Returns
  The number of cells as an Index.

## ◆ coordCount()

template<typename ValueT>

Index64 coordCount | ( |  | ) | const
| inline

Retrieves the total number of coordinates in the mesh.

Returns
  The number of coordinates as an Index.

## ◆ getAdjacentCells()

template<typename ValueT>

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

  v1 | First vertex index.
  v2 | Second vertex index.
  cellIds | Output vector to hold the IDs of adjacent cells.

Returns
  True if adjacent cells are found, false otherwise.

## ◆ getCell()

template<typename ValueT>
template<typename T>

const Vec3I & getCell | ( | const T & | i | ) | const
| inline

Retrieves the cell (triangle) at a given index.

Template Parameters

  T | Any integral type (int, unsigned int, size_t, etc.)

Parameters

  i | Index of the cell.

Returns
  Constant reference to the triangle's vertex indices.

## ◆ getCoord()

template<typename ValueT>
template<typename T>

const Vec3T & getCoord | ( | const T & | i | ) | const
| inline

Retrieves the 3D coordinate at a given index.

Template Parameters

  T | Any integral type (int, unsigned int, size_t, etc.)

Parameters

  i | Index of the vertex.

Returns
  The 3D coordinate as a constant reference to Vec3T.

## ◆ getNormal()

template<typename ValueT>
template<typename T>

Vec3T getNormal | ( | const T & | i | ) | const
| inline

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

Template Parameters

  T | Any integral type (int, unsigned int, size_t, etc.)

Parameters

  i | Index of the cell.

Returns
  The normal vector of the triangle as a Vec3T.

## ◆ getPrimitive()

template<typename ValueT>
template<typename T>

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

  T | Any integral type (int, unsigned int, size_t, etc.)

Parameters

  i | Index of the cell (triangle).

Returns
  A vector of three Vec3T representing the coordinates of the triangle's vertices.