本文整理汇总了C++中ON_Interval::Length方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_Interval::Length方法的具体用法?C++ ON_Interval::Length怎么用?C++ ON_Interval::Length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_Interval
的用法示例。
在下文中一共展示了ON_Interval::Length方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetAngleIntervalRadians
bool ON_Arc::SetAngleIntervalRadians( ON_Interval angle_in_radians )
{
bool rc = angle_in_radians.IsIncreasing()
&& angle_in_radians.Length() < (1.0+ON_SQRT_EPSILON)*2.0*ON_PI;
if (rc)
{
m_angle = angle_in_radians;
}
return rc;
}
示例2: Prepend
ON_BOOL32 ON_PolyEdgeCurve::Prepend( ON_PolyEdgeSegment* new_segment )
{
DestroyRuntimeCache();
ON_BOOL32 rc = false;
if ( new_segment )
{
if ( Count() > 0 )
{
// keep segment domains in synch with polycurve domain
// so that parameter bookkeeping is easy.
ON_Interval cdom = Domain();
ON_Interval sdom = new_segment->Domain();
if ( sdom[1] != cdom[0] )
{
sdom[0] = cdom[0] - sdom.Length();
sdom[1] = cdom[0];
new_segment->SetDomain(sdom[0],sdom[1]);
}
}
rc = ON_PolyCurve::Prepend(new_segment);
}
return rc;
}
示例3: ChangeClosedCurveSeam
ON_BOOL32 ON_PolyEdgeCurve::ChangeClosedCurveSeam( double t )
{
//int saved_is_closed_helper = m_is_closed_helper;
if ( SegmentCount() == 1 )
{
// A ON_PolyEdgeSegment cannot have its start/end
// changed. Split it into two segments and let
// ON_PolyCurve::ChangeClosedCurveSeam() do the work.
if ( !IsClosed() )
return false;
ON_Interval crvd = Domain();
double s = crvd.NormalizedParameterAt(t);
if ( s <= ON_SQRT_EPSILON || s >= (1.0 - ON_SQRT_EPSILON) )
{
s = fmod(s,1.0);
if ( s < 0.0 )
s += 1.0;
if ( fabs(s) <= ON_SQRT_EPSILON || fabs(1.0-s) <= ON_SQRT_EPSILON )
{
// split parameter is at start/end of this segemnt
if ( t != crvd[0] )
{
DestroyRuntimeCache();
SetDomain(t,t+crvd.Length() );
//m_is_closed_helper = saved_is_closed_helper;
}
return true;
}
return false;
}
ON_PolyEdgeSegment* left_seg = SegmentCurve(0);
if ( 0 == left_seg )
return false;
DestroyRuntimeCache();
ON_Curve* left = left_seg;
ON_Curve* right = 0;
double segt = SegmentCurveParameter(t);
if ( !left_seg->Split(segt,left,right) )
return false;
SetDomain(crvd[0],t);
ON_PolyEdgeSegment* right_seg = ON_PolyEdgeSegment::Cast(right);
if ( 0 == right_seg )
return false;
Append(right_seg);
double st[3];
st[0] = crvd[0];
st[1] = t;
st[2] = crvd[1];
SetParameterization( st );
}
// ON_PolyCurve::ChangeClosedCurveSeam works fine on
// two or more segments.
ON_BOOL32 rc = ON_PolyCurve::ChangeClosedCurveSeam(t);
//if ( saved_is_closed_helper )
// m_is_closed_helper = saved_is_closed_helper;
return rc;
}