FormIt C++ API
v23.0.0 (2023.0.0)
|
The Interval2d class corresponds to a bounding box in 2D space.
Interval2d and Interval3d are similar classes that keep an interval of values in 2D or 3D space, respectively. The classes were made to look uniform across 2 and 3 dimensions.
The bounds of the interval are accessed via public data members, lower and upper.
The interval classes contain operators and methods for extending or intersecting, as well as evaluating intervals.
#include <Interval2d.h>
Public Member Functions | |
Interval2d () | |
Interval2d (int) | |
Interval2d (const Point2d &p) | |
Interval2d (const Point2d &a, const Point2d &b) | |
Interval2d (const Point2d ¢er, double halfSize) | |
Interval2d (const Point2d &a, const Point2d &b, int) | |
void | operator+= (const Point2d &p) |
Extend this interval to cover the given point. More... | |
void | operator+= (const Interval2d &interv) |
Union this interval with another interval. More... | |
void | operator*= (const Interval2d &interv) |
Intersect this interval with another interval. More... | |
Interval2d | operator* (const Interval2d &interv) const |
Intersect two intervals and return the result. More... | |
Interval2d | operator+ (const Interval2d &interv) const |
Union two intervals and return the result. More... | |
bool | operator&& (const Interval2d &interv) const |
Returns true iff the two intervals overlap. More... | |
bool | operator&& (const Point2d &p) const |
Returns true iff the interval contains the given point. More... | |
bool | operator<= (const Interval2d &interv) const |
Given a <= b, returns true if a is subinterval of b. More... | |
bool | isNull () const |
Returns true if the interval is null. More... | |
Point2d | mid () const |
Returns the midpoint between the lower and upper bounds of the interval. More... | |
double | length () const |
Returns the length of the interval. More... | |
double | length (int i) const |
Returns the i-th component of the interval length. More... | |
void | init () |
Initializes the interval to null. More... | |
void | enlarge (double howMuch=10 *WSM_DISTANCE_TOL) |
Widen the bounds of the interval by the specified distance. More... | |
Public Attributes | |
Point2d | lower |
Lower bound of the interval. More... | |
Point2d | upper |
Upper bound of the interval. More... | |
Static Public Attributes | |
static const Interval2d | kNull |
|
inline |
|
inline |
|
inline |
|
inline |
void WSM::Interval2d::enlarge | ( | double | howMuch = 10 *WSM_DISTANCE_TOL | ) |
Widen the bounds of the interval by the specified distance.
|
inline |
Initializes the interval to null.
|
inline |
Returns true if the interval is null.
|
inline |
Returns the length of the interval.
|
inline |
Returns the i-th component of the interval length.
|
inline |
Returns the midpoint between the lower and upper bounds of the interval.
|
inline |
Returns true iff the two intervals overlap.
|
inline |
Returns true iff the interval contains the given point.
|
inline |
Intersect two intervals and return the result.
|
inline |
Intersect this interval with another interval.
|
inline |
Union two intervals and return the result.
|
inline |
Extend this interval to cover the given point.
|
inline |
Union this interval with another interval.
|
inline |
Given a <= b, returns true if a is subinterval of b.
|
static |
Point2d WSM::Interval2d::lower |
Lower bound of the interval.
Point2d WSM::Interval2d::upper |
Upper bound of the interval.