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

#include <vec4i.h>

Public Types

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

Public Member Functions

 GfVec4i ()=default
 
constexpr GfVec4i (int value)
 Initialize all elements to a single value. More...
 
constexpr GfVec4i (int s0, int s1, int s2, int s3)
 Initialize all elements with explicit arguments. More...
 
template<class Scl >
constexpr GfVec4i (Scl const *p)
 Construct with pointer to values. More...
 
GfVec4iSet (int s0, int s1, int s2, int s3)
 Set all elements with passed arguments. More...
 
GfVec4iSet (int const *a)
 Set all elements with a pointer to data. More...
 
int const * data () const
 Direct data access. More...
 
intdata ()
 
int const * GetArray () const
 
int const & operator[] (size_t i) const
 Indexing. More...
 
intoperator[] (size_t i)
 
bool operator== (GfVec4i const &other) const
 Equality comparison. More...
 
bool operator!= (GfVec4i 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 GfVec4h const &other) const
 Equality comparison. More...
 
GfVec4i operator- () const
 Create a vec with negated elements. More...
 
GfVec4ioperator+= (GfVec4i const &other)
 Addition. More...
 
GfVec4ioperator-= (GfVec4i const &other)
 Subtraction. More...
 
GfVec4ioperator*= (double s)
 Multiplication by scalar. More...
 
GfVec4i operator* (double s) const
 
GfVec4ioperator/= (int s)
 Division by scalar. More...
 
GfVec4i operator/ (int s) const
 
int operator* (GfVec4i const &v) const
 See GfDot(). More...
 
GfVec4i GetProjection (GfVec4i const &v) const
 
GfVec4i GetComplement (GfVec4i const &b) const
 
int GetLengthSq () const
 Squared length. More...
 

Static Public Member Functions

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

Static Public Attributes

static const size_t dimension = 4
 

Friends

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

Detailed Description

Basic type for a vector of 4 int components.

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

Definition at line 43 of file vec4i.h.

Member Typedef Documentation

Scalar element type and dimension.

Definition at line 47 of file vec4i.h.

Constructor & Destructor Documentation

GfVec4i::GfVec4i ( )
default

GfVec4i value-initializes to zero and performs no default initialization, like float or double.

constexpr GfVec4i::GfVec4i ( int  value)
inlineexplicit

Initialize all elements to a single value.

Definition at line 55 of file vec4i.h.

constexpr GfVec4i::GfVec4i ( int  s0,
int  s1,
int  s2,
int  s3 
)
inline

Initialize all elements with explicit arguments.

Definition at line 61 of file vec4i.h.

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

Construct with pointer to values.

Definition at line 68 of file vec4i.h.

Member Function Documentation

static GfVec4i GfVec4i::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 100 of file vec4i.h.

int const* GfVec4i::data ( ) const
inline

Direct data access.

Definition at line 122 of file vec4i.h.

int* GfVec4i::data ( )
inline

Definition at line 123 of file vec4i.h.

int const* GfVec4i::GetArray ( ) const
inline

Definition at line 124 of file vec4i.h.

GfVec4i GfVec4i::GetComplement ( GfVec4i const &  b) const
inline

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

*this - this->GetProjection(b)

Definition at line 231 of file vec4i.h.

int GfVec4i::GetLengthSq ( ) const
inline

Squared length.

Definition at line 236 of file vec4i.h.

GfVec4i GfVec4i::GetProjection ( GfVec4i const &  v) const
inline

Returns the projection of this onto v. That is:

v * (*this * v)

Definition at line 222 of file vec4i.h.

bool GfVec4i::operator!= ( GfVec4i const &  other) const
inline

Definition at line 142 of file vec4i.h.

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

Definition at line 194 of file vec4i.h.

int GfVec4i::operator* ( GfVec4i const &  v) const
inline

See GfDot().

Definition at line 214 of file vec4i.h.

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

Multiplication by scalar.

Definition at line 187 of file vec4i.h.

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

Addition.

Definition at line 163 of file vec4i.h.

GfVec4i GfVec4i::operator- ( ) const
inline

Create a vec with negated elements.

Definition at line 158 of file vec4i.h.

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

Subtraction.

Definition at line 175 of file vec4i.h.

GfVec4i GfVec4i::operator/ ( int  s) const
inline

Definition at line 209 of file vec4i.h.

GfVec4i& GfVec4i::operator/= ( int  s)
inline

Division by scalar.

Definition at line 202 of file vec4i.h.

bool GfVec4i::operator== ( GfVec4i const &  other) const
inline

Equality comparison.

Definition at line 136 of file vec4i.h.

GF_API bool GfVec4i::operator== ( class GfVec4d const &  other) const

Equality comparison.

GF_API bool GfVec4i::operator== ( class GfVec4f const &  other) const

Equality comparison.

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

Equality comparison.

int const& GfVec4i::operator[] ( size_t  i) const
inline

Indexing.

Definition at line 127 of file vec4i.h.

int& GfVec4i::operator[] ( size_t  i)
inline

Definition at line 128 of file vec4i.h.

GfVec4i& GfVec4i::Set ( int  s0,
int  s1,
int  s2,
int  s3 
)
inline

Set all elements with passed arguments.

Definition at line 108 of file vec4i.h.

GfVec4i& GfVec4i::Set ( int const *  a)
inline

Set all elements with a pointer to data.

Definition at line 117 of file vec4i.h.

static GfVec4i GfVec4i::WAxis ( )
inlinestatic

Create a unit vector along the W-axis.

Definition at line 92 of file vec4i.h.

static GfVec4i GfVec4i::XAxis ( )
inlinestatic

Create a unit vector along the X-axis.

Definition at line 74 of file vec4i.h.

static GfVec4i GfVec4i::YAxis ( )
inlinestatic

Create a unit vector along the Y-axis.

Definition at line 80 of file vec4i.h.

static GfVec4i GfVec4i::ZAxis ( )
inlinestatic

Create a unit vector along the Z-axis.

Definition at line 86 of file vec4i.h.

Friends And Related Function Documentation

size_t hash_value ( GfVec4i const &  vec)
friend

Hash.

Definition at line 131 of file vec4i.h.

GfVec4i operator* ( double  s,
GfVec4i const &  v 
)
friend

Definition at line 197 of file vec4i.h.

GfVec4i operator+ ( GfVec4i const &  l,
GfVec4i const &  r 
)
friend

Definition at line 170 of file vec4i.h.

GfVec4i operator- ( GfVec4i const &  l,
GfVec4i const &  r 
)
friend

Definition at line 182 of file vec4i.h.

Member Data Documentation

const size_t GfVec4i::dimension = 4
static

Definition at line 48 of file vec4i.h.


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