Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
hdi::core::ArtboardPoint Class Reference

Describes a point on the Illustrator artboard. More...

#include <hdicoreArtboardPoint.h>

Public Types

typedef std::vector< ArtboardPointArtboardPointVector
 

Public Member Functions

 ArtboardPoint ()
 Default ArtboardPoint constructor, setting the point to (0,0)
 
 ArtboardPoint (const ArtboardPoint &pt_)
 ArtboardPoint copy constructor.
 
 ArtboardPoint (const double x_, const double y_)
 ArtboardPoint constructor, taking x and y arguments.
 
virtual ~ArtboardPoint ()
 ArtboardPoint destructor.
 
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 double dotProduct (const ArtboardPoint &p2_) const
 Gets the dot product of two ArtboardPoint objects.
 
virtual ArtboardPoint offset (const double tx_, const double ty_) const
 Offsets a point along the x- and y-axes by given amounts.
 
virtual ArtboardPoint rotate (const ArtboardPoint &origin_, const Angle &angle_) const
 Rotates the point about a given "origin" point by a certain angle.
 
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 transform (const TransformMatrix &m_) const
 Transforms a point via a 2-dimensional transformation matrix.
 
virtual bool insidePolygon (const ArtboardPointVector &points_) const
 Checks if the point is within the provided polygon.
 
virtual ArtboardPointoperator= (const ArtboardPoint &rhs_)
 Allows one ArtboardPoint object to be assigned from another.
 
virtual bool operator== (const ArtboardPoint &rhs_) const
 Allows two ArtboardPoint objects to be compared with the == operator.
 
virtual bool operator!= (const ArtboardPoint &rhs_) const
 Allows two ArtboardPoint objects to be compared with the != operator.
 
virtual bool operator< (const ArtboardPoint &rhs_) const
 Allows two ArtboardPoint objects to be compared with the < operator.
 
virtual bool operator<= (const ArtboardPoint &rhs_) const
 Allows two ArtboardPoint objects to be compared with the <= operator.
 
virtual bool operator> (const ArtboardPoint &rhs_) const
 Allows two ArtboardPoint objects to be compared with the > operator.
 
virtual bool operator>= (const ArtboardPoint &rhs_) const
 Allows two ArtboardPoint objects to be compared with the >= operator.
 
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 double rhs_) const
 Allows a value to be subtracted from 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 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 ArtboardPoint &rhs_) const
 Allows two points to have their x and y values added using the + operator.
 
virtual ArtboardPoint operator- (const ArtboardPoint &rhs_) const
 Allows two points to have their x and y values subtracted using the - operator.
 
virtual ArtboardPoint operator* (const ArtboardPoint &rhs_) const
 Allows two points to have their x and y values multiplied using the * operator.
 
virtual ArtboardPoint operator/ (const ArtboardPoint &rhs_) const
 Allows two points to have their x and y values divided using the / operator.
 
virtual ArtboardPointoperator+= (const double rhs_)
 Allows a value to be added and assigned to both this->x and this->y using the += operator.
 
virtual ArtboardPointoperator-= (const double rhs_)
 Allows a value to be subtracted from, and assigned to, both this->x and this->y using the -= operator.
 
virtual ArtboardPointoperator*= (const double rhs_)
 Allows a value to be multiplied with, and assigned to, both this->x and this->y using the = operator.
 
virtual ArtboardPointoperator/= (const double rhs_)
 Allows both this->x and this->y to be divided by a value, and assigned, using the /= operator.
 
virtual ArtboardPointoperator+= (const ArtboardPoint &rhs_)
 Allows two points to have their x and y values added and assigned using the += operator.
 
virtual ArtboardPointoperator-= (const ArtboardPoint &rhs_)
 Allows two points to have their x and y values subtracted and assigned using the -= operator.
 
virtual ArtboardPointoperator*= (const ArtboardPoint &rhs_)
 Allows two points to have their x and y values multiplied and assigned using the *= operator.
 
virtual ArtboardPointoperator/= (const ArtboardPoint &rhs_)
 Allows two points to have their x and y values divided and assigned using the /= operator.
 
virtual Angle operator^ (const ArtboardPoint &rhs_) const
 Gets the angle of the vector (this, rhs_), if this were moved to the origin.
 
