Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreBezier.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_BEZIER__
8#define __HDI_CORE_BEZIER__
9
10#if defined(HDI_CORE_AIP_MODE)
11
12#include "hdicoreAngle.h"
13#include "hdicoreArtboardRect.h"
14
15namespace hdi
16{
17 namespace aip
18 {
19 class Bezier;
20 }
21
22 namespace core
23 {
24 class ArtboardSegPoint;
25
29 class Bezier
30 {
31 public:
36 {
37 AdjustmentReflectedStartOut = 1 << 0,
38 AdjustmentReflectedEndIn = 1 << 1,
39 AdjustmentRotatedStartOut = 1 << 2,
40 AdjustmentRotatedEndIn = 1 << 3
41 };
42
49
57 Bezier(const Bezier& bez_);
58
70 Bezier(const ArtboardSegPoint& segPt1_, const ArtboardSegPoint& segPt2_);
71
83 const ArtboardPoint& start_,
84 const ArtboardPoint& startOut_,
85 const ArtboardPoint& endIn_,
86 const ArtboardPoint& end_
87 );
88
94 virtual ~Bezier();
95
104 virtual Bezier& operator=(const Bezier& rhs_);
105
113 virtual ArtboardPoint startPoint() const;
114
123
131 virtual ArtboardPoint endInPoint() const;
132
140 virtual ArtboardPoint endPoint() const;
141
151 virtual AdjustmentResult adjustThruPoint(const ArtboardPoint& pt_, const double t_);
152
162 virtual void divide(const double t_, Bezier& bez1__, Bezier& bez2__) const;
163
173 virtual Bezier section(const double startT_, const double endT_) const;
174
183 virtual ArtboardPoint evaluate(const double t_) const;
184
192 virtual double length() const;
193
203 virtual double sublength(const double startT_, const double endT_) const;
204
214 virtual double tAtLength(const double length_) const;
215
226 virtual void setPoints(
227 const ArtboardPoint& start_,
228 const ArtboardPoint& startOut_,
229 const ArtboardPoint& endIn_,
230 const ArtboardPoint& end_
231 );
232
242 virtual Angle tangentAngle(const double t_) const;
243
253 virtual Angle normalAngle(const double t_) const;
254
262 virtual bool curved() const;
263
273 virtual bool radius(const double t_, double& radius__) const;
274
284 virtual bool center(const double t_, ArtboardPoint& center__) const;
285
299 virtual bool radiusAndCenter(const double t_, double& radius__, ArtboardPoint& center__) const;
300
308 virtual bool isCircularArc() const;
309
318 virtual ArtboardRect bounds() const;
319
329 virtual bool operator==(const Bezier& rhs_) const;
330
340 virtual bool operator!=(const Bezier& rhs_) const;
341
342
343 private:
344 friend aip::Bezier* __accessImpl(const Bezier&);
345 friend Bezier __accessCtor(const aip::Bezier&);
346
350 aip::Bezier* __impl;
351
357 Bezier(const aip::Bezier&);
358 };
359
360 typedef std::unique_ptr<Bezier> BezierUP;
361 typedef std::shared_ptr<Bezier> BezierSP;
362 typedef std::weak_ptr<Bezier> BezierWP;
363
364 extern aip::Bezier* __accessImpl(const Bezier&);
365 extern Bezier __accessCtor(const aip::Bezier&);
366 }
367}
368
372);
373
377);
378
379#endif
380// HDI_CORE_AIP_MODE
381
382#endif
383// __HDI_CORE_BEZIER__
Describes an angle, and allows for easy conversion between various units.
Definition: hdicoreAngle.h:26
Describes a point on the Illustrator artboard.
Definition: hdicoreArtboardPoint.h:31
Describes a rectangular area on the Illustrator artboard.
Definition: hdicoreArtboardRect.h:28
Describes a segment point of a bezier path on the Illustrator artboard.
Definition: hdicoreArtboardSegPoint.h:27
Allows for cubic bezier calculations and manipulation (e.g. division, tangents, normals,...
Definition: hdicoreBezier.h:30
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.
AdjustmentResult
Indicates what happened when a bezier was adjusted to pass through a point.
Definition: hdicoreBezier.h:36
virtual ArtboardPoint endPoint() const
Gets the second anchor point of the bezier.
virtual ArtboardRect bounds() const
Gets the bounds rect for the target bezier; that is, the rect that completely encloses all the contro...
virtual ArtboardPoint endInPoint() const
Gets the second control point of the bezier.
virtual void setPoints(const ArtboardPoint &start_, const ArtboardPoint &startOut_, const ArtboardPoint &endIn_, const ArtboardPoint &end_)
Sets the anchor and control points of the bezier.
Bezier(const ArtboardSegPoint &segPt1_, const ArtboardSegPoint &segPt2_)
Constructs a new Bezier object from two segment endpoints.
virtual ArtboardPoint evaluate(const double t_) const
Evaluates a given t-value along the target bezier as a point on the artboard.
Bezier(const Bezier &bez_)
Constructs a new Bezier object from an existing Bezier object (copy constructor)
Bezier(const ArtboardPoint &start_, const ArtboardPoint &startOut_, const ArtboardPoint &endIn_, const ArtboardPoint &end_)
Constructs a new Bezier object from individual component points.
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 bool operator==(const Bezier &rhs_) const
Tests whether a given Bezier object is the same as another.
virtual Bezier & operator=(const Bezier &rhs_)
Allows one Bezier object to be assigned from another.
Bezier()
Constructs a new Bezier object with all points at (0,0)
virtual ArtboardPoint startPoint() const
Gets the first anchor point of the bezier.
virtual ~Bezier()
Destructs a Bezier object.
virtual ArtboardPoint startOutPoint() const
Gets the first control point of the bezier.
virtual bool center(const double t_, ArtboardPoint &center__) const
Gets the center point of the curve at some t-value along the bezier.
virtual bool isCircularArc() const
Gets whether the bezier describes an arc segment of a circle.
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 Angle normalAngle(const double t_) const
Gets the normal angle at some t-value along the bezier.
virtual bool radius(const double t_, double &radius__) const
Gets the radius of the curve at some t-value along the bezier.
virtual double length() const
Gets the length of the bezier.
virtual bool curved() const
Determines whether the bezier has a curved path.
virtual Angle tangentAngle(const double t_) const
Gets the tangent angle at some t-value along 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.
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 double tAtLength(const double length_) const
Gives the t-value at a specific length along the target bezier.
virtual bool operator!=(const Bezier &rhs_) const
Tests whether a given Bezier object is not the same as another.
Header file for describing angles.
Header file for geometric rectangle manipulation on the Illustrator artboard.