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

#include <vec4h.h>

Public Types

typedef GfHalf ScalarType
 Scalar element type and dimension. More...
 

Public Member Functions

 GfVec4h ()=default
 Default constructor does no initialization. More...
 
constexpr GfVec4h (GfHalf value)
 Initialize all elements to a single value. More...
 
constexpr GfVec4h (GfHalf s0, GfHalf s1, GfHalf s2, GfHalf s3)
 Initialize all elements with explicit arguments. More...
 
template<class Scl >
constexpr GfVec4h (Scl const *p)
 Construct with pointer to values. More...
 
 GfVec4h (class GfVec4d const &other)
 Construct from GfVec4d. More...
 
 GfVec4h (class GfVec4f const &other)
 Construct from GfVec4f. More...
 
 GfVec4h (class GfVec4i const &other)
 Implicitly convert from GfVec4i. More...
 
GfVec4hSet (GfHalf s0, GfHalf s1, GfHalf s2, GfHalf s3)
 Set all elements with passed arguments. More...
 
GfVec4hSet (GfHalf const *a)
 Set all elements with a pointer to data. More...
 
GfHalf constdata () const
 Direct data access. More...
 
GfHalfdata ()
 
GfHalf constGetArray () const
 
GfHalf constoperator[] (size_t i) const
 Indexing. More...
 
GfHalfoperator[] (size_t i)
 
bool operator== (GfVec4h const &other) const
 Equality comparison. More...
 
bool operator!= (GfVec4h const &other) const
 
GF_API bool operator== (class GfVec4d const &other) const
 Equality comparison. More...
 
GF_API bool operator== (class GfVec4f const &other) const
 Equality comparison. More...
 
GF_API bool operator== (class GfVec4i const &other) const
 Equality comparison. More...
 
GfVec4h operator- () const
 Create a vec with negated elements. More...
 
GfVec4hoperator+= (GfVec4h const &other)
 Addition. More...
 
GfVec4hoperator-= (GfVec4h const &other)
 Subtraction. More...
 
GfVec4hoperator*= (double s)
 Multiplication by scalar. More...
 
GfVec4h operator* (double s) const
 
GfVec4hoperator/= (double s)
 Division by scalar. More...
 
GfVec4h operator/ (double s) const
 
GfHalf operator* (GfVec4h const &v) const
 See GfDot(). More...
 
GfVec4h GetProjection (GfVec4h const &v) const
 
GfVec4h GetComplement (GfVec4h const &b) const
 
GfHalf GetLengthSq () const
 Squared length. More...
 
GfHalf GetLength () const
 Length. More...
 
GfHalf Normalize (GfHalf eps=0.001)
 
GfVec4h GetNormalized (GfHalf eps=0.001) const
 

Static Public Member Functions

static GfVec4h XAxis ()
 Create a unit vector along the X-axis. More...
 
static GfVec4h YAxis ()
 Create a unit vector along the Y-axis. More...
 
static GfVec4h ZAxis ()
 Create a unit vector along the Z-axis. More...
 
static GfVec4h WAxis ()
 Create a unit vector along the W-axis. More...
 
static GfVec4h Axis (size_t i)
 

Static Public Attributes

static const size_t dimension = 4
 

Friends

size_t hash_value (GfVec4h const &vec)
 Hash. More...
 
GfVec4h operator+ (GfVec4h const &l, GfVec4h const &r)
 
GfVec4h operator- (GfVec4h const &l, GfVec4h const &r)
 
GfVec4h operator* (double s, GfVec4h const &v)
 

Detailed Description

Basic type for a vector of 4 GfHalf components.

Represents a vector of 4 components of type GfHalf. It is intended to be fast and simple.

Definition at line 64 of file vec4h.h.

Member Typedef Documentation

Scalar element type and dimension.

Definition at line 68 of file vec4h.h.

Constructor & Destructor Documentation

GfVec4h::GfVec4h ( )
default

Default constructor does no initialization.

constexpr GfVec4h::GfVec4h ( GfHalf  value)
inlineexplicit

Initialize all elements to a single value.

Definition at line 75 of file vec4h.h.

constexpr GfVec4h::GfVec4h ( GfHalf  s0,
GfHalf  s1,
GfHalf  s2,
GfHalf  s3 
)
inline

Initialize all elements with explicit arguments.

Definition at line 81 of file vec4h.h.

template<class Scl >
constexpr GfVec4h::GfVec4h ( Scl const p)
inlineexplicit

Construct with pointer to values.

Definition at line 88 of file vec4h.h.

PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE GfVec4h::GfVec4h ( class GfVec4d const other)
inlineexplicit

Construct from GfVec4d.

Definition at line 321 of file vec4h.h.

GfVec4h::GfVec4h ( class GfVec4f const other)
inlineexplicit

Construct from GfVec4f.

Definition at line 329 of file vec4h.h.

GfVec4h::GfVec4h ( class GfVec4i const other)
inline

Implicitly convert from GfVec4i.

Definition at line 337 of file vec4h.h.

Member Function Documentation

static GfVec4h GfVec4h::Axis ( size_t  i)
inlinestatic

Create a unit vector along the i-th axis, zero-based. Return the zero vector if i is greater than or equal to 4.

