Rhino C++ API
8.13
|
#include <opennurbs_point.h>
Public Member Functions | |
ON_Interval () | |
The default constructor creates ON_Interval::EmptyInterval (ON_UNSET_VALUE,ON_UNSET_VALUE) More... | |
ON_Interval (const ON_Interval &)=default | |
ON_Interval (double t0, double t1) | |
~ON_Interval ()=default | |
int | Clamp (double &value) const |
double | ClampedNormalizedParameterAt (double interval_parameter) const |
Returns a clamped normalized parameter from an interval value. This interval may be increasing, decreasing, or a singleton. More... | |
double | ClampedParameterAt (double normalized_parameter) const |
Returns the interval's value at a clamped normalized parameter. This interval may be increasing, decreasing, or a singleton. More... | |
void | Destroy () |
bool | Expand (double delta) |
bool | Includes (const ON_Interval &other, bool bProperSubSet=false) const |
bool | Includes (double t, bool bTestOpenInterval=false) const |
bool | Intersection (const ON_Interval &) |
bool | Intersection (const ON_Interval &, const ON_Interval &) |
bool | IsDecreasing () const |
returns true if m_t[0] > m_t[0]; More... | |
bool | IsEmptyInterval () const |
returns true if m_t[0] == m_t[1] == ON_UNSET_VALUE More... | |
bool | IsEmptySet () const |
returns true if m_t[0] == m_t[1] == ON_UNSET_VALUE More... | |
bool | IsIncreasing () const |
returns true if m_t[0] < m_t[1] More... | |
bool | IsInterval () const |
returns truc if m_t[0] != m_t[1] More... | |
bool | IsSingleton () const |
returns true if m_t[0] == m_t[1] != ON_UNSET_VALUE More... | |
bool | IsValid () const |
returns ON_IsValid(m_t[0]) && ON_IsValid(m_t[1]) More... | |
double | Length () const |
returns signed length, m_t[1]-m_t[0] More... | |
bool | MakeIncreasing () |
returns true if resulting interval IsIncreasing() More... | |
double | Max () const |
returns larger of m_t[0] and m_t[1] More... | |
double | Mid () const |
returns 0.5*(m_t[0] + m_t[1]) More... | |
double | Min () const |
returns smaller of m_t[0] and m_t[1] More... | |
double | NormalizedParameterAt (double interval_parameter) const |
ON_Interval | NormalizedParameterAt (ON_Interval interval_parameter) const |
bool | operator!= (const ON_Interval &rhs) const |
ON_Interval & | operator= (const ON_Interval &)=default |
bool | operator== (const ON_Interval &rhs) const |
double & | operator[] (int) |
returns (index<=0) ? m_t[0] : m_t[1] More... | |
double | operator[] (int) const |
returns (index<=0) ? m_t[0] : m_t[1] More... | |
double & | operator[] (unsigned int) |
returns (index<=0) ? m_t[0] : m_t[1] More... | |
double | operator[] (unsigned int) const |
returns (index<=0) ? m_t[0] : m_t[1] More... | |
double | ParameterAt (double normalized_parameter) const |
Convert a normalized parameter to an interval value. The interval can be increasing, decreasing, or a singleton. More... | |
ON_Interval | ParameterAt (ON_Interval normalized_interval) const |
Convert a a pair of normalized parameter values to a pair of interval values. This interval can be increasing, decreasing, or a singleton. More... | |
void | Reverse () |
void | Set (double t0, double t1) |
void | Swap () |
bool | Union (const ON_Interval &) |
bool | Union (const ON_Interval &, const ON_Interval &) |
bool | Union (double t) |
bool | Union (int count, const double *t) |
Static Public Member Functions | |
static int | Compare (const ON_Interval &lhs, const ON_Interval &rhs) |
static bool | IntervalsOverlap (const ON_Interval &A, const ON_Interval &B) |
static const ON_Interval | Singleton (double t) |
Public Attributes | |
double | m_t [2] |
Interval = (m_t[0], m_t[1]) More... | |
Static Public Attributes | |
static const ON_Interval | EmptyInterval |
(ON_UNSET_VALUE,ON_UNSET_VALUE) More... | |
static const ON_Interval | Nan |
(ON_DBL_QNAN,ON_DBL_QNAN) More... | |
static const ON_Interval | ZeroToOne |
(0.0, 1.0) More... | |
static const ON_Interval | ZeroToTwoPi |
(0.0, 2.0*ON_PI) More... | |
ON_Interval::ON_Interval | ( | ) |
The default constructor creates ON_Interval::EmptyInterval (ON_UNSET_VALUE,ON_UNSET_VALUE)
|
default |
|
default |
ON_Interval::ON_Interval | ( | double | t0, |
double | t1 | ||
) |
int ON_Interval::Clamp | ( | double & | value | ) | const |
double ON_Interval::ClampedNormalizedParameterAt | ( | double | interval_parameter | ) | const |
Returns a clamped normalized parameter from an interval value. This interval may be increasing, decreasing, or a singleton.
interval_parameter | interval_parameter may have any value but it is clamped to be in the interval before the normalized parameter is evaluated. |
double ON_Interval::ClampedParameterAt | ( | double | normalized_parameter | ) | const |
Returns the interval's value at a clamped normalized parameter. This interval may be increasing, decreasing, or a singleton.
normalized_parameter | normalized_parameter may have any value but it is clamped to be between 0 and 1 before the corresponding interval value is evaluated. |
|
static |
Description: A well ordered dictionary compare function that is nan aware and can be used for robust sorting.
void ON_Interval::Destroy | ( | ) |
bool ON_Interval::Expand | ( | double | delta | ) |
Expand the interval by adding delta to m_t[1] and subtracting it from m_t[0]. So, when delta is positive and the interval is increasing this function expands the interval on each side. returns true if the result is increasing.
bool ON_Interval::Includes | ( | const ON_Interval & | other, |
bool | bProperSubSet = false |
||
) | const |
Description: Test an interval to see if it is contained in this interval. Parameters: other - [in] interval to test bProperSubSet - [in] if true, then the test is for a proper subinterval. Returns: If bProperSubSet is false, then the result is true when this->Min() <= other.Min() and other.Max() <= this->Max(). If bProperSubSet is true, then the result is true when this->Min() <= other.Min() and other.Max() <= this->Max() and at least one of the inequalities is strict.
bool ON_Interval::Includes | ( | double | t, |
bool | bTestOpenInterval = false |
||
) | const |
Description: Test a value t to see if it is inside the interval. Parameters: t - [in] value to test bTestOpenInterval - [in] If false, t is tested to see if it satisfies min <= t <= max. If true, t is tested to see if it satisfies min < t < max. Returns: true if t is in the interval and false if t is not in the interval.
bool ON_Interval::Intersection | ( | const ON_Interval & | ) |
If the intersection is not empty, then intersection = [max(this.Min(),arg.Min()), min(this.Max(),arg.Max())] Intersection() returns true if the intersection is not empty. The interval [ON_UNSET_VALUE,ON_UNSET_VALUE] is considered to be the empty set interval. The result of any intersection involving an empty set interval or disjoint intervals is the empty set interval.
bool ON_Interval::Intersection | ( | const ON_Interval & | , |
const ON_Interval & | |||
) |
If the intersection is not empty, then intersection = [max(argA.Min(),argB.Min()), min(argA.Max(),argB.Max())] Intersection() returns true if the intersection is not empty. The interval [ON_UNSET_VALUE,ON_UNSET_VALUE] is considered to be the empty set interval. The result of any intersection involving an empty set interval or disjoint intervals is the empty set interval.
|
static |
Description: Test a pair of interval to see if they have a non-empty intersection. Parameters: A - [in] interval to test B - [in] interval to test Returns: true if the intersection is non-empty, including if the intersection is a single point. false otherwise.
bool ON_Interval::IsDecreasing | ( | ) | const |
returns true if m_t[0] > m_t[0];
bool ON_Interval::IsEmptyInterval | ( | ) | const |
returns true if m_t[0] == m_t[1] == ON_UNSET_VALUE
bool ON_Interval::IsEmptySet | ( | ) | const |
returns true if m_t[0] == m_t[1] == ON_UNSET_VALUE
bool ON_Interval::IsIncreasing | ( | ) | const |
returns true if m_t[0] < m_t[1]
bool ON_Interval::IsInterval | ( | ) | const |
returns truc if m_t[0] != m_t[1]
bool ON_Interval::IsSingleton | ( | ) | const |
returns true if m_t[0] == m_t[1] != ON_UNSET_VALUE
bool ON_Interval::IsValid | ( | ) | const |
returns ON_IsValid(m_t[0]) && ON_IsValid(m_t[1])
double ON_Interval::Length | ( | ) | const |
returns signed length, m_t[1]-m_t[0]
bool ON_Interval::MakeIncreasing | ( | ) |
returns true if resulting interval IsIncreasing()
double ON_Interval::Max | ( | ) | const |
returns larger of m_t[0] and m_t[1]
double ON_Interval::Mid | ( | ) | const |
returns 0.5*(m_t[0] + m_t[1])
double ON_Interval::Min | ( | ) | const |
returns smaller of m_t[0] and m_t[1]
double ON_Interval::NormalizedParameterAt | ( | double | interval_parameter | ) | const |
Description: Convert interval value, or pair of values, to normalized parameter. Parameters: interval_parameter - [in] value in interval Returns: Normalized parameter x so that min*(1.0-x) + max*x = interval_parameter. See Also: ON_Interval::ParameterAt
ON_Interval ON_Interval::NormalizedParameterAt | ( | ON_Interval | interval_parameter | ) | const |
bool ON_Interval::operator!= | ( | const ON_Interval & | rhs | ) | const |
Returns: True if (lhs.m_t[0] != rhs.m_t[0]) or (lhs.m_t[1] != rhs.m_t[1]) and no values are nans.
|
default |
bool ON_Interval::operator== | ( | const ON_Interval & | rhs | ) | const |
Returns: True if (lhs.m_t[0] == rhs.m_t[0]) and (lhs.m_t[1] === rhs.m_t[1]).
double& ON_Interval::operator[] | ( | int | ) |
returns (index<=0) ? m_t[0] : m_t[1]
double ON_Interval::operator[] | ( | int | ) | const |
returns (index<=0) ? m_t[0] : m_t[1]
double& ON_Interval::operator[] | ( | unsigned int | ) |
returns (index<=0) ? m_t[0] : m_t[1]
double ON_Interval::operator[] | ( | unsigned int | ) | const |
returns (index<=0) ? m_t[0] : m_t[1]
double ON_Interval::ParameterAt | ( | double | normalized_parameter | ) | const |
Convert a normalized parameter to an interval value. The interval can be increasing, decreasing, or a singleton.
normalized_parameter | The normalized parameter can have any value. |
ON_Interval ON_Interval::ParameterAt | ( | ON_Interval | normalized_interval | ) | const |
Convert a a pair of normalized parameter values to a pair of interval values. This interval can be increasing, decreasing, or a singleton.
normalized_interval | The normalized parameters can have any value. |
void ON_Interval::Reverse | ( | ) |
Description: Changes interval to [-m_t[1],-m_t[0]].
void ON_Interval::Set | ( | double | t0, |
double | t1 | ||
) |
Description: Sets interval to [t0,t1] Parameters: t0 - [in] t1 - [in] See Also: ON_Interval::ON_Interval( double, double )
|
static |
Returns: ON_Interval(t,t).
void ON_Interval::Swap | ( | ) |
Description: Swaps m_t[0] and m_t[1].
bool ON_Interval::Union | ( | const ON_Interval & | ) |
The union of an empty set and an increasing interval is the increasing interval. The union of two empty sets is empty. The union of an empty set an a non-empty interval is the non-empty interval. The union of two non-empty intervals is union = [min(this.Min(),arg.Min()), max(this.Max(),arg.Max()),] Union() returns true if the union is not empty.
bool ON_Interval::Union | ( | const ON_Interval & | , |
const ON_Interval & | |||
) |
The union of an empty set and an increasing interval is the increasing interval. The union of two empty sets is empty. The union of an empty set an a non-empty interval is the non-empty interval. The union of two non-empty intervals is union = [min(argA.Min(),argB.Min()), max(argA.Max(),argB.Max()),] Union() returns true if the union is not empty.
bool ON_Interval::Union | ( | double | t | ) |
t | this = this union arg |
bool ON_Interval::Union | ( | int | count, |
const double * | t | ||
) |
count | this = this union arg |
|
static |
(ON_UNSET_VALUE,ON_UNSET_VALUE)
double ON_Interval::m_t[2] |
Interval = (m_t[0], m_t[1])
|
static |
(ON_DBL_QNAN,ON_DBL_QNAN)
|
static |
(0.0, 1.0)
|
static |
(0.0, 2.0*ON_PI)