proj home

Files   Classes   Functions   Hierarchy  

linechoppedindexed< PT, PD, INDX > Class Template Reference

Maintain a linked list of chopped line segments, each having an index. More...

#include <linechopped.h>

Collaboration diagram for linechoppedindexed< PT, PD, INDX >:

List of all members.

Public Types

typedef list< pointindexed
< point2< PD >, INDX >
>::iterator 
listiter

Public Member Functions

 linechoppedindexed (line< PT, PD > const &ln_, pointindexed< point2< PD >, INDX > 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< pointindexed< point2< PD >
, INDX > > 
chain
 Chain segments.


Detailed Description

template<typename PT, typename PD, typename INDX>
class linechoppedindexed< PT, PD, INDX >

Maintain a linked list of chopped line segments, each having an index.

Definition at line 90 of file linechopped.h.


Member Typedef Documentation

template<typename PT, typename PD, typename INDX>
typedef list< pointindexed< point2<PD>, INDX > >::iterator linechoppedindexed< PT, PD, INDX >::listiter

Definition at line 110 of file linechopped.h.


Constructor & Destructor Documentation

template<typename PT, typename PD, typename INDX>
linechoppedindexed< PT, PD, INDX >::linechoppedindexed ( line< PT, PD > const &  ln_,
pointindexed< point2< PD >, INDX > const &  seg 
) [inline]

Pass in an initial line segment.

Definition at line 102 of file linechopped.h.

References linechoppedindexed< PT, PD, INDX >::chain.

00106     : ln(ln_)
00107     { chain.push_back( seg ); }


Member Function Documentation

template<typename PT , typename PD , typename INDX >
boolc linechoppedindexed< PT, PD, INDX >::split ( listiter posnew,
listiter  pos,
line< PT, PD > const &  L2 
) [inline]

Split into two segments.

The order is maintained.

Definition at line 168 of file linechopped.h.

References solver< T >::d2linearequ(), line< PT, PD >::nml, and line< PT, PD >::pos.

00173 {
00174   bool res;
00175   point2<PD> t;
00176   res = solver<PD>::d2linearequ
00177     (t,ln.nml,L2.nml*((PD)-1.0), L2.pos - ln.pos);
00178 
00179   if (res==false)
00180     return false;
00181 
00182   PD t0(t[0]);
00183 
00184   if (t0<(*pos).pt[0])
00185     return false;
00186 
00187   if (t0>(*pos).pt[1])
00188     return false;
00189 
00190   PD k0((*pos).pt[0]);
00191   (*pos).pt[0] = t0;
00192   
00193   posnew = chain.insert(pos,pointindexed< point2<PD>, INDX >( point2<PD>(k0,t0),0));
00194 
00195   return true;
00196 }


Member Data Documentation

template<typename PT, typename PD, typename INDX>
list< pointindexed< point2<PD>, INDX> > linechoppedindexed< PT, PD, INDX >::chain

template<typename PT, typename PD, typename INDX>
line<PT,PD> linechoppedindexed< PT, PD, INDX >::ln

The line.

Definition at line 95 of file linechopped.h.

Referenced by bsptreeD2< PT, PD, INDX >::find().


The documentation for this class was generated from the following file:

Generated on Fri Mar 4 00:50:04 2011 for Chelton Evans Source by  doxygen 1.5.8