Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreArtboardRect.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_ARTBOARD_RECT__
8 #define __HDI_CORE_ARTBOARD_RECT__
9 
10 #include "hdicoreArtboardPoint.h"
11 #include "hdicoreSize.h"
12 
13 namespace hdi
14 {
15  namespace plugin
16  {
17  class ArtboardRect;
18  }
19 
20  namespace core
21  {
26  {
27  public:
32  {
33  NoIntersectionsFound = 0,
34  FirstIntersectionFound = 1,
35  BothIntersectionsFound = 2
36  };
37 
42 
47 
53  ArtboardRect();
54 
62  ArtboardRect(const ArtboardRect& rect_);
63 
72  ArtboardRect(const ArtboardPoint& pt_, const Size& size_);
73 
83  ArtboardRect(const ArtboardPoint& tl_, const ArtboardPoint& br_);
84 
90  virtual ~ArtboardRect();
91 
104  const double x_,
105  const double y_,
106  const double width_,
107  const double height_
108  );
109 
121  const double left_,
122  const double top_,
123  const double right_,
124  const double bottom_
125  );
126 
135  virtual ArtboardRect& operator=(const ArtboardRect& rhs_);
136 
145  virtual bool operator==(const ArtboardRect& rhs_) const;
146 
155  virtual bool operator!=(const ArtboardRect& rhs_) const;
156 
164  virtual double left() const;
165 
173  virtual double top() const;
174 
182  virtual double right() const;
183 
191  virtual double bottom() const;
192 
203  virtual void setLeft(const double left_);
204 
215  virtual void setTop(const double top_);
216 
226  virtual void setRight(const double right_);
227 
237  virtual void setBottom(const double bottom_);
238 
250  virtual ArtboardRect inset(const double x_, const double y_) const;
251 
262  virtual ArtboardPoint topLeft() const;
263 
274  virtual ArtboardPoint topCenter() const;
275 
286  virtual ArtboardPoint topRight() const;
287 
298  virtual ArtboardPoint midLeft() const;
299 
307  virtual ArtboardPoint midCenter() const;
308 
319  virtual ArtboardPoint midRight() const;
320 
331  virtual ArtboardPoint bottomLeft() const;
332 
343  virtual ArtboardPoint bottomCenter() const;
344 
355  virtual ArtboardPoint bottomRight() const;
356 
365  virtual ArtboardPoint pointFromPinPoint(const BoundsPinPointType pinPt_) const;
366 
376  virtual double area() const;
377 
385  virtual double perimeter() const;
386 
396  virtual bool equalWithinTol(const ArtboardRect& compare_, const double tol_) const;
397 
406  virtual bool containsPoint(const ArtboardPoint& pt_) const;
407 
416  virtual bool overlaps(const ArtboardRect& rect2_) const;
417 
426  virtual bool enclosePoint(const ArtboardPoint& pt_);
427 
436  virtual ArtboardRect unionRects(const ArtboardRect& rect2_) const;
437 
447  virtual ArtboardRect scale(const double xScaler_, const double yScaler_) const;
448 
461  virtual bool intersection(const ArtboardRect& rect2_, ArtboardRect& iRect__) const;
462 
473  virtual void enclosingEllipse(double& width__, double& height__) const;
474 
489  const ArtboardPoint& a_,
490  const ArtboardPoint& b_,
491  ArtboardPoint& iPt1__,
492  ArtboardPoint& iPt2__
493  ) const;
494 
510  const ArtboardPoint& a_,
511  const ArtboardPoint& b_,
512  const Angle& angle_,
513  ArtboardPoint& iPt1__,
514  ArtboardPoint& iPt2__
515  ) const;
516 
517 
518  private:
519  friend plugin::ArtboardRect* __accessImpl(const ArtboardRect&);
520  friend ArtboardRect __accessCtor(const plugin::ArtboardRect&);
521 
525  plugin::ArtboardRect* __impl;
526 
532  ArtboardRect(const plugin::ArtboardRect&);
533  };
534 
535  typedef std::auto_ptr<ArtboardRect> ArtboardRectAP;
536 
537  extern plugin::ArtboardRect* __accessImpl(const ArtboardRect&);
538  extern ArtboardRect __accessCtor(const plugin::ArtboardRect&);
539  }
540 }
541 
542 #endif
543 // __HDI_CORE_ARTBOARD_RECT__
virtual ArtboardPoint midLeft() const
Gets the mid-left point of the rect.
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 ~ArtboardRect()
ArtboardRect destructor.
virtual void setLeft(const double left_)
Sets the position of the left bounding edge of the rectangle along the x-axis.
virtual ArtboardPoint topCenter() const
Gets the top-center 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 double right() const
Gets the position of the right bounding edge of the rectangle along the x-axis.
virtual double area() const
Gets the area of the rect.
Describes a rectangular area on the Illustrator artboard.
Definition: hdicoreArtboardRect.h:25
virtual double left() const
Gets 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.
LineIntersectionType
Describes which points were found when checking for intersections between a rect and a line...
Definition: hdicoreArtboardRect.h:31
Size size
Dimensions of the rect.
Definition: hdicoreArtboardRect.h:46
virtual bool intersection(const ArtboardRect &rect2_, ArtboardRect &iRect__) const
Gets the intersection between two rects.
Header file for describing 2D dimensions (width and height)
virtual void enclosingEllipse(double &width__, double &height__) const
Gets the width and height of an ellipse that would enclose the rect.
virtual LineIntersectionType 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.
Header file for geometric point manipulation on the Illustrator artboard.
virtual ArtboardPoint bottomCenter() const
Gets the bottom-center point of the rect.
virtual double top() const
Gets the position of the top bounding edge of the rectangle along the y-axis.
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 ArtboardPoint bottomRight() const
Gets the bottom-right point of the rect.
virtual bool operator!=(const ArtboardRect &rhs_) const
Tests whether a given ArtboardRect object is not the same as another.
virtual bool operator==(const ArtboardRect &rhs_) const
Tests whether a given ArtboardRect object is the same as another.
Contains a width and height for a rectangular shape.
Definition: hdicoreSize.h:24
virtual ArtboardRect & operator=(const ArtboardRect &rhs_)
Allows one ArtboardRect object to be assigned from another.
Definition: hdicoreaiArray.h:12
virtual ArtboardPoint pointFromPinPoint(const BoundsPinPointType pinPt_) const
Gets a "pin point" from the rect bounds.
virtual ArtboardPoint topLeft() const
Gets the top-left point of the rect.
virtual void setBottom(const double bottom_)
Sets the position of the bottom bounding edge of the rectangle along the y-axis.
virtual void setTop(const double top_)
Sets the position of the top bounding edge of the rectangle along the y-axis.
virtual ArtboardPoint midRight() const
Gets the mid-right point of the rect.
virtual bool overlaps(const ArtboardRect &rect2_) const
Checks whether the target rect overlaps a given rect.
virtual ArtboardPoint midCenter() const
Gets the mid-center point of the rect.
virtual bool containsPoint(const ArtboardPoint &pt_) const
Gets whether a given point lies inside the target rect.
virtual double perimeter() const
Gets the perimeter of the rect.
virtual ArtboardPoint bottomLeft() const
Gets the bottom-left point of the rect.
ArtboardRect()
Default ArtboardRect constructor, sets the top-left to (0,0) and the width and height to 0...
virtual ArtboardRect unionRects(const ArtboardRect &rect2_) const
Unions two rects, forming a rect that has bounds sufficient to enclose both initial rects...
Describes an angle, and allows for easy conversion between various units.
Definition: hdicoreAngle.h:25
Describes a point on the Illustrator artboard.
Definition: hdicoreArtboardPoint.h:28
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 enclosePoint(const ArtboardPoint &pt_)
Enlarges the target rect, if necessary, to enclose a given point.
virtual ArtboardPoint 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.
ArtboardPoint origin
Origin point for the rect (top-left, when size.width and size.height are positive) ...
Definition: hdicoreArtboardRect.h:41
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 ...