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
00077 #ifndef SWIG
00078
00081 void Get(double& out_x1, double& out_y1, double& out_x2, double& out_y2) const;
00082 #endif
00083
00087 void Set(double x1, double y1, double x2, double y2);
00088
00092 double Width() const;
00093
00097 double Height() const;
00098
00105 bool Contains(double x, double y) const;
00106
00117 bool IntersectRect(const Rect& rect1, const Rect& rect2);
00118
00127 void Normalize();
00128
00134 void Inflate(double amount);
00135
00142 void Inflate(double x, double y);
00143
00144
00148 double GetX1() const;
00149
00153 double GetY1() const;
00154
00158 double GetX2() const;
00159
00163 double GetY2() const;
00164
00168 void SetX1(double x1);
00169
00173 void SetY1(double y1);
00174
00178 void SetX2(double x2);
00179
00183 void SetY2(double y2);
00184 };
00185
00186 #include <Impl/Rect.inl>
00187
00188 };
00189 };
00190
00191 #endif
00192