24 #ifndef PXR_BASE_GF_SIZE2_H 25 #define PXR_BASE_GF_SIZE2_H 33 #include "pxr/base/gf/api.h" 37 PXR_NAMESPACE_OPEN_SCOPE
104 return _vec[0] == v._vec[0] && _vec[1] == v._vec[1];
109 return ! (*
this == v);
114 _vec[0] += v._vec[0];
115 _vec[1] += v._vec[1];
121 _vec[0] -= v._vec[0];
122 _vec[1] -= v._vec[1];
128 _vec[0] *= v._vec[0];
129 _vec[1] *= v._vec[1];
135 _vec[0] = _vec[0] * d;
136 _vec[1] = _vec[1] * d;
142 _vec[0] = _vec[0] / d;
143 _vec[1] = _vec[1] / d;
149 return GfSize2(v1._vec[0]+v2._vec[0],
150 v1._vec[1]+v2._vec[1]);
155 return GfSize2(v1._vec[0]-v2._vec[0],
156 v1._vec[1]-v2._vec[1]);
161 return GfSize2(v1._vec[0]*v2._vec[0],
162 v1._vec[1]*v2._vec[1]);
189 return GfVec2i(_vec[0], _vec[1]);
198 PXR_NAMESPACE_CLOSE_SCOPE
200 #endif // PXR_BASE_GF_SIZE2_H GfSize2(size_t v0, size_t v1)
Construct from two values.
bool operator !=(const GfSize2 &v) const
Component-wise inequality.
GfSize2(const GfVec2i &o)
Conversion from GfVec2i.
friend GfSize2 operator -(const GfSize2 &v1, const GfSize2 &v2)
Component-wise subtraction.
Basic type for a vector of 2 int components.
friend GfSize2 operator *(const GfSize2 &v1, const GfSize2 &v2)
Component-wise multiplication.
size_t & operator [](size_t i)
Array operator.
GfSize2 & operator *=(GfSize2 const &v)
Component-wise in-place multiplication.
GfSize2(const GfSize2 &o)
Copy constructor.
GfSize2 & Set(const size_t v[2])
Set to the values in a given array.
GfSize2 & operator *=(int d)
Component-wise in-place multiplication by a scalar.
GfSize2()
Default constructor initializes components to zero.
GfSize2(const size_t v[2])
Construct from an array.
GfSize2 & operator -=(const GfSize2 &v)
Component-wise in-place subtraction.
friend GfSize2 operator *(const GfSize2 &v1, int s)
Component-wise multiplication by a scalar.
const size_t & operator [](size_t i) const
Const array operator.
friend GfSize2 operator *(int s, const GfSize2 &v1)
Component-wise multiplication by a scalar.
friend GfSize2 operator/(const GfSize2 &v1, int s)
Component-wise division by a scalar.
GfSize2 & Set(size_t v0, size_t v1)
Set to values passed directly.
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].
GF_API friend std::ostream & operator<<(std::ostream &o, GfSize2 const &v)
Output operator.
bool operator==(const GfSize2 &v) const
Component-wise equality.
Two-dimensional array of sizes.
friend GfSize2 operator+(const GfSize2 &v1, const GfSize2 &v2)
Component-wise addition.
GfSize2 & operator/=(int d)
Component-wise in-place division by a scalar.
GfSize2 & operator+=(const GfSize2 &v)
Component-wise in-place addition.