本文整理汇总了C++中ON_NurbsSurface::Domain方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_NurbsSurface::Domain方法的具体用法?C++ ON_NurbsSurface::Domain怎么用?C++ ON_NurbsSurface::Domain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_NurbsSurface
的用法示例。
在下文中一共展示了ON_NurbsSurface::Domain方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BuildWireFrameFace
osg::Node* RhinoReader::BuildWireFrameFace(const ON_BrepFace* theFace)
{
osg::ref_ptr<osg::Geode> aGeode = new osg::Geode();
ON_NurbsSurface aSurface;
if (theFace->GetNurbForm(aSurface) == 0)
{
return NULL;
}
double u0 = aSurface.Domain(0).Min();
double u1 = aSurface.Domain(0).Max();
double v0 = aSurface.Domain(1).Min();
double v1 = aSurface.Domain(1).Max();
double d0 = 0.0;
double d1 = 0.0;
d0 = (u1 - u0) / 10.0;
d1 = (v1 - v0) / 10.0;
for (double u = u0; (u - u1) < TOLERANCE_FACE; u += d0)
{
osg::ref_ptr<osg::Geometry> aGeometry = new osg::Geometry();
osg::ref_ptr<osg::Vec3Array> aVertices = new osg::Vec3Array();
for (double v = v0; (v - v1) < TOLERANCE_FACE; v += d1)
{
ON_3dPoint aPoint = aSurface.PointAt(u, v);
aVertices->push_back(osg::Vec3(aPoint.x, aPoint.y, aPoint.z));
}
aGeometry->setVertexArray(aVertices);
aGeometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINE_STRIP, 0, aVertices->size()));
aGeode->addDrawable(aGeometry);
}
for (double v = v0; (v - v1) < TOLERANCE_FACE; v += d1)
{
osg::ref_ptr<osg::Geometry> aGeometry = new osg::Geometry();
osg::ref_ptr<osg::Vec3Array> aVertices = new osg::Vec3Array();
for (double u = u0; (u - u1) < TOLERANCE_FACE; u += d0)
{
ON_3dPoint aPoint = aSurface.PointAt(u, v);
aVertices->push_back(osg::Vec3(aPoint.x, aPoint.y, aPoint.z));
}
aGeometry->setVertexArray(aVertices);
aGeometry->addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::LINE_STRIP, 0, aVertices->size()));
aGeode->addDrawable(aGeometry);
}
return aGeode.release();
}