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

#include <range3d.h>

Public Types

typedef GfVec3d MinMaxType
 Helper typedef. More...
 
typedef GfVec3d::ScalarType ScalarType
 

Public Member Functions

void SetEmpty ()
 Sets the range to an empty interval. More...
 
 GfRange3d ()
 The default constructor creates an empty range. More...
 
 GfRange3d (const GfVec3d &min, const GfVec3d &max)
 This constructor initializes the minimum and maximum points. More...
 
const GfVec3dGetMin () const
 Returns the minimum value of the range. More...
 
const GfVec3dGetMax () const
 Returns the maximum value of the range. More...
 
GfVec3d GetSize () const
 Returns the size of the range. More...
 
GfVec3d GetMidpoint () const
 
void SetMin (const GfVec3d &min)
 Sets the minimum value of the range. More...
 
void SetMax (const GfVec3d &max)
 Sets the maximum value of the range. More...
 
bool IsEmpty () const
 Returns whether the range is empty (max < min). More...
 
void ExtendBy (const GfVec3d &point)
 
void ExtendBy (const GfRange3d &range)
 
bool Contains (const GfVec3d &point) const
 
bool Contains (const GfRange3d &range) const
 
bool IsInside (const GfVec3d &point) const
 
bool IsInside (const GfRange3d &range) const
 
bool IsOutside (const GfRange3d &range) const
 
const GfRange3dUnionWith (const GfRange3d &b)
 Extend this to include b. More...
 
const GfRange3dUnionWith (const GfVec3d &b)
 Extend this to include b. More...
 
const GfRange3dUnion (const GfRange3d &b)
 
const GfRange3dUnion (const GfVec3d &b)
 
const GfRange3dIntersectWith (const GfRange3d &b)
 
const GfRange3dIntersection (const GfRange3d &b)
 
GfRange3d operator+= (const GfRange3d &b)
 unary sum. More...
 
GfRange3d operator-= (const GfRange3d &b)
 unary difference. More...
 
GfRange3d operator*= (double m)
 unary multiply. More...
 
GfRange3d operator/= (double m)
 unary division. More...
 
GfRange3d operator+ (const GfRange3d &b) const
 binary sum. More...
 
GfRange3d operator- (const GfRange3d &b) const
 binary difference. More...
 
bool operator== (const GfRange3d &b) const
 The min and max points must match exactly for equality. More...
 
bool operator!= (const GfRange3d &b) const
 
GF_API bool operator== (const GfRange3f &other) const
 
GF_API bool operator!= (const GfRange3f &other) const
 
GF_API double GetDistanceSquared (const GfVec3d &p) const
 Compute the squared distance from a point to the range. More...
 
GF_API GfVec3d GetCorner (size_t i) const
 
GF_API GfRange3d GetOctant (size_t i) const
 

Static Public Member Functions

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

Static Public Attributes

static const size_t dimension = GfVec3d::dimension
 
static GF_API const GfRange3d UnitCube
 The unit cube. More...
 

Friends

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

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 64 of file range3d.h.

Member Typedef Documentation

Helper typedef.

Definition at line 69 of file range3d.h.

Definition at line 72 of file range3d.h.

Constructor & Destructor Documentation

GfRange3d::GfRange3d ( )
inline

The default constructor creates an empty range.

Definition at line 82 of file range3d.h.

GfRange3d::GfRange3d ( const GfVec3d min,
const GfVec3d max 
)
inline

This constructor initializes the minimum and maximum points.

Definition at line 87 of file range3d.h.

Member Function Documentation

