~ubuntu-branches/ubuntu/precise/ipe/precise

« back to all changes in this revision

Viewing changes to doc/class_ipe_path_segment.html

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2009-12-11 21:22:35 UTC
  • mfrom: (4.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20091211212235-5iio4nzpra64snab
Tags: 7.0.10-1
* New upstream.  Closes: #551192.
  - New build-depends: libcairo2-dev, liblua5.1-0-dev, gsfonts
  - patches/config.diff: Remove.  Upstream build system replaced.
  - Runtime lib package changed to libipe7.0.10 from libipe1c2a
  - Devel package renamed to libipe-dev (from libipe1-dev)
  - Package ipe depends on lua5.1 due to ipe-update-master.

* rules: Re-write to use dh.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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">
6
 
</head><body>
7
 
<!-- Generated by Doxygen 1.5.1 -->
8
 
<div class="tabs">
9
 
  <ul>
10
 
    <li><a href="index.html"><span>Main&nbsp;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>
13
 
  </ul></div>
14
 
<div class="tabs">
15
 
  <ul>
16
 
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
17
 
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
18
 
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
19
 
  </ul></div>
20
 
<h1>IpePathSegment Class Reference<br>
21
 
<small>
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>
25
 
<p>
26
 
<a href="class_ipe_path_segment-members.html">List of all members.</a><h2>Public Types</h2>
27
 
<ul>
28
 
<li>enum <b>TType</b> { <br>
29
 
&nbsp;&nbsp;<b>EArc</b>, 
30
 
<b>ESegment</b>, 
31
 
<b>EQuad</b>, 
32
 
<b>EBezier</b>, 
33
 
<br>
34
 
&nbsp;&nbsp;<b>ESpline</b>
35
 
<br>
36
 
 }
37
 
</ul>
38
 
<h2>Public Member Functions</h2>
39
 
<ul>
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&lt; <a class="el" href="class_ipe_bezier.html">IpeBezier</a> &gt; &amp;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> &amp;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> &amp;box, const <a class="el" href="class_ipe_matrix.html">IpeMatrix</a> &amp;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> &amp;v, const <a class="el" href="class_ipe_matrix.html">IpeMatrix</a> &amp;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> &amp;mouse, const <a class="el" href="class_ipe_matrix.html">IpeMatrix</a> &amp;m, <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;pos, double &amp;bound) const
52
 
<li><a class="anchor" name="1be032086d44cad81fdc22e685ff6297"></a><!-- doxytag: member="IpePathSegment::SnapBnd" ref="1be032086d44cad81fdc22e685ff6297" args="(const IpeVector &amp;mouse, const IpeMatrix &amp;m, IpeVector &amp;pos, double &amp;bound) const" -->
53
 
void <b>SnapBnd</b> (const <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;mouse, const <a class="el" href="class_ipe_matrix.html">IpeMatrix</a> &amp;m, <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;pos, double &amp;bound) const
54
 
</ul>
55
 
<h2>Friends</h2>
56
 
<ul>
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>
59
 
</ul>
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>. 
62
 
<p>
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>
65
 
<ul>
66
 
<li><code>ESegment:</code> the segment has two control points, and represents a line segment.</li></ul>
67
 
<p>
68
 
<ul>
69
 
<li><code>EQuad:</code> a quadratic Bezier spline with three control points.</li></ul>
70
 
<p>
71
 
<ul>
72
 
<li><code>EBezier:</code> a cubic Bezier spline with four control points.</li></ul>
73
 
<p>
74
 
<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>
76
 
<p>
77
 
<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>
79
 
 
80
 
<p>
81
 
<hr><h2>Member Function Documentation</h2>
82
 
<a class="anchor" name="112efec00e70fa4464e5c967832cb2b3"></a><!-- doxytag: member="IpePathSegment::Type" ref="112efec00e70fa4464e5c967832cb2b3" args="() const" -->
83
 
<div class="memitem">
84
 
<div class="memproto">
85
 
      <table class="memname">
86
 
        <tr>
87
 
          <td class="memname">TType IpePathSegment::Type           </td>
