CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
OdGeInterval Class Reference

#include <GeInterval.h>

Public Member Functions

 OdGeInterval (double tol=1.e-12)
 
 OdGeInterval (double lower, double upper, double tol=1.e-12)
 
 OdGeInterval (bool boundedBelow, double bound, double tol=1.e-12)
 
double lowerBound () const
 
double upperBound () const
 
double middle () const
 
double element () const
 
void getBounds (double &lower, double &upper) const
 
double getEnd (int index) const
 
double length () const
 
double tolerance () const
 
double eval (double ratio) const
 
OdGeIntervalset (double lower, double upper)
 
OdGeIntervalset (bool boundedBelow, double bound)
 
OdGeIntervalset ()
 
OdGeIntervalsetUpper (double upper)
 
OdGeIntervalsetLower (double lower)
 
OdGeIntervalsetTolerance (double tol)
 
OdGeIntervalscale (double factor)
 
OdGeIntervalswap ()
 
void getMerge (const OdGeInterval &otherInterval, OdGeInterval &result) const
 
int subtract (const OdGeInterval &otherInterval, OdGeInterval &lInterval, OdGeInterval &rInterval) const
 
bool intersectWith (const OdGeInterval &otherInterval, OdGeInterval &result) const
 
bool finiteIntersectWith (const OdGeInterval &range, OdGeInterval &result) const
 
bool isBounded () const
 
bool isBoundedAbove () const
 
bool isBoundedBelow () const
 
bool isUnBounded () const
 
bool isSingleton () const
 
bool isDisjoint (const OdGeInterval &otherInterval) const
 
bool contains (const OdGeInterval &otherInterval) const
 
bool contains (double value) const
 
double clamp (double value) const
 
bool isContinuousAtUpper (const OdGeInterval &otherInterval) const
 
bool isOverlapAtUpper (const OdGeInterval &otherInterval, OdGeInterval &overlap) const
 
bool operator== (const OdGeInterval &otherInterval) const
 
bool operator!= (const OdGeInterval &otherInterval) const
 
bool isEqualAtUpper (const OdGeInterval &otherInterval) const
 
bool isEqualAtUpper (double value) const
 
bool isEqualAtLower (const OdGeInterval &otherInterval) const
 
bool isEqualAtLower (double value) const
 
bool isPeriodicallyOn (double period, double &value)
 
bool operator> (double value) const
 
bool operator> (const OdGeInterval &otherInterval) const
 
bool operator>= (double value) const
 
bool operator>= (const OdGeInterval &otherInterval) const
 
bool operator< (double value) const
 
bool operator< (const OdGeInterval &otherInterval) const
 
bool operator<= (double value) const
 
bool operator<= (const OdGeInterval &otherInterval) const
 

Friends

bool operator> (double value, const OdGeInterval &interval)
 
bool operator>= (double value, const OdGeInterval &interval)
 
bool operator< (double value, const OdGeInterval &interval)
 
bool operator<= (double value, const OdGeInterval &interval)
 

Detailed Description

This class represents a finite, infinite, or semi-infinite interval as the real axis.

Corresponding C++ library: TD_Ge

<group OdGe_Classes>

Definition at line 39 of file GeInterval.h.

Constructor & Destructor Documentation

◆ OdGeInterval() [1/3]

OdGeInterval::OdGeInterval ( double tol = 1.e-12)
inline

Constructor for the OdGeInterval class. Creates an unbounded interval with the specified tolerance.

Parameters
tol[in] Boundary tolerance.

Definition at line 47 of file GeInterval.h.

◆ OdGeInterval() [2/3]

OdGeInterval::OdGeInterval ( double lower,
double upper,
double tol = 1.e-12 )
inline

Constructor for the OdGeInterval class.

Parameters
lower[in] Lower bound.
upper[in] Upper bound.
tol[in] Boundary tolerance.

Definition at line 63 of file GeInterval.h.

◆ OdGeInterval() [3/3]

OdGeInterval::OdGeInterval ( bool boundedBelow,
double bound,
double tol = 1.e-12 )

Constructor for the OdGeInterval class.

Parameters
boundedBelow[in] Determines if the interval is bounded below.
bound[in] Upper or lower bound.
tol[in] Boundary tolerance. If boundedBelow is true, the constructor sets the lower bound also to bound; otherwise the interval remains unbounded below.

