HDK
|
#include <range2d.h>
Public Types | |
typedef GfVec2d | MinMaxType |
Helper typedef. More... | |
typedef GfVec2d::ScalarType | ScalarType |
Public Member Functions | |
void | SetEmpty () |
Sets the range to an empty interval. More... | |
GfRange2d () | |
The default constructor creates an empty range. More... | |
GfRange2d (const GfVec2d &min, const GfVec2d &max) | |
This constructor initializes the minimum and maximum points. More... | |
GF_API | GfRange2d (class GfRange2f const &other) |
Implicitly convert from GfRange2f. More... | |
const GfVec2d & | GetMin () const |
Returns the minimum value of the range. More... | |
const GfVec2d & | GetMax () const |
Returns the maximum value of the range. More... | |
GfVec2d | GetSize () const |
Returns the size of the range. More... | |
GfVec2d | GetMidpoint () const |
void | SetMin (const GfVec2d &min) |
Sets the minimum value of the range. More... | |
void | SetMax (const GfVec2d &max) |
Sets the maximum value of the range. More... | |
bool | IsEmpty () const |
Returns whether the range is empty (max < min). More... | |
void | ExtendBy (const GfVec2d &point) |
void | ExtendBy (const GfRange2d &range) |
bool | Contains (const GfVec2d &point) const |
bool | Contains (const GfRange2d &range) const |
bool | IsInside (const GfVec2d &point) const |
bool | IsInside (const GfRange2d &range) const |
bool | IsOutside (const GfRange2d &range) const |
const GfRange2d & | UnionWith (const GfRange2d &b) |
Extend this to include b . More... | |
const GfRange2d & | UnionWith (const GfVec2d &b) |
Extend this to include b . More... | |
const GfRange2d & | Union (const GfRange2d &b) |
const GfRange2d & | Union (const GfVec2d &b) |
const GfRange2d & | IntersectWith (const GfRange2d &b) |
const GfRange2d & | Intersection (const GfRange2d &b) |
GfRange2d & | operator+= (const GfRange2d &b) |
unary sum. More... | |
GfRange2d & | operator-= (const GfRange2d &b) |
unary difference. More... | |
GfRange2d & | operator*= (double m) |
unary multiply. More... | |
GfRange2d & | operator/= (double m) |
unary division. More... | |
GfRange2d | operator+ (const GfRange2d &b) const |
binary sum. More... | |
GfRange2d | operator- (const GfRange2d &b) const |
binary difference. More... | |
bool | operator== (const GfRange2d &b) const |
The min and max points must match exactly for equality. More... | |
bool | operator!= (const GfRange2d &b) const |
GF_API bool | operator== (const GfRange2f &other) const |
GF_API bool | operator!= (const GfRange2f &other) const |
GF_API double | GetDistanceSquared (const GfVec2d &p) const |
Compute the squared distance from a point to the range. More... | |
GF_API GfVec2d | GetCorner (size_t i) const |
GF_API GfRange2d | GetQuadrant (size_t i) const |
Static Public Member Functions | |
static GfRange2d | GetUnion (const GfRange2d &a, const GfRange2d &b) |
Returns the smallest GfRange2d which contains both a and b . More... | |
static GfRange2d | Union (const GfRange2d &a, const GfRange2d &b) |
static GfRange2d | GetIntersection (const GfRange2d &a, const GfRange2d &b) |
Returns a GfRange2d that describes the intersection of a and b . More... | |
static GfRange2d | Intersection (const GfRange2d &a, const GfRange2d &b) |
Static Public Attributes | |
static const size_t | dimension = GfVec2d::dimension |
static GF_API const GfRange2d | UnitSquare |
The unit square. More... | |
Friends | |
GfRange2d | operator* (double m, const GfRange2d &r) |
scalar multiply. More... | |
GfRange2d | operator* (const GfRange2d &r, double m) |
scalar multiply. More... | |
GfRange2d | operator/ (const GfRange2d &r, double m) |
scalar divide. More... | |
size_t | hash_value (const GfRange2d &r) |
hash. More... | |
Basic type: 2-dimensional floating point range.
This class represents a 2-dimensional range (or interval) All operations are component-wise and conform to interval mathematics. An empty range is one where max < min. The default empty is [FLT_MAX,-FLT_MAX]
typedef GfVec2d GfRange2d::MinMaxType |
|
inline |
|
inline |
|
inline |
Modifies the range if necessary to surround the given value.
Modifies the range if necessary to surround the given range.
Returns the ith corner of the range, in the following order: SW, SE, NW, NE.
Compute the squared distance from a point to the range.
|
inline |
|
inline |
Returns the midpoint of the range, that is, 0.5*(min+max). Note: this returns zero in the case of default-constructed ranges, or ranges set via SetEmpty().
|
inline |
Returns the ith quadrant of the range, in the following order: SW, SE, NW, NE.
|
inline |
Returns a GfRange2d
that describes the intersection of a
and b
.
Modifies this range to hold its intersection with b
and returns the result.
|
inline |
|
inline |
Returns true if the point
is located inside the range. As with all operations of this type, the range is assumed to include its extrema.
|
inline |
Returns true if the range
is located entirely inside the range. As with all operations of this type, the ranges are assumed to include their extrema.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns the smallest GfRange2d
which contains both a
and b
Extend this
to include b
.
Extend this
to include b
.
|
static |