本文整理汇总了C++中MFloatPointArray::clear方法的典型用法代码示例。如果您正苦于以下问题:C++ MFloatPointArray::clear方法的具体用法?C++ MFloatPointArray::clear怎么用?C++ MFloatPointArray::clear使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MFloatPointArray
的用法示例。
在下文中一共展示了MFloatPointArray::clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: boundingBox
MBoundingBox BasicLocator::boundingBox() const
{
MBoundingBox bbox;
MFloatPointArray points;
points.clear();
points.setSizeIncrement(4);
points.append(-1.0, 0.0, 0.0);
points.append(1.0, 0.0, 0.0);
points.append(0.0, 0.0, 1.0);
points.append(0.0, 0.0, -1.0);
for (unsigned int i = 0; i < points.length(); i++)
bbox.expand(points[i]);
return bbox;
}
示例2: compute
MStatus ropeGenerator::compute( const MPlug& plug, MDataBlock& data )
{
MStatus status;
if ( plug == outMesh )
{
//Get Curve
MDataHandle inCurve_Hdl = data.inputValue( inCurve, &status );
if (status != MS::kSuccess ){
MGlobal::displayError( "Node ropeGenerator needs an Input Curve" );
return MS::kSuccess;
}
MObject inCurveObj = inCurve_Hdl.asNurbsCurve();
MFnNurbsCurve curveFn( inCurveObj );
//Get Attributes
int inDiv = data.inputValue( divisions ).asInt();
bool inCreateRope = data.inputValue( createRope ).asBool();
int inRopesCount = data.inputValue( ropesCount ).asInt();
int inPointsPerRope = data.inputValue( pointsPerRope ).asInt();
int inPointsCount = data.inputValue( pointsCount ).asInt();
float inRopesStrength = data.inputValue( ropesStrength ).asFloat();
float inRadius = data.inputValue( radius ).asFloat();
MRampAttribute inRadRamp( thisMObject(), taperRamp );
float inTwist = data.inputValue( twist ).asFloat();
MRampAttribute inTwistRamp( thisMObject(), twistRamp );
float inUvWidth = data.inputValue( uvWidth ).asFloat();
float inUvHeight = data.inputValue( uvHeight ).asFloat();
float inUvCapSize = data.inputValue( uvCapSize ).asFloat();
MFnMesh fnMesh;
MFnMeshData dataCreator;
MObject outMeshData;
outMeshData = dataCreator.create();
MDataHandle outputHandle = data.outputValue(outMesh);
//createBase
MIntArray faceCounts, faceConnects, uvIds;
MFloatArray uArray, vArray;
MFloatPointArray points;
faceCounts.clear();
faceConnects.clear();
points.clear();
if (inCreateRope)
inPointsCount = ( inPointsPerRope + 2 ) * inRopesCount;
int numVertices = ( inDiv + 1 ) * inPointsCount;
int numFaces = ( inPointsCount * inDiv ) + 2;
float param;
float lengPerDiv = curveFn.length() / inDiv;
PrevNormal = MVector( curveFn.normal( 0.0, MSpace::kWorld ).normal() );
float baseLeng = lengPerDiv;
float baseParamForRamp = 0;
float paramForRamp = 1.0 / float( inDiv );
float uDivNumber = inUvWidth / float( inPointsCount );
float vDivNumber = inUvHeight / float( inDiv );
for (int d = 0; d < inDiv + 1; d++)
{
if (d == 0)
{
param = 0;
faceCounts.append( inPointsCount );
for ( int i = inPointsCount - 1; i >= 0; i-- )
{
faceConnects.append( i );
}
for ( int i = 0; i < inPointsCount; i++ )
{
uvIds.append( i );
}
MFloatArray uTmpArray, vTmpArray;
if (inCreateRope)
createRopesUvs( inRopesCount, inPointsPerRope, inRopesStrength, inUvCapSize, uTmpArray, vTmpArray, 1.0 );
else
createCircleUvs( inPointsCount, inUvCapSize, uTmpArray, vTmpArray, 1.0 );
for ( int u = uTmpArray.length() - 1; u >= 0 ; u-- )
{
uArray.append( uTmpArray[u] + 1.0 );
vArray.append( vTmpArray[u] );
}
for ( int i = 0; i < inPointsCount + 1; i++ )
{
uArray.append( uDivNumber * float( i ) );
vArray.append( vDivNumber * float( d ) );
}
}else{
param = curveFn.findParamFromLength( baseLeng );
for ( int i = 0; i < inPointsCount + 1; i++ )
{
uArray.append( uDivNumber * float( i ) );
vArray.append( vDivNumber * float( d ) );
}
for ( int f = 0; f < inPointsCount; f++ )
{
faceCounts.append( 4 );
if( f == ( inPointsCount - 1 ))
{
faceConnects.append( ( f + 1 + ( d * inPointsCount ) ) - inPointsCount - inPointsCount );
faceConnects.append( ( f + 1 + ( d * inPointsCount ) - inPointsCount ) );
faceConnects.append( f + 1 + ( d * inPointsCount ) - 1 );
faceConnects.append( f + 1 + ( d * inPointsCount ) - inPointsCount - 1 );
uvIds.append( inPointsCount + (( inPointsCount + 1 ) * float( d - 1 )) + 1 + f );
//.........这里部分代码省略.........