Merge pull request #280 from Nazg-Gul/dev

Return success status from openSubdiv_finishEvaluatorDescr()
This commit is contained in:
Manuel Kraemer 2014-04-21 17:14:31 -07:00
commit d4b85556b8
2 changed files with 7 additions and 4 deletions

View File

@ -90,20 +90,23 @@ void openSubdiv_createEvaluatorDescrFace(OpenSubdiv_EvaluatorDescr *evaluator_de
}
}
void openSubdiv_finishEvaluatorDescr(OpenSubdiv_EvaluatorDescr *evaluator_descr,
int refinementLevel)
int openSubdiv_finishEvaluatorDescr(OpenSubdiv_EvaluatorDescr *evaluator_descr,
int refinementLevel)
{
std::string errorMessage;
evaluator_descr->topology.refinementLevel = refinementLevel;
// TODO: Pass the error message to the callee function so it know what's going on.
if (not evaluator_descr->topology.IsValid(&errorMessage)) {
std::cout <<"OpenSubdiv topology is not valid due to " << errorMessage << std::endl;
return 0;
} else {
if (not evaluator_descr->evaluator.Initialize(
evaluator_descr->topology, &errorMessage)) {
std::cout <<"OpenSubdiv uniform evaluator initialization failed due to " << errorMessage << std::endl;
return 0;
}
}
return 1;
}

View File

@ -38,7 +38,7 @@ struct OpenSubdiv_EvaluatorDescr;
struct OpenSubdiv_EvaluatorDescr *openSubdiv_createEvaluatorDescr(int numVertices);
void openSubdiv_deleteEvaluatorDescr(struct OpenSubdiv_EvaluatorDescr *evaluator_descr);
void openSubdiv_createEvaluatorDescrFace(struct OpenSubdiv_EvaluatorDescr *evaluator_descr, int num_vertices, int *indices);
void openSubdiv_finishEvaluatorDescr(struct OpenSubdiv_EvaluatorDescr *evaluator_descr, int refinementLevel);
int openSubdiv_finishEvaluatorDescr(struct OpenSubdiv_EvaluatorDescr *evaluator_descr, int refinementLevel);
/* Set the positions of points on the coarse mesh and refine. This method */
/* will perform catmull/clark refinement on the CVs to be ready to call */