88
 
          <td>(</td>
89
 
          <td class="paramname">          </td>
90
 
          <td>&nbsp;)&nbsp;</td>
91
 
          <td width="100%"> const<code> [inline]</code></td>
92
 
        </tr>
93
 
      </table>
94
 
</div>
95
 
<div class="memdoc">
96
 
 
97
 
<p>
98
 
Type of segment. 
99
 
<p>
100
 
 
101
 
</div>
102
 
</div><p>
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">
107
 
        <tr>
108
 
          <td class="memname">int IpePathSegment::NumCP           </td>
109
 
          <td>(</td>
110
 
          <td class="paramname">          </td>
111
 
          <td>&nbsp;)&nbsp;</td>
112
 
          <td width="100%"> const<code> [inline]</code></td>
113
 
        </tr>
114
 
      </table>
115
 
</div>
116
 
<div class="memdoc">
117
 
 
118
 
<p>
119
 
Number of control points. 
120
 
<p>
121
 
 
122
 
</div>
123
 
</div><p>
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">
128
 
        <tr>
129
 
          <td class="memname"><a class="el" href="class_ipe_vector.html">IpeVector</a> IpePathSegment::CP           </td>
130
 
          <td>(</td>
131
 
          <td class="paramtype">int&nbsp;</td>
132
 
          <td class="paramname"> <em>i</em>          </td>
133
 
          <td>&nbsp;)&nbsp;</td>
134
 
          <td width="100%"> const<code> [inline]</code></td>
135
 
        </tr>
136
 
      </table>
137
 
</div>
138
 
<div class="memdoc">
139
 
 
140
 
<p>
141
 
Return control point. 
142
 
<p>
143
 
 
144
 
</div>
145
 
</div><p>
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">
150
 
        <tr>
151
 
          <td class="memname"><a class="el" href="class_ipe_vector.html">IpeVector</a> IpePathSegment::Last           </td>
152
 
          <td>(</td>
153
 
          <td class="paramname">          </td>
154
 
          <td>&nbsp;)&nbsp;</td>
155
 
          <td width="100%"> const<code> [inline]</code></td>
156
 
        </tr>
157
 
      </table>
158
 
</div>
159
 
<div class="memdoc">
160
 
 
161
 
<p>
162
 
Return last control point. 
163
 
<p>
164
 
 
165
 
</div>
166
 
</div><p>
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">
171
 
        <tr>
172
 
          <td class="memname"><a class="el" href="class_ipe_matrix.html">IpeMatrix</a> IpePathSegment::Matrix           </td>
173
 
          <td>(</td>
174
 
          <td class="paramname">          </td>
175
 
          <td>&nbsp;)&nbsp;</td>
176
 
          <td width="100%"> const<code> [inline]</code></td>
177
 
        </tr>
178
 
      </table>
179
 
</div>
180
 
<div class="memdoc">
181
 
 
182
 
<p>
183
 
Matrix (if <a class="el" href="class_ipe_path_segment.html#112efec00e70fa4464e5c967832cb2b3">Type()</a> == EArc). 
184
 
<p>
185
 
 
186
 
</div>
187
 
</div><p>
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">
192
 
        <tr>
193
 
          <td class="memname"><a class="el" href="class_ipe_bezier.html">IpeBezier</a> IpePathSegment::Bezier           </td>
194
 
          <td>(</td>
195
 
          <td class="paramname">          </td>
196
 
          <td>&nbsp;)&nbsp;</td>
197
 
          <td width="100%"> const</td>
198
 
        </tr>
199
 
      </table>
200
 
</div>
201
 
<div class="memdoc">
202
 
 
203
 
<p>
204
 
Return segment as <a class="el" href="class_ipe_bezier.html">IpeBezier</a>. 
205
 
<p>
206
 
Panics if segment is not a quadratic or cubic Bezier spline. 
207
 
</div>
208
 
</div><p>
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">
213
 
        <tr>
214
 
          <td class="memname"><a class="el" href="class_ipe_arc.html">IpeArc</a> IpePathSegment::Arc           </td>
215
 
          <td>(</td>
216
 
          <td class="paramname">          </td>
217
 
          <td>&nbsp;)&nbsp;</td>
218
 
          <td width="100%"> const</td>
219
 
        </tr>
220
 
      </table>
221
 
</div>
222
 
<div class="memdoc">
223
 
 
224
 
<p>
225
 
Return segment as <a class="el" href="class_ipe_arc.html">IpeArc</a>. 
226
 
<p>
227
 
Panics if segment is not an arc. 
228
 
</div>
229
 
</div><p>
230
 
<a class="anchor" name="7c11483664eeb813a925c2c4b83f3e8d"></a><!-- doxytag: member="IpePathSegment::Beziers" ref="7c11483664eeb813a925c2c4b83f3e8d" args="(std::vector&lt; IpeBezier &gt; &amp;bez) const" -->
231
 
<div class="memitem">
232
 
<div class="memproto">
233
 
      <table class="memname">
234
 
        <tr>
235
 
          <td class="memname">void IpePathSegment::Beziers           </td>
236
 
          <td>(</td>
237
 
          <td class="paramtype">std::vector&lt; <a class="el" href="class_ipe_bezier.html">IpeBezier</a> &gt; &amp;&nbsp;</td>
238
 
          <td class="paramname"> <em>bez</em>          </td>
239
 
          <td>&nbsp;)&nbsp;</td>
240
 
          <td width="100%"> const</td>
241
 
        </tr>
242
 
      </table>
243
 
</div>
244
 
<div class="memdoc">
245
 
 
246
 
<p>
247
 
Convert B-spline to a sequence of Bezier splines. 
248
 
<p>
249
 
 
250
 
</div>
251
 
</div><p>
252
 
<a class="anchor" name="1560de4a393133e1435d28b08fefcf94"></a><!-- doxytag: member="IpePathSegment::Draw" ref="1560de4a393133e1435d28b08fefcf94" args="(IpePainter &amp;painter) const " -->
253
 
<div class="memitem">
254
 
<div class="memproto">
255
 
      <table class="memname">
256
 
        <tr>
257
 
          <td class="memname">void IpePathSegment::Draw           </td>
258
 
          <td>(</td>
259
 
          <td class="paramtype"><a class="el" href="class_ipe_painter.html">IpePainter</a> &amp;&nbsp;</td>
260
 
          <td class="paramname"> <em>painter</em>          </td>
261
 
          <td>&nbsp;)&nbsp;</td>
262
 
          <td width="100%"> const</td>
263
 
        </tr>
264
 
      </table>
265
 
</div>
266
 
<div class="memdoc">
267
 
 
268
 
<p>
269
 
Draw the segment. 
270
 
<p>
271
 
Current position of the <em>painter</em> is already on first control point. 
272
 
</div>
273
 
</div><p>
274
 
<a class="anchor" name="d952d774ce326b6b6b2676e31fe46793"></a><!-- doxytag: member="IpePathSegment::AddToBBox" ref="d952d774ce326b6b6b2676e31fe46793" args="(IpeRect &amp;box, const IpeMatrix &amp;m) const" -->
275
 
<div class="memitem">
276
 
<div class="memproto">
277
 
      <table class="memname">
278
 
        <tr>
279
 
          <td class="memname">void IpePathSegment::AddToBBox           </td>
280
 
          <td>(</td>
281
 
          <td class="paramtype"><a class="el" href="class_ipe_rect.html">IpeRect</a> &amp;&nbsp;</td>
282
 
          <td class="paramname"> <em>box</em>, </td>
283
 
        </tr>
284
 
        <tr>
285
 
          <td class="paramkey"></td>
286
 
          <td></td>
287
 
          <td class="paramtype">const <a class="el" href="class_ipe_matrix.html">IpeMatrix</a> &amp;&nbsp;</td>
288
 
          <td class="paramname"> <em>m</em></td><td>&nbsp;</td>
289
 
        </tr>
290
 
        <tr>
291
 
          <td></td>
292
 
          <td>)</td>
293
 
          <td></td><td></td><td width="100%"> const</td>
294
 
        </tr>
295
 
      </table>
296
 
</div>
297
 
<div class="memdoc">
298
 
 
299
 
<p>
300
 
Add segment to bounding box. 
301
 
<p>
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. 
303
 
</div>
304
 
</div><p>
305
 
<a class="anchor" name="296deb81970eb216967f15ffebc31dc4"></a><!-- doxytag: member="IpePathSegment::Distance" ref="296deb81970eb216967f15ffebc31dc4" args="(const IpeVector &amp;v, const IpeMatrix &amp;m, double bound) const" -->
306
 
<div class="memitem">
307
 
<div class="memproto">
308
 
      <table class="memname">
309
 
        <tr>
310
 
          <td class="memname">double IpePathSegment::Distance           </td>
311
 
          <td>(</td>
312
 
          <td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;&nbsp;</td>
313
 
          <td class="paramname"> <em>v</em>, </td>
314
 
        </tr>
315
 
        <tr>
316
 
          <td class="paramkey"></td>
317
 
          <td></td>
318
 
          <td class="paramtype">const <a class="el" href="class_ipe_matrix.html">IpeMatrix</a> &amp;&nbsp;</td>
319
 
          <td class="paramname"> <em>m</em>, </td>
320
 
        </tr>
321
 
        <tr>
322
 
          <td class="paramkey"></td>
323
 
          <td></td>
324
 
          <td class="paramtype">double&nbsp;</td>
325
 
          <td class="paramname"> <em>bound</em></td><td>&nbsp;</td>
326
 
        </tr>
327
 
        <tr>
328
 
          <td></td>
329
 
          <td>)</td>
330
 
          <td></td><td></td><td width="100%"> const</td>
331
 
        </tr>
332
 
      </table>
333
 
</div>
334
 
<div class="memdoc">
335
 
 
336
 
<p>
337
 
Return distance to the segment. 
338
 
<p>
339
 
 
340
 
</div>
341
 
</div><p>
342
 
<a class="anchor" name="5046f1ee95c2b731a98602b10a19fd34"></a><!-- doxytag: member="IpePathSegment::SnapVtx" ref="5046f1ee95c2b731a98602b10a19fd34" args="(const IpeVector &amp;mouse, const IpeMatrix &amp;m, IpeVector &amp;pos, double &amp;bound) const" -->
343
 
<div class="memitem">
344
 
<div class="memproto">
345
 
      <table class="memname">
346
 
        <tr>
347
 
          <td class="memname">void IpePathSegment::SnapVtx           </td>
348
 
          <td>(</td>
349
 
          <td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;&nbsp;</td>
350
 
          <td class="paramname"> <em>mouse</em>, </td>
351
 
        </tr>
352
 
        <tr>
353
 
          <td class="paramkey"></td>
354
 
          <td></td>
355
 
          <td class="paramtype">const <a class="el" href="class_ipe_matrix.html">IpeMatrix</a> &amp;&nbsp;</td>
356
 
          <td class="paramname"> <em>m</em>, </td>
357
 
        </tr>
358
 
        <tr>
359
 
          <td class="paramkey"></td>
360
 
          <td></td>
361
 
          <td class="paramtype"><a class="el" href="class_ipe_vector.html">IpeVector</a> &amp;&nbsp;</td>
362
 
          <td class="paramname"> <em>pos</em>, </td>
363
 
        </tr>
364
 
        <tr>
365
 
          <td class="paramkey"></td>
366
 
          <td></td>
367
 
          <td class="paramtype">double &amp;&nbsp;</td>
368
 
          <td class="paramname"> <em>bound</em></td><td>&nbsp;</td>
369
 
        </tr>
370
 
        <tr>
371
 
          <td></td>
372
 
          <td>)</td>
373
 
          <td></td><td></td><td width="100%"> const</td>
374
 
        </tr>
375
 
      </table>
376
 
</div>
377
 
<div class="memdoc">
378
 
 
379
 
<p>
380
 
Snap to vertex of the segment. 
381
 
<p>
382
 
The method assumes that the first control point has already been tested. 
383
 
</div>
384
 
</div><p>
385
 
<hr>The documentation for this class was generated from the following files:<ul>
386
 
<li>ipepath.h<li>ipepath.cpp</ul>
387
 
<hr>
388
 
</body></html>