Piecewise_Qsc_curve< K > Class Template Reference

#include <qsc_approximation_fcts.hpp>

List of all members.

Public Member Functions


Detailed Description

template<class K>
class mmx::shape::Piecewise_Qsc_curve< K >

Definition at line 874 of file qsc_approximation_fcts.hpp.


Constructor & Destructor Documentation

Piecewise_Qsc_curve (  )  [inline]

Definition at line 877 of file qsc_approximation_fcts.hpp.

00877 {};

Piecewise_Qsc_curve ( const Bezier_curve< K > &  B,
const double &  step = .3 
) [inline]

Definition at line 879 of file qsc_approximation_fcts.hpp.

References Rsc_curve< K >::ccw(), mmx::shape::dot(), Rsc_curve< K >::nend(), Rsc_curve< K >::nstart(), Rsc_curve< K >::orientation(), PI, Rsc_curve< K >::sdiff(), Rsc_curve< K >::seval(), Seq< C, R >::size(), Rsc_curve< K >::support_size(), and VECT.

00880     {
00881       Rsc_curve<K> R(B);
00882       n0= R.nstart();
00883       n1= R.nend();
00884       path= R.orientation();
00885 
00886       int k = R.support_size() / step ;
00887       std::cout<<"got "<<R.support_size() << ", pieces: "<< k <<"\n";      
00888 
00889       K fi, f0= acos( n0[0] );
00890       if (sin(n0[1])<0) f0= 2*PI- f0;
00891 
00892       if ( path * R.ccw() > 0 ) 
00893         fi =  path * acos( dot(n0,n1)) / K(k) ;
00894       else
00895         fi =  path * (2*PI - acos(dot(n0,n1))) / K(k);
00896 
00897       f0+=fi;
00898       VECT nn0(n0);
00899       VECT nnm(cos(f0+ 0.5*fi), sin(f0+ 0.5*fi));
00900       VECT nn1(cos(f0), sin(f0));
00901 
00902       P<< Qsc_curve<K>(nn0, R.seval(nn0), R.sdiff(nn0),
00903                        nnm, R.seval(nnm),
00904                        nn1, R.seval(nn1), R.sdiff(nn1),
00905                        path );
00906       //return;
00907 
00908       for (int i=1; i<k; i++ )
00909       {
00910         nn0= nn1;
00911         nnm= VECT(cos(f0+(0.5*fi)), sin(f0+ (0.5*fi)) );
00912         f0+=fi; 
00913         nn1= VECT(cos(f0), sin(f0));
00914         P<< Qsc_curve<K>(nn0, R.seval(nn0), R.sdiff(nn0),
00915                          nnm, R.seval(nnm),
00916                          nn1, R.seval(nn1), R.sdiff(nn1),
00917                          path );
00918      }
00919       nn0= nn1;
00920       nnm= VECT(cos(f0+ (0.5*fi) ), sin(f0+ (0.5*fi)));
00921 //      P<< Qsc_curve<K>(nn0, R.seval(nn0), R.sdiff(nn0),
00922 //                       nnm, R.seval(nnm),
00923 //                       n1, R.seval(n1), R.sdiff(n1),
00924 //                       path );
00925 
00926       std::cout<< P.size() <<"\n";
00927       //  for( double s=0.0; s
00928 
00929     };


Member Function Documentation

point<K> nend (  )  [inline]

Definition at line 940 of file qsc_approximation_fcts.hpp.

00940 {return n1; };

point<K> nstart (  )  [inline]

Definition at line 939 of file qsc_approximation_fcts.hpp.

00939 {return n0; };

int orientation (  )  [inline]

Definition at line 941 of file qsc_approximation_fcts.hpp.

00941 {return path; };

Qsc_curve<K>& piece ( const unsigned &  i  )  [inline]

Definition at line 937 of file qsc_approximation_fcts.hpp.

00937 {return P[i]; };

void print ( viewer< axel, default_env > &  axl,
const int &  k = 50 
) [inline]

Definition at line 931 of file qsc_approximation_fcts.hpp.

References Seq< C, R >::size().

00931                                            {
00932 //    int i= 1 + k/P.size();
00933     for ( unsigned j=0; j!=P.size(); j++ )
00934       P[j].print( axl  );
00935   };


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

Generated on 6 Dec 2012 for shape by  doxygen 1.6.1