HDK
|
#include <range1f.h>
Public Types | |
typedef float | MinMaxType |
Helper typedef. More... | |
typedef MinMaxType | ScalarType |
Public Member Functions | |
void | SetEmpty () |
Sets the range to an empty interval. More... | |
GfRange1f () | |
The default constructor creates an empty range. More... | |
GfRange1f (float min, float max) | |
This constructor initializes the minimum and maximum points. More... | |
GF_API | GfRange1f (class GfRange1d const &other) |
Construct from GfRange1d. More... | |
float | GetMin () const |
Returns the minimum value of the range. More... | |
float | GetMax () const |
Returns the maximum value of the range. More... | |
float | GetSize () const |
Returns the size of the range. More... | |
float | GetMidpoint () const |
void | SetMin (float min) |
Sets the minimum value of the range. More... | |
void | SetMax (float max) |
Sets the maximum value of the range. More... | |
bool | IsEmpty () const |
Returns whether the range is empty (max < min). More... | |
void | ExtendBy (float point) |
void | ExtendBy (const GfRange1f &range) |
bool | Contains (float point) const |
bool | Contains (const GfRange1f &range) const |
bool | IsInside (float point) const |
bool | IsInside (const GfRange1f &range) const |
bool | IsOutside (const GfRange1f &range) const |
const GfRange1f & | UnionWith (const GfRange1f &b) |
Extend this to include b . More... | |
const GfRange1f & | UnionWith (float b) |
Extend this to include b . More... | |
const GfRange1f & | Union (const GfRange1f &b) |
const GfRange1f & | Union (float b) |
const GfRange1f & | IntersectWith (const GfRange1f &b) |
const GfRange1f & | Intersection (const GfRange1f &b) |
GfRange1f & | operator+= (const GfRange1f &b) |
unary sum. More... | |
GfRange1f & | operator-= (const GfRange1f &b) |
unary difference. More... | |
GfRange1f & | operator*= (double m) |
unary multiply. More... | |
GfRange1f & | operator/= (double m) |
unary division. More... | |
GfRange1f | operator+ (const GfRange1f &b) const |
binary sum. More... | |
GfRange1f | operator- (const GfRange1f &b) const |
binary difference. More... | |
bool | operator== (const GfRange1f &b) const |
The min and max points must match exactly for equality. More... | |
bool | operator!= (const GfRange1f &b) const |
GF_API bool | operator== (const GfRange1d &other) const |
GF_API bool | operator!= (const GfRange1d &other) const |
GF_API double | GetDistanceSquared (float p) const |
Compute the squared distance from a point to the range. More... | |
Static Public Member Functions | |
static GfRange1f | GetUnion (const GfRange1f &a, const GfRange1f &b) |
Returns the smallest GfRange1f which contains both a and b . More... | |
static GfRange1f | Union (const GfRange1f &a, const GfRange1f &b) |
static GfRange1f | GetIntersection (const GfRange1f &a, const GfRange1f &b) |
Returns a GfRange1f that describes the intersection of a and b . More... | |
static GfRange1f | Intersection (const GfRange1f &a, const GfRange1f &b) |
Static Public Attributes | |
static const size_t | dimension = 1 |
Friends | |
GfRange1f | operator* (double m, const GfRange1f &r) |
scalar multiply. More... | |
GfRange1f | operator* (const GfRange1f &r, double m) |
scalar multiply. More... | |
GfRange1f | operator/ (const GfRange1f &r, double m) |
scalar divide. More... | |
size_t | hash_value (const GfRange1f &r) |
hash. More... | |
Basic type: 1-dimensional floating point range.
This class represents a 1-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 float GfRange1f::MinMaxType |
typedef MinMaxType GfRange1f::ScalarType |
|
inline |
|
inline |
|
inline |
Modifies the range if necessary to surround the given value.
Modifies the range if necessary to surround the given range.
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 |
|
inline |
Returns a GfRange1f
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 GfRange1f
which contains both a
and b
Extend this
to include b
.
Extend this
to include b
.