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
|
<!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: IpePathSegment 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 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 List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul></div>
<h1>IpePathSegment Class Reference<br>
<small>
[<a class="el" href="group__obj.html">Ipe Objects</a>]</small>
</h1><!-- doxytag: class="IpePathSegment" -->A segment on an <a class="el" href="class_ipe_sub_path.html">IpeSubPath</a>.
<a href="#_details">More...</a>
<p>
<a href="class_ipe_path_segment-members.html">List of all members.</a><h2>Public Types</h2>
<ul>
<li>enum <b>TType</b> { <br>
<b>EArc</b>,
<b>ESegment</b>,
<b>EQuad</b>,
<b>EBezier</b>,
<br>
<b>ESpline</b>
<br>
}
</ul>
<h2>Public Member Functions</h2>
<ul>
<li>TType <a class="el" href="class_ipe_path_segment.html#112efec00e70fa4464e5c967832cb2b3">Type</a> () const
<li>int <a class="el" href="class_ipe_path_segment.html#8742d084671fc427ab0a919595d7066d">NumCP</a> () const
<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
<li><a class="el" href="class_ipe_vector.html">IpeVector</a> <a class="el" href="class_ipe_path_segment.html#60852ec5ec72c8ff7af9b5bc64547c26">Last</a> () const
<li><a class="el" href="class_ipe_matrix.html">IpeMatrix</a> <a class="el" href="class_ipe_path_segment.html#b780187c84a625ab6d535037c5a3cf5c">Matrix</a> () const
<li><a class="el" href="class_ipe_bezier.html">IpeBezier</a> <a class="el" href="class_ipe_path_segment.html#53ec61327e522c0ed7b404f6923bc5dc">Bezier</a> () const
<li><a class="el" href="class_ipe_arc.html">IpeArc</a> <a class="el" href="class_ipe_path_segment.html#525411ee9383ba6d2b8789656135c0e2">Arc</a> () const
<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
<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
<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
<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
<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
<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" -->
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
</ul>
<h2>Friends</h2>
<ul>
<li><a class="anchor" name="ba8615e44d936d23096cf5c4b5ead3ff"></a><!-- doxytag: member="IpePathSegment::IpeSegmentSubPath" ref="ba8615e44d936d23096cf5c4b5ead3ff" args="" -->
class <a class="el" href="class_ipe_path_segment.html#ba8615e44d936d23096cf5c4b5ead3ff">IpeSegmentSubPath</a>
</ul>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A segment on an <a class="el" href="class_ipe_sub_path.html">IpeSubPath</a>.
<p>
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>
The <a class="el" href="class_ipe_path_segment.html#112efec00e70fa4464e5c967832cb2b3">Type()</a> is one of the following:<p>
<ul>
<li><code>ESegment:</code> the segment has two control points, and represents a line segment.</li></ul>
<p>
<ul>
<li><code>EQuad:</code> a quadratic Bezier spline with three control points.</li></ul>
<p>
<ul>
<li><code>EBezier:</code> a cubic Bezier spline with four control points.</li></ul>
<p>
<ul>
<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>
<p>
<ul>
<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>
<p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="112efec00e70fa4464e5c967832cb2b3"></a><!-- doxytag: member="IpePathSegment::Type" ref="112efec00e70fa4464e5c967832cb2b3" args="() const" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">TType IpePathSegment::Type </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Type of segment.
<p>
</div>
</div><p>
<a class="anchor" name="8742d084671fc427ab0a919595d7066d"></a><!-- doxytag: member="IpePathSegment::NumCP" ref="8742d084671fc427ab0a919595d7066d" args="() const" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int IpePathSegment::NumCP </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Number of control points.
<p>
</div>
</div><p>
<a class="anchor" name="e0c01dba94a04106875928d4ff0abd33"></a><!-- doxytag: member="IpePathSegment::CP" ref="e0c01dba94a04106875928d4ff0abd33" args="(int i) const" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="class_ipe_vector.html">IpeVector</a> IpePathSegment::CP </td>
<td>(</td>
<td class="paramtype">int </td>
<td class="paramname"> <em>i</em> </td>
<td> ) </td>
<td width="100%"> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Return control point.
<p>
</div>
</div><p>
<a class="anchor" name="60852ec5ec72c8ff7af9b5bc64547c26"></a><!-- doxytag: member="IpePathSegment::Last" ref="60852ec5ec72c8ff7af9b5bc64547c26" args="() const" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="class_ipe_vector.html">IpeVector</a> IpePathSegment::Last </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Return last control point.
<p>
</div>
</div><p>
<a class="anchor" name="b780187c84a625ab6d535037c5a3cf5c"></a><!-- doxytag: member="IpePathSegment::Matrix" ref="b780187c84a625ab6d535037c5a3cf5c" args="() const" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="class_ipe_matrix.html">IpeMatrix</a> IpePathSegment::Matrix </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"> const<code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Matrix (if <a class="el" href="class_ipe_path_segment.html#112efec00e70fa4464e5c967832cb2b3">Type()</a> == EArc).
<p>
</div>
</div><p>
<a class="anchor" name="53ec61327e522c0ed7b404f6923bc5dc"></a><!-- doxytag: member="IpePathSegment::Bezier" ref="53ec61327e522c0ed7b404f6923bc5dc" args="() const" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="class_ipe_bezier.html">IpeBezier</a> IpePathSegment::Bezier </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Return segment as <a class="el" href="class_ipe_bezier.html">IpeBezier</a>.
<p>
Panics if segment is not a quadratic or cubic Bezier spline.
</div>
</div><p>
<a class="anchor" name="525411ee9383ba6d2b8789656135c0e2"></a><!-- doxytag: member="IpePathSegment::Arc" ref="525411ee9383ba6d2b8789656135c0e2" args="() const" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="class_ipe_arc.html">IpeArc</a> IpePathSegment::Arc </td>
<td>(</td>
<td class="paramname"> </td>
<td> ) </td>
<td width="100%"> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Return segment as <a class="el" href="class_ipe_arc.html">IpeArc</a>.
<p>
Panics if segment is not an arc.
</div>
</div><p>
<a class="anchor" name="7c11483664eeb813a925c2c4b83f3e8d"></a><!-- doxytag: member="IpePathSegment::Beziers" ref="7c11483664eeb813a925c2c4b83f3e8d" args="(std::vector< IpeBezier > &bez) const" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void IpePathSegment::Beziers </td>
<td>(</td>
<td class="paramtype">std::vector< <a class="el" href="class_ipe_bezier.html">IpeBezier</a> > & </td>
<td class="paramname"> <em>bez</em> </td>
<td> ) </td>
<td width="100%"> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Convert B-spline to a sequence of Bezier splines.
<p>
</div>
</div><p>
<a class="anchor" name="1560de4a393133e1435d28b08fefcf94"></a><!-- doxytag: member="IpePathSegment::Draw" ref="1560de4a393133e1435d28b08fefcf94" args="(IpePainter &painter) const " -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void IpePathSegment::Draw </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_ipe_painter.html">IpePainter</a> & </td>
<td class="paramname"> <em>painter</em> </td>
<td> ) </td>
<td width="100%"> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Draw the segment.
<p>
Current position of the <em>painter</em> is already on first control point.
</div>
</div><p>
<a class="anchor" name="d952d774ce326b6b6b2676e31fe46793"></a><!-- doxytag: member="IpePathSegment::AddToBBox" ref="d952d774ce326b6b6b2676e31fe46793" args="(IpeRect &box, const IpeMatrix &m) const" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void IpePathSegment::AddToBBox </td>
<td>(</td>
<td class="paramtype"><a class="el" href="class_ipe_rect.html">IpeRect</a> & </td>
<td class="paramname"> <em>box</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="class_ipe_matrix.html">IpeMatrix</a> & </td>
<td class="paramname"> <em>m</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Add segment to bounding box.
<p>
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.
</div>
</div><p>
<a class="anchor" name="296deb81970eb216967f15ffebc31dc4"></a><!-- doxytag: member="IpePathSegment::Distance" ref="296deb81970eb216967f15ffebc31dc4" args="(const IpeVector &v, const IpeMatrix &m, double bound) const" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double IpePathSegment::Distance </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> & </td>
<td class="paramname"> <em>v</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="class_ipe_matrix.html">IpeMatrix</a> & </td>
<td class="paramname"> <em>m</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"> <em>bound</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Return distance to the segment.
<p>
</div>
</div><p>
<a class="anchor" name="5046f1ee95c2b731a98602b10a19fd34"></a><!-- doxytag: member="IpePathSegment::SnapVtx" ref="5046f1ee95c2b731a98602b10a19fd34" args="(const IpeVector &mouse, const IpeMatrix &m, IpeVector &pos, double &bound) const" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void IpePathSegment::SnapVtx </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="class_ipe_vector.html">IpeVector</a> & </td>
<td class="paramname"> <em>mouse</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="class_ipe_matrix.html">IpeMatrix</a> & </td>
<td class="paramname"> <em>m</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="class_ipe_vector.html">IpeVector</a> & </td>
<td class="paramname"> <em>pos</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double & </td>
<td class="paramname"> <em>bound</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"> const</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Snap to vertex of the segment.
<p>
The method assumes that the first control point has already been tested.
</div>
</div><p>
<hr>The documentation for this class was generated from the following files:<ul>
<li>ipepath.h<li>ipepath.cpp</ul>
<hr>
</body></html>
|