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

#include <range2f.h>

Public Types

typedef GfVec2f MinMaxType
 Helper typedef. More...
 
typedef GfVec2f::ScalarType ScalarType
 

Public Member Functions

void SetEmpty ()
 Sets the range to an empty interval. More...
 
 GfRange2f ()
 The default constructor creates an empty range. More...
 
 GfRange2f (const GfVec2f &min, const GfVec2f &max)
 This constructor initializes the minimum and maximum points. More...
 
GF_API GfRange2f (class GfRange2d const &other)
 Construct from GfRange2d. More...
 
const GfVec2fGetMin () const
 Returns the minimum value of the range. More...
 
const GfVec2fGetMax () const
 Returns the maximum value of the range. More...
 
GfVec2f GetSize () const
 Returns the size of the range. More...
 
GfVec2f GetMidpoint () const
 
void SetMin (const GfVec2f &min)
 Sets the minimum value of the range. More...
 
void SetMax (const GfVec2f &max)
 Sets the maximum value of the range. More...
 
bool IsEmpty () const
 Returns whether the range is empty (max < min). More...
 
void ExtendBy (const GfVec2f &point)
 
void ExtendBy (const GfRange2f &range)
 
bool Contains (const GfVec2f &point) const
 
bool Contains (const GfRange2f &range) const
 
bool IsInside (const GfVec2f &point) const
 
bool IsInside (const GfRange2f &range) const
 
bool IsOutside (const GfRange2f &range) const
 
const GfRange2fUnionWith (const GfRange2f &b)
 Extend this to include b. More...
 
const GfRange2fUnionWith (const GfVec2f &b)
 Extend this to include b. More...
 
const GfRange2fUnion (const GfRange2f &b)
 
const GfRange2fUnion (const GfVec2f &b)
 
const GfRange2fIntersectWith (const GfRange2f &b)
 
const GfRange2fIntersection (const GfRange2f &b)
 
GfRange2foperator+= (const GfRange2f &b)
 unary sum. More...
 
GfRange2foperator-= (const GfRange2f &b)
 unary difference. More...
 
GfRange2foperator*= (double m)
 unary multiply. More...
 
GfRange2foperator/= (double m)
 unary division. More...
 
GfRange2f operator+ (const GfRange2f &b) const
 binary sum. More...
 
GfRange2f operator- (const GfRange2f &b) const
 binary difference. More...
 
bool operator== (const GfRange2f &b) const
 The min and max points must match exactly for equality. More...
 
bool operator!= (const GfRange2f &b) const
 
GF_API bool operator== (const GfRange2d &other) const
 
GF_API bool operator!= (const GfRange2d &other) const
 
GF_API double GetDistanceSquared (const GfVec2f &p) const
 Compute the squared distance from a point to the range. More...
 
GF_API GfVec2f GetCorner (size_t i) const
 
GF_API GfRange2f GetQuadrant (size_t i) const
 

Static Public Member Functions

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

Static Public Attributes

static const size_t dimension = GfVec2f::dimension
 
static GF_API const GfRange2f UnitSquare
 The unit square. More...
 

Friends

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

Detailed Description

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]

Definition at line 63 of file range2f.h.

Member Typedef Documentation

Helper typedef.

Definition at line 68 of file range2f.h.

Definition at line 71 of file range2f.h.

Constructor & Destructor Documentation

GfRange2f::GfRange2f ( )
inline

The default constructor creates an empty range.

Definition at line 81 of file range2f.h.

GfRange2f::GfRange2f ( const GfVec2f min,
const GfVec2f max 
)
inline

This constructor initializes the minimum and maximum points.

Definition at line 86 of file range2f.h.

GF_API GfRange2f::GfRange2f ( class GfRange2d const &  other)
explicit

Construct from GfRange2d.

Member Function Documentation