Definition at line 129 of file vec4h.h.

GfHalf const* GfVec4h::data ( ) const
inline

Direct data access.

Definition at line 151 of file vec4h.h.

GfHalf* GfVec4h::data ( )
inline

Definition at line 152 of file vec4h.h.

GfHalf const* GfVec4h::GetArray ( ) const
inline

Definition at line 153 of file vec4h.h.

GfVec4h GfVec4h::GetComplement ( GfVec4h const b) const
inline

Returns the orthogonal complement of this->GetProjection(b). That is:

*this - this->GetProjection(b)

Definition at line 265 of file vec4h.h.

GfHalf GfVec4h::GetLength ( ) const
inline

Length.

Definition at line 275 of file vec4h.h.

GfHalf GfVec4h::GetLengthSq ( ) const
inline

Squared length.

Definition at line 270 of file vec4h.h.

GfVec4h GfVec4h::GetNormalized ( GfHalf  eps = 0.001) const
inline

Definition at line 296 of file vec4h.h.

GfVec4h GfVec4h::GetProjection ( GfVec4h const v) const
inline

Returns the projection of this onto v. That is:

v * (*this * v)

Definition at line 256 of file vec4h.h.

GfHalf GfVec4h::Normalize ( GfHalf  eps = 0.001)
inline

Normalizes the vector in place to unit length, returning the length before normalization. If the length of the vector is smaller than eps, then the vector is set to vector/eps. The original length of the vector is returned. See also GfNormalize().

Todo:
This was fixed for bug 67777. This is a gcc64 optimizer bug. By tickling the code, it no longer tries to write into an illegal memory address (in the code section of memory).

Definition at line 288 of file vec4h.h.

bool GfVec4h::operator!= ( GfVec4h const other) const
inline

Definition at line 176 of file vec4h.h.

GfVec4h GfVec4h::operator* ( double  s) const
inline

Definition at line 228 of file vec4h.h.

GfHalf GfVec4h::operator* ( GfVec4h const v) const
inline

See GfDot().

Definition at line 248 of file vec4h.h.

GfVec4h& GfVec4h::operator*= ( double  s)
inline

Multiplication by scalar.

Definition at line 221 of file vec4h.h.

GfVec4h& GfVec4h::operator+= ( GfVec4h const other)
inline

Addition.

Definition at line 197 of file vec4h.h.

GfVec4h GfVec4h::operator- ( ) const
inline

Create a vec with negated elements.

Definition at line 192 of file vec4h.h.

GfVec4h& GfVec4h::operator-= ( GfVec4h const other)
inline

Subtraction.

Definition at line 209 of file vec4h.h.

GfVec4h GfVec4h::operator/ ( double  s) const
inline

Definition at line 243 of file vec4h.h.

GfVec4h& GfVec4h::operator/= ( double  s)
inline

Division by scalar.

Definition at line 237 of file vec4h.h.

bool GfVec4h::operator== ( GfVec4h const other) const
inline

Equality comparison.

Definition at line 170 of file vec4h.h.

GF_API bool GfVec4h::operator== ( class GfVec4d const other) const

Equality comparison.

GF_API bool GfVec4h::operator== ( class GfVec4f const other) const

Equality comparison.

GF_API bool GfVec4h::operator== ( class GfVec4i const other) const

Equality comparison.

GfHalf const& GfVec4h::operator[] ( size_t  i) const
inline

Indexing.

Definition at line 156 of file vec4h.h.

GfHalf& GfVec4h::operator[] ( size_t  i)
inline

Definition at line 157 of file vec4h.h.

GfVec4h& GfVec4h::Set ( GfHalf  s0,
GfHalf  s1,
GfHalf  s2,
GfHalf  s3 
)
inline

Set all elements with passed arguments.

Definition at line 137 of file vec4h.h.

GfVec4h& GfVec4h::Set ( GfHalf const a)
inline

Set all elements with a pointer to data.

Definition at line 146 of file vec4h.h.

static GfVec4h GfVec4h::WAxis ( )
inlinestatic

Create a unit vector along the W-axis.

Definition at line 121 of file vec4h.h.

static GfVec4h GfVec4h::XAxis ( )
inlinestatic

Create a unit vector along the X-axis.

Definition at line 103 of file vec4h.h.

static GfVec4h GfVec4h::YAxis ( )
inlinestatic

Create a unit vector along the Y-axis.

Definition at line 109 of file vec4h.h.

static GfVec4h GfVec4h::ZAxis ( )
inlinestatic

Create a unit vector along the Z-axis.

Definition at line 115 of file vec4h.h.

Friends And Related Function Documentation

size_t hash_value ( GfVec4h const vec)
friend

Hash.

Definition at line 160 of file vec4h.h.

GfVec4h operator* ( double  s,
GfVec4h const v 
)
friend

Definition at line 231 of file vec4h.h.

GfVec4h operator+ ( GfVec4h const l,
GfVec4h const r 
)
friend

Definition at line 204 of file vec4h.h.

GfVec4h operator- ( GfVec4h const l,
GfVec4h const r 
)
friend

Definition at line 216 of file vec4h.h.

Member Data Documentation

const size_t GfVec4h::dimension = 4
static

Definition at line 69 of file vec4h.h.


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