All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Rect.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------------------
2 // Copyright (c) 2001-2020 by PDFTron Systems Inc. All Rights Reserved.
3 // Consult legal.txt regarding legal and license information.
4 //---------------------------------------------------------------------------------------
5 #ifndef PDFTRON_H_CPPPDFRect
6 #define PDFTRON_H_CPPPDFRect
7 
8 #include <C/PDF/TRN_Rect.h>
9 #include <Common/Common.h>
10 #include <SDF/Obj.h>
11 
12 namespace pdftron {
13  namespace PDF {
14 
28 class Rect : public TRN_Rect
29 {
30 public:
31 
35  Rect ();
36 
41  Rect (SDF::Obj rect);
42 
52  Rect (double x1, double y1, double x2, double y2);
53 
54  // copy constructor
55  Rect (const Rect& rect);
56 
57  // assignment operator
58  Rect& operator=(const Rect& rect);
59 
66  void Attach(SDF::Obj obj);
67 
78  bool Update(SDF::Obj obj = NULL);
79 
80 #ifndef SWIG
81 
84  void Get(double& out_x1, double& out_y1, double& out_x2, double& out_y2) const;
85 #endif
86 
96  void Set(double x1, double y1, double x2, double y2);
97 
101  double Width() const;
102 
106  double Height() const;
107 
115  bool Contains(double x, double y) const;
116 
127  bool IntersectRect(const Rect& rect1, const Rect& rect2);
128 
137  void Normalize();
138 
144  void Inflate(double amount);
145 
152  void Inflate(double x, double y);
153 
154 
158  double GetX1() const;
159 
163  double GetY1() const;
164 
168  double GetX2() const;
169 
173  double GetY2() const;
174 
179  void SetX1(double x1);
180 
185  void SetY1(double y1);
186 
191  void SetX2(double x2);
192 
197  void SetY2(double y2);
198 };
199 
200 #include <Impl/Rect.inl>
201 
202  }; // namespace PDF
203 }; // namespace pdftron
204 
205 #endif // PDFTRON_H_CPPPDFRect
bool Update(SDF::Obj obj=NULL)
void Get(double &out_x1, double &out_y1, double &out_x2, double &out_y2) const
double GetY1() const
void SetX1(double x1)
void Attach(SDF::Obj obj)
void Set(double x1, double y1, double x2, double y2)
double GetX2() const
double GetY2() const
double Height() const
double GetX1() const
void Inflate(double amount)
double Width() const
Rect & operator=(const Rect &rect)
bool IntersectRect(const Rect &rect1, const Rect &rect2)
void SetY2(double y2)
bool Contains(double x, double y) const
void SetX2(double x2)
void SetY1(double y1)