Loading...
Searching...
No Matches
GfRange3f Class Reference

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

#include <range3f.h>

Public Types

typedef GfVec3f MinMaxType
 Helper typedef.
 
typedef GfVec3f::ScalarType ScalarType
 

Public Member Functions

void SetEmpty ()
 Sets the range to an empty interval.
 
 GfRange3f ()
 The default constructor creates an empty range.
 
 GfRange3f (const GfVec3f &min, const GfVec3f &max)
 This constructor initializes the minimum and maximum points.
 
GF_API GfRange3f (class GfRange3d const &other)
 Construct from GfRange3d.
 
const GfVec3fGetMin () const
 Returns the minimum value of the range.
 
const GfVec3fGetMax () const
 Returns the maximum value of the range.
 
GfVec3f GetSize () const
 Returns the size of the range.
 
GfVec3f GetMidpoint () const
 Returns the midpoint of the range, that is, 0.5*(min+max).
 
void SetMin (const GfVec3f &min)
 Sets the minimum value of the range.
 
void SetMax (const GfVec3f &max)
 Sets the maximum value of the range.
 
bool IsEmpty () const
 Returns whether the range is empty (max < min).
 
void ExtendBy (const GfVec3f &point)
 Modifies the range if necessary to surround the given value.
 
void ExtendBy (const GfRange3f &range)
 Modifies the range if necessary to surround the given range.
 
bool Contains (const GfVec3f &point) const
 Returns true if the point is located inside the range.
 
bool Contains (const GfRange3f &range) const
 Returns true if the range is located entirely inside the range.
 
bool IsInside (const GfVec3f &point) const
 Returns true if the point is located inside the range.
 
bool IsInside (const GfRange3f &range) const
 Returns true if the range is located entirely inside the range.
 
bool IsOutside (const GfRange3f &range) const
 Returns true if the range is located entirely outside the range.
 
const GfRange3fUnionWith (const GfRange3f &b)
 Extend this to include b.
 
const GfRange3fUnionWith (const GfVec3f &b)
 Extend this to include b.
 
const GfRange3fUnion (const GfRange3f &b)
 Extend this to include b.
 
const GfRange3fUnion (const GfVec3f &b)
 Extend this to include b.
 
const GfRange3fIntersectWith (const GfRange3f &b)
 Modifies this range to hold its intersection with b and returns the result.
 
const GfRange3fIntersection (const GfRange3f &b)
 Modifies this range to hold its intersection with b and returns the result.
 
GfRange3foperator+= (const GfRange3f &b)
 unary sum.
 
GfRange3foperator-= (const GfRange3f &b)
 unary difference.
 
GfRange3foperator*= (double m)
 unary multiply.
 
GfRange3foperator/= (double m)
 unary division.
 
GfRange3f operator+ (const GfRange3f &b) const
 binary sum.
 
GfRange3f operator- (const GfRange3f &b) const
 binary difference.
 
bool operator== (const GfRange3f &b) const
 The min and max points must match exactly for equality.
 
bool operator!= (const GfRange3f &b) const
 
GF_API bool operator== (const GfRange3d &other) const
 Compare this range to a GfRange3d.
 
GF_API bool operator!= (const GfRange3d &other) const
 
GF_API double GetDistanceSquared (const GfVec3f &p) const
 Compute the squared distance from a point to the range.
 
GF_API GfVec3f GetCorner (size_t i) const
 Returns the ith corner of the range, in the following order: LDB, RDB, LUB, RUB, LDF, RDF, LUF, RUF.
 
GF_API GfRange3f GetOctant (size_t i) const
 Returns the ith octant of the range, in the following order: LDB, RDB, LUB, RUB, LDF, RDF, LUF, RUF.
 

Static Public Member Functions

static GfRange3f GetUnion (const GfRange3f &a, const GfRange3f &b)
 Returns the smallest GfRange3f which contains both a and b.
 
static GfRange3f Union (const GfRange3f &a, const GfRange3f &b)
 Returns the smallest GfRange3f which contains both a and b.
 
