本文整理汇总了C++中ON_Interval::IsIncreasing方法的典型用法代码示例。如果您正苦于以下问题:C++ ON_Interval::IsIncreasing方法的具体用法?C++ ON_Interval::IsIncreasing怎么用?C++ ON_Interval::IsIncreasing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ON_Interval
的用法示例。
在下文中一共展示了ON_Interval::IsIncreasing方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetSpanVector
ON_BOOL32 ON_PlaneSurface::GetSpanVector( int dir, double* s ) const
{
ON_Interval d = Domain(dir);
s[0] = d.Min();
s[1] = d.Max();
return d.IsIncreasing();
}
示例2: GetDomain
ON_BOOL32 ON_Surface::GetDomain( int dir, double* t0, double* t1 ) const
{
ON_Interval d = Domain(dir);
if ( t0 ) *t0 = d[0];
if ( t1 ) *t1 = d[1];
return d.IsIncreasing();
}
示例3: SetDomain
bool ON_Surface::SetDomain( int dir, ON_Interval domain )
{
return ( dir >= 0
&& dir <= 1
&& domain.IsIncreasing()
&& SetDomain( dir, domain[0], domain[1] )) ? true : false;
}
示例4: 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;
}
示例5: SetProxyCurveDomain
bool ON_CurveProxy::SetProxyCurveDomain( ON_Interval proxy_curve_subdomain )
{
bool rc = proxy_curve_subdomain.IsIncreasing();
if ( rc )
{
if ( m_real_curve )
{
ON_Interval cdom = m_real_curve->Domain();
cdom.Intersection( proxy_curve_subdomain );
rc = cdom.IsIncreasing();
if (rc )
m_real_curve_domain = cdom;
}
else
{
m_real_curve_domain = proxy_curve_subdomain;
}
}
return rc;
}
示例6: Domain
ON_BOOL32
ON_Surface::IsClosed(int dir) const
{
ON_Interval d = Domain(dir);
if ( d.IsIncreasing() && Dimension() <= 3 ) {
const int span_count = SpanCount(dir?0:1);
const int span_degree = Degree(dir?0:1);
if ( span_count > 0 && span_degree > 0 )
{
ON_SimpleArray<double> s(span_count+1);
s.SetCount(span_count+1);
int n = 2*span_degree+1;
double delta = 1.0/n;
ON_3dPoint P, Q;
P.Zero();
Q.Zero();
int hintP[2] = {0,0};
int hintQ[2] = {0,0};
double *u0, *u1, *v0, *v1;
double t;
ON_Interval sp;
if ( dir ) {
v0 = &d.m_t[0];
v1 = &d.m_t[1];
u0 = &t;
u1 = &t;
}
else {
u0 = &d.m_t[0];
u1 = &d.m_t[1];
v0 = &t;
v1 = &t;
}
if ( GetSpanVector( dir?0:1, s.Array() ) )
{
int span_index, i;
for ( span_index = 0; span_index < span_count; span_index++ ) {
sp.Set(s[span_index],s[span_index+1]);
for ( i = 0; i < n; i++ ) {
t = sp.ParameterAt(i*delta);
if ( !Evaluate( *u0, *v0, 1, 3, P, 0, hintP ) )
return false;
if ( !Evaluate( *u1, *v1, 2, 3, Q, 0, hintQ ) )
return false;
if ( false == ON_PointsAreCoincident( 3, 0, &P.x, &Q.x ) )
return false;
}
}
return true;
}
}
}
return false;
}
示例7: SetExtents
bool ON_PlaneSurface::SetExtents(
int dir,
ON_Interval extents,
bool bSyncDomain
)
{
if ( dir < 0 || dir > 1 || !extents.IsIncreasing() )
return false;
m_extents[dir] = extents;
if ( bSyncDomain )
m_domain[dir] = m_extents[dir];
return true;
}
示例8: GetParameterTolerance
ON_BOOL32 ON_Surface::GetParameterTolerance( // returns tminus < tplus: parameters tminus <= s <= tplus
int dir,
double t, // t = parameter in domain
double* tminus, // tminus
double* tplus // tplus
) const
{
ON_BOOL32 rc = false;
ON_Interval d = Domain( dir );
if ( d.IsIncreasing() )
rc = ON_GetParameterTolerance( d.Min(), d.Max(), t, tminus, tplus );
return rc;
}
示例9: Trim
ON_BOOL32 ON_LineCurve::Trim( const ON_Interval& domain )
{
ON_BOOL32 rc = false;
if ( domain.IsIncreasing() )
{
ON_3dPoint p = PointAt( domain[0] );
ON_3dPoint q = PointAt( domain[1] );
if( p.DistanceTo(q)>0){ // 2 April 2003 Greg Arden A successfull trim
// should return an IsValid ON_LineCurve .
m_line.from = p;
m_line.to = q;
m_t = domain;
rc = true;
}
}
return rc;
}
示例10: Trim
ON_BOOL32 ON_ArcCurve::Trim( const ON_Interval& in )
{
ON_BOOL32 rc = in.IsIncreasing();
if (rc)
{
double t0 = m_t.NormalizedParameterAt(in.m_t[0]);
double t1 = m_t.NormalizedParameterAt(in.m_t[1]);
const ON_Interval arc_angle0 = m_arc.DomainRadians();
double a0 = arc_angle0.ParameterAt(t0);
double a1 = arc_angle0.ParameterAt(t1);
// Resulting ON_Arc must pass IsValid()
if ( a1 - a0 > ON_ZERO_TOLERANCE && m_arc.SetAngleIntervalRadians(ON_Interval(a0,a1)) )
{
m_t = in;
}
else
{
rc = false;
}
}
return rc;
}
示例11: IsIsoparametric
ON_Surface::ISO
ON_Surface::IsIsoparametric( const ON_Curve& curve, const ON_Interval* subdomain ) const
{
ISO iso = not_iso;
if ( subdomain )
{
ON_Interval cdom = curve.Domain();
double t0 = cdom.NormalizedParameterAt(subdomain->Min());
double t1 = cdom.NormalizedParameterAt(subdomain->Max());
if ( t0 < t1-ON_SQRT_EPSILON )
{
if ( (t0 > ON_SQRT_EPSILON && t0 < 1.0-ON_SQRT_EPSILON) || (t1 > ON_SQRT_EPSILON && t1 < 1.0-ON_SQRT_EPSILON) )
{
cdom.Intersection(*subdomain);
if ( cdom.IsIncreasing() )
{
ON_NurbsCurve nurbs_curve;
if ( curve.GetNurbForm( nurbs_curve, 0.0,&cdom) )
{
return IsIsoparametric( nurbs_curve, 0 );
}
}
}
}
}
ON_BoundingBox bbox;
double tolerance = 0.0;
const int dim = curve.Dimension();
if ( (dim == 2 || dim==3) && curve.GetBoundingBox(bbox) )
{
iso = IsIsoparametric( bbox );
switch (iso) {
case x_iso:
case W_iso:
case E_iso:
// make sure curve is a (nearly) vertical line
// and weed out vertical scribbles
tolerance = bbox.m_max.x - bbox.m_min.x;
if ( tolerance < ON_ZERO_TOLERANCE && ON_ZERO_TOLERANCE*1024.0 <= (bbox.m_max.y-bbox.m_min.y) )
{
// 26 March 2007 Dale Lear
// If tolerance is tiny, then use ON_ZERO_TOLERANCE
// This fixes cases where iso curves where not getting
// the correct flag because tol=1e-16 and the closest
// point to line had calculation errors of 1e-15.
tolerance = ON_ZERO_TOLERANCE;
}
if ( !curve.IsLinear( tolerance ) )
iso = not_iso;
break;
case y_iso:
case S_iso:
case N_iso:
// make sure curve is a (nearly) horizontal line
// and weed out horizontal scribbles
tolerance = bbox.m_max.y - bbox.m_min.y;
if ( tolerance < ON_ZERO_TOLERANCE && ON_ZERO_TOLERANCE*1024.0 <= (bbox.m_max.x-bbox.m_min.x) )
{
// 26 March 2007 Dale Lear
// If tolerance is tiny, then use ON_ZERO_TOLERANCE
// This fixes cases where iso curves where not getting
// the correct flag because tol=1e-16 and the closest
// point to line had calculation errors of 1e-15.
tolerance = ON_ZERO_TOLERANCE;
}
if ( !curve.IsLinear( tolerance ) )
iso = not_iso;
break;
default:
// nothing here
break;
}
}
return iso;
}
示例12: SplitEdgeAtParameters
int ON_Brep::SplitEdgeAtParameters(
int edge_index,
int edge_t_count,
const double* edge_t
)
{
// Default kink_tol_radians MUST BE ON_PI/180.0.
//
// The default kink tol must be kept in sync with the default for
// TL_Brep::SplitKinkyFace() and ON_Brep::SplitKinkyFace().
// See comments in TL_Brep::SplitKinkyFace() for more details.
if (0 == edge_t_count)
return 0;
if (0 == edge_t)
return 0;
if (edge_index < 0 || edge_index >= m_E.Count())
return 0;
ON_BrepEdge& E = m_E[edge_index];
if (E.m_c3i < 0)
return 0;
ON_Curve* curve = m_C3[E.m_c3i];
if (!curve)
return 0;
ON_Interval Edomain;
if ( !E.GetDomain(&Edomain.m_t[0],&Edomain.m_t[1]) )
return 0;
if ( !Edomain.IsIncreasing() )
return 0;
// get a list of unique and valid splitting parameters
ON_SimpleArray<double> split_t(edge_t_count);
{
for (int i = 0; i < edge_t_count; i++)
{
double e = edge_t[i];
if ( !ON_IsValid(e) )
{
ON_ERROR("Invalid edge_t[] value");
continue;
}
if ( e <= Edomain.m_t[0] )
{
ON_ERROR("edge_t[] <= start of edge domain");
continue;
}
if ( e >= Edomain.m_t[1] )
{
ON_ERROR("edge_t[] >= end of edge domain");
continue;
}
split_t.Append(e);
}
if ( split_t.Count() > 1 )
{
// sort split_t[] and remove duplicates
ON_SortDoubleArray( ON::heap_sort, split_t.Array(), split_t.Count() );
int count = 1;
for ( int i = 1; i < split_t.Count(); i++ )
{
if ( split_t[i] > split_t[count-1] )
{
if ( i > count )
split_t[count] = split_t[i];
count++;
}
}
split_t.SetCount(count);
}
}
if (split_t.Count() <= 0)
return 0;
// Reverse split_t[] so the starting segment of the original
// edge m_E[edge_index] is the one at m_E[edge_index].
split_t.Reverse();
ON_Curve* new_curve = TuneupSplitteeHelper(m_E[edge_index].ProxyCurve());
if ( 0 != new_curve )
{
m_E[edge_index].m_c3i = AddEdgeCurve(new_curve);
m_E[edge_index].SetProxyCurve(new_curve);
new_curve = 0;
}
int eti, ti;
int successful_split_count = 0;
for (int i=0; i<split_t.Count(); i++)
{
double t0, t1;
m_E[edge_index].GetDomain(&t0, &t1);
if (t1 - t0 < 10.0*ON_ZERO_TOLERANCE)
break;
//6 Dec 2002 Dale Lear:
// I added the relative edge_split_s and trm_split_s tests to detect
// attempts to trim a nano-gnats-wisker off the end of a trim.
double edge_split_s = ON_Interval(t0,t1).NormalizedParameterAt(split_t[i]);
//.........这里部分代码省略.........