PoDoFo  0.9.20
Public Member Functions | Static Public Member Functions | List of all members
PoDoFo::Rect Class Referencefinal

#include <Rect.h>

Public Member Functions

 Rect ()
 
 Rect (double x, double y, double width, double height)
 
 Rect (const Rect &rhs)=default
 
void ToArray (PdfArray &arr) const
 
std::string ToString () const
 
void Intersect (const Rect &rect)
 
double GetLeft () const
 
double GetBottom () const
 
double GetRight () const
 
double GetTop () const
 

Static Public Member Functions

static Rect FromCorners (double x1, double y1, double x2, double y2)
 
static Rect FromArray (const PdfArray &arr)
 

Detailed Description

A rectangle defined by position and size

Constructor & Destructor Documentation

Rect::Rect ( )

Create an empty rectangle with bottom=left=with=height=0

Rect::Rect ( double  x,
double  y,
double  width,
double  height 
)

Create a rectangle with a given size and position

PoDoFo::Rect::Rect ( const Rect rhs)
default

Copy constructor

Member Function Documentation

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
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
double PoDoFo::Rect::GetBottom ( ) const
inline

Get the bottom coordinate of the rectangle

double PoDoFo::Rect::GetLeft ( ) const
inline

Get the left coordinate of the rectangle

double Rect::GetRight ( ) const

Get the right coordinate of the rectangle

double Rect::GetTop ( ) const

Get the top coordinate of the rectangle

void Rect::Intersect ( const Rect rect)

Intersect with another rect

Parameters
rectthe rect to intersect with
void Rect::ToArray ( PdfArray arr) const

Converts the rectangle into an array

Parameters
varthe array to store the Rect
string Rect::ToString ( ) const

Returns a string representation of the Rect

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