Class represents rectangle. More...

#include "Rectangle.h"

Inherits System::ICloneable.

Public Member Functions

ASPOSE_PDF_SHARED_API double get_Width ()
 Width of rectangle. More...
 
ASPOSE_PDF_SHARED_API double get_Height ()
 Height of rectangle. More...
 
ASPOSE_PDF_SHARED_API double get_LLX () const
 X-coordinate of lower - left corner. More...
 
ASPOSE_PDF_SHARED_API void set_LLX (double value)
 X-coordinate of lower - left corner. More...
 
ASPOSE_PDF_SHARED_API double get_LLY () const
 Y - coordinate of lower-left corner. More...
 
ASPOSE_PDF_SHARED_API void set_LLY (double value)
 Y - coordinate of lower-left corner. More...
 
ASPOSE_PDF_SHARED_API double get_URX () const
 X - coordinate of upper-right corner. More...
 
ASPOSE_PDF_SHARED_API void set_URX (double value)
 X - coordinate of upper-right corner. More...
 
ASPOSE_PDF_SHARED_API double get_URY () const
 Y - coordinate of upper-right corner. More...
 
ASPOSE_PDF_SHARED_API void set_URY (double value)
 Y - coordinate of upper-right corner. More...
 
ASPOSE_PDF_SHARED_API bool get_IsTrivial ()
 Checks if rectangle is trivial i.e. has zero size and position. More...
 
ASPOSE_PDF_SHARED_API bool get_IsEmpty () const
 Checks if rectangle is empty. More...
 
ASPOSE_PDF_SHARED_API bool get_IsPoint ()
 Checks if rectangle is point i.e. LLX is equal URX and LLY is equal URY. More...
 
ASPOSE_PDF_SHARED_API Rectangle (double llx, double lly, double urx, double ury, bool normalizeCoordinates=true)
 Constructor of Rectangle. More...
 
ASPOSE_PDF_SHARED_API System::Drawing::Rectangle ToRect ()
 Converts rectangle to instance of System.Drawing.Rectangle. Floating-point positions and size are truncated. More...
 
ASPOSE_PDF_SHARED_API bool Equals (System::SharedPtr< Rectangle > other)
 Check if rectangles are equal i.e. have same position and sizes. More...
 
ASPOSE_PDF_SHARED_API bool NearEquals (System::SharedPtr< Rectangle > other, double delta)
 Check if rectangles are near equal i.e. have near same (up to delta) position and sizes. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< RectangleIntersect (System::SharedPtr< Rectangle > otherRect)
 Intersects to rectangles. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< RectangleJoin (System::SharedPtr< Rectangle > otherRect)
 Joins rectangles. More...
 
ASPOSE_PDF_SHARED_API bool IsIntersect (System::SharedPtr< Rectangle > otherRect)
 Determines whether this rectangle intersects with other rectangle. More...
 
ASPOSE_PDF_SHARED_API bool Contains (System::SharedPtr< Point > point)
 Determinces whether given point is inside of the rectangle. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< PointCenter ()
 Returncs coordinates of center of the rectangle. More...
 
ASPOSE_PDF_SHARED_API void Rotate (Rotation angle)
 Rotate rectangle by the specified angle. More...
 
ASPOSE_PDF_SHARED_API void Rotate (int32_t angle)
 Rotate rectangle by the specified angle. More...
 
ASPOSE_PDF_SHARED_API System::SharedPtr< System::ObjectClone () override
 Clones the Rectangle object. More...
 
ASPOSE_PDF_SHARED_API System::ArrayPtr< System::SharedPtr< Point > > ToPoints ()
 Converts rectangle into array of points ("QuadPoints"). More...
 
ASPOSE_PDF_SHARED_API System::String ToString () const override
 Gets rectangle string representation. More...
 
