Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicorePoint.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_POINT__
8 #define __HDI_CORE_POINT__
9 
10 #include <memory>
11 #include <vector>
12 
13 namespace hdi
14 {
15  namespace plugin
16  {
17  class Point;
18  }
19 
20  namespace core
21  {
26  class Point
27  {
28  public:
29  typedef std::vector<Point> PointVector;
30 
34  double x;
35 
39  double y;
40 
46  Point();
47 
56  Point(const double x_, const double y_);
57 
65  Point(const Point& pt_);
66 
72  virtual ~Point();
73 
82  virtual Point& operator=(const Point& rhs_);
83 
92  virtual bool operator==(const Point& rhs_) const;
93 
102  virtual bool operator!=(const Point& rhs_) const;
103 
112  virtual Point operator+(const Point& rhs_) const;
113 
122  virtual Point& operator+=(const Point& rhs_);
123 
132  virtual Point operator-(const Point& rhs_) const;
133 
142  virtual Point& operator-=(const Point& rhs_);
143 
156  virtual Point offset(const double tx_, const double ty_) const;
157 
166  virtual bool insidePolygon(const PointVector& points_) const;
167 
168 
169  private:
170  friend plugin::Point* __accessImpl(const Point&);
171  friend Point __accessCtor(const plugin::Point&);
172 
176  plugin::Point* __impl;
177 
183  Point(const plugin::Point&);
184  };
185 
186  typedef std::auto_ptr<Point> PointAP;
187 
188  extern plugin::Point* __accessImpl(const Point&);
189  extern Point __accessCtor(const plugin::Point&);
190  }
191 }
192 
193 #endif
194 // __HDI_CORE_POINT__
virtual bool insidePolygon(const PointVector &points_) const
Checks if the point is within the provided polygon.
virtual bool operator!=(const Point &rhs_) const
Tests whether a given Point object is not the same as another.
Describes a point in the 2-dimensional (x,y) coordinate system, typically in an Illustrator document ...
Definition: hdicorePoint.h:26
double y
Position on the y-axis.
Definition: hdicorePoint.h:39
virtual Point & operator-=(const Point &rhs_)
Allows two points to have their x and y values subtracted and assigned using the -= operator...
virtual Point & operator=(const Point &rhs_)
Sets a Point object from another Point object.
virtual Point operator-(const Point &rhs_) const
Allows two points to have their x and y values subtracted using the - operator.
virtual Point & operator+=(const Point &rhs_)
Allows two points to have their x and y values added and assigned using the += operator.
Definition: hdicoreaiArray.h:12
virtual Point offset(const double tx_, const double ty_) const
Offsets a point along the x- and y-axes by given amounts.
virtual ~Point()
Point destructor.
virtual bool operator==(const Point &rhs_) const
Tests whether a given Point object is the same as another.
double x
Position on the x-axis.
Definition: hdicorePoint.h:34
Point()
Default Point constructor; sets x and y to 0.0.
virtual Point operator+(const Point &rhs_) const
Allows two points to have their x and y values added using the + operator.