1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3
<title>Ipelib: IpeBezier Class Reference</title>
4
<link href="doxygen.css" rel="stylesheet" type="text/css">
5
<link href="tabs.css" rel="stylesheet" type="text/css">
7
<!-- Generated by Doxygen 1.5.1 -->
10
<li><a href="index.html"><span>Main Page</span></a></li>
11
<li><a href="modules.html"><span>Modules</span></a></li>
12
<li id="current"><a href="annotated.html"><span>Classes</span></a></li>
16
<li><a href="annotated.html"><span>Class List</span></a></li>
17
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
18
<li><a href="functions.html"><span>Class Members</span></a></li>
20
<h1>IpeBezier Class Reference<br>
22
[<a class="el" href="group__geo.html">Ipe Geometry</a>]</small>
23
</h1><!-- doxytag: class="IpeBezier" -->A cubic Bezier spline.
24
<a href="#_details">More...</a>
26
<a href="class_ipe_bezier-members.html">List of all members.</a><h2>Public Member Functions</h2>
28
<li><a class="el" href="class_ipe_bezier.html#81bb69b5de624e838412557b90b33b94">IpeBezier</a> ()
29
<li><a class="el" href="class_ipe_bezier.html#6e84332f2589d4cec6f2490222f49483">IpeBezier</a> (const <a class="el" href="class_ipe_vector.html">IpeVector</a> &p0, const <a class="el" href="class_ipe_vector.html">IpeVector</a> &p1, const <a class="el" href="class_ipe_vector.html">IpeVector</a> &p2, const <a class="el" href="class_ipe_vector.html">IpeVector</a> &p3)
30
<li><a class="el" href="class_ipe_vector.html">IpeVector</a> <a class="el" href="class_ipe_bezier.html#bc785d910c2fc78fd2109e8d48e43559">Point</a> (double t) const
31
<li>double <a class="el" href="class_ipe_bezier.html#a9029b31431b42b08d89cc85a61b5f6d">Distance</a> (const <a class="el" href="class_ipe_vector.html">IpeVector</a> &v, double bound)
32
<li>bool <a class="el" href="class_ipe_bezier.html#ed5ba315cd9ae63896fa0cfe24c0b37f">Straight</a> (double precision) const
33
<li>void <a class="el" href="class_ipe_bezier.html#b9780a68638b2bbfba08962a3cfde0ce">Subdivide</a> (<a class="el" href="class_ipe_bezier.html">IpeBezier</a> &l, <a class="el" href="class_ipe_bezier.html">IpeBezier</a> &r) const
34
<li>void <a class="el" href="class_ipe_bezier.html#288cfd024c9ccce6ad9d23e84328ff2c">Approximate</a> (double precision, std::vector< <a class="el" href="class_ipe_vector.html">IpeVector</a> > &result) const
35
<li><a class="el" href="class_ipe_rect.html">IpeRect</a> <a class="el" href="class_ipe_bezier.html#74b8c3bef01be934d9e6e3c7b674517d">BBox</a> () const
36
<li><a class="anchor" name="e18263e6b0627f88e3734bec171f16d2"></a><!-- doxytag: member="IpeBezier::Intersects" ref="e18263e6b0627f88e3734bec171f16d2" args="(const IpeLine &l, IpeVector &pt) const" -->
37
bool <b>Intersects</b> (const <a class="el" href="class_ipe_line.html">IpeLine</a> &l, <a class="el" href="class_ipe_vector.html">IpeVector</a> &pt) const
38
<li><a class="anchor" name="fb7cb5e14d3e0f2d03f7baf66d29d45f"></a><!-- doxytag: member="IpeBezier::Intersects" ref="fb7cb5e14d3e0f2d03f7baf66d29d45f" args="(const IpeSegment &l, IpeVector &pt) const" -->
39
bool <b>Intersects</b> (const <a class="el" href="class_ipe_segment.html">IpeSegment</a> &l, <a class="el" href="class_ipe_vector.html">IpeVector</a> &pt) const
41
<h2>Static Public Member Functions</h2>
43
<li>static <a class="el" href="class_ipe_bezier.html">IpeBezier</a> <a class="el" href="class_ipe_bezier.html#ff8a12de16305569bec160e165d969df">QuadBezier</a> (const <a class="el" href="class_ipe_vector.html">IpeVector</a> &p0, const <a class="el" href="class_ipe_vector.html">IpeVector</a> &p1, const <a class="el" href="class_ipe_vector.html">IpeVector</a> &p2)
44
<li>static void <a class="el" href="class_ipe_bezier.html#c58af3d3b1adeece51ca228687570d7e">Spline</a> (int n, const <a class="el" href="class_ipe_vector.html">IpeVector</a> *v, std::vector< <a class="el" href="class_ipe_bezier.html">IpeBezier</a> > &result)
45
<li>static void <a class="el" href="class_ipe_bezier.html#1f5bf9d341dc7818c02e79dab85c1754">ClosedSpline</a> (int n, const <a class="el" href="class_ipe_vector.html">IpeVector</a> *v, std::vector< <a class="el" href="class_ipe_bezier.html">IpeBezier</a> > &result)
47
<h2>Public Attributes</h2>
49
<li><a class="anchor" name="b78e85fdc7bf8e09bcd1f64ce39e6761"></a><!-- doxytag: member="IpeBezier::iV" ref="b78e85fdc7bf8e09bcd1f64ce39e6761" args="[4]" -->
50
<a class="el" href="class_ipe_vector.html">IpeVector</a> <b>iV</b> [4]
52
<hr><a name="_details"></a><h2>Detailed Description</h2>
53
A cubic Bezier spline.
55
<hr><h2>Constructor & Destructor Documentation</h2>
56
<a class="anchor" name="81bb69b5de624e838412557b90b33b94"></a><!-- doxytag: member="IpeBezier::IpeBezier" ref="81bb69b5de624e838412557b90b33b94" args="()" -->
58
<div class="memproto">
59
<table class="memname">
61
<td class="memname">IpeBezier::IpeBezier </td>
63
<td class="paramname"> </td>
64
<td> ) </td>
65
<td width="100%"><code> [inline]</code></td>
72
Default constructor, uninitialized curve.
77
<a class="anchor" name="6e84332f2589d4cec6f2490222f49483"></a><!-- doxytag: member="IpeBezier::IpeBezier" ref="6e84332f2589d4cec6f2490222f49483" args="(const IpeVector &p0, const IpeVector &p1, const IpeVector &p2, const IpeVector &p3)" -->
79
<div class="memproto">
80
<table class="memname">
82
<td class="memname">IpeBezier::IpeBezier </td>
84
<td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> & </td>
85
<td class="paramname"> <em>p0</em>, </td>
88
<td class="paramkey"></td>
90
<td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> & </td>
91
<td class="paramname"> <em>p1</em>, </td>
94
<td class="paramkey"></td>
96
<td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> & </td>
97
<td class="paramname"> <em>p2</em>, </td>
100
<td class="paramkey"></td>
102
<td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> & </td>
103
<td class="paramname"> <em>p3</em></td><td> </td>
108
<td></td><td></td><td width="100%"><code> [inline]</code></td>
115
Constructor with four control points.
120
<hr><h2>Member Function Documentation</h2>
121
<a class="anchor" name="bc785d910c2fc78fd2109e8d48e43559"></a><!-- doxytag: member="IpeBezier::Point" ref="bc785d910c2fc78fd2109e8d48e43559" args="(double t) const" -->
122
<div class="memitem">
123
<div class="memproto">
124
<table class="memname">
126
<td class="memname"><a class="el" href="class_ipe_vector.html">IpeVector</a> IpeBezier::Point </td>
128
<td class="paramtype">double </td>
129
<td class="paramname"> <em>t</em> </td>
130
<td> ) </td>
131
<td width="100%"> const</td>
138
Return point on curve with parameter <em>t</em> (from 0.0 to 1.0).
143
<a class="anchor" name="a9029b31431b42b08d89cc85a61b5f6d"></a><!-- doxytag: member="IpeBezier::Distance" ref="a9029b31431b42b08d89cc85a61b5f6d" args="(const IpeVector &v, double bound)" -->
144
<div class="memitem">
145
<div class="memproto">
146
<table class="memname">
148
<td class="memname">double IpeBezier::Distance </td>
150
<td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> & </td>
151
<td class="paramname"> <em>v</em>, </td>
154
<td class="paramkey"></td>
156
<td class="paramtype">double </td>
157
<td class="paramname"> <em>bound</em></td><td> </td>
162
<td></td><td></td><td width="100%"></td>
169
Return distance to Bezier spline.
171
But may just return <em>bound</em> if actual distance is larger.
174
<a class="anchor" name="ed5ba315cd9ae63896fa0cfe24c0b37f"></a><!-- doxytag: member="IpeBezier::Straight" ref="ed5ba315cd9ae63896fa0cfe24c0b37f" args="(double precision) const" -->
175
<div class="memitem">
176
<div class="memproto">
177
<table class="memname">
179
<td class="memname">bool IpeBezier::Straight </td>
181
<td class="paramtype">double </td>
182
<td class="paramname"> <em>precision</em> </td>
183
<td> ) </td>
184
<td width="100%"> const</td>
191
Returns true if the Bezier curve is nearly identical to the line segment iV[0]..iV[3].
194
<a class="anchor" name="b9780a68638b2bbfba08962a3cfde0ce"></a><!-- doxytag: member="IpeBezier::Subdivide" ref="b9780a68638b2bbfba08962a3cfde0ce" args="(IpeBezier &l, IpeBezier &r) const" -->
195
<div class="memitem">
196
<div class="memproto">
197
<table class="memname">
199
<td class="memname">void IpeBezier::Subdivide </td>
201
<td class="paramtype"><a class="el" href="class_ipe_bezier.html">IpeBezier</a> & </td>
202
<td class="paramname"> <em>l</em>, </td>
205
<td class="paramkey"></td>
207
<td class="paramtype"><a class="el" href="class_ipe_bezier.html">IpeBezier</a> & </td>
208
<td class="paramname"> <em>r</em></td><td> </td>
213
<td></td><td></td><td width="100%"> const</td>
220
Subdivide this Bezier curve in the middle.
225
<a class="anchor" name="288cfd024c9ccce6ad9d23e84328ff2c"></a><!-- doxytag: member="IpeBezier::Approximate" ref="288cfd024c9ccce6ad9d23e84328ff2c" args="(double precision, std::vector< IpeVector > &result) const" -->
226
<div class="memitem">
227
<div class="memproto">
228
<table class="memname">
230
<td class="memname">void IpeBezier::Approximate </td>
232
<td class="paramtype">double </td>
233
<td class="paramname"> <em>precision</em>, </td>
236
<td class="paramkey"></td>
238
<td class="paramtype">std::vector< <a class="el" href="class_ipe_vector.html">IpeVector</a> > & </td>
239
<td class="paramname"> <em>result</em></td><td> </td>
244
<td></td><td></td><td width="100%"> const</td>
251
Approximate by a polygonal chain.
253
<em>result</em> must be empty when calling this.
256
<a class="anchor" name="74b8c3bef01be934d9e6e3c7b674517d"></a><!-- doxytag: member="IpeBezier::BBox" ref="74b8c3bef01be934d9e6e3c7b674517d" args="() const" -->
257
<div class="memitem">
258
<div class="memproto">
259
<table class="memname">
261
<td class="memname"><a class="el" href="class_ipe_rect.html">IpeRect</a> IpeBezier::BBox </td>
263
<td class="paramname"> </td>
264
<td> ) </td>
265
<td width="100%"> const</td>
272
Return a tight bounding box (accurate to within 0.5).
277
<a class="anchor" name="ff8a12de16305569bec160e165d969df"></a><!-- doxytag: member="IpeBezier::QuadBezier" ref="ff8a12de16305569bec160e165d969df" args="(const IpeVector &p0, const IpeVector &p1, const IpeVector &p2)" -->
278
<div class="memitem">
279
<div class="memproto">
280
<table class="memname">
282
<td class="memname"><a class="el" href="class_ipe_bezier.html">IpeBezier</a> IpeBezier::QuadBezier </td>
284
<td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> & </td>
285
<td class="paramname"> <em>p0</em>, </td>
288
<td class="paramkey"></td>
290
<td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> & </td>
291
<td class="paramname"> <em>p1</em>, </td>
294
<td class="paramkey"></td>
296
<td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> & </td>
297
<td class="paramname"> <em>p2</em></td><td> </td>
302
<td></td><td></td><td width="100%"><code> [static]</code></td>
309
Convert a quadratic Bezier-spline to a cubic one.
311
The quadratic Bezier-spline with control points p0, p1, p2 is identical to the cubic Bezier-spline with control points q0 = p0, q1 = (2p1 + p0)/3, q2 = (2p1 + p2)/3, q3 = p2.
314
<a class="anchor" name="c58af3d3b1adeece51ca228687570d7e"></a><!-- doxytag: member="IpeBezier::Spline" ref="c58af3d3b1adeece51ca228687570d7e" args="(int n, const IpeVector *v, std::vector< IpeBezier > &result)" -->
315
<div class="memitem">
316
<div class="memproto">
317
<table class="memname">
319
<td class="memname">void IpeBezier::Spline </td>
321
<td class="paramtype">int </td>
322
<td class="paramname"> <em>n</em>, </td>
325
<td class="paramkey"></td>
327
<td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> * </td>
328
<td class="paramname"> <em>v</em>, </td>
331
<td class="paramkey"></td>
333
<td class="paramtype">std::vector< <a class="el" href="class_ipe_bezier.html">IpeBezier</a> > & </td>
334
<td class="paramname"> <em>result</em></td><td> </td>
339
<td></td><td></td><td width="100%"><code> [static]</code></td>
346
Convert a uniform cubic B-spline to a series of Bezier splines.
348
First and last control point are given multiplicity 3. Bezier splines are appended to <em>result</em>.
351
<a class="anchor" name="1f5bf9d341dc7818c02e79dab85c1754"></a><!-- doxytag: member="IpeBezier::ClosedSpline" ref="1f5bf9d341dc7818c02e79dab85c1754" args="(int n, const IpeVector *v, std::vector< IpeBezier > &result)" -->
352
<div class="memitem">
353
<div class="memproto">
354
<table class="memname">
356
<td class="memname">void IpeBezier::ClosedSpline </td>
358
<td class="paramtype">int </td>
359
<td class="paramname"> <em>n</em>, </td>
362
<td class="paramkey"></td>
364
<td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> * </td>
365
<td class="paramname"> <em>v</em>, </td>
368
<td class="paramkey"></td>
370
<td class="paramtype">std::vector< <a class="el" href="class_ipe_bezier.html">IpeBezier</a> > & </td>
371
<td class="paramname"> <em>result</em></td><td> </td>
376
<td></td><td></td><td width="100%"><code> [static]</code></td>
383
Convert a closed uniform cubic B-spline to a series of Bezier splines.
385
Bezier splines are appended to <em>result</em>.
388
<hr>The documentation for this class was generated from the following files:<ul>
389
<li>ipegeo.h<li>ipegeo.cpp</ul>