- Public Member Functions inherited from System::Object
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared reference counter. More...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API int32_t GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (uint32_t argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
virtual ASPOSECPP_SHARED_API bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool Equals (double const &objA, double const &objB)
 Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN. More...
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 Specialization of Object::ReferenceEquals for case of string and nullptr. More...
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 Specialization of Object::ReferenceEquals for case of strings. More...
 

Static Public Member Functions

static ASPOSE_PDF_SHARED_API System::SharedPtr< Rectangleget_Trivial ()
 Initializes trivial rectangle i.e. rectangle with zero position and size. More...
 
static ASPOSE_PDF_SHARED_API System::SharedPtr< RectangleFromRect (System::Drawing::Rectangle src)
 Initializes new rectangle from given instance of System.Drawing.Rectangle. More...
 
static ASPOSE_PDF_SHARED_API System::SharedPtr< RectangleFromRect (System::Drawing::RectangleF src)
 Initializes new rectangle from given instance of System.Drawing.Rectangle. More...
 
static ASPOSE_PDF_SHARED_API System::SharedPtr< RectangleParse (System::String value)
 Try to parse string and extract from it rectangle components llx, lly, urx, ury. More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Implements C# typeof(System.Object) construct. More...
 

Static Public Attributes

static ASPOSE_PDF_SHARED_API System::SharedPtr< RectangleEmpty
 Empty rectangle More...
 

Protected Member Functions

System::Drawing::RectangleF ToRectangleF ()
 
System::SharedPtr< Engine::Data::PdfArray > ToArray (System::SharedPtr< Engine::Data::ITrailerable > trailerable)
 
void _Intersect (System::SharedPtr< Rectangle > otherRect)
 Intersects rectangles. OBolsete method. Please use Intersect instead. More...
 
bool IsInclude (System::SharedPtr< Rectangle > otherRect, double rotationAngle)
 Checks that this rectangle includes whole another rectangle. I.e. whole another rectangle is inside this rectangle. Difference with IsIntersect method is that IsIntersect will true for partly intersected rectangles but IsInclude will false. More...
 
virtual ASPOSE_PDF_SHARED_API ~Rectangle ()
 

Static Protected Member Functions

static System::SharedPtr< RectangleCreateNormalizedRectangle (const System::ArrayPtr< System::SharedPtr< Engine::CommonData::IPdfRectangle >> &rectangles)
 Creates normalized rectangle from IPdfRectangle More...
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 

Detailed Description

Class represents rectangle.

Constructor & Destructor Documentation

◆ Rectangle()

ASPOSE_PDF_SHARED_API Aspose::Pdf::Rectangle::Rectangle ( double  llx,
double  lly,
double  urx,
double  ury,
bool  normalizeCoordinates = true 
)

Constructor of Rectangle.

Parameters
llxX of lower left corner.
llyY of lower left corner.
urxX of upper right corner.
uryY of upper right corner.
normalizeCoordinatesNormalize coordinates of rectangle.

◆ ~Rectangle()

virtual ASPOSE_PDF_SHARED_API Aspose::Pdf::Rectangle::~Rectangle ( )
protectedvirtual

Member Function Documentation

◆ _Intersect()

void Aspose::Pdf::Rectangle::_Intersect ( System::SharedPtr< Rectangle otherRect)
protected

Intersects rectangles. OBolsete method. Please use Intersect instead.

Parameters
otherRect
Returns

◆ Center()

ASPOSE_PDF_SHARED_API System::SharedPtr<Point> Aspose::Pdf::Rectangle::Center ( )

Returncs coordinates of center of the rectangle.

Returns
Point which is center of the rectangle.

◆ Clone()

ASPOSE_PDF_SHARED_API System::SharedPtr<System::Object> Aspose::Pdf::Rectangle::Clone ( )
overridevirtual

Clones the Rectangle object.

Returns
Clone object.

Implements System::ICloneable.

◆ Contains()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Rectangle::Contains ( System::SharedPtr< Point point)

Determinces whether given point is inside of the rectangle.

Parameters
pointPoint to check.
Returns
True if point is inside of the recatngle.

◆ CreateNormalizedRectangle()

static System::SharedPtr<Rectangle> Aspose::Pdf::Rectangle::CreateNormalizedRectangle ( const System::ArrayPtr< System::SharedPtr< Engine::CommonData::IPdfRectangle >> &  rectangles)
staticprotected

Creates normalized rectangle from IPdfRectangle

Parameters
rectanglesThe source rectangles.
Returns
Return the first non-null normalized rectangle

◆ Equals()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Rectangle::Equals ( System::SharedPtr< Rectangle other)

Check if rectangles are equal i.e. have same position and sizes.

Parameters
otherRectangle which will be compared.
Returns
True if rectangles are eqals, false otherwise.

◆ FromRect() [1/2]

static ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> Aspose::Pdf::Rectangle::FromRect ( System::Drawing::Rectangle  src)
static

Initializes new rectangle from given instance of System.Drawing.Rectangle.

Parameters
srcSource rectangle which position and size will be set to new rectangle.
Returns
New rectangle.

◆ FromRect() [2/2]

static ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> Aspose::Pdf::Rectangle::FromRect ( System::Drawing::RectangleF  src)
static

Initializes new rectangle from given instance of System.Drawing.Rectangle.

Parameters
srcSource rectangle which position and size will be set to new rectangle.
Returns
New rectangle.

◆ get_Height()

ASPOSE_PDF_SHARED_API double Aspose::Pdf::Rectangle::get_Height ( )

Height of rectangle.

◆ get_IsEmpty()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Rectangle::get_IsEmpty ( ) const

Checks if rectangle is empty.

◆ get_IsPoint()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Rectangle::get_IsPoint ( )

Checks if rectangle is point i.e. LLX is equal URX and LLY is equal URY.

◆ get_IsTrivial()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Rectangle::get_IsTrivial ( )

Checks if rectangle is trivial i.e. has zero size and position.

◆ get_LLX()

ASPOSE_PDF_SHARED_API double Aspose::Pdf::Rectangle::get_LLX ( ) const

X-coordinate of lower - left corner.

◆ get_LLY()

ASPOSE_PDF_SHARED_API double Aspose::Pdf::Rectangle::get_LLY ( ) const

Y - coordinate of lower-left corner.

◆ get_Trivial()

static ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> Aspose::Pdf::Rectangle::get_Trivial ( )
static

Initializes trivial rectangle i.e. rectangle with zero position and size.

◆ get_URX()

ASPOSE_PDF_SHARED_API double Aspose::Pdf::Rectangle::get_URX ( ) const

X - coordinate of upper-right corner.

◆ get_URY()

ASPOSE_PDF_SHARED_API double Aspose::Pdf::Rectangle::get_URY ( ) const

Y - coordinate of upper-right corner.

◆ get_Width()

ASPOSE_PDF_SHARED_API double Aspose::Pdf::Rectangle::get_Width ( )

Width of rectangle.

◆ Intersect()

ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> Aspose::Pdf::Rectangle::Intersect ( System::SharedPtr< Rectangle otherRect)

Intersects to rectangles.

Parameters
otherRectRectangle to which this recatangle be intersected.
Returns
Intersection of rectangles; null if rectangles are not intersected.

◆ IsInclude()

bool Aspose::Pdf::Rectangle::IsInclude ( System::SharedPtr< Rectangle otherRect,
double  rotationAngle 
)
protected

Checks that this rectangle includes whole another rectangle. I.e. whole another rectangle is inside this rectangle. Difference with IsIntersect method is that IsIntersect will true for partly intersected rectangles but IsInclude will false.

Parameters
otherRectRectangle for which including is checked.
rotationAngleRotation angle of another rectangle in radians.
Returns
True if this rectangle includes whole specified rectangle. Otherwise false.

◆ IsIntersect()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Rectangle::IsIntersect ( System::SharedPtr< Rectangle otherRect)

Determines whether this rectangle intersects with other rectangle.

Parameters
otherRectIntersection will be tested with specified rectangle.
Returns
True if this rectangle intersects with specified rectangle. Otherwise false.

◆ Join()

ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> Aspose::Pdf::Rectangle::Join ( System::SharedPtr< Rectangle otherRect)

Joins rectangles.

Parameters
otherRectRectangle to which this recatangle be joined.
Returns
Described rectangle.

◆ NearEquals()

ASPOSE_PDF_SHARED_API bool Aspose::Pdf::Rectangle::NearEquals ( System::SharedPtr< Rectangle other,
double  delta 
)

Check if rectangles are near equal i.e. have near same (up to delta) position and sizes.

Parameters
otherRectangle which will be compared.
deltaValue of comparation tollerance.
Returns
True if rectangles are eqals, false otherwise.

◆ Parse()

static ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> Aspose::Pdf::Rectangle::Parse ( System::String  value)
static

Try to parse string and extract from it rectangle components llx, lly, urx, ury.

Parameters
valueString to parse.
Returns
Rectangle object.

◆ Rotate() [1/2]

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Rectangle::Rotate ( Rotation  angle)

Rotate rectangle by the specified angle.

Parameters
angleAngle of rotation. Member of Rotation enumeration.

◆ Rotate() [2/2]

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Rectangle::Rotate ( int32_t  angle)

Rotate rectangle by the specified angle.

Parameters
angleAngle of rotation in degrees between 0 and 360.

◆ set_LLX()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Rectangle::set_LLX ( double  value)

X-coordinate of lower - left corner.

◆ set_LLY()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Rectangle::set_LLY ( double  value)

Y - coordinate of lower-left corner.

◆ set_URX()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Rectangle::set_URX ( double  value)

X - coordinate of upper-right corner.

◆ set_URY()

ASPOSE_PDF_SHARED_API void Aspose::Pdf::Rectangle::set_URY ( double  value)

Y - coordinate of upper-right corner.

◆ ToArray()

System::SharedPtr<Engine::Data::PdfArray> Aspose::Pdf::Rectangle::ToArray ( System::SharedPtr< Engine::Data::ITrailerable >  trailerable)
protected

◆ ToPoints()

ASPOSE_PDF_SHARED_API System::ArrayPtr<System::SharedPtr<Point> > Aspose::Pdf::Rectangle::ToPoints ( )

Converts rectangle into array of points ("QuadPoints").

Returns
Array of points.

◆ ToRect()

ASPOSE_PDF_SHARED_API System::Drawing::Rectangle Aspose::Pdf::Rectangle::ToRect ( )

Converts rectangle to instance of System.Drawing.Rectangle. Floating-point positions and size are truncated.

Returns
Result of conversion.

◆ ToRectangleF()

System::Drawing::RectangleF Aspose::Pdf::Rectangle::ToRectangleF ( )
protected

◆ ToString()

ASPOSE_PDF_SHARED_API System::String Aspose::Pdf::Rectangle::ToString ( ) const
overridevirtual

Gets rectangle string representation.

Returns
String has format llx,lly,urx,ury.

Reimplemented from System::Object.

Member Data Documentation

◆ Empty

ASPOSE_PDF_SHARED_API System::SharedPtr<Rectangle> Aspose::Pdf::Rectangle::Empty
static

Empty rectangle