All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GfRange1f Class Reference

Basic type: 1-dimensional floating point range. More...

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...
 
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
 Returns the midpoint of the range, that is, 0.5*(min+max). More...
 
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)
 Modifies the range if necessary to surround the given value. More...
 
void ExtendBy (const GfRange1f &range)
 Modifies the range if necessary to surround the given range. More...
 
bool Contains (float point) const
 Returns true if the point is located inside the range. More...
 
bool Contains (const GfRange1f &range) const
 Returns true if the range is located entirely inside the range. More...
 
bool IsInside (float point) const
 Returns true if the point is located inside the range. More...
 
bool IsInside (const GfRange1f &range) const
 Returns true if the range is located entirely inside the range. More...
 
bool IsOutside (const GfRange1f &range) const
 Returns true if the range is located entirely outside the range. More...
 
const GfRange1fUnionWith (const GfRange1f &b)
 Extend this to include b. More...
 
const GfRange1fUnionWith (float b)
 Extend this to include b. More...
 
const GfRange1fUnion (const GfRange1f &b)
 Extend this to include b. More...
 
const GfRange1fUnion (float b)
 Extend this to include b. More...
 
const GfRange1fIntersectWith (const GfRange1f &b)
 Modifies this range to hold its intersection with b and returns the result. More...
 
const GfRange1fIntersection (const GfRange1f &b)
 Modifies this range to hold its intersection with b and returns the result. More...
 
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
 Compare this range to a GfRange1d. More...
 
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)
 Returns the smallest GfRange1f which contains both a and b. More...
 
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)
 Returns a GfRange1f that describes the intersection of a and b. More...
 

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...
 

Detailed Description

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]

Definition at line 62 of file range1f.h.

Member Typedef Documentation

typedef float MinMaxType

Helper typedef.

Definition at line 67 of file range1f.h.

Constructor & Destructor Documentation

GfRange1f ( )
inline

The default constructor creates an empty range.

Definition at line 80 of file range1f.h.

GfRange1f ( float  min,
float  max 
)
inline

This constructor initializes the minimum and maximum points.

Definition at line 85 of file range1f.h.

Member Function Documentation

bool Contains ( float  point) const
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.

Definition at line 128 of file range1f.h.

bool Contains ( const GfRange1f range) const
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.

Definition at line 135 of file range1f.h.

void ExtendBy ( float  point)
inline

Modifies the range if necessary to surround the given value.

Deprecated:
Use UnionWith() instead.

Definition at line 120 of file range1f.h.

void ExtendBy ( const GfRange1f range)
inline

Modifies the range if necessary to surround the given range.

Deprecated:
Use UnionWith() instead.

Definition at line 124 of file range1f.h.

GF_API double GetDistanceSquared ( float  p) const

Compute the squared distance from a point to the range.

static GfRange1f GetIntersection ( const GfRange1f a,
const GfRange1f b 
)
inlinestatic

Returns a GfRange1f that describes the intersection of a and b.

Definition at line 202 of file range1f.h.

float GetMax ( ) const
inline

Returns the maximum value of the range.

Definition at line 94 of file range1f.h.

float GetMidpoint ( ) const
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().

Definition at line 102 of file range1f.h.

float GetMin ( ) const
inline

Returns the minimum value of the range.

Definition at line 91 of file range1f.h.

float GetSize ( ) const
inline

Returns the size of the range.

Definition at line 97 of file range1f.h.

static GfRange1f GetUnion ( const GfRange1f a,
const GfRange1f b 
)
inlinestatic

Returns the smallest GfRange1f which contains both a and b.

Definition at line 162 of file range1f.h.

static GfRange1f Intersection ( const GfRange1f a,
const GfRange1f b 
)
inlinestatic

Returns a GfRange1f that describes the intersection of a and b.

Deprecated:
Use GetIntersection() instead.

Definition at line 211 of file range1f.h.

const GfRange1f& Intersection ( const GfRange1f b)
inline

Modifies this range to hold its intersection with b and returns the result.

Deprecated:
Use IntersectWith() instead.

Definition at line 226 of file range1f.h.

const GfRange1f& IntersectWith ( const GfRange1f b)
inline

Modifies this range to hold its intersection with b and returns the result.

Definition at line 217 of file range1f.h.

bool IsEmpty ( ) const
inline

Returns whether the range is empty (max < min).

Definition at line 114 of file range1f.h.

bool IsInside ( float  point) const
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.

Deprecated:
Use Contains() instead.

Definition at line 142 of file range1f.h.

bool IsInside ( const GfRange1f range) const
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.

Deprecated:
Use Contains() instead.

Definition at line 150 of file range1f.h.

bool IsOutside ( const GfRange1f range) const
inline

Returns true if the range is located entirely outside the range.

As with all operations of this type, the ranges are assumed to include their extrema.

Definition at line 157 of file range1f.h.

GfRange1f operator*= ( double  m)
inline

unary multiply.

Definition at line 245 of file range1f.h.

GfRange1f operator+ ( const GfRange1f b) const
inline

binary sum.

Definition at line 263 of file range1f.h.

GfRange1f operator+= ( const GfRange1f b)
inline

unary sum.

Definition at line 231 of file range1f.h.

GfRange1f operator- ( const GfRange1f b) const
inline

binary difference.

Definition at line 269 of file range1f.h.

GfRange1f operator-= ( const GfRange1f b)
inline

unary difference.

Definition at line 238 of file range1f.h.

GfRange1f operator/= ( double  m)
inline

unary division.

Definition at line 258 of file range1f.h.

bool operator== ( const GfRange1f b) const
inline

The min and max points must match exactly for equality.

Definition at line 301 of file range1f.h.

bool operator== ( const GfRange1d other) const
inline

Compare this range to a GfRange1d.

The values must match exactly and it does exactly what you might expect when comparing float and double values.

Definition at line 345 of file range1f.h.

void SetEmpty ( )
inline

Sets the range to an empty interval.

Definition at line 74 of file range1f.h.

void SetMax ( float  max)
inline

Sets the maximum value of the range.

Definition at line 111 of file range1f.h.

void SetMin ( float  min)
inline

Sets the minimum value of the range.

Definition at line 108 of file range1f.h.

static GfRange1f Union ( const GfRange1f a,
const GfRange1f b 
)
inlinestatic

Returns the smallest GfRange1f which contains both a and b.

Deprecated:
Use GetUnion() instead.

Definition at line 185 of file range1f.h.

const GfRange1f& Union ( const GfRange1f b)
inline

Extend this to include b.

Deprecated:
Use UnionWith() instead.

Definition at line 191 of file range1f.h.

const GfRange1f& Union ( float  b)
inline

Extend this to include b.

Deprecated:
Use UnionWith() instead.

Definition at line 197 of file range1f.h.

const GfRange1f& UnionWith ( const GfRange1f b)
inline

Extend this to include b.

Definition at line 170 of file range1f.h.

const GfRange1f& UnionWith ( float  b)
inline

Extend this to include b.

Definition at line 177 of file range1f.h.

Friends And Related Function Documentation

size_t hash_value ( const GfRange1f r)
friend

hash.

Definition at line 293 of file range1f.h.

GfRange1f operator* ( double  m,
const GfRange1f r 
)
friend

scalar multiply.

Definition at line 274 of file range1f.h.

GfRange1f operator* ( const GfRange1f r,
double  m 
)
friend

scalar multiply.

Definition at line 281 of file range1f.h.

GfRange1f operator/ ( const GfRange1f r,
double  m 
)
friend

scalar divide.

Definition at line 288 of file range1f.h.


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