Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreArtboardPoint.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_ARTBOARD_POINT__
8#define __HDI_CORE_ARTBOARD_POINT__
9
10#if defined(HDI_CORE_AIP_MODE)
11
12#include <vector>
13
14#include "hdicoreAngle.h"
15
16namespace hdi
17{
18 namespace aip
19 {
20 class ArtboardPoint;
21 }
22
23 namespace core
24 {
25 class TransformMatrix;
26
31 {
32 public:
33 typedef std::vector<ArtboardPoint> ArtboardPointVector;
34
38 double x;
39
43 double y;
44
51
60
69 ArtboardPoint(const double x_, const double y_);
70
76 virtual ~ArtboardPoint();
77
87 static ArtboardPoint LengthAngle(const double length_, const Angle& angle_);
88
98 virtual bool closeTo(const ArtboardPoint& compare_, const double tol_) const;
99
108 virtual double dotProduct(const ArtboardPoint& p2_) const;
109
122 virtual ArtboardPoint offset(const double tx_, const double ty_) const;
123
133 virtual ArtboardPoint rotate(const ArtboardPoint& origin_, const Angle& angle_) const;
134
144 virtual ArtboardPoint move(const double length_, const Angle& angle_) const;
145
154 virtual ArtboardPoint transform(const TransformMatrix& m_) const;
155
164 virtual bool insidePolygon(const ArtboardPointVector& points_) const;
165
174 virtual ArtboardPoint& operator=(const ArtboardPoint& rhs_);
175
187 virtual bool operator==(const ArtboardPoint& rhs_) const;
188
200 virtual bool operator!=(const ArtboardPoint& rhs_) const;
201
210 virtual bool operator<(const ArtboardPoint& rhs_) const;
211
220 virtual bool operator<=(const ArtboardPoint& rhs_) const;
221
230 virtual bool operator>(const ArtboardPoint& rhs_) const;
231
240 virtual bool operator>=(const ArtboardPoint& rhs_) const;
241
250 virtual ArtboardPoint operator+(const double rhs_) const;
251
260 virtual ArtboardPoint operator-(const double rhs_) const;
261
270 virtual ArtboardPoint operator*(const double rhs_) const;
271
280 virtual ArtboardPoint operator/(const double rhs_) const;
281
290 virtual ArtboardPoint operator+(const ArtboardPoint& rhs_) const;
291
300 virtual ArtboardPoint operator-(const ArtboardPoint& rhs_) const;
301
310 virtual ArtboardPoint operator*(const ArtboardPoint& rhs_) const;
311
320 virtual ArtboardPoint operator/(const ArtboardPoint& rhs_) const;
321
330 virtual ArtboardPoint& operator+=(const double rhs_);
331
341 virtual ArtboardPoint& operator-=(const double rhs_);
342
352 virtual ArtboardPoint& operator*=(const double rhs_);
353
363 virtual ArtboardPoint& operator/=(const double rhs_);
364
374
385
396
406
415 virtual Angle operator^(const ArtboardPoint& rhs_) const;
416
425 virtual double operator|(const ArtboardPoint& rhs_) const;
426
427
428 private:
429 friend aip::ArtboardPoint* __accessImpl(const ArtboardPoint&);
430 friend ArtboardPoint __accessCtor(const aip::ArtboardPoint&);
431
435 aip::ArtboardPoint* __impl;
436
442 ArtboardPoint(const aip::ArtboardPoint&);
443 };
444
445 typedef std::unique_ptr<ArtboardPoint> ArtboardPointUP;
446 typedef std::shared_ptr<ArtboardPoint> ArtboardPointSP;
447 typedef std::weak_ptr<ArtboardPoint> ArtboardPointWP;
448
449 extern aip::ArtboardPoint* __accessImpl(const ArtboardPoint&);
450 extern ArtboardPoint __accessCtor(const aip::ArtboardPoint&);
451 }
452}
453
454#endif
455// HDI_CORE_AIP_MODE
456
457#endif
458// __HDI_CORE_ARTBOARD_POINT__
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
virtual ArtboardPoint operator-(const double rhs_) const
Allows a value to be subtracted from both this->x and this->y using the - operator.
double y
Position on the y-axis.
Definition: hdicoreArtboardPoint.h:43
virtual ArtboardPoint offset(const double tx_, const double ty_) const
Offsets a point along the x- and y-axes by given amounts.
ArtboardPoint(const ArtboardPoint &pt_)
ArtboardPoint copy constructor.
virtual bool operator>=(const ArtboardPoint &rhs_) const
Allows two ArtboardPoint objects to be compared with the >= operator.
ArtboardPoint(const double x_, const double y_)
ArtboardPoint constructor, taking x and y arguments.
virtual bool operator>(const ArtboardPoint &rhs_) const
Allows two ArtboardPoint objects to be compared with the > operator.
virtual ~ArtboardPoint()
ArtboardPoint destructor.
virtual ArtboardPoint operator/(const double rhs_) const
Allows both this->x and this->y to be divided by a value using the / operator.
virtual ArtboardPoint & operator*=(const double rhs_)
Allows a value to be multiplied with, and assigned to, both this->x and this->y using the = operator.
virtual ArtboardPoint operator*(const double rhs_) const
Allows a value to be multiplied with both this->x and this->y using the * operator.
virtual ArtboardPoint transform(const TransformMatrix &m_) const
Transforms a point via a 2-dimensional transformation matrix.
virtual bool operator<=(const ArtboardPoint &rhs_) const
Allows two ArtboardPoint objects to be compared with the <= operator.
virtual ArtboardPoint move(const double length_, const Angle &angle_) const
"Moves" a point by a given length and angle away from its current position
virtual ArtboardPoint & operator/=(const double rhs_)
Allows both this->x and this->y to be divided by a value, and assigned, using the /= operator.
virtual double operator|(const ArtboardPoint &rhs_) const
Gets the distance between this and rhs_.
virtual ArtboardPoint & operator/=(const ArtboardPoint &rhs_)
Allows two points to have their x and y values divided and assigned using the /= operator.
virtual double dotProduct(const ArtboardPoint &p2_) const
Gets the dot product of two ArtboardPoint objects.
virtual ArtboardPoint & operator=(const ArtboardPoint &rhs_)
Allows one ArtboardPoint object to be assigned from another.
virtual Angle operator^(const ArtboardPoint &rhs_) const
Gets the angle of the vector (this, rhs_), if this were moved to the origin.
virtual ArtboardPoint & operator-=(const double rhs_)
Allows a value to be subtracted from, and assigned to, both this->x and this->y using the -= operator...
virtual ArtboardPoint operator+(const ArtboardPoint &rhs_) const
Allows two points to have their x and y values added using the + operator.
virtual bool closeTo(const ArtboardPoint &compare_, const double tol_) const
Gets whether a given point is within a certain tolerance ("close to") the target point.
virtual ArtboardPoint & operator*=(const ArtboardPoint &rhs_)
Allows two points to have their x and y values multiplied and assigned using the *= operator.
virtual bool operator==(const ArtboardPoint &rhs_) const
Allows two ArtboardPoint objects to be compared with the == operator.
virtual bool insidePolygon(const ArtboardPointVector &points_) const
Checks if the point is within the provided polygon.
virtual ArtboardPoint operator+(const double rhs_) const
Allows a value to be added to both this->x and this->y using the + operator.
virtual ArtboardPoint & operator-=(const ArtboardPoint &rhs_)
Allows two points to have their x and y values subtracted and assigned using the -= operator.
virtual ArtboardPoint & operator+=(const double rhs_)
Allows a value to be added and assigned to both this->x and this->y using the += operator.
static ArtboardPoint LengthAngle(const double length_, const Angle &angle_)
"Named constructor" for a point that is a given length and angle away from the origin
virtual bool operator<(const ArtboardPoint &rhs_) const
Allows two ArtboardPoint objects to be compared with the < operator.
virtual ArtboardPoint rotate(const ArtboardPoint &origin_, const Angle &angle_) const
Rotates the point about a given "origin" point by a certain angle.
virtual ArtboardPoint operator-(const ArtboardPoint &rhs_) const
Allows two points to have their x and y values subtracted using the - operator.
ArtboardPoint()
Default ArtboardPoint constructor, setting the point to (0,0)
virtual ArtboardPoint operator/(const ArtboardPoint &rhs_) const
Allows two points to have their x and y values divided using the / operator.
virtual ArtboardPoint operator*(const ArtboardPoint &rhs_) const
Allows two points to have their x and y values multiplied using the * operator.
double x
Position on the x-axis.
Definition: hdicoreArtboardPoint.h:38
virtual ArtboardPoint & operator+=(const ArtboardPoint &rhs_)
Allows two points to have their x and y values added and assigned using the += operator.
virtual bool operator!=(const ArtboardPoint &rhs_) const
Allows two ArtboardPoint objects to be compared with the != operator.
Allows for 2-dimensional transformations in a single application via matrix math.
Definition: hdicoreTransformMatrix.h:34
Header file for describing angles.