7#ifndef __HDI_CORE_RECT__
8#define __HDI_CORE_RECT__
15 #if defined(HDI_CORE_AIP_MODE)
20 #elif defined(HDI_CORE_PSP_MODE)
63 Rect(
const double x_,
const double y_,
const double width_,
const double height_);
175 virtual void offset(
const double tx_,
const double ty_);
186 virtual void resize(
const double w_,
const double h_);
199 virtual Rect inset(
const double x_,
const double y_)
const;
332 virtual double top()
const;
467 virtual Rect scale(
const double xScaler_,
const double yScaler_)
const;
539 #if defined(HDI_CORE_AIP_MODE)
540 friend aip::Rect* __accessImpl(
const Rect&);
541 friend Rect __accessCtor(
const aip::Rect&);
553 Rect(
const aip::Rect&);
554 #elif defined(HDI_CORE_PSP_MODE)
555 friend psp::Rect* __accessImpl(
const Rect&);
556 friend Rect __accessCtor(
const psp::Rect&);
568 Rect(
const psp::Rect&);
572 typedef std::unique_ptr<Rect> RectUP;
573 typedef std::shared_ptr<Rect> RectSP;
574 typedef std::weak_ptr<Rect> RectWP;
576 #if defined(HDI_CORE_AIP_MODE)
577 extern aip::Rect* __accessImpl(
const Rect&);
578 extern Rect __accessCtor(
const aip::Rect&);
579 #elif defined(HDI_CORE_PSP_MODE)
580 extern psp::Rect* __accessImpl(
const Rect&);
581 extern Rect __accessCtor(
const psp::Rect&);
Describes an angle, and allows for easy conversion between various units.
Definition: hdicoreAngle.h:26
Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document ...
Definition: hdicorePoint.h:38
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dime...
Definition: hdicoreRect.h:34
virtual void setBottom(const double bottom_)
Sets the position of the bottom bounding edge of the rectangle along the y-axis.
virtual void offset(const double tx_, const double ty_)
Offsets a rect along the x- and y-axes by given amounts.
virtual Point pointFromPinPoint(const BoundsPinPointType pinPt_) const
Gets a "pin point" from the rect bounds.
virtual RectLineIntersectionType lineIntersectionPoints(const Point &a_, const Point &b_, Point &iPt1__, Point &iPt2__) const
Finds the intersection points on a rectangle that a line has with it.
virtual Rect operator+(const Rect &rhs_) const
Allows two rects to have their origin and size objects added using the + operator.
virtual Point topRight() const
Gets the top-right point of the rect.
virtual void setRight(const double right_)
Sets the position of the right bounding edge of the rectangle along the x-axis.
virtual bool enclosePoint(const Point &pt_)
Enlarges the target rect, if necessary, to enclose a given point.
virtual void enclosingEllipse(double &width__, double &height__) const
Gets the width and height of an ellipse that would enclose the rect.
Point origin
Origin point for the rect (top-left, when size.width and size.height are positive)
Definition: hdicoreRect.h:39
virtual RectLineIntersectionType lineIntersectionPoints(const Point &a_, const Point &b_, const Angle &angle_, Point &iPt1__, Point &iPt2__) const
Finds the intersection points on a rectangle, were it rotated, that a line has with it.
virtual Rect & operator+=(const Rect &rhs_)
Allows two rects to have their origin and size objects added and assigned using the += operator.
virtual bool intersection(const Rect &rect2_, Rect &iRect__) const
Gets the intersection between two rects.
virtual Point midLeft() const
Gets the mid-left point of the rect.
virtual Rect unionRects(const Rect &rect2_) const
Unions two rects, forming a rect that has bounds sufficient to enclose both initial rects.
virtual bool containsPoint(const Point &pt_) const
Gets whether a given point lies inside the target rect.
virtual double area() const
Gets the area of the rect.
virtual Point bottomCenter() const
Gets the bottom-center point of the rect.
virtual void setLeft(const double left_)
Sets the position of the left bounding edge of the rectangle along the x-axis.
virtual double bottom() const
Gets the position of the bottom bounding edge of the rectangle along the y-axis.
virtual double perimeter() const
Gets the perimeter of the rect.
virtual Point midRight() const
Gets the mid-right point of the rect.
virtual Rect operator-(const Rect &rhs_) const
Allows two rects to have their origin and size objects subtracted using the - operator.
virtual bool overlaps(const Rect &rect2_) const
Checks whether the target rect overlaps a given rect.
virtual ~Rect()
Rect destructor.
virtual double right() const
Gets the position of the right bounding edge of the rectangle along the x-axis.
virtual double top() const
Gets the position of the top bounding edge of the rectangle along the y-axis.
virtual Rect scale(const double xScaler_, const double yScaler_) const
Scales the width and height of a rect by given amounts on the x- and y- axes.
virtual Rect inset(const double x_, const double y_) const
Insets a rect by given amounts on the x- and y-axes (or expands if negative)
virtual Point bottomRight() const
Gets the bottom-right point of the rect.
virtual Point topLeft() const
Gets the top-left point of the rect.
virtual Point topCenter() const
Gets the top-center point of the rect.
virtual bool operator==(const Rect &rhs_) const
Tests whether a given Rect object is the same as another.
Rect(const double x_, const double y_, const double width_, const double height_)
Constructs a Rect from an (x,y) point for the top-left and a width and height.
virtual Rect & operator-=(const Rect &rhs_)
Allows two rects to have their origin and size objects subtracted and assigned using the -= operator.
virtual Rect & operator=(const Rect &rhs_)
Sets a Rect object from another Rect object.
Rect()
Default Rect constructor; calls the default constructors for the origin and size.
Rect(const Point &pt_, const Size &size_)
Rect constructor, taking Point and Size arguments.
virtual Point midCenter() const
Gets the mid-center point of the rect.
virtual void setTop(const double top_)
Sets the position of the top bounding edge of the rectangle along the y-axis.
Rect(const Rect &rect_)
Rect copy constructor.
Size size
Dimensions of the rect.
Definition: hdicoreRect.h:44
virtual Point bottomLeft() const
Gets the bottom-left point of the rect.
virtual double left() const
Gets the position of the left bounding edge of the rectangle along the x-axis.
virtual void resize(const double w_, const double h_)
Resizes a rect to a given width and height.
virtual bool operator!=(const Rect &rhs_) const
Tests whether a given Rect object is not the same as another.
Contains a width and height for a rectangular shape.
Definition: hdicoreSize.h:25
Header file for describing 2D points.
Header file for describing 2D dimensions (width and height)
BoundsPinPointType
These allow for simpler art transformation/bounds metadata access.
Definition: hdicoreTypes.h:794
RectLineIntersectionType
Describes which points were found when checking for intersections between a rect and a line.
Definition: hdicoreTypes.h:812