Hot Door CORE  0.7.1
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__
Header file for describing angles.
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
Header file for geometric rectangle manipulation on the Illustrator artboard.
AdjustmentResult
Indicates what happened when a bezier was adjusted to pass through a point.
Definition: hdicoreBezier.h:33
Definition: hdicoreaiArray.h:12
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