24 #ifndef PXR_BASE_GF_SIZE3_H 25 #define PXR_BASE_GF_SIZE3_H 33 #include "pxr/base/gf/api.h" 37 PXR_NAMESPACE_OPEN_SCOPE
65 Set(o[0], o[1], o[2]);
74 GfSize3(
size_t v0,
size_t v1,
size_t v2) {
106 return _vec[0] == v._vec[0] && _vec[1] == v._vec[1] &&
107 _vec[2] == v._vec[2];
112 return ! (*
this == v);
117 _vec[0] += v._vec[0];
118 _vec[1] += v._vec[1];
119 _vec[2] += v._vec[2];
125 _vec[0] -= v._vec[0];
126 _vec[1] -= v._vec[1];
127 _vec[2] -= v._vec[2];
133 _vec[0] *= v._vec[0];
134 _vec[1] *= v._vec[1];
135 _vec[2] *= v._vec[2];
141 _vec[0] = _vec[0] * d;
142 _vec[1] = _vec[1] * d;
143 _vec[2] = _vec[2] * d;
149 _vec[0] = _vec[0] / d;
150 _vec[1] = _vec[1] / d;
151 _vec[2] = _vec[2] / d;
157 return GfSize3(v1._vec[0]+v3._vec[0],
158 v1._vec[1]+v3._vec[1],
159 v1._vec[2]+v3._vec[2]);
164 return GfSize3(v1._vec[0]-v3._vec[0],
165 v1._vec[1]-v3._vec[1],
166 v1._vec[2]-v3._vec[2]);
171 return GfSize3(v1._vec[0]*v3._vec[0],
172 v1._vec[1]*v3._vec[1],
173 v1._vec[2]*v3._vec[2]);
202 return GfVec3i(_vec[0],_vec[1],_vec[2]);
211 PXR_NAMESPACE_CLOSE_SCOPE
213 #endif // PXR_BASE_GF_SIZE3_H GfSize3()
Default constructor initializes components to zero.
friend GfSize3 operator *(const GfSize3 &v1, const GfSize3 &v3)
Component-wise multiplication.
Three-dimensional array of sizes.
GfSize3 & operator *=(size_t d)
Component-wise in-place multiplication by a scalar.
GfSize3 & Set(const size_t v[3])
Set to the values in v.
friend GfSize3 operator *(size_t s, const GfSize3 &v1)
Component-wise multiplication by a scalar.
GfSize3 & Set(size_t v0, size_t v1, size_t v2)
Set to values passed directly.
friend GF_API std::ostream & operator<<(std::ostream &o, GfSize3 const &v)
Output operator.
GfSize3(const GfVec3i &o)
Conversion from GfVec3i.
size_t & operator [](size_t i)
Array operator.
GfSize3 & operator/=(size_t d)
Component-wise in-place division by a scalar.
GfSize3 & operator *=(GfSize3 const &v)
Component-wise in-place multiplication.
GfSize3 & operator+=(const GfSize3 &v)
Component-wise in-place addition.
friend GfSize3 operator/(const GfSize3 &v1, size_t s)
Component-wise division by a scalar.
Basic type for a vector of 3 int components.
friend GfSize3 operator -(const GfSize3 &v1, const GfSize3 &v3)
Component-wise subtraction.
GfSize3 & operator -=(const GfSize3 &v)
Component-wise in-place subtraction.
GfSize3(const GfSize3 &o)
Copy constructor.
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
const size_t & operator [](size_t i) const
Const array operator.
GfSize3(const size_t v[3])
Construct from an array.
bool operator !=(const GfSize3 &v) const
Component-wise inequality.
friend GfSize3 operator *(const GfSize3 &v1, size_t s)
Component-wise multiplication by a scalar.
friend GfSize3 operator+(const GfSize3 &v1, const GfSize3 &v3)
Component-wise addition.
bool operator==(const GfSize3 &v) const
Component-wise equality.
GfSize3(size_t v0, size_t v1, size_t v2)
Construct from three values.