Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreBezier.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_BEZIER__
8 #define __HDI_CORE_BEZIER__
9 
10 #include "hdicoreAngle.h"
11 #include "hdicoreArtboardRect.h"
12 
13 namespace hdi
14 {
15  namespace plugin
16  {
17  class Bezier;
18  }
19 
20  namespace core
21  {
22  class ArtboardSegPoint;
23 
27  class Bezier
28  {
29  public:
34  {
35  AdjustmentReflectedStartOut = 1 << 0,
36  AdjustmentReflectedEndIn = 1 << 1,
37  AdjustmentRotatedStartOut = 1 << 2,
38  AdjustmentRotatedEndIn = 1 << 3
39  };
40 
46  Bezier();
47 
55  Bezier(const Bezier& bez_);
56 
68  Bezier(const ArtboardSegPoint& segPt1_, const ArtboardSegPoint& segPt2_);
69 
80  Bezier(
81  const ArtboardPoint& start_,
82  const ArtboardPoint& startOut_,
83  const ArtboardPoint& endIn_,
84  const ArtboardPoint& end_
85  );
86 
92  virtual ~Bezier();
93 
102  virtual Bezier& operator=(const Bezier& rhs_);
103 
111  virtual ArtboardPoint startPoint() const;
112 
120  virtual ArtboardPoint startOutPoint() const;
121 
129  virtual ArtboardPoint endInPoint() const;
130 
138  virtual ArtboardPoint endPoint() const;
139 
149  virtual AdjustmentResult adjustThruPoint(const ArtboardPoint& pt_, const double t_);
150 
160  virtual void divide(const double t_, Bezier& bez1__, Bezier& bez2__) const;
161 
171  virtual Bezier section(const double startT_, const double endT_) const;
172 
181  virtual ArtboardPoint evaluate(const double t_) const;
182 
190  virtual double length() const;
191 
201  virtual double sublength(const double startT_, const double endT_) const;
202 
212  virtual double tAtLength(const double length_) const;
213 
224  virtual void setPoints(
225  const ArtboardPoint& start_,
226  const ArtboardPoint& startOut_,
227  const ArtboardPoint& endIn_,
228  const ArtboardPoint& end_
229  );
230 
240  virtual Angle tangentAngle(const double t_) const;
241 
251  virtual Angle normalAngle(const double t_) const;
252 
260  virtual bool curved() const;
261 
271  virtual bool radius(const double t_, double& radius__) const;
272 
282  virtual bool center(const double t_, ArtboardPoint& center__) const;
283 
297  virtual bool radiusAndCenter(const double t_, double& radius__, ArtboardPoint& center__) const;
298 
306  virtual bool isCircularArc() const;
307 
315  virtual ArtboardRect bounds() const;
316 
326  virtual bool operator==(const Bezier& rhs_) const;
327 
337  virtual bool operator!=(const Bezier& rhs_) const;
338 
339 
340  private:
341  friend plugin::Bezier* __accessImpl(const Bezier&);
342  friend Bezier __accessCtor(const plugin::Bezier&);
343 
347  plugin::Bezier* __impl;
348 
354  Bezier(const plugin::Bezier&);
355  };
356 
357  typedef std::auto_ptr<Bezier> BezierAP;
358 
359  extern plugin::Bezier* __accessImpl(const Bezier&);
360  extern Bezier __accessCtor(const plugin::Bezier&);
361  }
362 }
363 
367 );
368 
372 );
373 
374 #endif
375 // __HDI_CORE_BEZIER__
Bezier()
Constructs a new Bezier object with all points at (0,0)
Header file for describing angles.
virtual bool isCircularArc() const
Gets whether the bezier describes an arc segment of a circle.
virtual ArtboardPoint evaluate(const double t_) const
Evaluates a given t-value along the target bezier as a point on the artboard.
virtual void setPoints(const ArtboardPoint &start_, const ArtboardPoint &startOut_, const ArtboardPoint &endIn_, const ArtboardPoint &end_)
Sets the anchor and control points of the bezier.
virtual void divide(const double t_, Bezier &bez1__, Bezier &bez2__) const
Splits the target bezier into two separate beziers at a given t-value.
virtual bool center(const double t_, ArtboardPoint &center__) const
Gets the center point of the curve at some t-value along the bezier.
virtual ArtboardPoint endPoint() const
Gets the second anchor point of the bezier.
virtual Angle normalAngle(const double t_) const
Gets the normal angle at some t-value along the bezier.
Describes a rectangular area on the Illustrator artboard.
Definition: hdicoreArtboardRect.h:25
Allows for cubic bezier calculations and manipulation (e.g. division, tangents, normals, etc.)
Definition: hdicoreBezier.h:27
virtual bool radius(const double t_, double &radius__) const
Gets the radius of the curve at some t-value along the bezier.
virtual ArtboardPoint startPoint() const
Gets the first anchor point of the bezier.
virtual AdjustmentResult adjustThruPoint(const ArtboardPoint &pt_, const double t_)
Adjusts the bezier such that the given t-value will pass through the provided point.
Header file for geometric rectangle manipulation on the Illustrator artboard.
virtual double length() const
Gets the length of the bezier.
AdjustmentResult
Indicates what happened when a bezier was adjusted to pass through a point.
Definition: hdicoreBezier.h:33
virtual Angle tangentAngle(const double t_) const
Gets the tangent angle at some t-value along the bezier.
virtual bool curved() const
Determines whether the bezier has a curved path.
virtual double sublength(const double startT_, const double endT_) const
Gives approximate length of a bezier from t-value startT_ to t-value endT_.
virtual ArtboardRect bounds() const
Gets the bounds rect for the target bezier.
virtual ~Bezier()
Destructs a Bezier object.
virtual ArtboardPoint startOutPoint() const
Gets the first control point of the bezier.
virtual bool operator!=(const Bezier &rhs_) const
Tests whether a given Bezier object is not the same as another.
Definition: hdicoreaiArray.h:12
virtual bool operator==(const Bezier &rhs_) const
Tests whether a given Bezier object is the same as another.
virtual Bezier section(const double startT_, const double endT_) const
Gets a section of the target bezier, from a starting t-value to an ending t-value.
virtual bool radiusAndCenter(const double t_, double &radius__, ArtboardPoint &center__) const
Gets both the radius and center point of the curve at some t-value along the bezier.
virtual double tAtLength(const double length_) const
Gives the t-value at a specific length along the target bezier.
virtual Bezier & operator=(const Bezier &rhs_)
Allows one Bezier object to be assigned from another.
Describes a segment point of a bezier path on the Illustrator artboard.
Definition: hdicoreArtboardSegPoint.h:24
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
virtual ArtboardPoint endInPoint() const
Gets the second control point of the bezier.