Hot Door CORE 0.8.4
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreArtboardRect.h
Go to the documentation of this file.
1
6
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
98 const double x_,
99 const double y_,
100 const double width_,
101 const double height_
102 );
103
117 const double left_,
118 const double top_,
119 const double right_,
120 const double bottom_
121 );
122
131 virtual ArtboardRect& operator=(const ArtboardRect& rhs_);
132
141 virtual bool operator==(const ArtboardRect& rhs_) const;
142
151 virtual bool operator!=(const ArtboardRect& rhs_) const;
152
160 virtual double left() const;
161
169 virtual double top() const;
170
178 virtual double right() const;
179
187 virtual double bottom() const;
188
199 virtual void setLeft(const double left_);
200
211 virtual void setTop(const double top_);
212
222 virtual void setRight(const double right_);
223
233 virtual void setBottom(const double bottom_);
234
246 virtual ArtboardRect inset(const double x_, const double y_) const;
247
258 virtual ArtboardPoint topLeft() const;
259
270 virtual ArtboardPoint topCenter() const;
271
282 virtual ArtboardPoint topRight() const;
283
294 virtual ArtboardPoint midLeft() const;
295
303 virtual ArtboardPoint midCenter() const;
304
315 virtual ArtboardPoint midRight() const;
316
327 virtual ArtboardPoint bottomLeft() const;
328
340
351 virtual ArtboardPoint bottomRight() const;
352
362
372 virtual double area() const;
373
381 virtual double perimeter() const;
382
392 virtual bool equalWithinTol(const ArtboardRect& compare_, const double tol_) const;
393
402 virtual bool containsPoint(const ArtboardPoint& pt_) const;
403
412 virtual bool overlaps(const ArtboardRect& rect2_) const;
413
422 virtual bool enclosePoint(const ArtboardPoint& pt_);
423
432 virtual ArtboardRect unionRects(const ArtboardRect& rect2_) const;
433
443 virtual ArtboardRect scale(const double xScaler_, const double yScaler_) const;
444
457 virtual bool intersection(const ArtboardRect& rect2_, ArtboardRect& iRect__) const;
458
469 virtual void enclosingEllipse(double& width__, double& height__) const;
470
485 const ArtboardPoint& a_,
486 const ArtboardPoint& b_,
487 ArtboardPoint& iPt1__,
488 ArtboardPoint& iPt2__
489 ) const;
490
506 const ArtboardPoint& a_,
507 const ArtboardPoint& b_,
508 const Angle& angle_,
509 ArtboardPoint& iPt1__,
510 ArtboardPoint& iPt2__
511 ) const;
512
513
514 private:
515 friend aip::ArtboardRect* __accessImpl(const ArtboardRect&);
516 friend ArtboardRect __accessCtor(const aip::ArtboardRect&);
517
521 aip::ArtboardRect* __impl;
522
528 ArtboardRect(const aip::ArtboardRect&);
529 };
530
531 typedef std::unique_ptr<ArtboardRect> ArtboardRectUP;
532 typedef std::shared_ptr<ArtboardRect> ArtboardRectSP;
533 typedef std::weak_ptr<ArtboardRect> ArtboardRectWP;
534
535 extern aip::ArtboardRect* __accessImpl(const ArtboardRect&);
536 extern ArtboardRect __accessCtor(const aip::ArtboardRect&);
537 }
538}
539
540#endif
541// HDI_CORE_AIP_MODE
542
543#endif
544// __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