static GfRange3f GetIntersection (const GfRange3f &a, const GfRange3f &b)
 Returns a GfRange3f that describes the intersection of a and b.
 
static GfRange3f Intersection (const GfRange3f &a, const GfRange3f &b)
 Returns a GfRange3f that describes the intersection of a and b.
 

Static Public Attributes

static const size_t dimension = GfVec3f::dimension
 
static GF_API const GfRange3f UnitCube
 The unit cube.
 

Friends

GfRange3f operator* (double m, const GfRange3f &r)
 scalar multiply.
 
GfRange3f operator* (const GfRange3f &r, double m)
 scalar multiply.
 
GfRange3f operator/ (const GfRange3f &r, double m)
 scalar divide.
 
size_t hash_value (const GfRange3f &r)
 hash.
 

Detailed Description

Basic type: 3-dimensional floating point range.

This class represents a 3-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 63 of file range3f.h.

Member Typedef Documentation

◆ MinMaxType

Helper typedef.

Definition at line 68 of file range3f.h.

◆ ScalarType

typedef GfVec3f::ScalarType ScalarType

Definition at line 71 of file range3f.h.

Constructor & Destructor Documentation

◆ GfRange3f() [1/3]

GfRange3f ( )
inline

The default constructor creates an empty range.

Definition at line 81 of file range3f.h.

◆ GfRange3f() [2/3]

GfRange3f ( const GfVec3f min,
const GfVec3f max 
)
inline

This constructor initializes the minimum and maximum points.

Definition at line 86 of file range3f.h.

◆ GfRange3f() [3/3]

GF_API GfRange3f ( class GfRange3d const &  other)
explicit

Construct from GfRange3d.

Member Function Documentation

◆ Contains() [1/2]