bool GfRange3d::Contains ( const GfVec3d 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 130 of file range3d.h.

bool GfRange3d::Contains ( const GfRange3d 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 139 of file range3d.h.

void GfRange3d::ExtendBy ( const GfVec3d point)
inline

Modifies the range if necessary to surround the given value.

Deprecated:
Use UnionWith() instead.

Definition at line 122 of file range3d.h.

void GfRange3d::ExtendBy ( const GfRange3d range)
inline

Modifies the range if necessary to surround the given range.

Deprecated:
Use UnionWith() instead.

Definition at line 126 of file range3d.h.

GF_API GfVec3d GfRange3d::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.

GF_API double GfRange3d::GetDistanceSquared ( const GfVec3d p) const

Compute the squared distance from a point to the range.

static GfRange3d GfRange3d::GetIntersection ( const GfRange3d a,
const GfRange3d b 
)
inlinestatic

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

Definition at line 208 of file range3d.h.

const GfVec3d& GfRange3d::GetMax ( ) const
inline

Returns the maximum value of the range.

Definition at line 96 of file range3d.h.

GfVec3d GfRange3d::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 104 of file range3d.h.

const GfVec3d& GfRange3d::GetMin ( ) const
inline

Returns the minimum value of the range.

Definition at line 93 of file range3d.h.

GF_API GfRange3d GfRange3d::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.

GfVec3d GfRange3d::GetSize ( ) const
inline

Returns the size of the range.

Definition at line 99 of file range3d.h.

static GfRange3d GfRange3d::GetUnion ( const GfRange3d a,
const GfRange3d b 
)
inlinestatic

Returns the smallest GfRange3d which contains both a and b.

Definition at line 168 of file range3d.h.

static GfRange3d GfRange3d::Intersection ( const GfRange3d a,
const GfRange3d b 
)
inlinestatic

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

Deprecated:
Use GetIntersection() instead.

Definition at line 217 of file range3d.h.

const GfRange3d& GfRange3d::Intersection ( const GfRange3d b)
inline

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

Deprecated:
Use IntersectWith() instead.

Definition at line 232 of file range3d.h.

const GfRange3d& GfRange3d::IntersectWith ( const GfRange3d b)
inline

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

Definition at line 223 of file range3d.h.

bool GfRange3d::IsEmpty ( ) const
inline

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

Definition at line 116 of file range3d.h.

bool GfRange3d::IsInside ( const GfVec3d 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 146 of file range3d.h.

bool GfRange3d::IsInside ( const GfRange3d 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 154 of file range3d.h.

bool GfRange3d::IsOutside ( const GfRange3d 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 161 of file range3d.h.

bool GfRange3d::operator!= ( const GfRange3d b) const
inline

Definition at line 311 of file range3d.h.

bool GfRange3d::operator!= ( const GfRange3f other) const
inline

Definition at line 376 of file range3d.h.

GfRange3d GfRange3d::operator*= ( double  m)
inline

unary multiply.

Definition at line 251 of file range3d.h.

GfRange3d GfRange3d::operator+ ( const GfRange3d b) const
inline

binary sum.

Definition at line 269 of file range3d.h.

GfRange3d GfRange3d::operator+= ( const GfRange3d b)
inline

unary sum.

Definition at line 237 of file range3d.h.

GfRange3d GfRange3d::operator- ( const GfRange3d b) const
inline

binary difference.

Definition at line 275 of file range3d.h.

GfRange3d GfRange3d::operator-= ( const GfRange3d b)
inline

unary difference.

Definition at line 244 of file range3d.h.

GfRange3d GfRange3d::operator/= ( double  m)
inline

unary division.

Definition at line 264 of file range3d.h.

bool GfRange3d::operator== ( const GfRange3d b) const
inline

The min and max points must match exactly for equality.

Definition at line 307 of file range3d.h.

PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE bool GfRange3d::operator== ( const GfRange3f other) const
inline

Compare this range to a GfRange3f.

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

Definition at line 370 of file range3d.h.

void GfRange3d::SetEmpty ( )
inline

Sets the range to an empty interval.

Definition at line 76 of file range3d.h.

void GfRange3d::SetMax ( const GfVec3d max)
inline

Sets the maximum value of the range.

Definition at line 113 of file range3d.h.

void GfRange3d::SetMin ( const GfVec3d min)
inline

Sets the minimum value of the range.

Definition at line 110 of file range3d.h.

static GfRange3d GfRange3d::Union ( const GfRange3d a,
const GfRange3d b 
)
inlinestatic

Returns the smallest GfRange3d which contains both a and b

Deprecated:
Use GetUnion() instead.

Definition at line 191 of file range3d.h.

const GfRange3d& GfRange3d::Union ( const GfRange3d b)
inline

Extend this to include b.

Deprecated:
Use UnionWith() instead.

Definition at line 197 of file range3d.h.

const GfRange3d& GfRange3d::Union ( const GfVec3d b)
inline

Extend this to include b.

Deprecated:
Use UnionWith() instead.

Definition at line 203 of file range3d.h.

const GfRange3d& GfRange3d::UnionWith ( const GfRange3d b)
inline

Extend this to include b.

Definition at line 176 of file range3d.h.

const GfRange3d& GfRange3d::UnionWith ( const GfVec3d b)
inline

Extend this to include b.

Definition at line 183 of file range3d.h.

Friends And Related Function Documentation

size_t hash_value ( const GfRange3d r)
friend

hash.

Definition at line 299 of file range3d.h.

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

scalar multiply.

Definition at line 280 of file range3d.h.

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

scalar multiply.

Definition at line 287 of file range3d.h.

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

scalar divide.

Definition at line 294 of file range3d.h.

Member Data Documentation

const size_t GfRange3d::dimension = GfVec3d::dimension
static

Definition at line 71 of file range3d.h.

GF_API const GfRange3d GfRange3d::UnitCube
static

The unit cube.

Definition at line 340 of file range3d.h.


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