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

#include <range1d.h>

Public Types

typedef double MinMaxType
 Helper typedef. More...
 
typedef MinMaxType ScalarType
 

Public Member Functions

void SetEmpty ()
 Sets the range to an empty interval. More...
 
 GfRange1d ()
 The default constructor creates an empty range. More...
 
 GfRange1d (double min, double max)
 This constructor initializes the minimum and maximum points. More...
 
GF_API GfRange1d (class GfRange1f const &other)
 Implicitly convert from GfRange1f. More...
 
double GetMin () const
 Returns the minimum value of the range. More...
 
double GetMax () const
 Returns the maximum value of the range. More...
 
double GetSize () const
 Returns the size of the range. More...
 
double GetMidpoint () const
 
void SetMin (double min)
 Sets the minimum value of the range. More...
 
void SetMax (double max)
 Sets the maximum value of the range. More...
 
bool IsEmpty () const
 Returns whether the range is empty (max < min). More...
 
void ExtendBy (double point)
 
void ExtendBy (const GfRange1d &range)
 
bool Contains (double point) const
 
bool Contains (const GfRange1d &range) const
 
bool IsInside (double point) const
 
bool IsInside (const GfRange1d &range) const
 
bool IsOutside (const GfRange1d &range) const
 
const GfRange1dUnionWith (const GfRange1d &b)
 Extend this to include b. More...
 
const GfRange1dUnionWith (double b)
 Extend this to include b. More...
 
const GfRange1dUnion (const GfRange1d &b)
 
const GfRange1dUnion (double b)
 
const GfRange1dIntersectWith (const GfRange1d &b)
 
const GfRange1dIntersection (const GfRange1d &b)
 
GfRange1doperator+= (const GfRange1d &b)
 unary sum. More...
 
GfRange1doperator-= (const GfRange1d &b)
 unary difference. More...
 
GfRange1doperator*= (double m)
 unary multiply. More...
 
GfRange1doperator/= (double m)
 unary division. More...
 
GfRange1d operator+ (const GfRange1d &b) const
 binary sum. More...
 
GfRange1d operator- (const GfRange1d &b) const
 binary difference. More...
 
bool operator== (const GfRange1d &b) const
 The min and max points must match exactly for equality. More...
 
bool operator!= (const GfRange1d &b) const
 
GF_API bool operator== (const GfRange1f &other) const
 
GF_API bool operator!= (const GfRange1f &other) const
 
GF_API double GetDistanceSquared (double p) const
 Compute the squared distance from a point to the range. More...
 

Static Public Member Functions

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

Static Public Attributes

static const size_t dimension = 1
 

Friends

GfRange1d operator* (double m, const GfRange1d &r)
 scalar multiply. More...
 
GfRange1d operator* (const GfRange1d &r, double m)
 scalar multiply. More...
 
GfRange1d operator/ (const GfRange1d &r, double m)
 scalar divide. More...
 