virtual double operator| (const ArtboardPoint &rhs_) const
 Gets the distance between this and rhs_.
 

Static Public Member Functions

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
 

Public Attributes

double x
 Position on the x-axis.
 
double y
 Position on the y-axis.
 

Friends

aip::ArtboardPoint * __accessImpl (const ArtboardPoint &)
 
ArtboardPoint __accessCtor (const aip::ArtboardPoint &)
 

Detailed Description

Describes a point on the Illustrator artboard.

Constructor & Destructor Documentation

◆ ArtboardPoint() [1/3]

hdi::core::ArtboardPoint::ArtboardPoint ( )

Default ArtboardPoint constructor, setting the point to (0,0)

Author
GW
Date
08/2013

◆ ArtboardPoint() [2/3]

hdi::core::ArtboardPoint::ArtboardPoint ( const ArtboardPoint pt_)

ArtboardPoint copy constructor.

Author
GW
Date
08/2013
Parameters
pt_Existing ArtboardPoint object to copy

◆ ArtboardPoint() [3/3]

hdi::core::ArtboardPoint::ArtboardPoint ( const double  x_,
const double  y_ 
)

ArtboardPoint constructor, taking x and y arguments.

Author
GW
Date
08/2013
Parameters
x_Location of the item on the x-axis
y_Location of the item on the y-axis

◆ ~ArtboardPoint()

virtual hdi::core::ArtboardPoint::~ArtboardPoint ( )
virtual

ArtboardPoint destructor.

Author
GW
Date
08/2013

Member Function Documentation

◆ closeTo()

virtual bool hdi::core::ArtboardPoint::closeTo ( const ArtboardPoint compare_,
const double  tol_ 
) const
virtual

Gets whether a given point is within a certain tolerance ("close to") the target point.

Author
GW
Date
08/2013
Parameters
compare_Point to compare with
tol_Tolerance between the points; a definition of what constitutes "close"
Returns
true if the points are within tol_ distance of one another, false otherwise

◆ dotProduct()

virtual double hdi::core::ArtboardPoint::dotProduct ( const ArtboardPoint p2_) const
virtual

Gets the dot product of two ArtboardPoint objects.

Author
GW
Date
08/2013
Parameters
p2_Second ArtboardPoint object with which the dot product is calculated
Returns
The dot product of the target point and the given point (p2_)

◆ insidePolygon()

virtual bool hdi::core::ArtboardPoint::insidePolygon ( const ArtboardPointVector &  points_) const
virtual

Checks if the point is within the provided polygon.

Author
GW
Date
08/2013
Parameters
points_[]Points that describe the polygon
Returns
true if the point lies within the provided polygon, false otherwise

◆ LengthAngle()

static ArtboardPoint hdi::core::ArtboardPoint::LengthAngle ( const double  length_,
const Angle angle_ 
)
static

"Named constructor" for a point that is a given length and angle away from the origin

Author
GW
Date
08/2013
Parameters
length_Length away from the origin
angle_Angle that the point is rotated about the origin and away from the x-axis
Returns
An ArtboardPoint at the given distance and angle from the origin (0,0)

◆ move()

virtual ArtboardPoint hdi::core::ArtboardPoint::move ( const double  length_,
const Angle angle_ 
) const
virtual

"Moves" a point by a given length and angle away from its current position

Author
GW
Date
08/2013
Parameters
length_Length away from the current position
angle_Angle that the point is moved from the current position
Returns
A copy of the target point, moved as specified

◆ offset()

virtual ArtboardPoint hdi::core::ArtboardPoint::offset ( const double  tx_,
const double  ty_ 
) const
virtual

Offsets a point along the x- and y-axes by given amounts.

Author
GW
Date
08/2013
Parameters
tx_Amount to offset along the x-axis
ty_Amount to offset along the y-axis
Returns
A copy of the target point, offset by the given amounts
Note
Negative values go toward 0.0 if the object to be transformed has a positive x and/or y value; positive values go away from 0.0

◆ operator!=()

virtual bool hdi::core::ArtboardPoint::operator!= ( const ArtboardPoint rhs_) const
virtual

