本文整理汇总了C++中MFnNurbsCurve::getKnotDomain方法的典型用法代码示例。如果您正苦于以下问题:C++ MFnNurbsCurve::getKnotDomain方法的具体用法?C++ MFnNurbsCurve::getKnotDomain怎么用?C++ MFnNurbsCurve::getKnotDomain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFnNurbsCurve
的用法示例。
在下文中一共展示了MFnNurbsCurve::getKnotDomain方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: iter
MStatus Posts1Cmd::doIt ( const MArgList & )
{
const int nPosts = 5;
const double radius = 0.5;
const double height = 5.0;
// Get a list of currently selected objects
MSelectionList selection;
MGlobal::getActiveSelectionList( selection );
MDagPath dagPath;
MFnNurbsCurve curveFn;
double heightRatio = height / radius;
// Iterate over the nurbs curves
MItSelectionList iter( selection, MFn::kNurbsCurve );
for ( ; !iter.isDone(); iter.next() )
{
// Get the curve and attach it to the function set
iter.getDagPath( dagPath );
curveFn.setObject( dagPath );
// Get the domain of the curve, i.e. its start and end parametric values
double tStart, tEnd;
curveFn.getKnotDomain( tStart, tEnd );
MPoint pt;
int i;
double t;
double tIncr = (tEnd - tStart) / (nPosts - 1);
for( i=0, t=tStart; i < nPosts; i++, t += tIncr )
{
// Get point along curve at parametric position t
curveFn.getPointAtParam( t, pt, MSpace::kWorld );
pt.y += 0.5 * height;
MGlobal::executeCommand( MString( "cylinder -pivot ") + pt.x + " " + pt.y + " " + pt.z
+ " -radius " + radius + " -axis 0 1 0 -heightRatio " + heightRatio );
}
}
return MS::kSuccess;
}