7#ifndef PXR_BASE_GF_SIZE3_H
8#define PXR_BASE_GF_SIZE3_H
16#include "pxr/base/gf/api.h"
20PXR_NAMESPACE_OPEN_SCOPE
48 Set(o[0], o[1], o[2]);
57 GfSize3(
size_t v0,
size_t v1,
size_t v2) {
89 return _vec[0] == v._vec[0] && _vec[1] == v._vec[1] &&
95 return ! (*
this == v);
100 _vec[0] += v._vec[0];
101 _vec[1] += v._vec[1];
102 _vec[2] += v._vec[2];
108 _vec[0] -= v._vec[0];
109 _vec[1] -= v._vec[1];
110 _vec[2] -= v._vec[2];
116 _vec[0] *= v._vec[0];
117 _vec[1] *= v._vec[1];
118 _vec[2] *= v._vec[2];
124 _vec[0] = _vec[0] * d;
125 _vec[1] = _vec[1] * d;
126 _vec[2] = _vec[2] * d;
132 _vec[0] = _vec[0] / d;
133 _vec[1] = _vec[1] / d;
134 _vec[2] = _vec[2] / d;
140 return GfSize3(v1._vec[0]+v3._vec[0],
141 v1._vec[1]+v3._vec[1],
142 v1._vec[2]+v3._vec[2]);
147 return GfSize3(v1._vec[0]-v3._vec[0],
148 v1._vec[1]-v3._vec[1],
149 v1._vec[2]-v3._vec[2]);
154 return GfSize3(v1._vec[0]*v3._vec[0],
155 v1._vec[1]*v3._vec[1],
156 v1._vec[2]*v3._vec[2]);
185 return GfVec3i(_vec[0],_vec[1],_vec[2]);
194PXR_NAMESPACE_CLOSE_SCOPE
Three-dimensional array of sizes.
GfSize3 & Set(const size_t v[3])
Set to the values in v.
friend GF_API std::ostream & operator<<(std::ostream &o, GfSize3 const &v)
Output operator.
GfSize3()
Default constructor initializes components to zero.
GfSize3(const GfSize3 &o)
Copy constructor.
GfSize3 & operator/=(size_t d)
Component-wise in-place division by a scalar.
friend GfSize3 operator/(const GfSize3 &v1, size_t s)
Component-wise division by a scalar.
GfSize3(const GfVec3i &o)
Conversion from GfVec3i.
bool operator==(const GfSize3 &v) const
Component-wise equality.
GfSize3(size_t v0, size_t v1, size_t v2)
Construct from three values.
friend GfSize3 operator+(const GfSize3 &v1, const GfSize3 &v3)
Component-wise addition.
GfSize3 & operator-=(const GfSize3 &v)
Component-wise in-place subtraction.
friend GfSize3 operator-(const GfSize3 &v1, const GfSize3 &v3)
Component-wise subtraction.
GfSize3(const size_t v[3])
Construct from an array.
GfSize3 & operator*=(GfSize3 const &v)
Component-wise in-place multiplication.
friend GfSize3 operator*(const GfSize3 &v1, const GfSize3 &v3)
Component-wise multiplication.
GfSize3 & operator+=(const GfSize3 &v)
Component-wise in-place addition.
GfSize3 & Set(size_t v0, size_t v1, size_t v2)
Set to values passed directly.
size_t & operator[](size_t i)
Array operator.
bool operator!=(const GfSize3 &v) const
Component-wise inequality.
Basic type for a vector of 3 int components.
GF_API std::ostream & operator<<(std::ostream &, const GfBBox3d &)
Output a GfBBox3d using the format [(range) matrix zeroArea].