PoDoFo  1.0.0-dev
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
PoDoFo::Rect Class Referencefinal

A rectangle defined by position and size. More...

#include <Rect.h>

Public Member Functions

 Rect ()
 Create an empty rectangle with bottom=left=with=height=0.
 
 Rect (double x, double y, double width, double height)
 Create a rectangle with a given size and position.
 
 Rect (const Rect &rhs)=default
 Copy constructor.
 
void ToArray (PdfArray &arr) const
 Converts the rectangle into an array. More...
 
std::string ToString () const
 Returns a string representation of the Rect. More...
 
bool Contains (double x, double y) const
 
void Intersect (const Rect &rect)
 Intersect with another rect. More...
 
double GetLeft () const
 Get the left coordinate of the rectangle.
 
double GetBottom () const
 Get the bottom coordinate of the rectangle.
 
double GetRight () const
 Get the right coordinate of the rectangle.
 
double GetTop () const
 Get the top coordinate of the rectangle.
 
bool operator== (const Rect &rect) const
 
bool operator!= (const Rect &rect) const
 
Rect operator* (const Matrix &m) const
 
Rectoperator= (const Rect &rhs)=default
 

Static Public Member Functions

static Rect FromCorners (double x1, double y1, double x2, double y2)
 Create a Rect from a couple of arbitrary points. More...
 
static Rect FromArray (const PdfArray &arr)
 Create a Rect from a the 4 values in the array. More...
 

Public Attributes

double X
 
double Y
 
double Width
 
double Height
 

Detailed Description

A rectangle defined by position and size.

Member Function Documentation

◆ FromArray()

Rect Rect::FromArray ( const PdfArray arr)
static

Create a Rect from a the 4 values in the array.

Parameters
arrthe array to load the values from

◆ FromCorners()

Rect Rect::FromCorners ( double  x1,
double  y1,
double  x2,
double  y2 
)
static

Create a Rect from a couple of arbitrary points.

Returns
the created Rect

◆ Intersect()

void Rect::Intersect ( const Rect rect)

Intersect with another rect.

Parameters
rectthe rect to intersect with

◆ ToArray()

void Rect::ToArray ( PdfArray arr) const

Converts the rectangle into an array.

Parameters
varthe array to store the Rect

◆ ToString()

string Rect::ToString ( ) const

Returns a string representation of the Rect.

Returns
std::string representation as [ left bottom right top ]

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