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::Point Class Reference

Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document view or a UI window. More...

#include <hdicorePoint.h>

Public Types

typedef std::vector< PointPointVector
 

Public Member Functions

 Point ()
 Default Point constructor; sets x and y to 0.0.
 
 Point (const double x_, const double y_)
 Point constructor, taking x and y arguments.
 
 Point (const Point &pt_)
 Point copy constructor.
 
virtual ~Point ()
 Point destructor.
 
virtual Pointoperator= (const Point &rhs_)
 Sets a Point object from another Point object.
 
virtual bool operator== (const Point &rhs_) const
 Tests whether a given Point object is the same as another.
 
virtual bool operator!= (const Point &rhs_) const
 Tests whether a given Point object is not the same as another.
 
virtual Point operator+ (const Point &rhs_) const
 Allows two points to have their x and y values added using the + operator.
 
virtual Pointoperator+= (const Point &rhs_)
 Allows two points to have their x and y values added and assigned using the += operator.
 
virtual Point operator- (const Point &rhs_) const
 Allows two points to have their x and y values subtracted using the - operator.
 
virtual Pointoperator-= (const Point &rhs_)
 Allows two points to have their x and y values subtracted and assigned using the -= operator.
 
virtual Angle operator^ (const Point &rhs_) const
 Gets the angle of the vector (this, rhs_), if this were moved to the origin.
 
virtual double operator| (const Point &rhs_) const
 Gets the distance between this and rhs_.
 
virtual bool closeTo (const Point &compare_, const double tol_) const
 Gets whether a given point is within a certain tolerance ("close to") the target point.
 
virtual double dotProduct (const Point &p2_) const
 Gets the dot product of two Point objects.
 
virtual Point offset (const double tx_, const double ty_) const
 Offsets a point along the x- and y-axes by given amounts.
 
virtual Point rotate (const Point &origin_, const Angle &angle_) const
 Rotates the point about a given "origin" point by a certain angle.
 
virtual Point move (const double length_, const Angle &angle_) const
 "Moves" a point by a given length and angle away from its current position
 
virtual Point transform (const TransformMatrix &m_) const
 Transforms a point via a 2-dimensional transformation matrix.
 
virtual bool insidePolygon (const PointVector &points_) const
 Checks if the point is within the provided polygon.
 

Static Public Member Functions

static Point 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::Point * __accessImpl (const Point &)
 
Point __accessCtor (const aip::Point &)
 

Detailed Description

Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document view or a UI window.

Constructor & Destructor Documentation

◆ Point() [1/3]

hdi::core::Point::Point ( )

Default Point constructor; sets x and y to 0.0.

Author
GW
Date
08/2013

◆ Point() [2/3]

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

Point constructor, taking x and y arguments.

Author
GW
Date
08/2013
Parameters
x_Position on the x-axis
y_Position on the y-axis

◆ Point() [3/3]

hdi::core::Point::Point ( const Point pt_)

Point copy constructor.

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

◆ ~Point()

virtual hdi::core::Point::~Point ( )
virtual

Point destructor.

Author
GW
Date
08/2013

Member Function Documentation

◆ closeTo()

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

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

Author
GW
Date
01/2018
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::Point::dotProduct ( const Point p2_) const
virtual

Gets the dot product of two Point objects.

Author
GW
Date
06/2018
Parameters
p2_Second Point 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::Point::insidePolygon ( const PointVector &  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 Point hdi::core::Point::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
A Point at the given distance and angle from the origin (0,0)

◆ move()

virtual Point hdi::core::Point::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
01/2018
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 Point hdi::core::Point::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::Point::operator!= ( const Point rhs_) const
virtual

Tests whether a given Point object is not the same as another.

Author
GW
Date
08/2013
Parameters
rhs_Point to compare against (righthand side of inequality operator)
Returns
true for the target and rhs_ being different points, false otherwise

◆ operator+()

virtual Point hdi::core::Point::operator+ ( const Point 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 Point, with all x and y values summed together

◆ operator+=()

virtual Point & hdi::core::Point::operator+= ( const Point 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-()

virtual Point hdi::core::Point::operator- ( const Point 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 Point, with rhs_ x and y values subtracted from this x and y

◆ operator-=()

virtual Point & hdi::core::Point::operator-= ( const Point 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=()

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

Sets a Point object from another Point object.

Author
GW
Date
08/2013
Parameters
rhs_Righthand side of the = operator; Point object to pull values from
Returns
The target Point object, but with its value updated

◆ operator==()

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

Tests whether a given Point object is the same as another.

Author
GW
Date
08/2013
Parameters
rhs_Point to compare against (righthand side of equality operator)
Returns
true for the target and rhs_ being the same point, false otherwise

◆ operator^()

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

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

Author
GW
Date
01/2018
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::Point::operator| ( const Point rhs_) const
virtual

Gets the distance between this and rhs_.

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

◆ rotate()

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

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

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

◆ transform()

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

Transforms a point via a 2-dimensional transformation matrix.

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