Allows two ArtboardPoint objects to be compared with the != operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the != operator
Returns
true if this.x != rhs_.x or this.y != rhs_.y
Note
Due to the nature of floating point comparisons, it is better to use a method like closeTo() to determine if two ArtboardPoints are "equal"

◆ operator*() [1/2]

virtual ArtboardPoint hdi::core::ArtboardPoint::operator* ( const ArtboardPoint rhs_) const
virtual

Allows two points to have their x and y values multiplied using the * operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the * operator
Returns
A copy of the target ArtboardPoint, with this x and y values multipled by rhs_ x and y

◆ operator*() [2/2]

virtual ArtboardPoint hdi::core::ArtboardPoint::operator* ( const double  rhs_) const
virtual

Allows a value to be multiplied with both this->x and this->y using the * operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the * operator
Returns
A copy of the target ArtboardPoint, with both the x and y members multiplied by a value

◆ operator*=() [1/2]

virtual ArtboardPoint & hdi::core::ArtboardPoint::operator*= ( const ArtboardPoint rhs_)
virtual

Allows two points to have their x and y values multiplied and assigned using the *= operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the *= operator
Returns
The lefthand side of the *= operator, with this x and y values multipled by rhs_ x and y

◆ operator*=() [2/2]

virtual ArtboardPoint & hdi::core::ArtboardPoint::operator*= ( const double  rhs_)
virtual

Allows a value to be multiplied with, and assigned to, both this->x and this->y using the = operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the *= operator
Returns
The lefthand side of the *= operator, with both the x and y members multiplied by a value

◆ operator+() [1/2]

virtual ArtboardPoint hdi::core::ArtboardPoint::operator+ ( const ArtboardPoint rhs_) const
virtual

Allows two points to have their x and y values added using the + operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the + operator
Returns
A copy of the target ArtboardPoint, with all x and y values summed together

◆ operator+() [2/2]

virtual ArtboardPoint hdi::core::ArtboardPoint::operator+ ( const double  rhs_) const
virtual

Allows a value to be added to both this->x and this->y using the + operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the + operator
Returns
A copy of the target ArtboardPoint, with a value added to both the x and y members

◆ operator+=() [1/2]

virtual ArtboardPoint & hdi::core::ArtboardPoint::operator+= ( const ArtboardPoint rhs_)
virtual

Allows two points to have their x and y values added and assigned using the += operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the += operator
Returns
The lefthand side of the += operator, with all x and y values summed together

◆ operator+=() [2/2]

virtual ArtboardPoint & hdi::core::ArtboardPoint::operator+= ( const double  rhs_)
virtual

Allows a value to be added and assigned to both this->x and this->y using the += operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the += operator
Returns
The lefthand side of the += operator, with a value added to both the x and y members

◆ operator-() [1/2]

virtual ArtboardPoint hdi::core::ArtboardPoint::operator- ( const ArtboardPoint rhs_) const
virtual

Allows two points to have their x and y values subtracted using the - operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the - operator
Returns
A copy of the target ArtboardPoint, with rhs_ x and y values subtracted from this x and y

◆ operator-() [2/2]

virtual ArtboardPoint hdi::core::ArtboardPoint::operator- ( const double  rhs_) const
virtual

Allows a value to be subtracted from both this->x and this->y using the - operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the - operator
Returns
A copy of the target ArtboardPoint, with a value subtracted from both the x and y members

◆ operator-=() [1/2]

virtual ArtboardPoint & hdi::core::ArtboardPoint::operator-= ( const ArtboardPoint rhs_)
virtual

Allows two points to have their x and y values subtracted and assigned using the -= operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the -= operator
Returns
The lefthand side of the -= operator, with rhs_ x and y values subtracted from this x and y

◆ operator-=() [2/2]

virtual ArtboardPoint & hdi::core::ArtboardPoint::operator-= ( const double  rhs_)
virtual

Allows a value to be subtracted from, and assigned to, both this->x and this->y using the -= operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the -= operator
Returns
The lefthand side of the -= operator, with a value subtracted from both the x and y members

◆ operator/() [1/2]

virtual ArtboardPoint hdi::core::ArtboardPoint::operator/ ( const ArtboardPoint rhs_) const
virtual

Allows two points to have their x and y values divided using the / operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the / operator
Returns
A copy of the target ArtboardPoint, with this x and y values divided by rhs_ x and y

