File: class_ipe_bezier.html

package info (click to toggle)
ipe 6.0pre30-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 5,100 kB
  • ctags: 5,419
  • sloc: cpp: 30,430; ansic: 1,045; xml: 845; makefile: 78; sh: 5
file content (391 lines) | stat: -rw-r--r-- 16,920 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Ipelib: IpeBezier Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.1 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li id="current"><a href="annotated.html"><span>Classes</span></a></li>
  </ul></div>
<div class="tabs">
  <ul>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul></div>
<h1>IpeBezier Class Reference<br>
<small>
[<a class="el" href="group__geo.html">Ipe Geometry</a>]</small>
</h1><!-- doxytag: class="IpeBezier" -->A cubic Bezier spline.  
<a href="#_details">More...</a>
<p>
<a href="class_ipe_bezier-members.html">List of all members.</a><h2>Public Member Functions</h2>
<ul>
<li><a class="el" href="class_ipe_bezier.html#81bb69b5de624e838412557b90b33b94">IpeBezier</a> ()
<li><a class="el" href="class_ipe_bezier.html#6e84332f2589d4cec6f2490222f49483">IpeBezier</a> (const <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;p0, const <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;p1, const <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;p2, const <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;p3)
<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
<li>double <a class="el" href="class_ipe_bezier.html#a9029b31431b42b08d89cc85a61b5f6d">Distance</a> (const <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;v, double bound)
<li>bool <a class="el" href="class_ipe_bezier.html#ed5ba315cd9ae63896fa0cfe24c0b37f">Straight</a> (double precision) const
<li>void <a class="el" href="class_ipe_bezier.html#b9780a68638b2bbfba08962a3cfde0ce">Subdivide</a> (<a class="el" href="class_ipe_bezier.html">IpeBezier</a> &amp;l, <a class="el" href="class_ipe_bezier.html">IpeBezier</a> &amp;r) const
<li>void <a class="el" href="class_ipe_bezier.html#288cfd024c9ccce6ad9d23e84328ff2c">Approximate</a> (double precision, std::vector&lt; <a class="el" href="class_ipe_vector.html">IpeVector</a> &gt; &amp;result) const
<li><a class="el" href="class_ipe_rect.html">IpeRect</a> <a class="el" href="class_ipe_bezier.html#74b8c3bef01be934d9e6e3c7b674517d">BBox</a> () const
<li><a class="anchor" name="e18263e6b0627f88e3734bec171f16d2"></a><!-- doxytag: member="IpeBezier::Intersects" ref="e18263e6b0627f88e3734bec171f16d2" args="(const IpeLine &amp;l, IpeVector &amp;pt) const" -->
bool <b>Intersects</b> (const <a class="el" href="class_ipe_line.html">IpeLine</a> &amp;l, <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;pt) const
<li><a class="anchor" name="fb7cb5e14d3e0f2d03f7baf66d29d45f"></a><!-- doxytag: member="IpeBezier::Intersects" ref="fb7cb5e14d3e0f2d03f7baf66d29d45f" args="(const IpeSegment &amp;l, IpeVector &amp;pt) const" -->
bool <b>Intersects</b> (const <a class="el" href="class_ipe_segment.html">IpeSegment</a> &amp;l, <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;pt) const
</ul>
<h2>Static Public Member Functions</h2>
<ul>
<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> &amp;p0, const <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;p1, const <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;p2)
<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&lt; <a class="el" href="class_ipe_bezier.html">IpeBezier</a> &gt; &amp;result)
<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&lt; <a class="el" href="class_ipe_bezier.html">IpeBezier</a> &gt; &amp;result)
</ul>
<h2>Public Attributes</h2>
<ul>
<li><a class="anchor" name="b78e85fdc7bf8e09bcd1f64ce39e6761"></a><!-- doxytag: member="IpeBezier::iV" ref="b78e85fdc7bf8e09bcd1f64ce39e6761" args="[4]" -->
<a class="el" href="class_ipe_vector.html">IpeVector</a> <b>iV</b> [4]
</ul>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A cubic Bezier spline. 
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="81bb69b5de624e838412557b90b33b94"></a><!-- doxytag: member="IpeBezier::IpeBezier" ref="81bb69b5de624e838412557b90b33b94" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">IpeBezier::IpeBezier           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Default constructor, uninitialized curve. 
<p>

</div>
</div><p>
<a class="anchor" name="6e84332f2589d4cec6f2490222f49483"></a><!-- doxytag: member="IpeBezier::IpeBezier" ref="6e84332f2589d4cec6f2490222f49483" args="(const IpeVector &amp;p0, const IpeVector &amp;p1, const IpeVector &amp;p2, const IpeVector &amp;p3)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">IpeBezier::IpeBezier           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>p0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>p1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>p2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>p3</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Constructor with four control points. 
<p>

</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="bc785d910c2fc78fd2109e8d48e43559"></a><!-- doxytag: member="IpeBezier::Point" ref="bc785d910c2fc78fd2109e8d48e43559" args="(double t) const" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_ipe_vector.html">IpeVector</a> IpeBezier::Point           </td>
          <td>(</td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>t</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return point on curve with parameter <em>t</em> (from 0.0 to 1.0). 
<p>

</div>
</div><p>
<a class="anchor" name="a9029b31431b42b08d89cc85a61b5f6d"></a><!-- doxytag: member="IpeBezier::Distance" ref="a9029b31431b42b08d89cc85a61b5f6d" args="(const IpeVector &amp;v, double bound)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double IpeBezier::Distance           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>v</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>bound</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return distance to Bezier spline. 
<p>
But may just return <em>bound</em> if actual distance is larger. 
</div>
</div><p>
<a class="anchor" name="ed5ba315cd9ae63896fa0cfe24c0b37f"></a><!-- doxytag: member="IpeBezier::Straight" ref="ed5ba315cd9ae63896fa0cfe24c0b37f" args="(double precision) const" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool IpeBezier::Straight           </td>
          <td>(</td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>precision</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Returns true if the Bezier curve is nearly identical to the line segment iV[0]..iV[3]. 
</div>
</div><p>
<a class="anchor" name="b9780a68638b2bbfba08962a3cfde0ce"></a><!-- doxytag: member="IpeBezier::Subdivide" ref="b9780a68638b2bbfba08962a3cfde0ce" args="(IpeBezier &amp;l, IpeBezier &amp;r) const" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void IpeBezier::Subdivide           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_ipe_bezier.html">IpeBezier</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>l</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_ipe_bezier.html">IpeBezier</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>r</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Subdivide this Bezier curve in the middle. 
<p>

</div>
</div><p>
<a class="anchor" name="288cfd024c9ccce6ad9d23e84328ff2c"></a><!-- doxytag: member="IpeBezier::Approximate" ref="288cfd024c9ccce6ad9d23e84328ff2c" args="(double precision, std::vector&lt; IpeVector &gt; &amp;result) const" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void IpeBezier::Approximate           </td>
          <td>(</td>
          <td class="paramtype">double&nbsp;</td>
          <td class="paramname"> <em>precision</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; <a class="el" href="class_ipe_vector.html">IpeVector</a> &gt; &amp;&nbsp;</td>
          <td class="paramname"> <em>result</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Approximate by a polygonal chain. 
<p>
<em>result</em> must be empty when calling this. 
</div>
</div><p>
<a class="anchor" name="74b8c3bef01be934d9e6e3c7b674517d"></a><!-- doxytag: member="IpeBezier::BBox" ref="74b8c3bef01be934d9e6e3c7b674517d" args="() const" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_ipe_rect.html">IpeRect</a> IpeBezier::BBox           </td>
          <td>(</td>
          <td class="paramname">          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"> const</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Return a tight bounding box (accurate to within 0.5). 
<p>

</div>
</div><p>
<a class="anchor" name="ff8a12de16305569bec160e165d969df"></a><!-- doxytag: member="IpeBezier::QuadBezier" ref="ff8a12de16305569bec160e165d969df" args="(const IpeVector &amp;p0, const IpeVector &amp;p1, const IpeVector &amp;p2)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_ipe_bezier.html">IpeBezier</a> IpeBezier::QuadBezier           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>p0</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>p1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>p2</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Convert a quadratic Bezier-spline to a cubic one. 
<p>
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. 
</div>
</div><p>
<a class="anchor" name="c58af3d3b1adeece51ca228687570d7e"></a><!-- doxytag: member="IpeBezier::Spline" ref="c58af3d3b1adeece51ca228687570d7e" args="(int n, const IpeVector *v, std::vector&lt; IpeBezier &gt; &amp;result)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void IpeBezier::Spline           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> *&nbsp;</td>
          <td class="paramname"> <em>v</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; <a class="el" href="class_ipe_bezier.html">IpeBezier</a> &gt; &amp;&nbsp;</td>
          <td class="paramname"> <em>result</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Convert a uniform cubic B-spline to a series of Bezier splines. 
<p>
First and last control point are given multiplicity 3. Bezier splines are appended to <em>result</em>. 
</div>
</div><p>
<a class="anchor" name="1f5bf9d341dc7818c02e79dab85c1754"></a><!-- doxytag: member="IpeBezier::ClosedSpline" ref="1f5bf9d341dc7818c02e79dab85c1754" args="(int n, const IpeVector *v, std::vector&lt; IpeBezier &gt; &amp;result)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void IpeBezier::ClosedSpline           </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> *&nbsp;</td>
          <td class="paramname"> <em>v</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; <a class="el" href="class_ipe_bezier.html">IpeBezier</a> &gt; &amp;&nbsp;</td>
          <td class="paramname"> <em>result</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Convert a closed uniform cubic B-spline to a series of Bezier splines. 
<p>
Bezier splines are appended to <em>result</em>. 
</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li>ipegeo.h<li>ipegeo.cpp</ul>
<hr>
</body></html>