28 #ifndef PXR_BASE_GF_VEC4I_H
29 #define PXR_BASE_GF_VEC4I_H
40 #include <hboost/functional/hash.hpp>
79 : _data{
s0,
s1, s2, s3 }
86 : _data{ p[0], p[1], p[2], p[3] }
135 return Set(a[0], a[1], a[2], a[3]);
139 int const *
data()
const {
return _data; }
150 hboost::hash_combine(h, vec[0]);
151 hboost::hash_combine(h, vec[1]);
152 hboost::hash_combine(h, vec[2]);
153 hboost::hash_combine(h, vec[3]);
159 return _data[0] == other[0] &&
160 _data[1] == other[1] &&
161 _data[2] == other[2] &&
162 _data[3] == other[3];
165 return !(*
this == other);
181 return GfVec4i(-_data[0], -_data[1], -_data[2], -_data[3]);
186 _data[0] += other[0];
187 _data[1] += other[1];
188 _data[2] += other[2];
189 _data[3] += other[3];
198 _data[0] -= other[0];
199 _data[1] -= other[1];
200 _data[2] -= other[2];
201 _data[3] -= other[3];
237 return _data[0] * v[0] + _data[1] * v[1] + _data[2] * v[2] + _data[3] * v[3];
245 return v * (*
this *
v);
259 return *
this * *
this;
303 #endif // PXR_BASE_GF_VEC4I_H
static GfVec4i Axis(size_t i)
GLboolean GLboolean GLboolean b
friend GfVec4i operator+(GfVec4i const &l, GfVec4i const &r)
int const & operator[](size_t i) const
Indexing.
GfVec4i GfCompMult(GfVec4i const &v1, GfVec4i const &v2)
Returns component-wise multiplication of vectors v1 and v2.
GfVec4i operator-() const
Create a vec with negated elements.
GfVec4i & operator*=(double s)
Multiplication by scalar.
friend size_t hash_value(GfVec4i const &vec)
Hash.
GfVec4i & operator-=(GfVec4i const &other)
Subtraction.
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
constexpr GfVec4i(int value)
Initialize all elements to a single value.
int const * GetArray() const
static GfVec4i YAxis()
Create a unit vector along the Y-axis.
GfVec4i GfCompDiv(GfVec4i const &v1, GfVec4i const &v2)
Returns component-wise quotient of vectors v1 and v2.
int const * data() const
Direct data access.
GfVec4i()=default
Default constructor does no initialization.
GfVec4i & operator/=(int s)
Division by scalar.
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
GfVec4i GetComplement(GfVec4i const &b) const
GfVec4i & operator+=(GfVec4i const &other)
Addition.
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s0
int & operator[](size_t i)
GfVec4i operator*(double s) const
GLfloat GLfloat GLfloat v2
static GfVec4i ZAxis()
Create a unit vector along the Z-axis.
bool operator==(GfVec4i const &other) const
Equality comparison.
GLboolean GLboolean GLboolean GLboolean a
GF_API std::ostream & operator<<(std::ostream &, GfVec4i const &)
GfVec4i GetProjection(GfVec4i const &v) const
constexpr GfVec4i(Scl const *p)
Construct with pointer to values.
int GfDot(GfVec4i const &v1, GfVec4i const &v2)
Returns the dot (inner) product of two vectors.
GLfloat GLfloat GLfloat GLfloat h
GfVec4i & Set(int s0, int s1, int s2, int s3)
Set all elements with passed arguments.
bool operator!=(GfVec4i const &other) const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
friend GfVec4i operator*(double s, GfVec4i const &v)
GfVec4i operator/(int s) const
#define PXR_NAMESPACE_CLOSE_SCOPE
GfVec4i & Set(int const *a)
Set all elements with a pointer to data.
GLsizei const GLfloat * value
friend GfVec4i operator-(GfVec4i const &l, GfVec4i const &r)
static GfVec4i XAxis()
Create a unit vector along the X-axis.
int ScalarType
Scalar element type and dimension.
static const size_t dimension
int operator*(GfVec4i const &v) const
See GfDot().
constexpr GfVec4i(int s0, int s1, int s2, int s3)
Initialize all elements with explicit arguments.
static GfVec4i WAxis()
Create a unit vector along the W-axis.
int GetLengthSq() const
Squared length.