mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2025-01-04 06:00:17 +00:00
Implement C-API accessor to evaluator topology
This way external application might check whether it need to re-create evaluator from scratch or it might re-use existing one without storing extra data from it's side. TODO: Tags are still not accessible via C-API, it's marked as to be solved later when it becomes more clear what is the best way to expose them and when there'll be a real application to test the tags.
This commit is contained in:
parent
727077a8e0
commit
8b627c1c73
@ -146,4 +146,23 @@ void openSubdiv_evaluateLimit(
|
||||
|
||||
evaluation_descr->evaluator.EvaluateLimit(coords, P, dPdu, dPdv);
|
||||
}
|
||||
|
||||
|
||||
void openSubdiv_getEvaluatorTopology(
|
||||
struct OpenSubdiv_EvaluatorDescr *evaluation_descr,
|
||||
int *numVertices,
|
||||
int *refinementLevel,
|
||||
int *numIndices,
|
||||
int **indices,
|
||||
int *numNVerts,
|
||||
int **nverts)
|
||||
{
|
||||
// TODO(sergey): Tag data is also need to do the full comparison,
|
||||
// but it's not that clear how to pass it via C-API and no real
|
||||
// application to test this yet.
|
||||
*numVertices = evaluation_descr->topology.numVertices;
|
||||
*refinementLevel = evaluation_descr->topology.refinementLevel;
|
||||
*numIndices = evaluation_descr->topology.indices.size();
|
||||
*indices = &evaluation_descr->topology.indices[0];
|
||||
*numNVerts = evaluation_descr->topology.nverts.size();
|
||||
*nverts = &evaluation_descr->topology.nverts[0];
|
||||
}
|
||||
|
@ -58,6 +58,18 @@ void openSubdiv_evaluateLimit(
|
||||
|
||||
|
||||
|
||||
/* Get topology stored in the evaluator descriptor in order to be able */
|
||||
/* to check whether it still matches the mesh topology one is going to */
|
||||
/* evaluate. */
|
||||
void openSubdiv_getEvaluatorTopology(
|
||||
struct OpenSubdiv_EvaluatorDescr *evaluation_descr,
|
||||
int *numVertices,
|
||||
int *refinementLevel,
|
||||
int *numIndices,
|
||||
int **indices,
|
||||
int *numNVerts,
|
||||
int **nverts);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user