Member Function Documentation

◆ clamp()

double OdGeInterval::clamp ( double value) const
inline

Corrects the parameter so that it belongs to the interval. If parameter is already within interval, then it is returned as is. Otherwise parameter is moved to closest of endpoints.

Parameters
value[in] The parameter to be corrected.

Definition at line 438 of file GeInterval.h.

◆ contains() [1/2]

bool OdGeInterval::contains ( const OdGeInterval & otherInterval) const

Checks whether this interval contains the specified interval within tolerance().

Parameters
otherInterval[in] The interval to be tested.
Returns
true if and only if this interval contains the specified interval.

◆ contains() [2/2]

bool OdGeInterval::contains ( double value) const
inline

Checks whether this interval contains the specified value within tolerance().

Parameters
value[in] The value to be tested.
Returns
true if and only if this interval contains the specified value.

Definition at line 424 of file GeInterval.h.

◆ element()

double OdGeInterval::element ( ) const

Returns a point on this interval.

Remarks
Above Bounded Below Returns Yes — Upper Bound No Yes Lower Bound No No 0.0

◆ eval()

double OdGeInterval::eval ( double ratio) const
inline

Returns parameter L + (R-L) * t for given ratio t. Note: if the interval is unbounded, behavior is undefined!

Parameters
ratio[in] Arbitrary number

Definition at line 182 of file GeInterval.h.

◆ finiteIntersectWith()

bool OdGeInterval::finiteIntersectWith ( const OdGeInterval & range,
OdGeInterval & result ) const

Find finite sub-interval belonging both to the specified range and this one

Parameters
range[in] The interval to be intersected.
result[out] Receives the intersected interval.
Returns
true if and only if the specified interval intersects with this one, and the resulting interval is bounded.

◆ getBounds()

void OdGeInterval::getBounds ( double & lower,
double & upper ) const
inline

Returns the bounds of this interval.

Parameters
lower[out] Receives the Lower bound.
upper[out] Receives the Upper bound.

Definition at line 137 of file GeInterval.h.

◆ getEnd()

double OdGeInterval::getEnd ( int index) const
inline

Returns the parameter of interval's end.

Parameters
indexMust be 0 (interval start) or 1 (interval end), otherwise behavior is undefined.

Definition at line 150 of file GeInterval.h.

◆ getMerge()

void OdGeInterval::getMerge ( const OdGeInterval & otherInterval,
OdGeInterval & result ) const

Returns the smallest interval containing both the specified interval and this interval.

Parameters
otherInterval[in] The interval to be merged with this one.
result[out] Receives the merged interval.

◆ intersectWith()

bool OdGeInterval::intersectWith ( const OdGeInterval & otherInterval,
OdGeInterval & result ) const

Intersects the specified interval from this one.

Parameters
otherInterval[in] The interval to be intersected.
result[out] Receives the intersected interval.
Returns
true if and only if this specified interval intersects with this one.

◆ isBounded()

bool OdGeInterval::isBounded ( ) const
inline

Returns true if and only if this interval is bounded above and below.

Definition at line 359 of file GeInterval.h.

◆ isBoundedAbove()

bool OdGeInterval::isBoundedAbove ( ) const
inline

Returns true if and only if this interval is bounded above.

Definition at line 367 of file GeInterval.h.

◆ isBoundedBelow()

bool OdGeInterval::isBoundedBelow ( ) const
inline

Returns true if and only if this interval is bounded below.

Definition at line 375 of file GeInterval.h.

◆ isContinuousAtUpper()

bool OdGeInterval::isContinuousAtUpper ( const OdGeInterval & otherInterval) const

Returns true if and only if the specified Interval is continuous with the upper bound of this Interval.

Remarks
Returns true if and only if this Interval is bounded above, otherInterval is bounded below, and the upper bound of this Interval is equal to the lower bound of otherInterval within tolerance().
Parameters
otherInterval[in] The Interval to be tested.

◆ isDisjoint()

bool OdGeInterval::isDisjoint ( const OdGeInterval & otherInterval) const

Returns true if and only if the specified interval is disjoint from this interval.

Remarks
Returns true if and only if this interval does not intersect otherInterval within tolerance().
Parameters
otherInterval[in] The interval to be tested.

