This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GfSize2 Class Reference

Two-dimensional array of sizes. More...

#include <size2.h>

Public Member Functions

 GfSize2 ()
 Default constructor initializes components to zero.
 
 GfSize2 (const GfSize2 &o)
 Copy constructor.
 
 GfSize2 (const GfVec2i &o)
 Conversion from GfVec2i.
 
 GfSize2 (const size_t v[2])
 Construct from an array.
 
 GfSize2 (size_t v0, size_t v1)
 Construct from two values.
 
GfSize2Set (const size_t v[2])
 Set to the values in a given array.
 
GfSize2Set (size_t v0, size_t v1)
 Set to values passed directly.
 
size_t & operator[] (size_t i)
 Array operator.
 
const size_t & operator[] (size_t i) const
 Const array operator.
 
bool operator== (const GfSize2 &v) const
 Component-wise equality.
 
bool operator!= (const GfSize2 &v) const
 Component-wise inequality.
 
GfSize2operator+= (const GfSize2 &v)
 Component-wise in-place addition.
 
GfSize2operator-= (const GfSize2 &v)
 Component-wise in-place subtraction.
 
GfSize2operator*= (GfSize2 const &v)
 Component-wise in-place multiplication.
 
GfSize2operator*= (int d)
 Component-wise in-place multiplication by a scalar.
 
GfSize2operator/= (int d)
 Component-wise in-place division by a scalar.
 
 operator GfVec2i () const
 Conversion to GfVec2i.
 

Friends

GfSize2 operator+ (const GfSize2 &v1, const GfSize2 &v2)
 Component-wise addition.
 
GfSize2 operator- (const GfSize2 &v1, const GfSize2 &v2)
 Component-wise subtraction.
 
GfSize2 operator* (const GfSize2 &v1, const GfSize2 &v2)
 Component-wise multiplication.
 
GfSize2 operator* (const GfSize2 &v1, int s)
 Component-wise multiplication by a scalar.
 
GfSize2 operator* (int s, const GfSize2 &v1)
 Component-wise multiplication by a scalar.
 
GfSize2 operator/ (const GfSize2 &v1, int s)
 Component-wise division by a scalar.
 
GF_API friend std::ostream & operator<< (std::ostream &o, GfSize2 const &v)
 Output operator.
 

Detailed Description

Two-dimensional array of sizes.

GfSize2 is used to represent pairs of counts. It is based on the datatype size_t, and thus can only represent non-negative values in each dimension. If you need to represent negative numbers as well, use GfVec2i.

Usage of GfSize2 is similar to that of GfVec2i, except that all mathematical operations are componentwise (including multiplication).

Definition at line 34 of file size2.h.

Constructor & Destructor Documentation

◆ GfSize2() [1/5]

GfSize2 ( )
inline

Default constructor initializes components to zero.

Definition at line 37 of file size2.h.

◆ GfSize2() [2/5]

GfSize2 ( const GfSize2 o)
inline

Copy constructor.

Definition at line 42 of file size2.h.

◆ GfSize2() [3/5]

GfSize2 ( const GfVec2i o)
inlineexplicit

Conversion from GfVec2i.

Definition at line 47 of file size2.h.

◆ GfSize2() [4/5]

GfSize2 ( const size_t  v[2])
inline

Construct from an array.

Definition at line 52 of file size2.h.

◆ GfSize2() [5/5]

GfSize2 ( size_t  v0,
size_t  v1 
)
inline

Construct from two values.

Definition at line 57 of file size2.h.

Member Function Documentation

◆ operator GfVec2i()

operator GfVec2i ( ) const
inline

Conversion to GfVec2i.

Definition at line 171 of file size2.h.

◆ operator!=()

bool operator!= ( const GfSize2 v) const
inline

Component-wise inequality.

Definition at line 91 of file size2.h.

◆ operator*=() [1/2]

GfSize2 & operator*= ( GfSize2 const &  v)
inline

Component-wise in-place multiplication.

Definition at line 110 of file size2.h.

◆ operator*=() [2/2]

GfSize2 & operator*= ( int  d)
inline

Component-wise in-place multiplication by a scalar.

Definition at line 117 of file size2.h.

◆ operator+=()

GfSize2 & operator+= ( const GfSize2 v)
inline

Component-wise in-place addition.

Definition at line 96 of file size2.h.

◆ operator-=()

GfSize2 & operator-= ( const GfSize2 v)
inline

Component-wise in-place subtraction.

Definition at line 103 of file size2.h.

◆ operator/=()

GfSize2 & operator/= ( int  d)
inline

Component-wise in-place division by a scalar.

Definition at line 124 of file size2.h.

◆ operator==()

bool operator== ( const GfSize2 v) const
inline

Component-wise equality.

Definition at line 86 of file size2.h.

◆ operator[]() [1/2]

size_t & operator[] ( size_t  i)
inline

Array operator.

Definition at line 76 of file size2.h.

◆ operator[]() [2/2]

const size_t & operator[] ( size_t  i) const
inline

Const array operator.

Definition at line 81 of file size2.h.

◆ Set() [1/2]

GfSize2 & Set ( const size_t  v[2])
inline

Set to the values in a given array.

Definition at line 62 of file size2.h.

◆ Set() [2/2]

GfSize2 & Set ( size_t  v0,
size_t  v1 
)
inline

Set to values passed directly.

Definition at line 69 of file size2.h.

Friends And Related Function Documentation

◆ operator* [1/3]

GfSize2 operator* ( const GfSize2 v1,
const GfSize2 v2 
)
friend

Component-wise multiplication.

Definition at line 143 of file size2.h.

◆ operator* [2/3]

GfSize2 operator* ( const GfSize2 v1,
int  s 
)
friend

Component-wise multiplication by a scalar.

Definition at line 149 of file size2.h.

◆ operator* [3/3]

GfSize2 operator* ( int  s,
const GfSize2 v1 
)
friend

Component-wise multiplication by a scalar.

Definition at line 155 of file size2.h.

◆ operator+

GfSize2 operator+ ( const GfSize2 v1,
const GfSize2 v2 
)
friend

Component-wise addition.

Definition at line 131 of file size2.h.

◆ operator-

GfSize2 operator- ( const GfSize2 v1,
const GfSize2 v2 
)
friend

Component-wise subtraction.

Definition at line 137 of file size2.h.

◆ operator/

GfSize2 operator/ ( const GfSize2 v1,
int  s 
)
friend

Component-wise division by a scalar.

Definition at line 161 of file size2.h.

◆ operator<<

GF_API friend std::ostream & operator<< ( std::ostream &  o,
GfSize2 const &  v 
)
friend

Output operator.


The documentation for this class was generated from the following file: