00001
00002
00003
00004
00005
00006 #ifndef H_CPPPDFRect
00007 #define H_CPPPDFRect
00008
00009
00010 #include <C/PDF/TRN_Rect.h>
00011 #include <Common/Common.h>
00012 #include <SDF/Obj.h>
00013
00014 namespace pdftron {
00015 namespace PDF {
00016
00030 class Rect : public TRN_Rect
00031 {
00032 public:
00033
00037 Rect ();
00038
00043 Rect (SDF::Obj rect);
00044
00049 Rect (double x1, double y1, double x2, double y2);
00050
00051
00052 Rect (const Rect& rect);
00053
00054
00055 Rect& operator=(const Rect& rect);
00056
00063 void Attach(SDF::Obj rect);
00064
00075 bool Update(SDF::Obj rect = NULL);
00076
00080 void Get(double& out_x1, double& out_y1, double& out_x2, double& out_y2) const;
00081
00085 void Set(double x1, double y1, double x2, double y2);
00086
00090 double Width() const;
00091
00095 double Height() const;
00096
00103 bool Contains(double x, double y) const;
00104
00115 bool IntersectRect(const Rect& rect1, const Rect& rect2);
00116
00124 void Normalize();
00125
00129 double GetX1();
00130
00134 double GetY1();
00135
00139 double GetX2();
00140
00144 double GetY2();
00145
00149 void SetX1(double x1);
00150
00154 void SetY1(double y1);
00155
00159 void SetX2(double x2);
00160
00164 void SetY2(double y2);
00165 };
00166
00167 #include <Impl/Rect.inl>
00168
00169 };
00170 };
00171
00172 #endif
00173