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

#include <vec3i.h>

Public Types

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

Public Member Functions

 GfVec3i ()=default
 Default constructor does no initialization. More...
 
constexpr GfVec3i (int value)
 Initialize all elements to a single value. More...
 
constexpr GfVec3i (int s0, int s1, int s2)
 Initialize all elements with explicit arguments. More...
 
template<class Scl >
constexpr GfVec3i (Scl const *p)
 Construct with pointer to values. More...
 
GfVec3iSet (int s0, int s1, int s2)
 Set all elements with passed arguments. More...
 
GfVec3iSet (int const *a)
 Set all elements with a pointer to data. More...
 
int constdata () const
 Direct data access. More...
 
intdata ()
 
int constGetArray () const
 
int constoperator[] (size_t i) const
 Indexing. More...
 
intoperator[] (size_t i)
 
bool operator== (GfVec3i const &other) const
 Equality comparison. More...
 
bool operator!= (GfVec3i const &other) const
 
GF_API bool operator== (class GfVec3d const &other) const
 Equality comparison. More...
 
GF_API bool operator== (class GfVec3f const &other) const
 Equality comparison. More...
 
GF_API bool operator== (class GfVec3h const &other) const
 Equality comparison. More...
 
GfVec3i operator- () const
 Create a vec with negated elements. More...
 
GfVec3ioperator+= (GfVec3i const &other)
 Addition. More...
 
GfVec3ioperator-= (GfVec3i const &other)
 Subtraction. More...
 
GfVec3ioperator*= (double s)
 Multiplication by scalar. More...
 
GfVec3i operator* (double s) const
 
GfVec3ioperator/= (int s)
 Division by scalar. More...
 
GfVec3i operator/ (int s) const
 
int operator* (GfVec3i const &v) const
 See GfDot(). More...
 
GfVec3i GetProjection (GfVec3i const &v) const
 
GfVec3i GetComplement (GfVec3i const &b) const
 
int GetLengthSq () const
 Squared length. More...
 

Static Public Member Functions

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

Static Public Attributes

static const size_t dimension = 3
 

Friends

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

Detailed Description

Basic type for a vector of 3 int components.

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

Definition at line 61 of file vec3i.h.

Member Typedef Documentation

Scalar element type and dimension.

Definition at line 65 of file vec3i.h.

Constructor & Destructor Documentation

GfVec3i::GfVec3i ( )
default

Default constructor does no initialization.

constexpr GfVec3i::GfVec3i ( int  value)
inlineexplicit

Initialize all elements to a single value.

Definition at line 72 of file vec3i.h.

constexpr GfVec3i::GfVec3i ( int  s0,
int  s1,
int  s2 
)
inline

Initialize all elements with explicit arguments.

Definition at line 78 of file vec3i.h.

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

Construct with pointer to values.

Definition at line 85 of file vec3i.h.

Member Function Documentation

static GfVec3i GfVec3i::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 3.

Definition at line 111 of file vec3i.h.

int const* GfVec3i::data ( ) const
inline

Direct data access.

Definition at line 132 of file vec3i.h.

int* GfVec3i::data ( )
inline

Definition at line 133 of file vec3i.h.

int const* GfVec3i::GetArray ( ) const
inline

Definition at line 134 of file vec3i.h.

GfVec3i GfVec3i::GetComplement ( GfVec3i const b) const
inline

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

*this - this->GetProjection(b)

Definition at line 240 of file vec3i.h.

int GfVec3i::GetLengthSq ( ) const
inline

Squared length.

Definition at line 245 of file vec3i.h.

GfVec3i GfVec3i::GetProjection ( GfVec3i const v) const
inline

Returns the projection of this onto v. That is:

v * (*this * v)

Definition at line 231 of file vec3i.h.

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

Definition at line 155 of file vec3i.h.

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

Definition at line 204 of file vec3i.h.

int GfVec3i::operator* ( GfVec3i const v) const
inline

See GfDot().

Definition at line 223 of file vec3i.h.

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

Multiplication by scalar.

Definition at line 198 of file vec3i.h.

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

Addition.

Definition at line 176 of file vec3i.h.

GfVec3i GfVec3i::operator- ( ) const
inline

Create a vec with negated elements.

Definition at line 171 of file vec3i.h.

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

Subtraction.

Definition at line 187 of file vec3i.h.

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

Definition at line 218 of file vec3i.h.

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

Division by scalar.

Definition at line 212 of file vec3i.h.

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

Equality comparison.

Definition at line 150 of file vec3i.h.

GF_API bool GfVec3i::operator== ( class GfVec3d const other) const

Equality comparison.

GF_API bool GfVec3i::operator== ( class GfVec3f const other) const

Equality comparison.

GF_API bool GfVec3i::operator== ( class GfVec3h const other) const

Equality comparison.

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

Indexing.

Definition at line 137 of file vec3i.h.

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

Definition at line 138 of file vec3i.h.

GfVec3i& GfVec3i::Set ( int  s0,
int  s1,
int  s2 
)
inline

Set all elements with passed arguments.

Definition at line 119 of file vec3i.h.

GfVec3i& GfVec3i::Set ( int const a)
inline

Set all elements with a pointer to data.

Definition at line 127 of file vec3i.h.

static GfVec3i GfVec3i::XAxis ( )
inlinestatic

Create a unit vector along the X-axis.

Definition at line 91 of file vec3i.h.

static GfVec3i GfVec3i::YAxis ( )
inlinestatic

Create a unit vector along the Y-axis.

Definition at line 97 of file vec3i.h.

static GfVec3i GfVec3i::ZAxis ( )
inlinestatic

Create a unit vector along the Z-axis.

Definition at line 103 of file vec3i.h.

Friends And Related Function Documentation

size_t hash_value ( GfVec3i const vec)
friend

Hash.

Definition at line 141 of file vec3i.h.

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

Definition at line 207 of file vec3i.h.

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

Definition at line 182 of file vec3i.h.

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

Definition at line 193 of file vec3i.h.

Member Data Documentation

const size_t GfVec3i::dimension = 3
static

Definition at line 66 of file vec3i.h.


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