本文整理汇总了C++中SurfacePtr::setDimV方法的典型用法代码示例。如果您正苦于以下问题:C++ SurfacePtr::setDimV方法的具体用法?C++ SurfacePtr::setDimV怎么用?C++ SurfacePtr::setDimV使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SurfacePtr
的用法示例。
在下文中一共展示了SurfacePtr::setDimV方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makeSurface
// Helper function to create an untrimmed rational OSG::Surface Core+Node
// from the controlpoints, dimensions in U & V,
// knotvectors in U & V and the desired error and material.
NodePtr makeSurface(const int numcps, const float xyzw[][4],
const int dimU, const int dimV,
const int numknotsU, const float *knotsU,
const int numknotsV, const float *knotsV,
const float error, const MaterialPtr &mat)
{
SurfacePtr surface;
NodePtr ret = makeCoredNode<Surface>(&surface);
GeoPositions4fPtr cps = GeoPositions4f::create();
int i;
beginEditCP(cps, GeoPositions4f::GeoPropDataFieldMask);
{
cps->clear();
for (i = 0; i < numcps; ++i)
{
cps->getField().push_back(Pnt4f(xyzw[i][0], xyzw[i][1],
xyzw[i][2], xyzw[i][3]));
}
}
endEditCP(cps, GeoPositions4f::GeoPropDataFieldMask);
beginEditCP(surface);
{
// let's clear the trimming
surface->removeCurves();
// set up dimensions and knot vectors:
surface->setDimU( dimU );
surface->setDimV( dimV );
surface->editMFKnotsU()->clear();
for (i = 0; i < numknotsU; ++i)
{
surface->editMFKnotsU()->push_back(knotsU[i]);
}
surface->editMFKnotsV()->clear();
for (i = 0; i < numknotsV; ++i)
{
surface->editMFKnotsV()->push_back(knotsV[i]);
}
// set control points
surface->setControlPoints(cps);
// set error
surface->setError(error);
// and finally set the material
surface->setMaterial(mat);
}
endEditCP(surface);
return ret;
}