Loading...
Searching...
No Matches
Rect.h
Go to the documentation of this file.
1//---------------------------------------------------------------------------------------
2// Copyright (c) 2001-2025 by Apryse Software 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
12namespace pdftron {
13 namespace PDF {
14
28class Rect : public TRN_Rect
29{
30public:
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
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
Rect(SDF::Obj rect)
void Set(double x1, double y1, double x2, double y2)
void SetY2(double y2)
void SetX1(double x1)
double GetY2() const
void Inflate(double amount)
bool Update(SDF::Obj obj=NULL)
bool Contains(double x, double y) const
double GetX2() const
Rect & operator=(const Rect &rect)
void SetX2(double x2)
Rect(const Rect &rect)
Rect(double x1, double y1, double x2, double y2)
double GetY1() const
double GetX1() const
void SetY1(double y1)
void Get(double &out_x1, double &out_y1, double &out_x2, double &out_y2) const
void Attach(SDF::Obj obj)
double Width() const
bool IntersectRect(const Rect &rect1, const Rect &rect2)
void Inflate(double x, double y)
double Height() const