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
00131 void Inflate(double amount);
00132
00139 void Inflate(double x, double y);
00140
00141
00145 double GetX1() const;
00146
00150 double GetY1() const;
00151
00155 double GetX2() const;
00156
00160 double GetY2() const;
00161
00165 void SetX1(double x1);
00166
00170 void SetY1(double y1);
00171
00175 void SetX2(double x2);
00176
00180 void SetY2(double y2);
00181 };
00182
00183 #include <Impl/Rect.inl>
00184
00185 };
00186 };
00187
00188 #endif
00189