◆ isEqualAtLower() [1/2]

bool OdGeInterval::isEqualAtLower ( const OdGeInterval & otherInterval) const

Returns true if and only if lower bounds of the specified Interval and this Interval are equal.

Remarks
Returns true if and only if
  1. Both this Interval and otherInterval are unbounded below or bounded below with their lower bounds equal within tolerance.
Parameters
otherInterval[in] The Interval to be tested.

◆ isEqualAtLower() [2/2]

bool OdGeInterval::isEqualAtLower ( double value) const

Returns true if and only if lower bounds of the specified Interval and this Interval are equal.

Remarks
Returns true if and only if
  1. This Interval is bounded below, and the lower bound is equal to value within tolerance.
Parameters
value[in] The value to be tested.

◆ isEqualAtUpper() [1/2]

bool OdGeInterval::isEqualAtUpper ( const OdGeInterval & otherInterval) const

Returns true if and only if upper bounds of the specified Interval and this Interval are equal.

Remarks

Returns true if and only if

  1. Both this Interval and otherInterval are unbounded above or bounded above with their upper bounds equal within tolerance().
Parameters
otherInterval[in] The Interval to be tested.

◆ isEqualAtUpper() [2/2]

bool OdGeInterval::isEqualAtUpper ( double value) const

Returns true if and only if upper bounds of the specified Interval and this Interval are equal.

Remarks

Returns true if and only if

  1. This Interval is bounded above, and the upper bound is equal to value within tolerance().
Parameters
value[in] The value to be tested.

◆ isOverlapAtUpper()

bool OdGeInterval::isOverlapAtUpper ( const OdGeInterval & otherInterval,
OdGeInterval & overlap ) const

Returns true if and only if the specified Interval and this Interval overlap at the upper bound of this Interval.

Remarks
Returns true if and only if
  1. This Interval is bounded above, otherInterval is bounded below.
  2. Neither Interval is a singleton.
  3. The Intervals Intersect.
  4. otherInterval does not contain this one.
  5. The upper bound of this Interval is contained in otherInterval.
  6. The lower bound of otherInterval is contained within this one.

If all these conditions are met, this function returns the intersection of the Intervals.

Parameters
otherInterval[in] The Interval to be tested.
overlap[out] Receives the overlap of the Intervals.

◆ isPeriodicallyOn()

bool OdGeInterval::isPeriodicallyOn ( double period,
double & value )

Checks whether the specified value is periodically on this interval.

Parameters
period[in] Period.
value[in/out] Value.
Returns
true if and only if there is a positive integer N such that
    <pre>
    value + N * period
    </pre>

is on this interval. If so, returns that value.

◆ isSingleton()

bool OdGeInterval::isSingleton ( ) const

Returns true if and only if this interval object is a singleton.

Remarks
Returns true if and only if this interval is bounded, and the upper and lower bounds are equal within tolerance().

◆ isUnBounded()

bool OdGeInterval::isUnBounded ( ) const
inline

Returns true if and only if this interval is unbounded above or below.

Definition at line 383 of file GeInterval.h.

◆ length()

double OdGeInterval::length ( ) const
inline

Returns the length of this interval.

Returns
-1.0 if this interval is unbounded above or below.

Definition at line 163 of file GeInterval.h.

◆ lowerBound()

double OdGeInterval::lowerBound ( ) const
inline

Returns the lower bound of this interval.

Remarks
This value is meaningful if and only if the interval has a lower bound.

Definition at line 91 of file GeInterval.h.

◆ middle()

double OdGeInterval::middle ( ) const
inline

Returns the center point of this interval.

Remarks
This value is meaningful if and only if the interval has both lower and upper bounds.

Definition at line 113 of file GeInterval.h.

◆ operator!=()

bool OdGeInterval::operator!= ( const OdGeInterval & otherInterval) const

Comparison operator for the OdGeInterval object.

Parameters
otherInterval[in] Other interval.
Returns
A boolean value that indicates whether the input interval is not identical to this interval.

◆ operator<() [1/2]

bool OdGeInterval::operator< ( const OdGeInterval & otherInterval) const

◆ operator<() [2/2]

bool OdGeInterval::operator< ( double value) const

◆ operator<=() [1/2]

