![]() |
Hot Door CORE 0.8.4
Adobe® Illustrator® Plug-in Library
|
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dimensions. More...
#include <hdicoreRect.h>

Public Member Functions | |
| Rect () | |
| Default Rect constructor; calls the default constructors for the origin and size. | |
| 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. | |
| Rect (const Point &pt_, const Size &size_) | |
| Rect constructor, taking Point and Size arguments. | |
| Rect (const Rect &rect_) | |
| Rect copy constructor. | |
| virtual | ~Rect () |
| Rect destructor. | |
| virtual Rect & | operator= (const Rect &rhs_) |
| Sets a Rect object from another Rect object. | |
| virtual bool | operator== (const Rect &rhs_) const |
| Tests whether a given Rect object is the same as another. | |
| virtual bool | operator!= (const Rect &rhs_) const |
| Tests whether a given Rect object is not the same as another. | |
| virtual Rect | operator+ (const Rect &rhs_) const |
| Allows two rects to have their origin and size objects added using the + operator. | |
| virtual Rect & | operator+= (const Rect &rhs_) |
| Allows two rects to have their origin and size objects added and assigned using the += operator. | |
| virtual Rect | operator- (const Rect &rhs_) const |
| Allows two rects to have their origin and size objects subtracted using the - operator. | |
| virtual Rect & | operator-= (const Rect &rhs_) |
| Allows two rects to have their origin and size objects subtracted and assigned using the -= operator. | |
| virtual void | offset (const double tx_, const double ty_) |
| Offsets a rect along the x- and y-axes by given amounts. | |
| virtual void | resize (const double w_, const double h_) |
| Resizes a rect to a given width and height. | |
| 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 | topLeft () const |
| Gets the top-left point of the rect. | |
| virtual Point | topCenter () const |
| Gets the top-center point of the rect. | |
| virtual Point | topRight () const |
| Gets the top-right point of the rect. | |
| virtual Point | midLeft () const |
| Gets the mid-left point of the rect. | |
| virtual Point | midCenter () const |
| Gets the mid-center point of the rect. | |
| virtual Point | midRight () const |
| Gets the mid-right point of the rect. | |
| virtual Point | bottomLeft () const |
| Gets the bottom-left point of the rect. | |
| virtual Point | bottomCenter () const |
| Gets the bottom-center point of the rect. | |
| virtual Point | bottomRight () const |
| Gets the bottom-right point of the rect. | |
| virtual Point | pointFromPinPoint (const BoundsPinPointType pinPt_) const |
| Gets a "pin point" from the rect bounds. | |
| virtual double | left () const |
| Gets the position of the left 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 double | right () const |
| Gets the position of the right 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 void | setLeft (const double left_) |
| Sets the position of the left bounding edge of the rectangle along the x-axis. | |
| virtual void | setTop (const double top_) |
| Sets the position of the top bounding edge of the rectangle along the y-axis. | |
| virtual void | setRight (const double right_) |
| Sets the position of the right bounding edge of the rectangle along the x-axis. | |
| virtual void | setBottom (const double bottom_) |
| Sets the position of the bottom bounding edge of the rectangle along the y-axis. | |
| virtual double | area () const |
| Gets the area of the rect. | |
| virtual double | perimeter () const |
| Gets the perimeter of the rect. | |
| virtual bool | containsPoint (const Point &pt_) const |
| Gets whether a given point lies inside the target rect. | |
| virtual bool | overlaps (const Rect &rect2_) const |
| Checks whether the target rect overlaps a given rect. | |
| virtual bool | enclosePoint (const Point &pt_) |
| Enlarges the target rect, if necessary, to enclose a given point. | |
| virtual Rect | unionRects (const Rect &rect2_) const |
| Unions two rects, forming a rect that has bounds sufficient to enclose both initial rects. | |
| 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 bool | intersection (const Rect &rect2_, Rect &iRect__) const |
| Gets the intersection between two rects. | |
| virtual void | enclosingEllipse (double &width__, double &height__) const |
| Gets the width and height of an ellipse that would enclose the rect. | |
| 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 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. | |
Public Attributes | |
| Point | origin |
| Origin point for the rect (top-left, when size.width and size.height are positive) | |
| Size | size |
| Dimensions of the rect. | |
Friends | |
| aip::Rect * | __accessImpl (const Rect &) |
| Rect | __accessCtor (const aip::Rect &) |
Contains Point and Size objects to describe a rectangle that exists at a specific point of given dimensions.
| hdi::core::Rect::Rect | ( | ) |
Default Rect constructor; calls the default constructors for the origin and size.
| hdi::core::Rect::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.
| x_ | Position of the left of the rect along the x-axis |
| y_ | Position of the top of the rect along the y-axis |
| width_ | Width of the rect |
| height_ | Height of the rect |
| hdi::core::Rect::Rect | ( | const Rect & | rect_ | ) |
|
virtual |
Rect destructor.
|
virtual |
Gets the area of the rect.
|
virtual |
Gets the position of the bottom bounding edge of the rectangle along the y-axis.
|
virtual |
Gets the bottom-center point of the rect.
|
virtual |
Gets the bottom-left point of the rect.
|
virtual |
Gets the bottom-right point of the rect.
|
virtual |
Gets whether a given point lies inside the target rect.
| pt_ | Point to test |
|
virtual |
Enlarges the target rect, if necessary, to enclose a given point.
| pt_ | Point the rect should enclose |
|
virtual |
Gets the width and height of an ellipse that would enclose the rect.
| width__ | Return-by-reference for the ellipse width |
| height__ | Return-by-reference for the ellipse height |
|
virtual |
Insets a rect by given amounts on the x- and y-axes (or expands if negative)
| x_ | Amount to inset the rect on the left and right sides |
| y_ | Amount to inset the rect on the top and bottom sides |
Gets the intersection between two rects.
| rect2_ | Second rect to test for an intersection with the target rect |
| iRect__ | Return-by-reference for the intersection rect |
|
virtual |
Gets the position of the left bounding edge of the rectangle along the x-axis.
|
virtual |
Finds the intersection points on a rectangle, were it rotated, that a line has with it.
| a_ | Start point for the line |
| b_ | End point for the line |
| angle_ | Amount the rectangle is rotated |
| iPt1__ | Return-by-reference for the first intersection point found |
| iPt2__ | Return-by-reference for the second intersection point found |
|
virtual |
Finds the intersection points on a rectangle that a line has with it.
| a_ | Start point for the line |
| b_ | End point for the line |
| iPt1__ | Return-by-reference for the first intersection point found |
| iPt2__ | Return-by-reference for the second intersection point found |
|
virtual |
Gets the mid-center point of the rect.
|
virtual |
Gets the mid-left point of the rect.
|
virtual |
Gets the mid-right point of the rect.
|
virtual |
Offsets a rect along the x- and y-axes by given amounts.
This is a convenience method to adjust both the x and y values in one call
| tx_ | Amount to offset along the x-axis |
| ty_ | Amount to offset along the y-axis |
|
virtual |
Allows two rects to have their origin and size objects added using the + operator.
| rhs_ | Righthand side of the + operator |
Allows two rects to have their origin and size objects added and assigned using the += operator.
| rhs_ | Righthand side of the += operator |
Allows two rects to have their origin and size objects subtracted using the - operator.
| rhs_ | Righthand side of the - operator |
Allows two rects to have their origin and size objects subtracted and assigned using the -= operator.
| rhs_ | Righthand side of the -= operator |
Sets a Rect object from another Rect object.
| rhs_ | Righthand side of the = operator; Rect object to pull values from |
|
virtual |
|
virtual |
Checks whether the target rect overlaps a given rect.
| rect2_ | Rect to compare against for overlapping boundaries |
|
virtual |
Gets the perimeter of the rect.
|
virtual |
Gets a "pin point" from the rect bounds.
| pinPt_ | Pin point which will be turned into an absolute point from the rect |
|
virtual |
Resizes a rect to a given width and height.
This is a convenience method to set both width and height in one call
| w_ | New rect width |
| h_ | New rect height |
|
virtual |
Gets the position of the right bounding edge of the rectangle along the x-axis.
|
virtual |
Scales the width and height of a rect by given amounts on the x- and y- axes.
| xScaler_ | Multiplier for scaling horizontally (e.g. 0.75 is 75% of the current size) |
| yScaler_ | Multiplier for scaling vertically (e.g. 0.75 is 75% of the current size) |
|
virtual |
Sets the position of the bottom bounding edge of the rectangle along the y-axis.
| bottom_ | New bottom edge of the rect |
|
virtual |
Sets the position of the left bounding edge of the rectangle along the x-axis.
| left_ | New left edge of the rect |
|
virtual |
Sets the position of the right bounding edge of the rectangle along the x-axis.
| right_ | New right edge of the rect |
|
virtual |
Sets the position of the top bounding edge of the rectangle along the y-axis.
| top_ | New top edge of the rect |
|
virtual |
Gets the position of the top bounding edge of the rectangle along the y-axis.
|
virtual |
Gets the top-center point of the rect.
|
virtual |
Gets the top-left point of the rect.
|
virtual |
Gets the top-right point of the rect.
Unions two rects, forming a rect that has bounds sufficient to enclose both initial rects.
| rect2_ | Second rect to consider in the union |