size_t hash_value (const GfRange1d &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 44 of file range1d.h.

Member Typedef Documentation

typedef double GfRange1d::MinMaxType

Helper typedef.

Definition at line 49 of file range1d.h.

Definition at line 52 of file range1d.h.

Constructor & Destructor Documentation

GfRange1d::GfRange1d ( )
inline

The default constructor creates an empty range.

Definition at line 62 of file range1d.h.

GfRange1d::GfRange1d ( double  min,
double  max 
)
inline

This constructor initializes the minimum and maximum points.

Definition at line 67 of file range1d.h.

GF_API GfRange1d::GfRange1d ( class GfRange1f const &  other)

Implicitly convert from GfRange1f.

Member Function Documentation

bool GfRange1d::Contains ( double  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 115 of file range1d.h.

bool GfRange1d::Contains ( const GfRange1d 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 122 of file range1d.h.

void GfRange1d::ExtendBy ( double  point)
inline

Modifies the range if necessary to surround the given value.

Deprecated:
Use UnionWith() instead.

Definition at line 107 of file range1d.h.

void GfRange1d::ExtendBy ( const GfRange1d range)
inline

Modifies the range if necessary to surround the given range.

Deprecated:
Use UnionWith() instead.

Definition at line 111 of file range1d.h.

GF_API double GfRange1d::GetDistanceSquared ( double  p) const

Compute the squared distance from a point to the range.

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

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

Definition at line 189 of file range1d.h.

double GfRange1d::GetMax ( ) const
inline

Returns the maximum value of the range.

Definition at line 81 of file range1d.h.

double GfRange1d::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 89 of file range1d.h.

double GfRange1d::GetMin ( ) const
inline

Returns the minimum value of the range.

Definition at line 78 of file range1d.h.

double GfRange1d::GetSize ( ) const
inline

Returns the size of the range.

Definition at line 84 of file range1d.h.

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

Returns the smallest GfRange1d which contains both a and b.

Definition at line 149 of file range1d.h.

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

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

Deprecated:
Use GetIntersection() instead.

Definition at line 198 of file range1d.h.

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

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

Deprecated:
Use IntersectWith() instead.

Definition at line 213 of file range1d.h.

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

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

Definition at line 204 of file range1d.h.

bool GfRange1d::IsEmpty ( ) const
inline

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

Definition at line 101 of file range1d.h.

bool GfRange1d::IsInside ( double  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 129 of file range1d.h.

bool GfRange1d::IsInside ( const GfRange1d 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 137 of file range1d.h.

bool GfRange1d::IsOutside ( const GfRange1d 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 144 of file range1d.h.

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

Definition at line 289 of file range1d.h.

bool GfRange1d::operator!= ( const GfRange1f other) const
inline

Definition at line 335 of file range1d.h.

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

unary multiply.

Definition at line 232 of file range1d.h.

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

binary sum.

Definition at line 250 of file range1d.h.

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

unary sum.

Definition at line 218 of file range1d.h.

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

binary difference.

Definition at line 256 of file range1d.h.

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

unary difference.

Definition at line 225 of file range1d.h.

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

unary division.

Definition at line 245 of file range1d.h.

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

The min and max points must match exactly for equality.

Definition at line 285 of file range1d.h.

PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE bool GfRange1d::operator== ( const GfRange1f other) const
inline

Compare this range to a GfRange1f.

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

Definition at line 329 of file range1d.h.

void GfRange1d::SetEmpty ( )
inline

Sets the range to an empty interval.

Definition at line 56 of file range1d.h.

void GfRange1d::SetMax ( double  max)
inline

Sets the maximum value of the range.

Definition at line 98 of file range1d.h.

void GfRange1d::SetMin ( double  min)
inline

Sets the minimum value of the range.

Definition at line 95 of file range1d.h.

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

Returns the smallest GfRange1d which contains both a and b

Deprecated:
Use GetUnion() instead.

Definition at line 172 of file range1d.h.

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

Extend this to include b.

Deprecated:
Use UnionWith() instead.

Definition at line 178 of file range1d.h.

const GfRange1d& GfRange1d::Union ( double  b)
inline

Extend this to include b.

Deprecated:
Use UnionWith() instead.

Definition at line 184 of file range1d.h.

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

Extend this to include b.

Definition at line 157 of file range1d.h.

const GfRange1d& GfRange1d::UnionWith ( double  b)
inline

Extend this to include b.

Definition at line 164 of file range1d.h.

Friends And Related Function Documentation

size_t hash_value ( const GfRange1d r)
friend

hash.

Definition at line 280 of file range1d.h.

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

scalar multiply.

Definition at line 261 of file range1d.h.

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

scalar multiply.

Definition at line 268 of file range1d.h.

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

scalar divide.

Definition at line 275 of file range1d.h.

Member Data Documentation

const size_t GfRange1d::dimension = 1
static

Definition at line 51 of file range1d.h.


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