HDK
|
#include <vertexAdjacency.h>
Public Member Functions | |
HD_API | Hd_VertexAdjacency () |
HD_API | ~Hd_VertexAdjacency () |
HD_API bool | BuildAdjacencyTable (HdMeshTopology const *topology) |
HD_API HdBufferSourceSharedPtr | GetSharedAdjacencyBuilderComputation (HdMeshTopology const *topology) |
void | SetAdjacencyRange (HdBufferArrayRangeSharedPtr const &range) |
Sets the buffer range used for adjacency table storage. More... | |
HdBufferArrayRangeSharedPtr const & | GetAdjacencyRange () const |
Returns the buffer range used for adjacency table storage. More... | |
int | GetNumPoints () const |
Returns the number of points in the adjacency table. More... | |
VtIntArray const & | GetAdjacencyTable () const |
Returns the adjacency table. More... | |
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 83 of file vertexAdjacency.h.
HD_API Hd_VertexAdjacency::Hd_VertexAdjacency | ( | ) |
HD_API Hd_VertexAdjacency::~Hd_VertexAdjacency | ( | ) |
HD_API bool 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.
|
inline |
Returns the buffer range used for adjacency table storage.
Definition at line 111 of file vertexAdjacency.h.
|
inline |
Returns the adjacency table.
Definition at line 121 of file vertexAdjacency.h.
|
inline |
Returns the number of points in the adjacency table.
Definition at line 116 of file vertexAdjacency.h.
HD_API HdBufferSourceSharedPtr Hd_VertexAdjacency::GetSharedAdjacencyBuilderComputation | ( | HdMeshTopology const * | topology | ) |
Returns a shared adjacency builder computation which will call BuildAdjacencyTable. The shared computation is useful if multiple meshes share a topology and adjacency table, and only want to build the adjacency table once.
|
inline |
Sets the buffer range used for adjacency table storage.
Definition at line 106 of file vertexAdjacency.h.