Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreArtboardRect.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_ARTBOARD_RECT__
8#define __HDI_CORE_ARTBOARD_RECT__
9
10#if defined(HDI_CORE_AIP_MODE)
11
13#include "hdicoreSize.h"
14
15namespace hdi
16{
17 namespace aip
18 {
19 class ArtboardRect;
20 }
21
22 namespace core
23 {
28 {
29 public:
34
39
46
55
64 ArtboardRect(const ArtboardPoint& pt_, const Size& size_);
65
75 ArtboardRect(const ArtboardPoint& tl_, const ArtboardPoint& br_);
76
82 virtual ~ArtboardRect();
83
96 const double x_,
97 const double y_,
98 const double width_,
99 const double height_
100 );
101
113 const double left_,
114 const double top_,
115 const double right_,
116 const double bottom_
117 );
118
127 virtual ArtboardRect& operator=(const ArtboardRect& rhs_);
128
137 virtual bool operator==(const ArtboardRect& rhs_) const;
138
147 virtual bool operator!=(const ArtboardRect& rhs_) const;
148
156 virtual double left() const;
157
165 virtual double top() const;
166
174 virtual double right() const;
175
183 virtual double bottom() const;
184
195 virtual void setLeft(const double left_);
196
207 virtual void setTop(const double top_);
208
218 virtual void setRight(const double right_);
219
229 virtual void setBottom(const double bottom_);
230
242 virtual ArtboardRect inset(const double x_, const double y_) const;
243
254 virtual ArtboardPoint topLeft() const;
255
266 virtual ArtboardPoint topCenter() const;
267
278 virtual ArtboardPoint topRight() const;
279
290 virtual ArtboardPoint midLeft() const;
291
299 virtual ArtboardPoint midCenter() const;
300
311 virtual ArtboardPoint midRight() const;
312
323 virtual ArtboardPoint bottomLeft() const;
324
336
347 virtual ArtboardPoint bottomRight() const;
348
358
368 virtual double area() const;
369
377 virtual double perimeter() const;
378
388 virtual bool equalWithinTol(const ArtboardRect& compare_, const double tol_) const;
389
398 virtual bool containsPoint(const ArtboardPoint& pt_) const;
399
408 virtual bool overlaps(const ArtboardRect& rect2_) const;
409
418 virtual bool enclosePoint(const ArtboardPoint& pt_);
419
428 virtual ArtboardRect unionRects(const ArtboardRect& rect2_) const;
429
439 virtual ArtboardRect scale(const double xScaler_, const double yScaler_) const;
440
453 virtual bool intersection(const ArtboardRect& rect2_, ArtboardRect& iRect__) const;
454
465 virtual void enclosingEllipse(double& width__, double& height__) const;
466
481 const ArtboardPoint& a_,
482 const ArtboardPoint& b_,
483 ArtboardPoint& iPt1__,
484 ArtboardPoint& iPt2__
485 ) const;
486
502 const ArtboardPoint& a_,
503 const ArtboardPoint& b_,
504 const Angle& angle_,
505 ArtboardPoint& iPt1__,
506 ArtboardPoint& iPt2__
507 ) const;
508
509
510 private:
511 friend aip::ArtboardRect* __accessImpl(const ArtboardRect&);
512 friend ArtboardRect __accessCtor(const aip::ArtboardRect&);
513
517 aip::ArtboardRect* __impl;
518
524 ArtboardRect(const aip::ArtboardRect&);
525 };
526
527 typedef std::unique_ptr<ArtboardRect> ArtboardRectUP;
528 typedef std::shared_ptr<ArtboardRect> ArtboardRectSP;
529 typedef std::weak_ptr<ArtboardRect> ArtboardRectWP;
530
531 extern aip::ArtboardRect* __accessImpl(const ArtboardRect&);
532 extern ArtboardRect __accessCtor(const aip::ArtboardRect&);
533 }
534}
535
536#endif
537// HDI_CORE_AIP_MODE
538
539#endif
540// __HDI_CORE_ARTBOARD_RECT__
Describes an angle, and allows for easy conversion between various units.
Definition: hdicoreAngle.h:26
Describes a point on the Illustrator artboard.
Definition: hdicoreArtboardPoint.h:31
Describes a rectangular area on the Illustrator artboard.
Definition: hdicoreArtboardRect.h:28
virtual bool containsPoint(const ArtboardPoint &pt_) const
Gets whether a given point lies inside the target rect.
virtual ArtboardPoint pointFromPinPoint(const BoundsPinPointType pinPt_) const
Gets a "pin point" from the rect bounds.
virtual void enclosingEllipse(double &width__, double &height__) const
Gets the width and height of an ellipse that would enclose the rect.
ArtboardPoint origin
Origin point for the rect (top-left, when size.width and size.height are positive)
Definition: hdicoreArtboardRect.h:33
virtual void setBottom(const double bottom_)
Sets the position of the bottom bounding edge of the rectangle along the y-axis.
ArtboardRect(const ArtboardPoint &pt_, const Size &size_)
Constructor to create an ArtboardRect from an ArtboardPoint object and Size object.
virtual bool operator!=(const ArtboardRect &rhs_) const
Tests whether a given ArtboardRect object is not the same as another.
virtual ArtboardPoint bottomRight() const
Gets the bottom-right point of the rect.
static ArtboardRect XYWidthHeight(const double x_, const double y_, const double width_, const double height_)
"Named constructor" to create an ArtboardRect from an (x,y) top-left point and a width and height
virtual bool operator==(const ArtboardRect &rhs_) const
Tests whether a given ArtboardRect object is the same as another.
virtual bool equalWithinTol(const ArtboardRect &compare_, const double tol_) const
Gets whether a given rect is equal to the target rect, within a given tolerance.
virtual double perimeter() const
Gets the perimeter of the rect.
Size size
Dimensions of the rect.
Definition: hdicoreArtboardRect.h:38
virtual double area() const
Gets the area of the rect.
virtual ~ArtboardRect()
ArtboardRect destructor.
virtual ArtboardPoint topCenter() const
Gets the top-center point of the rect.
static ArtboardRect LeftTopRightBottom(const double left_, const double top_, const double right_, const double bottom_)
"Named constructor" to create an ArtboardRect from the values of its bounding edges
virtual RectLineIntersectionType lineIntersectionPoints(const ArtboardPoint &a_, const ArtboardPoint &b_, const Angle &angle_, ArtboardPoint &iPt1__, ArtboardPoint &iPt2__) const
Finds the intersection points on a rectangle, were it rotated, that a line has with it.
virtual double left() const
Gets the position of the left bounding edge of the rectangle along the x-axis.
virtual bool enclosePoint(const ArtboardPoint &pt_)
Enlarges the target rect, if necessary, to enclose a given point.
virtual ArtboardRect unionRects(const ArtboardRect &rect2_) const
Unions two rects, forming a rect that has bounds sufficient to enclose both initial rects.
virtual ArtboardPoint topLeft() const
Gets the top-left 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 ArtboardPoint bottomCenter() const
Gets the bottom-center point of the rect.
ArtboardRect()
Default ArtboardRect constructor, sets the top-left to (0,0) and the width and height to 0.
virtual double right() const
Gets the position of the right bounding edge of the rectangle along the x-axis.
virtual ArtboardPoint midCenter() const
Gets the mid-center point of the rect.
ArtboardRect(const ArtboardPoint &tl_, const ArtboardPoint &br_)
Constructor to create an ArtboardRect object from top-left and bottom-right ArtboardPoint objects.
virtual ArtboardRect 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 ArtboardPoint midRight() const
Gets the mid-right point of the rect.
virtual ArtboardPoint midLeft() const
Gets the mid-left point of the rect.
virtual ArtboardRect 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 ArtboardRect &rect2_, ArtboardRect &iRect__) const
Gets the intersection between two rects.
virtual ArtboardPoint topRight() const
Gets the top-right point of the rect.
virtual double top() const
Gets the position of the top bounding edge of the rectangle along the y-axis.
virtual RectLineIntersectionType lineIntersectionPoints(const ArtboardPoint &a_, const ArtboardPoint &b_, ArtboardPoint &iPt1__, ArtboardPoint &iPt2__) const
Finds the intersection points on a rectangle that a line has with it.
virtual void setTop(const double top_)
Sets the position of the top bounding edge of the rectangle along the y-axis.
virtual ArtboardPoint bottomLeft() const
Gets the bottom-left 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 ArtboardRect & operator=(const ArtboardRect &rhs_)
Allows one ArtboardRect object to be assigned from another.
virtual double bottom() const
Gets the position of the bottom bounding edge of the rectangle along the y-axis.
ArtboardRect(const ArtboardRect &rect_)
ArtboardRect copy constructor.
virtual bool overlaps(const ArtboardRect &rect2_) const
Checks whether the target rect overlaps a given rect.
Contains a width and height for a rectangular shape.
Definition: hdicoreSize.h:25
Header file for geometric point manipulation on the Illustrator artboard.
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