bool GfRange2f::Contains ( const GfVec2f 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 range2f.h.

bool GfRange2f::Contains ( const GfRange2f 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 142 of file range2f.h.

void GfRange2f::ExtendBy ( const GfVec2f point)
inline

Modifies the range if necessary to surround the given value.

Deprecated:
Use UnionWith() instead.

Definition at line 126 of file range2f.h.

void GfRange2f::ExtendBy ( const GfRange2f range)
inline

Modifies the range if necessary to surround the given range.

Deprecated:
Use UnionWith() instead.

Definition at line 130 of file range2f.h.

GF_API GfVec2f GfRange2f::GetCorner ( size_t  i) const

Returns the ith corner of the range, in the following order: SW, SE, NW, NE.

GF_API double GfRange2f::GetDistanceSquared ( const GfVec2f p) const

Compute the squared distance from a point to the range.

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

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

Definition at line 210 of file range2f.h.

const GfVec2f& GfRange2f::GetMax ( ) const
inline

Returns the maximum value of the range.

Definition at line 100 of file range2f.h.

GfVec2f GfRange2f::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 range2f.h.

const GfVec2f& GfRange2f::GetMin ( ) const
inline

Returns the minimum value of the range.

Definition at line 97 of file range2f.h.

GF_API GfRange2f GfRange2f::GetQuadrant ( size_t  i) const

Returns the ith quadrant of the range, in the following order: SW, SE, NW, NE.

GfVec2f GfRange2f::GetSize ( ) const
inline

Returns the size of the range.

Definition at line 103 of file range2f.h.

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

Returns the smallest GfRange2f which contains both a and b.

Definition at line 170 of file range2f.h.

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

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

Deprecated:
Use GetIntersection() instead.

Definition at line 219 of file range2f.h.

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

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

Deprecated:
Use IntersectWith() instead.

Definition at line 234 of file range2f.h.

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

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

Definition at line 225 of file range2f.h.

bool GfRange2f::IsEmpty ( ) const
inline

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

Definition at line 120 of file range2f.h.

bool GfRange2f::IsInside ( const GfVec2f 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 149 of file range2f.h.

bool GfRange2f::IsInside ( const GfRange2f 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 157 of file range2f.h.

bool GfRange2f::IsOutside ( const GfRange2f 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 164 of file range2f.h.

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

Definition at line 310 of file range2f.h.

bool GfRange2f::operator!= ( const GfRange2d other) const
inline

Definition at line 371 of file range2f.h.

GfRange2f& GfRange2f::operator*= ( double  m)
inline

unary multiply.

Definition at line 253 of file range2f.h.

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

binary sum.

Definition at line 271 of file range2f.h.

GfRange2f& GfRange2f::operator+= ( const GfRange2f b)
inline

unary sum.

Definition at line 239 of file range2f.h.

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

binary difference.

Definition at line 277 of file range2f.h.

GfRange2f& GfRange2f::operator-= ( const GfRange2f b)
inline

unary difference.

Definition at line 246 of file range2f.h.

GfRange2f& GfRange2f::operator/= ( double  m)
inline

unary division.

Definition at line 266 of file range2f.h.

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

The min and max points must match exactly for equality.

Definition at line 306 of file range2f.h.

PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE bool GfRange2f::operator== ( const GfRange2d other) const
inline

Compare this range to a GfRange2d.

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

Definition at line 365 of file range2f.h.

void GfRange2f::SetEmpty ( )
inline

Sets the range to an empty interval.

Definition at line 75 of file range2f.h.

void GfRange2f::SetMax ( const GfVec2f max)
inline

Sets the maximum value of the range.

Definition at line 117 of file range2f.h.

void GfRange2f::SetMin ( const GfVec2f min)
inline

Sets the minimum value of the range.

Definition at line 114 of file range2f.h.

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

Returns the smallest GfRange2f which contains both a and b

Deprecated:
Use GetUnion() instead.

Definition at line 193 of file range2f.h.

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

Extend this to include b.

Deprecated:
Use UnionWith() instead.

Definition at line 199 of file range2f.h.

const GfRange2f& GfRange2f::Union ( const GfVec2f b)
inline

Extend this to include b.

Deprecated:
Use UnionWith() instead.

Definition at line 205 of file range2f.h.

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

Extend this to include b.

Definition at line 178 of file range2f.h.

const GfRange2f& GfRange2f::UnionWith ( const GfVec2f b)
inline

Extend this to include b.

Definition at line 185 of file range2f.h.

Friends And Related Function Documentation

size_t hash_value ( const GfRange2f r)
friend

hash.

Definition at line 301 of file range2f.h.

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

scalar multiply.

Definition at line 282 of file range2f.h.

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

scalar multiply.

Definition at line 289 of file range2f.h.

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

scalar divide.

Definition at line 296 of file range2f.h.

Member Data Documentation

const size_t GfRange2f::dimension = GfVec2f::dimension
static

Definition at line 70 of file range2f.h.

GF_API const GfRange2f GfRange2f::UnitSquare
static

The unit square.

Definition at line 337 of file range2f.h.


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