本文整理汇总了C++中ON_NurbsSurface::IsClosed方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_NurbsSurface::IsClosed方法的具体用法?C++ ON_NurbsSurface::IsClosed怎么用?C++ ON_NurbsSurface::IsClosed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_NurbsSurface
的用法示例。
在下文中一共展示了ON_NurbsSurface::IsClosed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
std::vector<double>
FittingCylinder::getElementVector (const ON_NurbsSurface &nurbs, int dim) // !
{
std::vector<double> result;
if (dim == 0)
{
int idx_min = 0;
int idx_max = nurbs.KnotCount (0) - 1;
if (nurbs.IsClosed (0))
{
idx_min = nurbs.Order (0) - 2;
idx_max = nurbs.KnotCount (0) - nurbs.Order (0) + 1;
}
const double* knotsU = nurbs.Knot (0);
result.push_back (knotsU[idx_min]);
//for(int E=(m_nurbs.m_order[0]-2); E<(m_nurbs.m_knot_capacity[0]-m_nurbs.m_order[0]+2); E++) {
for (int E = idx_min + 1; E <= idx_max; E++)
{
if (knotsU[E] != knotsU[E - 1]) // do not count double knots
result.push_back (knotsU[E]);
}
}
else if (dim == 1)
{
int idx_min = 0;
int idx_max = nurbs.KnotCount (1) - 1;
if (nurbs.IsClosed (1))
{
idx_min = nurbs.Order (1) - 2;
idx_max = nurbs.KnotCount (1) - nurbs.Order (1) + 1;
}
const double* knotsV = nurbs.Knot (1);
result.push_back (knotsV[idx_min]);
//for(int F=(m_nurbs.m_order[1]-2); F<(m_nurbs.m_knot_capacity[1]-m_nurbs.m_order[1]+2); F++) {
for (int F = idx_min + 1; F <= idx_max; F++)
{
if (knotsV[F] != knotsV[F - 1])
result.push_back (knotsV[F]);
}
}
else
printf ("[FittingCylinder::getElementVector] Error, index exceeds problem dimensions!\n");
return result;
}
示例2:
std::vector<double>
FittingSurface::getElementVector (const ON_NurbsSurface &nurbs, int dim) // !
{
std::vector<double> result;
int idx_min = 0;
int idx_max = nurbs.KnotCount (dim) - 1;
if (nurbs.IsClosed (dim))
{
idx_min = nurbs.Order (dim) - 2;
idx_max = nurbs.KnotCount (dim) - nurbs.Order (dim) + 1;
}
const double* knots = nurbs.Knot (dim);
result.push_back (knots[idx_min]);
//for(int E=(m_nurbs.Order(0)-2); E<(m_nurbs.KnotCount(0)-m_nurbs.Order(0)+2); E++) {
for (int E = idx_min + 1; E <= idx_max; E++)
{
if (!NEAR_EQUAL(knots[E], knots[E - 1], SMALL_FASTF)) // do not count double knots
result.push_back (knots[E]);
}
return result;
}