OpenSubdiv: Add accessor to vertex edges via refiner C-API
This commit is contained in:
parent
f6a90f018c
commit
0cc45eaac4
|
@ -123,6 +123,21 @@ void getEdgeVertices(const OpenSubdiv_TopologyRefiner *topology_refiner,
|
|||
edge_vertices_indices[1] = array[1];
|
||||
}
|
||||
|
||||
int getNumVertexEdges(const OpenSubdiv_TopologyRefiner *topology_refiner, const int vertex_index)
|
||||
{
|
||||
const OpenSubdiv::Far::TopologyLevel *base_level = getOSDTopologyBaseLevel(topology_refiner);
|
||||
return base_level->GetVertexEdges(vertex_index).size();
|
||||
}
|
||||
|
||||
void getVertexEdges(const OpenSubdiv_TopologyRefiner *topology_refiner,
|
||||
const int vertex_index,
|
||||
int *vertex_edges_indices)
|
||||
{
|
||||
const OpenSubdiv::Far::TopologyLevel *base_level = getOSDTopologyBaseLevel(topology_refiner);
|
||||
OpenSubdiv::Far::ConstIndexArray array = base_level->GetVertexEdges(vertex_index);
|
||||
convertArrayToRaw(array, vertex_edges_indices);
|
||||
}
|
||||
|
||||
int getNumFacePtexFaces(const OpenSubdiv_TopologyRefiner *topology_refiner, const int face_index)
|
||||
{
|
||||
const int num_face_vertices = topology_refiner->getNumFaceVertices(topology_refiner, face_index);
|
||||
|
@ -201,6 +216,8 @@ void assignFunctionPointers(OpenSubdiv_TopologyRefiner *topology_refiner)
|
|||
topology_refiner->getNumFaceEdges = getNumFaceEdges;
|
||||
topology_refiner->getFaceEdges = getFaceEdges;
|
||||
topology_refiner->getEdgeVertices = getEdgeVertices;
|
||||
topology_refiner->getNumVertexEdges = getNumVertexEdges;
|
||||
topology_refiner->getVertexEdges = getVertexEdges;
|
||||
// PTex face geometry.
|
||||
topology_refiner->getNumFacePtexFaces = getNumFacePtexFaces;
|
||||
topology_refiner->getNumPtexFaces = getNumPtexFaces;
|
||||
|
|
|
@ -58,11 +58,13 @@ typedef struct OpenSubdiv_TopologyRefiner {
|
|||
int (*getNumVertices)(const struct OpenSubdiv_TopologyRefiner *topology_refiner);
|
||||
int (*getNumEdges)(const struct OpenSubdiv_TopologyRefiner *topology_refiner);
|
||||
int (*getNumFaces)(const struct OpenSubdiv_TopologyRefiner *topology_refiner);
|
||||
|
||||
int (*getNumFaceVertices)(const struct OpenSubdiv_TopologyRefiner *topology_refiner,
|
||||
const int face_index);
|
||||
void (*getFaceVertices)(const struct OpenSubdiv_TopologyRefiner *topology_refiner,
|
||||
const int face_index,
|
||||
int *face_vertices_indices);
|
||||
|
||||
int (*getNumFaceEdges)(const struct OpenSubdiv_TopologyRefiner *topology_refiner,
|
||||
const int face_index);
|
||||
void (*getFaceEdges)(const struct OpenSubdiv_TopologyRefiner *topology_refiner,
|
||||
|
@ -72,6 +74,12 @@ typedef struct OpenSubdiv_TopologyRefiner {
|
|||
const int edge_index,
|
||||
int edge_vertices_indices[2]);
|
||||
|
||||
int (*getNumVertexEdges)(const struct OpenSubdiv_TopologyRefiner *topology_refiner,
|
||||
const int vertex_index);
|
||||
void (*getVertexEdges)(const struct OpenSubdiv_TopologyRefiner *topology_refiner,
|
||||
const int vertex_index,
|
||||
int *vertex_edges_indices);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// PTex face geometry queries.
|
||||
|
||||
|
|
Loading…
Reference in New Issue