Rectangle.h
1 #pragma once
2 // Copyright (c) 2001-2022 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 class TextMarkupAnnotation;
22 } // namespace Annotations
23 class ApsUsingConverter;
24 namespace Engine
25 {
26 namespace CommonData
27 {
28 namespace Text
29 {
30 namespace Segmenting
31 {
32 class PhysicalTextSegment;
33 class TextSegmenter;
34 } // namespace Segmenting
35 class Subpath;
36 } // namespace Text
37 } // namespace CommonData
38 namespace Data
39 {
40 class ITrailerable;
41 class PdfArray;
42 } // namespace Data
43 namespace IO
44 {
45 namespace ConvertStrategies
46 {
47 class PdfUaConvertStrategy;
48 } // namespace ConvertStrategies
49 } // namespace IO
50 } // namespace Engine
51 namespace Facades
52 {
53 class PdfFileEditor;
54 } // namespace Facades
55 class PdfToApsConverter;
56 class Point;
57 enum class Rotation;
58 namespace Text
59 {
60 class PageMarkup;
61 class TextPostReplaceFixer;
62 } // namespace Text
63 class TextStamp;
64 } // namespace Pdf
65 } // namespace Aspose
66 namespace System
67 {
68 namespace Drawing
69 {
70 class Rectangle;
71 class RectangleF;
72 } // namespace Drawing
73 } // namespace System
74 
75 namespace Aspose {
76 
77 namespace Pdf {
78 
82 class ASPOSE_PDF_SHARED_CLASS Rectangle final : public System::ICloneable
83 {
84  typedef Rectangle ThisType;
86 
87  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
88  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
89 
90  friend class Aspose::Pdf::Engine::CommonData::Text::Subpath;
91  friend class Aspose::Pdf::Engine::IO::ConvertStrategies::PdfUaConvertStrategy;
92  friend class Aspose::Pdf::PdfToApsConverter;
94  friend class Aspose::Pdf::Annotations::Redaction;
95  friend class Aspose::Pdf::Engine::CommonData::Text::Segmenting::PhysicalTextSegment;
96  friend class Aspose::Pdf::Engine::CommonData::Text::Segmenting::TextSegmenter;
98  friend class Aspose::Pdf::Text::TextPostReplaceFixer;
99  friend class Aspose::Pdf::ApsUsingConverter;
106 
107 public:
108 
112  ASPOSE_PDF_SHARED_API double get_Width();
116  ASPOSE_PDF_SHARED_API double get_Height();
120  ASPOSE_PDF_SHARED_API double get_LLX() const;
124  ASPOSE_PDF_SHARED_API void set_LLX(double value);
128  ASPOSE_PDF_SHARED_API double get_LLY() const;
132  ASPOSE_PDF_SHARED_API void set_LLY(double value);
136  ASPOSE_PDF_SHARED_API double get_URX() const;
140  ASPOSE_PDF_SHARED_API void set_URX(double value);
144  ASPOSE_PDF_SHARED_API double get_URY() const;
148  ASPOSE_PDF_SHARED_API void set_URY(double value);
149 
153  static ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> Empty;
154 
158  static ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> get_Trivial();
162  ASPOSE_PDF_SHARED_API bool get_IsTrivial();
166  ASPOSE_PDF_SHARED_API bool get_IsEmpty() const;
170  ASPOSE_PDF_SHARED_API bool get_IsPoint();
171 
180  ASPOSE_PDF_SHARED_API Rectangle(double llx, double lly, double urx, double ury, bool normalizeCoordinates = true);
181 
186  ASPOSE_PDF_SHARED_API System::Drawing::Rectangle ToRect();
192  static ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> FromRect(System::Drawing::Rectangle src);
202  static ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> Parse(System::String value);
208  ASPOSE_PDF_SHARED_API bool Equals(System::SharedPtr<Rectangle> other);
215  ASPOSE_PDF_SHARED_API bool NearEquals(System::SharedPtr<Rectangle> other, double delta);
221  ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> Intersect(System::SharedPtr<Rectangle> otherRect);
227  ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> Join(System::SharedPtr<Rectangle> otherRect);
233  ASPOSE_PDF_SHARED_API bool IsIntersect(System::SharedPtr<Rectangle> otherRect);
239  ASPOSE_PDF_SHARED_API bool Contains(System::SharedPtr<Point> point);
244  ASPOSE_PDF_SHARED_API System::SharedPtr<Point> Center();
249  ASPOSE_PDF_SHARED_API void Rotate(Rotation angle);
254  ASPOSE_PDF_SHARED_API void Rotate(int32_t angle);
259  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Object> Clone() override;
264  ASPOSE_PDF_SHARED_API System::ArrayPtr<System::SharedPtr<Point>> ToPoints();
271  ASPOSE_PDF_SHARED_API System::String ToString() const override;
272 
273 protected:
274 
275  System::Drawing::RectangleF ToRectangleF();
282  void _Intersect(System::SharedPtr<Rectangle> otherRect);
290  bool IsInclude(System::SharedPtr<Rectangle> otherRect, double rotationAngle);
291 
292  virtual ASPOSE_PDF_SHARED_API ~Rectangle();
293 
294 private:
295 
296  double _llx;
297  double _lly;
298  double _urx;
299  double _ury;
300  bool _isEmpty;
301 
309  Rectangle(double llx, double lly, double urx, double ury, bool isEmpty, bool normalizeCoordinates);
310 
311  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(Rectangle, CODEPORTING_ARGS(double llx, double lly, double urx, double ury, bool isEmpty, bool normalizeCoordinates));
312  void Normalize();
313  System::String ToString_NonConst();
314  System::ArrayPtr<double> GetIntersect(double l1, double r1, double l2, double r2);
321  bool IsInclude(System::SharedPtr<Rectangle> otherRect);
328  bool IsIncludePointCoordinates(double x, double y);
329 
330 };
331 
332 } // namespace Pdf
333 } // namespace Aspose
334 
335 
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:16
Definition: Artifact.h:67
virtual ASPOSECPP_SHARED_API bool Equals(ptr obj)
Compares objects using C# Object.Equals semantics.
MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(ScreenAnnotation, CODEPORTING_ARGS(System::SharedPtr< Aspose::Pdf::Engine::Data::IPdfObject > engineAnnot, System::SharedPtr< Document > document))
Definition: reflection.h:29
Represents a rectangular area of an image defined as integer X and Y coordinates of its upper left co...
Definition: rectangle.h:19
static ASPOSE_PDF_SHARED_API System::SharedPtr< Rectangle > Empty
Empty rectangle
Definition: Rectangle.h:153
virtual ASPOSE_PDF_SHARED_API double get_Height()
Gets height of the annotation.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: fwd.h:22
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:67
Class representing Caret annotation.
Definition: CaretAnnotation.h:55
A printer&#39;s point (1/72 of an inch).
Implements operations with PDF file: concatenation, splitting, extracting pages, making booklet...
Definition: PdfFileEditor.h:94
Abstract class representing common figure annotation.
Definition: CommonFigureAnnotation.h:47
virtual ASPOSECPP_SHARED_API String ToString() const
Analog of C# Object.ToString() method. Enables converting custom objects to string.
Page markup represented by collections of MarkupSection and MarkupParagraph.
Definition: PageMarkup.h:45
Abstract base class for text markup annotations.
Definition: TextMarkupAnnotation.h:57
Class representing annotation object.
Definition: Annotation.h:247
virtual ASPOSE_PDF_SHARED_API double get_Width()
Gets width of the annotation.
ASPOSE_PDF_SHARED_API System::SharedPtr< System::Object > Clone() override
Clones this instance. Virtual method. Always return null.
Whole PDF file will be submitted.
Class represents rectangle.
Definition: Rectangle.h:82