Files Classes Functions Hierarchy
#include <linechopped.h>
Public Types | |
| typedef list< point2< PD > >::iterator | listiter |
Public Member Functions | |
| linechopped (line< PT, PD > const &ln_, point2< PD > const &seg) | |
| Pass in an initial line segment. | |
| boolc | split (listiter &posnew, listiter pos, line< PT, PD > const &L2) |
| Split into two segments. | |
Public Attributes | |
| line< PT, PD > | ln |
| The line. | |
| list< point2< PD > > | chain |
| Chain segments. | |
Definition at line 17 of file linechopped.h.
| typedef list< point2<PD> >::iterator linechopped< PT, PD >::listiter |
Definition at line 36 of file linechopped.h.
| linechopped< PT, PD >::linechopped | ( | line< PT, PD > const & | ln_, | |
| point2< PD > const & | seg | |||
| ) | [inline] |
Pass in an initial line segment.
Definition at line 29 of file linechopped.h.
References linechopped< PT, PD >::chain.
| boolc linechopped< PT, PD >::split | ( | listiter & | posnew, | |
| listiter | pos, | |||
| line< PT, PD > const & | L2 | |||
| ) | [inline] |
Split into two segments.
The order is maintained. If the new element is inserted posnew then points to it and is before pos.
Definition at line 132 of file linechopped.h.
References solver< T >::d2linearequ(), line< PT, PD >::nml, and line< PT, PD >::pos.
00137 { 00138 bool res; 00139 point2<PD> t; 00140 res = solver<PD>::d2linearequ 00141 (t,ln.nml,L2.nml*((PD)-1.0), L2.pos - ln.pos); 00142 00143 if (res==false) 00144 return false; 00145 00146 PD t0(t[0]); 00147 00148 if (t0<(*pos)[0]) 00149 return false; 00150 00151 if (t0>(*pos)[1]) 00152 return false; 00153 00154 // The line is being split. 00155 00156 PD k0((*pos)[0]); 00157 (*pos)[0] = t0; 00158 00159 posnew = chain.insert(pos,point2<PD>(k0,t0)); 00160 00161 return true; 00162 }
| list< point2<PD> > linechopped< PT, PD >::chain |
Chain segments.
Definition at line 25 of file linechopped.h.
Referenced by linechopped< PT, PD >::linechopped().
| line<PT,PD> linechopped< PT, PD >::ln |
1.5.8