◆ operator/() [2/2]

virtual ArtboardPoint hdi::core::ArtboardPoint::operator/ ( const double  rhs_) const
virtual

Allows both this->x and this->y to be divided by a value using the / operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the / operator
Returns
A copy of the target ArtboardPoint, with both the x and y members divided by a value

◆ operator/=() [1/2]

virtual ArtboardPoint & hdi::core::ArtboardPoint::operator/= ( const ArtboardPoint rhs_)
virtual

Allows two points to have their x and y values divided and assigned using the /= operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the /= operator
Returns
The lefthand side of the /= operator, with this x and y values divided by rhs_ x and y

◆ operator/=() [2/2]

virtual ArtboardPoint & hdi::core::ArtboardPoint::operator/= ( const double  rhs_)
virtual

Allows both this->x and this->y to be divided by a value, and assigned, using the /= operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the /= operator
Returns
The lefthand side of the /= operator, with both the x and y members divided by a value

◆ operator<()

virtual bool hdi::core::ArtboardPoint::operator< ( const ArtboardPoint rhs_) const
virtual

Allows two ArtboardPoint objects to be compared with the < operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the < operator
Returns
true if this->x and this->y are less than rhs_.x and rhs_.y, respectively

◆ operator<=()

virtual bool hdi::core::ArtboardPoint::operator<= ( const ArtboardPoint rhs_) const
virtual

Allows two ArtboardPoint objects to be compared with the <= operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the <= operator
Returns
true if this->x and this->y are less than/equal to rhs_.x and rhs_.y, respectively

◆ operator=()

virtual ArtboardPoint & hdi::core::ArtboardPoint::operator= ( const ArtboardPoint rhs_)
virtual

Allows one ArtboardPoint object to be assigned from another.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the = operator; the object to copy values from
Returns
The target ArtboardPoint object, but with its value updated to match that of rhs_

◆ operator==()

virtual bool hdi::core::ArtboardPoint::operator== ( const ArtboardPoint rhs_) const
virtual

Allows two ArtboardPoint objects to be compared with the == operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the == operator
Returns
true if this.x == rhs_.x and this.y == rhs_.y
Note
Due to the nature of floating point comparisons, it is better to use a method like closeTo() to determine if two ArtboardPoints are "equal"

◆ operator>()

virtual bool hdi::core::ArtboardPoint::operator> ( const ArtboardPoint rhs_) const
virtual

Allows two ArtboardPoint objects to be compared with the > operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the > operator
Returns
true if this->x and this->y are greater than rhs_.x and rhs_.y, respectively

◆ operator>=()

virtual bool hdi::core::ArtboardPoint::operator>= ( const ArtboardPoint rhs_) const
virtual

Allows two ArtboardPoint objects to be compared with the >= operator.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the >= operator
Returns
true if this->x and this->y are greater than/equal to rhs_.x and rhs_.y, respectively

◆ operator^()

virtual Angle hdi::core::ArtboardPoint::operator^ ( const ArtboardPoint rhs_) const
virtual

Gets the angle of the vector (this, rhs_), if this were moved to the origin.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the ^ operator (called the angle operator in this case)
Returns
The angle formed by vector (this, rhs_)

◆ operator|()

virtual double hdi::core::ArtboardPoint::operator| ( const ArtboardPoint rhs_) const
virtual

Gets the distance between this and rhs_.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the | operator (called the length operator in this case)
Returns
The distance between this and rhs_

◆ rotate()

virtual ArtboardPoint hdi::core::ArtboardPoint::rotate ( const ArtboardPoint origin_,
const Angle angle_ 
) const
virtual

Rotates the point about a given "origin" point by a certain angle.

Author
GW
Date
08/2013
Parameters
origin_New "origin" to rotate around
angle_Angle to rotate by
Returns
A copy of the target point, rotated as specified

◆ transform()

virtual ArtboardPoint hdi::core::ArtboardPoint::transform ( const TransformMatrix m_) const
virtual

Transforms a point via a 2-dimensional transformation matrix.

Author
GW
Date
08/2013
Parameters
m_Transformation matrix to apply to the point
Returns
A copy of the target point, transformed as specified by the matrix