Rectangle.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include <system/icloneable.h>
5 #include <system/array.h>
6 #include <cstdint>
7 
8 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
9 
10 namespace Aspose
11 {
12 namespace Pdf
13 {
14 namespace Annotations
15 {
16 class Annotation;
17 class CaretAnnotation;
18 class CommonFigureAnnotation;
19 class Redaction;
20 class ScreenAnnotation;
21 } // namespace Annotations
22 class ApsUsingConverter;
23 namespace Engine
24 {
25 namespace CommonData
26 {
27 class IPdfRectangle;
28 class PageTreeNode;
29 namespace Text
30 {
31 namespace Segmenting
32 {
33 class PhysicalTextSegment;
34 class TextSegmenter;
35 } // namespace Segmenting
36 class Subpath;
37 } // namespace Text
38 } // namespace CommonData
39 namespace Data
40 {
41 class ITrailerable;
42 class PdfArray;
43 } // namespace Data
44 namespace IO
45 {
46 namespace ConvertStrategies
47 {
48 class PdfUaConvertStrategy;
49 class TransparentContentRemoval;
50 } // namespace ConvertStrategies
51 } // namespace IO
52 } // namespace Engine
53 namespace Facades
54 {
55 class PdfFileEditor;
56 } // namespace Facades
57 class Page;
58 class PdfToApsConverter;
59 class Point;
60 enum class Rotation;
61 namespace Tests
62 {
63 namespace Plugins
64 {
65 class FormExporterTests;
66 class PdfFormTests;
67 } // namespace Plugins
68 } // namespace Tests
69 namespace Text
70 {
71 class PageMarkup;
72 class TextPostReplaceFixer;
73 } // namespace Text
74 class TextStamp;
75 } // namespace Pdf
76 } // namespace Aspose
77 namespace System
78 {
79 namespace Drawing
80 {
81 class Rectangle;
82 class RectangleF;
83 } // namespace Drawing
84 } // namespace System
85 
86 namespace Aspose {
87 
88 namespace Pdf {
89 
93 class ASPOSE_PDF_SHARED_CLASS Rectangle final : public System::ICloneable
94 {
95  typedef Rectangle ThisType;
97 
98  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
99  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
100 
101  friend class Aspose::Pdf::Engine::CommonData::Text::Subpath;
102  friend class Aspose::Pdf::Engine::IO::ConvertStrategies::PdfUaConvertStrategy;
103  friend class Aspose::Pdf::PdfToApsConverter;
105  friend class Aspose::Pdf::Annotations::Redaction;
106  friend class Aspose::Pdf::Engine::IO::ConvertStrategies::TransparentContentRemoval;
107  friend class Aspose::Pdf::Engine::CommonData::PageTreeNode;
108  friend class Aspose::Pdf::Engine::CommonData::Text::Segmenting::PhysicalTextSegment;
109  friend class Aspose::Pdf::Engine::CommonData::Text::Segmenting::TextSegmenter;
111  friend class Aspose::Pdf::Text::TextPostReplaceFixer;
112  friend class Aspose::Pdf::ApsUsingConverter;
116  friend class Aspose::Pdf::Page;
119  friend class Aspose::Pdf::Tests::Plugins::PdfFormTests;
120  friend class Aspose::Pdf::Tests::Plugins::FormExporterTests;
121 
122 public:
123 
127  ASPOSE_PDF_SHARED_API double get_Width();
131  ASPOSE_PDF_SHARED_API double get_Height();
135  ASPOSE_PDF_SHARED_API double get_LLX() const;
139  ASPOSE_PDF_SHARED_API void set_LLX(double value);
143  ASPOSE_PDF_SHARED_API double get_LLY() const;
147  ASPOSE_PDF_SHARED_API void set_LLY(double value);
151  ASPOSE_PDF_SHARED_API double get_URX() const;
155  ASPOSE_PDF_SHARED_API void set_URX(double value);
159  ASPOSE_PDF_SHARED_API double get_URY() const;
163  ASPOSE_PDF_SHARED_API void set_URY(double value);
164 
168  static ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> Empty;
169 
173  static ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> get_Trivial();
177  ASPOSE_PDF_SHARED_API bool get_IsTrivial();
181  ASPOSE_PDF_SHARED_API bool get_IsEmpty() const;
185  ASPOSE_PDF_SHARED_API bool get_IsPoint();
186 
195  ASPOSE_PDF_SHARED_API Rectangle(double llx, double lly, double urx, double ury, bool normalizeCoordinates = true);
196 
201  ASPOSE_PDF_SHARED_API System::Drawing::Rectangle ToRect();
207  static ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> FromRect(System::Drawing::Rectangle src);
213  static ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> FromRect(System::Drawing::RectangleF src);
223  static ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> Parse(System::String value);
229  ASPOSE_PDF_SHARED_API bool Equals(System::SharedPtr<Rectangle> other);
236  ASPOSE_PDF_SHARED_API bool NearEquals(System::SharedPtr<Rectangle> other, double delta);
242  ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> Intersect(System::SharedPtr<Rectangle> otherRect);
248  ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> Join(System::SharedPtr<Rectangle> otherRect);
254  ASPOSE_PDF_SHARED_API bool IsIntersect(System::SharedPtr<Rectangle> otherRect);
260  ASPOSE_PDF_SHARED_API bool Contains(System::SharedPtr<Point> point);
265  ASPOSE_PDF_SHARED_API System::SharedPtr<Point> Center();
270  ASPOSE_PDF_SHARED_API void Rotate(Rotation angle);
275  ASPOSE_PDF_SHARED_API void Rotate(int32_t angle);
280  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Object> Clone() override;
285  ASPOSE_PDF_SHARED_API System::ArrayPtr<System::SharedPtr<Point>> ToPoints();
292  ASPOSE_PDF_SHARED_API System::String ToString() const override;
293 
294 protected:
295 
296  System::Drawing::RectangleF ToRectangleF();
303  void _Intersect(System::SharedPtr<Rectangle> otherRect);
311  bool IsInclude(System::SharedPtr<Rectangle> otherRect, double rotationAngle);
318 
319  virtual ASPOSE_PDF_SHARED_API ~Rectangle();
320 
321 private:
322 
323  double _llx;
324  double _lly;
325  double _urx;
326  double _ury;
327  bool _isEmpty;
328 
336  Rectangle(double llx, double lly, double urx, double ury, bool isEmpty, bool normalizeCoordinates);
337 
338  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(Rectangle, CODEPORTING_ARGS(double llx, double lly, double urx, double ury, bool isEmpty, bool normalizeCoordinates));
339  void Normalize();
340  System::String ToString_NonConst();
341  System::ArrayPtr<double> GetIntersect(double l1, double r1, double l2, double r2);
348  bool IsInclude(System::SharedPtr<Rectangle> otherRect);
355  bool IsIncludePointCoordinates(double x, double y);
356 
357 };
358 
359 } // namespace Pdf
360 } // namespace Aspose
361 
362 
String class used across the library. Is a substitute for C# System.String when translating code...
Definition: string.h:121
Rotation
Enumeration of possible rotation values.
Definition: Rotation.h:16
Represents a rectangular area of an image defined as single-precision floating point X and Y coordina...
Definition: rectangle_f.h:14
Definition: Artifact.h:67
Represents a rectangular area of an image defined as integer X and Y coordinates of its upper left co...
Definition: rectangle.h:18
static ASPOSE_PDF_SHARED_API System::SharedPtr< Rectangle > Empty
Empty rectangle
Definition: Rectangle.h:168
Definition: signed_info.h:13
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: fwd.h:22
Class representing page of PDF document.
Definition: Page.h:362
Definition: AFRelationship.h:4
A screen annotation that specifies a region of a page upon which media clips may be played...
Definition: ScreenAnnotation.h:43
Defies a method that enables object cloning - creating a copy of an object. Objects of this class sho...
Definition: icloneable.h:15
Reresents textual stamp.
Definition: TextStamp.h:68
Class representing Caret annotation.
Definition: CaretAnnotation.h:55
A printer&#39;s point (1/72 of an inch).
The coordinates are in the page coordinate context.
Implements operations with PDF file: concatenation, splitting, extracting pages, making booklet...
Definition: PdfFileEditor.h:99
Abstract class representing common figure annotation.
Definition: CommonFigureAnnotation.h:47
Page markup represented by collections of MarkupSection and MarkupParagraph.
Definition: PageMarkup.h:52
Class representing annotation object.
Definition: Annotation.h:293
Whole PDF file will be submitted.
Class represents rectangle.
Definition: Rectangle.h:93