24 #ifndef PXR_BASE_GF_SIZE2_H
25 #define PXR_BASE_GF_SIZE2_H
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]);
200 #endif // PXR_BASE_GF_SIZE2_H
GfSize2(const GfSize2 &o)
Copy constructor.
GfSize2(const GfVec2i &o)
Conversion from GfVec2i.
GfSize2 & Set(const size_t v[2])
Set to the values in a given array.
GLfloat GLfloat GLfloat v2
size_t & operator[](size_t i)
Array operator.
bool operator==(const GfSize2 &v) const
Component-wise equality.
friend GfSize2 operator*(const GfSize2 &v1, const GfSize2 &v2)
Component-wise multiplication.
GF_API std::ostream & operator<<(std::ostream &o, GfSize2 const &v)
GfSize2(size_t v0, size_t v1)
Construct from two values.
bool operator!=(const GfSize2 &v) const
Component-wise inequality.
friend GfSize2 operator/(const GfSize2 &v1, int s)
Component-wise division by a scalar.
friend GfSize2 operator-(const GfSize2 &v1, const GfSize2 &v2)
Component-wise subtraction.
GfSize2(const size_t v[2])
Construct from an array.
GF_API friend std::ostream & operator<<(std::ostream &o, GfSize2 const &v)
Output operator.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
GfSize2 & operator*=(GfSize2 const &v)
Component-wise in-place multiplication.
GfSize2 & operator-=(const GfSize2 &v)
Component-wise in-place subtraction.
GfSize2 & operator+=(const GfSize2 &v)
Component-wise in-place addition.
#define PXR_NAMESPACE_CLOSE_SCOPE
friend GfSize2 operator+(const GfSize2 &v1, const GfSize2 &v2)
Component-wise addition.
GfSize2()
Default constructor initializes components to zero.
GfSize2 & operator/=(int d)
Component-wise in-place division by a scalar.
GfSize2 & Set(size_t v0, size_t v1)
Set to values passed directly.