HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Hd_VertexAdjacency Class Referencefinal

#include <vertexAdjacency.h>

Public Member Functions

HD_API Hd_VertexAdjacency ()
 
HD_API ~Hd_VertexAdjacency ()
 
HD_API void BuildAdjacencyTable (HdMeshTopology const *topology)
 
int GetNumPoints () const
 Returns the number of points in the adjacency table. More...
 
VtIntArray const & GetAdjacencyTable () const
 Returns the adjacency table. More...
 

Detailed Description

Hd_VertexAdjacency encapsulates mesh adjacency information, which is used for smooth normal computation.

The Adjacency table (built by the AdjacencyBuilder computation) provides the index of the previous and next vertex for each face that uses that vertex.

The table is split into two parts. The first part of the table provides a offset to the prev/next data for the vertex as well as the number of faces that use the vertex. The second part of the table provides the actual prev/next indices.

For example, The following prim has 4 vertices and 2 faces and uses a CCW winding order:

3.---.2
 |  /|
 | / |
 |/  |
0.---.1

Picking one vertex, 0, it is used by 2 faces, so it contains 2 previous/ next pairs: (2, 1) and (3, 2)

The full adjacency table for this prim would be:

0 1 | 2 3 | 4 5 | 6 7 || 8 9 10 11 | 12 13 | 14 15 16 17 | 18 19 8 2 | 12 1 | 14 2 | 18 1 || 2 1 3 2 | 0 2 | 1 0 0 3 | 2 0 Offset / Count pairs || Prev / Next Pairs per vertex || Per Vertex, Per Face.

Definition at line 75 of file vertexAdjacency.h.

Constructor & Destructor Documentation

HD_API Hd_VertexAdjacency::Hd_VertexAdjacency ( )
HD_API Hd_VertexAdjacency::~Hd_VertexAdjacency ( )

Member Function Documentation

HD_API void Hd_VertexAdjacency::BuildAdjacencyTable ( HdMeshTopology const *  topology)

Updates the internal adjacency table using the supplied topology. Important! The adjacency table needs to be computed before smooth normals.

VtIntArray const& Hd_VertexAdjacency::GetAdjacencyTable ( ) const
inline

Returns the adjacency table.

Definition at line 96 of file vertexAdjacency.h.

int Hd_VertexAdjacency::GetNumPoints ( ) const
inline

Returns the number of points in the adjacency table.

Definition at line 91 of file vertexAdjacency.h.


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