bool OdGeInterval::operator<= ( const OdGeInterval & otherInterval) const

◆ operator<=() [2/2]

bool OdGeInterval::operator<= ( double value) const

◆ operator==()

bool OdGeInterval::operator== ( const OdGeInterval & otherInterval) const

Comparison operator for the OdGeInterval object.

Parameters
otherInterval[in] Other interval.
Returns
A boolean value that indicates whether the input interval is identical to this interval.

◆ operator>() [1/2]

bool OdGeInterval::operator> ( const OdGeInterval & otherInterval) const

◆ operator>() [2/2]

bool OdGeInterval::operator> ( double value) const

◆ operator>=() [1/2]

bool OdGeInterval::operator>= ( const OdGeInterval & otherInterval) const

◆ operator>=() [2/2]

bool OdGeInterval::operator>= ( double value) const

◆ scale()

OdGeInterval & OdGeInterval::scale ( double factor)

Scales the parameters of this interval by the provided scale factor.

Parameters
factor[in] Scale factor.
Returns
Reference to this interval.
Remarks
On negative scale factor the ends of the interval will not be swapped.

◆ set() [1/3]

OdGeInterval & OdGeInterval::set ( )
inline

Unbounds this interval.

Returns
Reference to this interval.

Definition at line 226 of file GeInterval.h.

◆ set() [2/3]

OdGeInterval & OdGeInterval::set ( bool boundedBelow,
double bound )

Sets the parameters for this interval according to the arguments.

Parameters
boundedBelow[in] Determines if bound specifies a lower or an upper bound.
bound[in] Specifies a lower bound if boundedBelow is true, or an upper bound if it is false.
Returns
Reference to this interval.

◆ set() [3/3]

OdGeInterval & OdGeInterval::set ( double lower,
double upper )
inline

Sets the parameters for this interval according to the arguments.

Parameters
lower[in] Lower bound.
upper[in] Upper bound.
Returns
Reference to this interval.

Definition at line 198 of file GeInterval.h.

◆ setLower()

OdGeInterval & OdGeInterval::setLower ( double lower)
inline

Sets the lower bound for this interval.

Parameters
lower[in] Lower bound.
Returns
Reference to this interval.

Definition at line 254 of file GeInterval.h.

◆ setTolerance()

OdGeInterval & OdGeInterval::setTolerance ( double tol)
inline

Sets the boundary tolerance for this interval.

Parameters
tol[in] Boundary tolerance.
Returns
Reference to this interval.

Definition at line 270 of file GeInterval.h.

◆ setUpper()

OdGeInterval & OdGeInterval::setUpper ( double upper)
inline

Sets the upper bound for this interval.

Parameters
upper[in] Upper bound.

Definition at line 239 of file GeInterval.h.

◆ subtract()

int OdGeInterval::subtract ( const OdGeInterval & otherInterval,
OdGeInterval & lInterval,
OdGeInterval & rInterval ) const

Subtracts the specified interval from this interval.

Parameters
otherInterval[in] The interval to be subtracted from this one.
lInterval[out] Receives the Left (or only) interval.
rInterval[out] Receives the right interval.
Returns
Number of intervals, and the intervals, resulting from the subtraction.
Remarks
value Results 0 Empty result 1 Single interval in lInterval 2 Left in lInterval, Right in rInterval.

◆ swap()

OdGeInterval & OdGeInterval::swap ( )

Swaps the parameters of this interval.

Returns
Reference to this interval.

◆ tolerance()

double OdGeInterval::tolerance ( ) const
inline

Returns the boundary tolerance for this interval.

Definition at line 171 of file GeInterval.h.

◆ upperBound()

double OdGeInterval::upperBound ( ) const
inline

Returns the upper bound of this interval.

Remarks
This value is meaningful if and only if the interval has an upper bound.

Definition at line 102 of file GeInterval.h.

Friends And Related Symbol Documentation

◆ operator<

bool operator< ( double value,
const OdGeInterval & interval )
friend

◆ operator<=

bool operator<= ( double value,
const OdGeInterval & interval )
friend

◆ operator>

bool operator> ( double value,
const OdGeInterval & interval )
friend

◆ operator>=

bool operator>= ( double value,
const OdGeInterval & interval )
friend

The documentation for this class was generated from the following file: