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: IpePathSegment 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>IpePathSegment Class Reference<br>
22
[<a class="el" href="group__obj.html">Ipe Objects</a>]</small>
23
</h1><!-- doxytag: class="IpePathSegment" -->A segment on an <a class="el" href="class_ipe_sub_path.html">IpeSubPath</a>.
24
<a href="#_details">More...</a>
26
<a href="class_ipe_path_segment-members.html">List of all members.</a><h2>Public Types</h2>
28
<li>enum <b>TType</b> { <br>
29
<b>EArc</b>,
34
<b>ESpline</b>
38
<h2>Public Member Functions</h2>
40
<li>TType <a class="el" href="class_ipe_path_segment.html#112efec00e70fa4464e5c967832cb2b3">Type</a> () const
41
<li>int <a class="el" href="class_ipe_path_segment.html#8742d084671fc427ab0a919595d7066d">NumCP</a> () const
42
<li><a class="el" href="class_ipe_vector.html">IpeVector</a> <a class="el" href="class_ipe_path_segment.html#e0c01dba94a04106875928d4ff0abd33">CP</a> (int i) const
43
<li><a class="el" href="class_ipe_vector.html">IpeVector</a> <a class="el" href="class_ipe_path_segment.html#60852ec5ec72c8ff7af9b5bc64547c26">Last</a> () const
44
<li><a class="el" href="class_ipe_matrix.html">IpeMatrix</a> <a class="el" href="class_ipe_path_segment.html#b780187c84a625ab6d535037c5a3cf5c">Matrix</a> () const
45
<li><a class="el" href="class_ipe_bezier.html">IpeBezier</a> <a class="el" href="class_ipe_path_segment.html#53ec61327e522c0ed7b404f6923bc5dc">Bezier</a> () const
46
<li><a class="el" href="class_ipe_arc.html">IpeArc</a> <a class="el" href="class_ipe_path_segment.html#525411ee9383ba6d2b8789656135c0e2">Arc</a> () const
47
<li>void <a class="el" href="class_ipe_path_segment.html#7c11483664eeb813a925c2c4b83f3e8d">Beziers</a> (std::vector< <a class="el" href="class_ipe_bezier.html">IpeBezier</a> > &bez) const
48
<li>void <a class="el" href="class_ipe_path_segment.html#1560de4a393133e1435d28b08fefcf94">Draw</a> (<a class="el" href="class_ipe_painter.html">IpePainter</a> &painter) const
49
<li>void <a class="el" href="class_ipe_path_segment.html#d952d774ce326b6b6b2676e31fe46793">AddToBBox</a> (<a class="el" href="class_ipe_rect.html">IpeRect</a> &box, const <a class="el" href="class_ipe_matrix.html">IpeMatrix</a> &m) const
50
<li>double <a class="el" href="class_ipe_path_segment.html#296deb81970eb216967f15ffebc31dc4">Distance</a> (const <a class="el" href="class_ipe_vector.html">IpeVector</a> &v, const <a class="el" href="class_ipe_matrix.html">IpeMatrix</a> &m, double bound) const
51
<li>void <a class="el" href="class_ipe_path_segment.html#5046f1ee95c2b731a98602b10a19fd34">SnapVtx</a> (const <a class="el" href="class_ipe_vector.html">IpeVector</a> &mouse, const <a class="el" href="class_ipe_matrix.html">IpeMatrix</a> &m, <a class="el" href="class_ipe_vector.html">IpeVector</a> &pos, double &bound) const
52
<li><a class="anchor" name="1be032086d44cad81fdc22e685ff6297"></a><!-- doxytag: member="IpePathSegment::SnapBnd" ref="1be032086d44cad81fdc22e685ff6297" args="(const IpeVector &mouse, const IpeMatrix &m, IpeVector &pos, double &bound) const" -->
53
void <b>SnapBnd</b> (const <a class="el" href="class_ipe_vector.html">IpeVector</a> &mouse, const <a class="el" href="class_ipe_matrix.html">IpeMatrix</a> &m, <a class="el" href="class_ipe_vector.html">IpeVector</a> &pos, double &bound) const
57
<li><a class="anchor" name="ba8615e44d936d23096cf5c4b5ead3ff"></a><!-- doxytag: member="IpePathSegment::IpeSegmentSubPath" ref="ba8615e44d936d23096cf5c4b5ead3ff" args="" -->
58
class <a class="el" href="class_ipe_path_segment.html#ba8615e44d936d23096cf5c4b5ead3ff">IpeSegmentSubPath</a>
60
<hr><a name="_details"></a><h2>Detailed Description</h2>
61
A segment on an <a class="el" href="class_ipe_sub_path.html">IpeSubPath</a>.
63
A segment is either an elliptic arc, a straight segment, a quadratic Bezier spline, a cubic Bezier spline, or a B-spline curve, depending on its <a class="el" href="class_ipe_path_segment.html#112efec00e70fa4464e5c967832cb2b3">Type()</a>. This is a lightweight object, created on the fly by <a class="el" href="class_ipe_segment_sub_path.html#869f8831fc1b3bfee46357acc1a95993">IpeSegmentSubPath::Segment()</a>. There is no public constructor, so the only way to create such an object is through that method.<p>
64
The <a class="el" href="class_ipe_path_segment.html#112efec00e70fa4464e5c967832cb2b3">Type()</a> is one of the following:<p>
66
<li><code>ESegment:</code> the segment has two control points, and represents a line segment.</li></ul>
69
<li><code>EQuad:</code> a quadratic Bezier spline with three control points.</li></ul>
72
<li><code>EBezier:</code> a cubic Bezier spline with four control points.</li></ul>
75
<li><code>ESpline:</code> a B-spline curve with n control points. The first and last control point's knot value is repeated three times, so the curve begins and ends in these points.</li></ul>
78
<li><code>EArc:</code> an elliptic arc, with begin and end point. The supporting ellipse is defined by the <a class="el" href="class_ipe_path_segment.html#b780187c84a625ab6d535037c5a3cf5c">Matrix()</a>, it is the image under the affine transformation <a class="el" href="class_ipe_path_segment.html#b780187c84a625ab6d535037c5a3cf5c">Matrix()</a> of the unit circle. <a class="el" href="class_ipe_path_segment.html#b780187c84a625ab6d535037c5a3cf5c">Matrix()</a> is such that its inverse transforms both start and end position to points (nearly) on the unit circle. The arc is the image of the positively (counter-clockwise) directed arc from the pre-image of the start position to the pre-image of the end position. Whether this is a positively or negatively oriented arc in user space depends on the matrix. </li></ul>
81
<hr><h2>Member Function Documentation</h2>
82
<a class="anchor" name="112efec00e70fa4464e5c967832cb2b3"></a><!-- doxytag: member="IpePathSegment::Type" ref="112efec00e70fa4464e5c967832cb2b3" args="() const" -->
84
<div class="memproto">
85
<table class="memname">
87
<td class="memname">TType IpePathSegment::Type </td>
89
<td class="paramname"> </td>
90
<td> ) </td>
91
<td width="100%"> const<code> [inline]</code></td>
103
<a class="anchor" name="8742d084671fc427ab0a919595d7066d"></a><!-- doxytag: member="IpePathSegment::NumCP" ref="8742d084671fc427ab0a919595d7066d" args="() const" -->
104
<div class="memitem">
105
<div class="memproto">
106
<table class="memname">
108
<td class="memname">int IpePathSegment::NumCP </td>
110
<td class="paramname"> </td>
111
<td> ) </td>
112
<td width="100%"> const<code> [inline]</code></td>
119
Number of control points.
124
<a class="anchor" name="e0c01dba94a04106875928d4ff0abd33"></a><!-- doxytag: member="IpePathSegment::CP" ref="e0c01dba94a04106875928d4ff0abd33" args="(int i) const" -->
125
<div class="memitem">
126
<div class="memproto">
127
<table class="memname">
129
<td class="memname"><a class="el" href="class_ipe_vector.html">IpeVector</a> IpePathSegment::CP </td>
131
<td class="paramtype">int </td>
132
<td class="paramname"> <em>i</em> </td>
133
<td> ) </td>
134
<td width="100%"> const<code> [inline]</code></td>
141
Return control point.
146
<a class="anchor" name="60852ec5ec72c8ff7af9b5bc64547c26"></a><!-- doxytag: member="IpePathSegment::Last" ref="60852ec5ec72c8ff7af9b5bc64547c26" args="() const" -->
147
<div class="memitem">
148
<div class="memproto">
149
<table class="memname">
151
<td class="memname"><a class="el" href="class_ipe_vector.html">IpeVector</a> IpePathSegment::Last </td>
153
<td class="paramname"> </td>
154
<td> ) </td>
155
<td width="100%"> const<code> [inline]</code></td>
162
Return last control point.
167
<a class="anchor" name="b780187c84a625ab6d535037c5a3cf5c"></a><!-- doxytag: member="IpePathSegment::Matrix" ref="b780187c84a625ab6d535037c5a3cf5c" args="() const" -->
168
<div class="memitem">
169
<div class="memproto">
170
<table class="memname">
172
<td class="memname"><a class="el" href="class_ipe_matrix.html">IpeMatrix</a> IpePathSegment::Matrix </td>
174
<td class="paramname"> </td>
175
<td> ) </td>
176
<td width="100%"> const<code> [inline]</code></td>
183
Matrix (if <a class="el" href="class_ipe_path_segment.html#112efec00e70fa4464e5c967832cb2b3">Type()</a> == EArc).
188
<a class="anchor" name="53ec61327e522c0ed7b404f6923bc5dc"></a><!-- doxytag: member="IpePathSegment::Bezier" ref="53ec61327e522c0ed7b404f6923bc5dc" args="() const" -->
189
<div class="memitem">
190
<div class="memproto">
191
<table class="memname">
193
<td class="memname"><a class="el" href="class_ipe_bezier.html">IpeBezier</a> IpePathSegment::Bezier </td>
195
<td class="paramname"> </td>
196
<td> ) </td>
197
<td width="100%"> const</td>
204
Return segment as <a class="el" href="class_ipe_bezier.html">IpeBezier</a>.
206
Panics if segment is not a quadratic or cubic Bezier spline.
209
<a class="anchor" name="525411ee9383ba6d2b8789656135c0e2"></a><!-- doxytag: member="IpePathSegment::Arc" ref="525411ee9383ba6d2b8789656135c0e2" args="() const" -->
210
<div class="memitem">
211
<div class="memproto">
212
<table class="memname">
214
<td class="memname"><a class="el" href="class_ipe_arc.html">IpeArc</a> IpePathSegment::Arc </td>
216
<td class="paramname"> </td>
217
<td> ) </td>
218
<td width="100%"> const</td>
225
Return segment as <a class="el" href="class_ipe_arc.html">IpeArc</a>.
227
Panics if segment is not an arc.
230
<a class="anchor" name="7c11483664eeb813a925c2c4b83f3e8d"></a><!-- doxytag: member="IpePathSegment::Beziers" ref="7c11483664eeb813a925c2c4b83f3e8d" args="(std::vector< IpeBezier > &bez) const" -->
231
<div class="memitem">
232
<div class="memproto">
233
<table class="memname">
235
<td class="memname">void IpePathSegment::Beziers </td>
237
<td class="paramtype">std::vector< <a class="el" href="class_ipe_bezier.html">IpeBezier</a> > & </td>
238
<td class="paramname"> <em>bez</em> </td>
239
<td> ) </td>
240
<td width="100%"> const</td>
247
Convert B-spline to a sequence of Bezier splines.
252
<a class="anchor" name="1560de4a393133e1435d28b08fefcf94"></a><!-- doxytag: member="IpePathSegment::Draw" ref="1560de4a393133e1435d28b08fefcf94" args="(IpePainter &painter) const " -->
253
<div class="memitem">
254
<div class="memproto">
255
<table class="memname">
257
<td class="memname">void IpePathSegment::Draw </td>
259
<td class="paramtype"><a class="el" href="class_ipe_painter.html">IpePainter</a> & </td>
260
<td class="paramname"> <em>painter</em> </td>
261
<td> ) </td>
262
<td width="100%"> const</td>
271
Current position of the <em>painter</em> is already on first control point.
274
<a class="anchor" name="d952d774ce326b6b6b2676e31fe46793"></a><!-- doxytag: member="IpePathSegment::AddToBBox" ref="d952d774ce326b6b6b2676e31fe46793" args="(IpeRect &box, const IpeMatrix &m) const" -->
275
<div class="memitem">
276
<div class="memproto">
277
<table class="memname">
279
<td class="memname">void IpePathSegment::AddToBBox </td>
281
<td class="paramtype"><a class="el" href="class_ipe_rect.html">IpeRect</a> & </td>
282
<td class="paramname"> <em>box</em>, </td>
285
<td class="paramkey"></td>
287
<td class="paramtype">const <a class="el" href="class_ipe_matrix.html">IpeMatrix</a> & </td>
288
<td class="paramname"> <em>m</em></td><td> </td>
293
<td></td><td></td><td width="100%"> const</td>
300
Add segment to bounding box.
302
Does not assume that first control point has already been added. Centers of arcs are included in the bbox, to make sure snapping finds them.
305
<a class="anchor" name="296deb81970eb216967f15ffebc31dc4"></a><!-- doxytag: member="IpePathSegment::Distance" ref="296deb81970eb216967f15ffebc31dc4" args="(const IpeVector &v, const IpeMatrix &m, double bound) const" -->
306
<div class="memitem">
307
<div class="memproto">
308
<table class="memname">
310
<td class="memname">double IpePathSegment::Distance </td>
312
<td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> & </td>
313
<td class="paramname"> <em>v</em>, </td>
316
<td class="paramkey"></td>
318
<td class="paramtype">const <a class="el" href="class_ipe_matrix.html">IpeMatrix</a> & </td>
319
<td class="paramname"> <em>m</em>, </td>
322
<td class="paramkey"></td>
324
<td class="paramtype">double </td>
325
<td class="paramname"> <em>bound</em></td><td> </td>
330
<td></td><td></td><td width="100%"> const</td>
337
Return distance to the segment.
342
<a class="anchor" name="5046f1ee95c2b731a98602b10a19fd34"></a><!-- doxytag: member="IpePathSegment::SnapVtx" ref="5046f1ee95c2b731a98602b10a19fd34" args="(const IpeVector &mouse, const IpeMatrix &m, IpeVector &pos, double &bound) const" -->
343
<div class="memitem">
344
<div class="memproto">
345
<table class="memname">
347
<td class="memname">void IpePathSegment::SnapVtx </td>
349
<td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> & </td>
350
<td class="paramname"> <em>mouse</em>, </td>
353
<td class="paramkey"></td>
355
<td class="paramtype">const <a class="el" href="class_ipe_matrix.html">IpeMatrix</a> & </td>
356
<td class="paramname"> <em>m</em>, </td>
359
<td class="paramkey"></td>
361
<td class="paramtype"><a class="el" href="class_ipe_vector.html">IpeVector</a> & </td>
362
<td class="paramname"> <em>pos</em>, </td>
365
<td class="paramkey"></td>
367
<td class="paramtype">double & </td>
368
<td class="paramname"> <em>bound</em></td><td> </td>
373
<td></td><td></td><td width="100%"> const</td>
380
Snap to vertex of the segment.
382
The method assumes that the first control point has already been tested.
385
<hr>The documentation for this class was generated from the following files:<ul>
386
<li>ipepath.h<li>ipepath.cpp</ul>