28 #ifndef PXR_BASE_GF_VEC4I_H
29 #define PXR_BASE_GF_VEC4I_H
77 constexpr
GfVec4i(
int s0,
int s1,
int s2,
int s3)
78 : _data{ s0, s1, s2, s3 }
85 : _data{ p[0], p[1], p[2], p[3] }
134 return Set(a[0], a[1], a[2], a[3]);
138 int const *
data()
const {
return _data; }
153 return _data[0] == other[0] &&
154 _data[1] == other[1] &&
155 _data[2] == other[2] &&
156 _data[3] == other[3];
159 return !(*
this == other);
175 return GfVec4i(-_data[0], -_data[1], -_data[2], -_data[3]);
180 _data[0] += other[0];
181 _data[1] += other[1];
182 _data[2] += other[2];
183 _data[3] += other[3];
192 _data[0] -= other[0];
193 _data[1] -= other[1];
194 _data[2] -= other[2];
195 _data[3] -= other[3];
231 return _data[0] * v[0] + _data[1] * v[1] + _data[2] * v[2] + _data[3] * v[3];
239 return v * (*
this *
v);
253 return *
this * *
this;
297 #endif // PXR_BASE_GF_VEC4I_H
static GfVec4i Axis(size_t i)
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.
GLsizei const GLfloat * 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.
GLboolean GLboolean GLboolean GLboolean a
int const * data() const
Direct data access.
**But if you need a result
GLfloat GLfloat GLfloat v2
GfVec4i()=default
Default constructor does no initialization.
GfVec4i & operator/=(int s)
Division by scalar.
GfVec4i GetComplement(GfVec4i const &b) const
GfVec4i & operator+=(GfVec4i const &other)
Addition.
int & operator[](size_t i)
GfVec4i operator*(double s) const
static GfVec4i ZAxis()
Create a unit vector along the Z-axis.
bool operator==(GfVec4i const &other) const
Equality comparison.
GF_API std::ostream & operator<<(std::ostream &, GfVec4i const &)
GLboolean GLboolean GLboolean b
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.
GfVec4i & Set(int s0, int s1, int s2, int s3)
Set all elements with passed arguments.
bool operator!=(GfVec4i const &other) const
static size_t Combine(Args &&...args)
Produce a hash code by combining the hash codes of several objects.
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.
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.