![]() |
#include <Rect.h>
Public Member Functions | |
Rect () | |
Rect default constructor. | |
Rect (SDF::Obj rect) | |
Create a Rect and initialize it using given Cos/SDF rectangle Array object. | |
Rect (double x1, double y1, double x2, double y2) | |
Create a Rect and initialize it using specified parameters. | |
Rect (const Rect &rect) | |
Rect & | operator= (const Rect &rect) |
void | Attach (SDF::Obj rect) |
Attach the Cos/SDF object to the Rect. | |
bool | Update (SDF::Obj rect=NULL) |
Saves changes made to the Rect object in the attached (or specified) SDF/Cos rectangle. | |
void | Get (double &out_x1, double &out_y1, double &out_x2, double &out_y2) const |
Get the coordinates of the rectangle. | |
void | Set (double x1, double y1, double x2, double y2) |
Set the coordinates of the rectangle. | |
double | Width () const |
double | Height () const |
bool | Contains (double x, double y) const |
Determines if the specified point is contained within the rectangular region defined by this Rectangle. | |
bool | IntersectRect (const Rect &rect1, const Rect &rect2) |
Makes a Rect equal to the intersection of two existing rectangles. | |
void | Normalize () |
Normalizes the rectangle to the one with lower-left and upper-right corners. | |
void | Inflate (double amount) |
Expands the rectangle by the specified size, in all directions. | |
void | Inflate (double x, double y) |
Expands the rectangle by the specified size, in all directions. | |
double | GetX1 () const |
double | GetY1 () const |
double | GetX2 () const |
double | GetY2 () const |
void | SetX1 (double x1) |
Set the horizontal value of lower-left point. | |
void | SetY1 (double y1) |
Set the vertical value of lower-left point. | |
void | SetX2 (double x2) |
Set the horizontal value of upper-right point. | |
void | SetY2 (double y2) |
Set the vertical value of upper-right point. |
Rect can be associated with a SDF/Cos rectangle array using Rect(Obj*) constructor or later using Rect::Attach(Obj*) or Rect::Update(Obj*) methods.
Rect keeps a local cache for rectangle points so it is necessary to call Rect::Update() method if the changes to the Rect should be saved in the attached Cos/SDF array.
pdftron::PDF::Rect::Rect | ( | ) |
Rect default constructor.
pdftron::PDF::Rect::Rect | ( | SDF::Obj | rect | ) |
Create a Rect and initialize it using given Cos/SDF rectangle Array object.
The rect is attached to this object.
pdftron::PDF::Rect::Rect | ( | double | x1, | |
double | y1, | |||
double | x2, | |||
double | y2 | |||
) |
Create a Rect and initialize it using specified parameters.
The rect is not attached to any Cos/SDF object.
pdftron::PDF::Rect::Rect | ( | const Rect & | rect | ) |
void pdftron::PDF::Rect::Attach | ( | SDF::Obj | rect | ) |
Attach the Cos/SDF object to the Rect.
rect | - underlying Cos/SDF object. Must be an SDF::Array with four SDF::Number elements. |
bool pdftron::PDF::Rect::Update | ( | SDF::Obj | rect = NULL |
) |
Saves changes made to the Rect object in the attached (or specified) SDF/Cos rectangle.
rect | - an optional parameter indicating a SDF array that should be updated and attached to this Rect. If parameter rect is NULL or is omitted, update is performed on previously attached Cos/SDF rectangle. |
void pdftron::PDF::Rect::Get | ( | double & | out_x1, | |
double & | out_y1, | |||
double & | out_x2, | |||
double & | out_y2 | |||
) | const |
Get the coordinates of the rectangle.
void pdftron::PDF::Rect::Set | ( | double | x1, | |
double | y1, | |||
double | x2, | |||
double | y2 | |||
) |
Set the coordinates of the rectangle.
double pdftron::PDF::Rect::Width | ( | ) | const |
double pdftron::PDF::Rect::Height | ( | ) | const |
bool pdftron::PDF::Rect::Contains | ( | double | x, | |
double | y | |||
) | const |
Determines if the specified point is contained within the rectangular region defined by this Rectangle.
Makes a Rect equal to the intersection of two existing rectangles.
rect1 | - A Rect object that contains a source rectangle. | |
rect2 | - A Rect object that contains a source rectangle. |
void pdftron::PDF::Rect::Normalize | ( | ) |
Normalizes the rectangle to the one with lower-left and upper-right corners.
void pdftron::PDF::Rect::Inflate | ( | double | amount | ) |
Expands the rectangle by the specified size, in all directions.
amount | Specifies the amount to increase the rectangle in all directions. |
void pdftron::PDF::Rect::Inflate | ( | double | x, | |
double | y | |||
) |
Expands the rectangle by the specified size, in all directions.
x | Specifies the amount to increase the rectangle's Left (x1) and Right (x2) properties. | |
y | Specifies the amount to increase the rectangle's Top (y1) and Bottom (y1) properties. |
double pdftron::PDF::Rect::GetX1 | ( | ) | const |
Referenced by pdftron::PDF::QuadPoint::QuadPoint().
double pdftron::PDF::Rect::GetY1 | ( | ) | const |
double pdftron::PDF::Rect::GetX2 | ( | ) | const |
Referenced by pdftron::PDF::QuadPoint::QuadPoint().
double pdftron::PDF::Rect::GetY2 | ( | ) | const |
Referenced by pdftron::PDF::QuadPoint::QuadPoint().
void pdftron::PDF::Rect::SetX1 | ( | double | x1 | ) |
Set the horizontal value of lower-left point.
void pdftron::PDF::Rect::SetY1 | ( | double | y1 | ) |
Set the vertical value of lower-left point.
void pdftron::PDF::Rect::SetX2 | ( | double | x2 | ) |
Set the horizontal value of upper-right point.
void pdftron::PDF::Rect::SetY2 | ( | double | y2 | ) |
Set the vertical value of upper-right point.