本文整理汇总了C++中NURBSSet::GetNumObjects方法的典型用法代码示例。如果您正苦于以下问题:C++ NURBSSet::GetNumObjects方法的具体用法?C++ NURBSSet::GetNumObjects怎么用?C++ NURBSSet::GetNumObjects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NURBSSet
的用法示例。
在下文中一共展示了NURBSSet::GetNumObjects方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Save
bool AlembicCurves::Save(double time, bool bLastFrame)
{
ESS_PROFILE_FUNC();
//TimeValue ticks = GET_MAX_INTERFACE()->GetTime();
TimeValue ticks = GetTimeValueFromFrame(time);
Object *obj = mMaxNode->EvalWorldState(ticks).obj;
if(mNumSamples == 0){
bForever = CheckIfObjIsValidForever(obj, ticks);
}
else{
bool bNewForever = CheckIfObjIsValidForever(obj, ticks);
if(bForever && bNewForever != bForever){
ESS_LOG_INFO( "bForever has changed" );
}
}
SaveMetaData(mMaxNode, this);
// check if the spline is animated
if(mNumSamples > 0)
{
if(bForever)
{
return true;
}
}
AbcG::OCurvesSchema::Sample curvesSample;
std::vector<AbcA::int32_t> nbVertices;
std::vector<Point3> vertices;
std::vector<float> knotVector;
std::vector<Abc::uint16_t> orders;
if(obj->ClassID() == EDITABLE_SURF_CLASS_ID){
NURBSSet nurbsSet;
BOOL success = GetNURBSSet(obj, ticks, nurbsSet, TRUE);
AbcG::CurvePeriodicity cPeriod = AbcG::kNonPeriodic;
AbcG::CurveType cType = AbcG::kCubic;
AbcG::BasisType cBasis = AbcG::kNoBasis;
int n = nurbsSet.GetNumObjects();
for(int i=0; i<n; i++){
NURBSObject* pObject = nurbsSet.GetNURBSObject((int)i);
//NURBSType type = pObject->GetType();
if(!pObject){
continue;
}
if( pObject->GetKind() == kNURBSCurve ){
NURBSCurve* pNurbsCurve = (NURBSCurve*)pObject;
int degree;
int numCVs;
NURBSCVTab cvs;
int numKnots;
NURBSKnotTab knots;
pNurbsCurve->GetNURBSData(ticks, degree, numCVs, cvs, numKnots, knots);
orders.push_back(degree+1);
const int cvsCount = cvs.Count();
const int knotCount = knots.Count();
for(int j=0; j<cvs.Count(); j++){
NURBSControlVertex cv = cvs[j];
double x, y, z;
cv.GetPosition(ticks, x, y, z);
vertices.push_back( Point3((float)x, (float)y, (float)z) );
}
nbVertices.push_back(cvsCount);
//skip the first and last entry because Maya and XSI use this format
for(int j=1; j<knots.Count()-1; j++){
knotVector.push_back((float)knots[j]);
}
if(i == 0){
if(pNurbsCurve->IsClosed()){
cPeriod = AbcG::kPeriodic;
}
}
else{
if(pNurbsCurve->IsClosed()){
if(cPeriod != AbcG::kPeriodic){
ESS_LOG_WARNING("Mixed curve wrap types not supported.");
}
}
else{
if(cPeriod != AbcG::kNonPeriodic){
ESS_LOG_WARNING("Mixed curve wrap types not supported.");
}
}
}
//.........这里部分代码省略.........