bool Contains ( const GfRange3f 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 143 of file range3f.h.

◆ Contains() [2/2]

bool Contains ( const GfVec3f 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 134 of file range3f.h.

◆ ExtendBy() [1/2]

void ExtendBy ( const GfRange3f range)
inline

Modifies the range if necessary to surround the given range.

Deprecated:
Use UnionWith() instead.

Definition at line 130 of file range3f.h.

◆ ExtendBy() [2/2]

void ExtendBy ( const GfVec3f point)
inline

Modifies the range if necessary to surround the given value.

Deprecated:
Use UnionWith() instead.

Definition at line 126 of file range3f.h.

◆ GetCorner()

GF_API GfVec3f GetCorner ( size_t  i) const

Returns the ith corner of the range, in the following order: LDB, RDB, LUB, RUB, LDF, RDF, LUF, RUF.

Where L/R is left/right, D/U is down/up, and B/F is back/front.

◆ GetDistanceSquared()

GF_API double GetDistanceSquared ( const GfVec3f p) const

Compute the squared distance from a point to the range.

◆ GetIntersection()

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

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

Definition at line 212 of file range3f.h.

◆ GetMax()

const GfVec3f & GetMax ( ) const
inline

Returns the maximum value of the range.

Definition at line 100 of file range3f.h.

◆ GetMidpoint()

GfVec3f 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 108 of file range3f.h.

◆ GetMin()

const GfVec3f & GetMin ( ) const
inline

Returns the minimum value of the range.

Definition at line 97 of file range3f.h.

◆ GetOctant()

GF_API GfRange3f GetOctant ( size_t  i) const

Returns the ith octant of the range, in the following order: LDB, RDB, LUB, RUB, LDF, RDF, LUF, RUF.

Where L/R is left/right, D/U is down/up, and B/F is back/front.

◆ GetSize()

GfVec3f GetSize ( ) const
inline

Returns the size of the range.

Definition at line 103 of file range3f.h.

◆ GetUnion()

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

Returns the smallest GfRange3f which contains both a and b.

Definition at line 172 of file range3f.h.

◆ Intersection() [1/2]

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

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

Deprecated:
Use GetIntersection() instead.

Definition at line 221 of file range3f.h.

◆ Intersection() [2/2]

const GfRange3f & Intersection ( const GfRange3f b)
inline

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

Deprecated:
Use IntersectWith() instead.

Definition at line 236 of file range3f.h.

◆ IntersectWith()

const GfRange3f & IntersectWith ( const GfRange3f b)
inline

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

Definition at line 227 of file range3f.h.

◆ IsEmpty()

bool IsEmpty ( ) const
inline

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

Definition at line 120 of file range3f.h.

◆ IsInside() [1/2]

bool IsInside ( const GfRange3f 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 158 of file range3f.h.

◆ IsInside() [2/2]

bool IsInside ( const GfVec3f 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 150 of file range3f.h.

◆ IsOutside()

bool IsOutside ( const GfRange3f 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 165 of file range3f.h.

◆ operator!=() [1/2]

bool operator!= ( const GfRange3d other) const
inline

Definition at line 377 of file range3f.h.

◆ operator!=() [2/2]

bool operator!= ( const GfRange3f b) const
inline

Definition at line 312 of file range3f.h.

◆ operator*=()

GfRange3f & operator*= ( double  m)
inline

unary multiply.

Definition at line 255 of file range3f.h.

◆ operator+()

GfRange3f operator+ ( const GfRange3f b) const
inline

binary sum.

Definition at line 273 of file range3f.h.

◆ operator+=()

GfRange3f & operator+= ( const GfRange3f b)
inline

unary sum.

Definition at line 241 of file range3f.h.

◆ operator-()

GfRange3f operator- ( const GfRange3f b) const
inline

binary difference.

Definition at line 279 of file range3f.h.

◆ operator-=()

GfRange3f & operator-= ( const GfRange3f b)
inline

unary difference.

Definition at line 248 of file range3f.h.

◆ operator/=()

GfRange3f & operator/= ( double  m)
inline

unary division.

Definition at line 268 of file range3f.h.

◆ operator==() [1/2]

bool operator== ( const GfRange3d other) const
inline

Compare this range to a GfRange3d.

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

Definition at line 371 of file range3f.h.

◆ operator==() [2/2]

bool operator== ( const GfRange3f b) const
inline

The min and max points must match exactly for equality.

Definition at line 308 of file range3f.h.

◆ SetEmpty()

void SetEmpty ( )
inline

Sets the range to an empty interval.

Definition at line 75 of file range3f.h.

◆ SetMax()

void SetMax ( const GfVec3f max)
inline

Sets the maximum value of the range.

Definition at line 117 of file range3f.h.

◆ SetMin()

void SetMin ( const GfVec3f min)
inline

Sets the minimum value of the range.

Definition at line 114 of file range3f.h.

◆ Union() [1/3]

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

Returns the smallest GfRange3f which contains both a and b.

Deprecated:
Use GetUnion() instead.

Definition at line 195 of file range3f.h.

◆ Union() [2/3]

const GfRange3f & Union ( const GfRange3f b)
inline

Extend this to include b.

Deprecated:
Use UnionWith() instead.

Definition at line 201 of file range3f.h.

◆ Union() [3/3]

const GfRange3f & Union ( const GfVec3f b)
inline

Extend this to include b.

Deprecated:
Use UnionWith() instead.

Definition at line 207 of file range3f.h.

◆ UnionWith() [1/2]

const GfRange3f & UnionWith ( const GfRange3f b)
inline

Extend this to include b.

Definition at line 180 of file range3f.h.

◆ UnionWith() [2/2]

const GfRange3f & UnionWith ( const GfVec3f b)
inline

Extend this to include b.

Definition at line 187 of file range3f.h.

Friends And Related Function Documentation

◆ hash_value

size_t hash_value ( const GfRange3f r)
friend

hash.

Definition at line 303 of file range3f.h.

◆ operator* [1/2]

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

scalar multiply.

Definition at line 291 of file range3f.h.

◆ operator* [2/2]

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

scalar multiply.

Definition at line 284 of file range3f.h.

◆ operator/

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

scalar divide.

Definition at line 298 of file range3f.h.

Member Data Documentation

◆ dimension

const size_t dimension = GfVec3f::dimension
static

Definition at line 70 of file range3f.h.

◆ UnitCube

GF_API const GfRange3f UnitCube
static

The unit cube.

Definition at line 341 of file range3f.h.


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