usdrt::GfRect2i
Defined in usdrt/gf/rect.h
Functions
usdrt::GfRect2i::Contains: Returns true if the specified point in the rectangle.
usdrt::GfRect2i::GetArea: Return the area of the rectangle.
usdrt::GfRect2i::GetCenter: Returns the center point of the rectangle.
usdrt::GfRect2i::GetHeight: Returns the height of the rectangle.
usdrt::GfRect2i::GetIntersection: Computes the intersection of two rectangles.
usdrt::GfRect2i::GetMax: Returns the max corner of the rectangle.
usdrt::GfRect2i::GetMaxX: Return the X value of the max corner.
usdrt::GfRect2i::GetMaxY: Return the Y value of the max corner.
usdrt::GfRect2i::GetMin: Returns the min corner of the rectangle.
usdrt::GfRect2i::GetMinX: Return the X value of min corner.
usdrt::GfRect2i::GetMinY: Return the Y value of the min corner.
usdrt::GfRect2i::GetNormalized: Returns a normalized rectangle, i.e. one that has a non-negative width and height.
usdrt::GfRect2i::GetSize: Returns the size of the rectangle as a vector (width,height).
usdrt::GfRect2i::GetUnion: Computes the union of two rectangles.
usdrt::GfRect2i::GetWidth: Returns the width of the rectangle.
usdrt::GfRect2i::GfRect2i: Constructs a rectangle with
min
corner and the indicatedwidth
andheight
.usdrt::GfRect2i::GfRect2i: Constructs a rectangle with
min
andmax
corners.usdrt::GfRect2i::Intersect: Computes the intersection of two rectangles.
usdrt::GfRect2i::IsEmpty: Returns true if the rectangle is empty.
usdrt::GfRect2i::IsNull: Returns true if the rectangle is a null rectangle.
usdrt::GfRect2i::IsValid: Return true if the rectangle is valid (equivalently, not empty).
usdrt::GfRect2i::SetMax: Sets the max corner of the rectangle.
usdrt::GfRect2i::SetMaxX: Set the X value of the max corner.
usdrt::GfRect2i::SetMaxY: Set the Y value of the max corner.
usdrt::GfRect2i::SetMin: Sets the min corner of the rectangle.
usdrt::GfRect2i::SetMinX: Set the X value of the min corner.
usdrt::GfRect2i::SetMinY: Set the Y value of the min corner.
usdrt::GfRect2i::Translate: Move the rectangle by
displ
.usdrt::GfRect2i::Union: Computes the union of two rectangles.
usdrt::GfRect2i::operator+=: Computes the union of two rectangles.
Typedefs
usdrt::GfRect2i::MinMaxType: Helper typedef.
Variables
-
struct GfRect2i
-
Public Functions
-
GfRect2i() = default
-
inline constexpr GfRect2i(const GfVec2i &min, const GfVec2i &max)
Constructs a rectangle with
min
andmax
corners.
-
inline GfRect2i(const GfVec2i &min, int width, int height)
Constructs a rectangle with
min
corner and the indicatedwidth
andheight
.
-
inline bool IsNull() const
Returns true if the rectangle is a null rectangle.
A null rectangle has both the width and the height set to 0, that is
andGetMaxX() == GetMinX() - 1
Remember that ifGetMaxY() == GetMinY() - 1
GetMinX()
andGetMaxX()
return the same value then the rectangle has width 1, and similarly for the height.A null rectangle is both empty, and not valid.
-
inline bool IsEmpty() const
Returns true if the rectangle is empty.
An empty rectangle has one or both of its min coordinates strictly greater than the corresponding max coordinate.
An empty rectangle is not valid.
-
inline bool IsValid() const
Return true if the rectangle is valid (equivalently, not empty).
-
inline GfRect2i GetNormalized() const
Returns a normalized rectangle, i.e. one that has a non-negative width and height.
GetNormalized()
swaps the min and max x-coordinates to ensure a non-negative width, and similarly for the y-coordinates.
-
inline int GetMinX() const
Return the X value of min corner.
-
inline void SetMinX(int x)
Set the X value of the min corner.
-
inline int GetMaxX() const
Return the X value of the max corner.
-
inline void SetMaxX(int x)
Set the X value of the max corner.
-
inline int GetMinY() const
Return the Y value of the min corner.
-
inline void SetMinY(int y)
Set the Y value of the min corner.
-
inline int GetMaxY() const
Return the Y value of the max corner.
-
inline void SetMaxY(int y)
Set the Y value of the max corner.
-
inline unsigned long GetArea() const
Return the area of the rectangle.
-
inline int GetWidth() const
Returns the width of the rectangle.
Note
If the min and max x-coordinates are coincident, the width is one.
-
inline int GetHeight() const
Returns the height of the rectangle.
Note
If the min and max y-coordinates are coincident, the height is one.
-
inline GfRect2i GetIntersection(const GfRect2i &that) const
Computes the intersection of two rectangles.
-
inline GfRect2i Intersect(const GfRect2i &that) const
Computes the intersection of two rectangles.
- Deprecated:
Use GetIntersection() instead
-
inline GfRect2i Union(const GfRect2i &that) const
Computes the union of two rectangles.
- Deprecated:
Use GetUnion() instead.
Public Static Attributes
-
static const size_t dimension = MinMaxType::dimension
-
GfRect2i() = default