* More...
#include <qsc_approximation_fcts.hpp>
*
Definition at line 68 of file qsc_approximation_fcts.hpp.
Bezier_curve | ( | ) | [inline] |
Definition at line 71 of file qsc_approximation_fcts.hpp.
Referenced by Bezier_curve< K >::subdiv().
Bezier_curve | ( | const point< K > & | a, | |
const point< K > & | b, | |||
const point< K > & | c | |||
) | [inline] |
Definition at line 73 of file qsc_approximation_fcts.hpp.
Bezier_curve | ( | const point< K > & | a, | |
const point< K > & | b, | |||
const point< K > & | c, | |||
const point< K > & | d | |||
) | [inline] |
Definition at line 78 of file qsc_approximation_fcts.hpp.
Bezier_curve | ( | int | n | ) | [inline] |
Definition at line 83 of file qsc_approximation_fcts.hpp.
Bezier_curve | ( | Seq< point< K > > & | cpts | ) | [inline] |
Definition at line 84 of file qsc_approximation_fcts.hpp.
bool ccw | ( | const int & | i = 0 |
) | const [inline] |
Definition at line 87 of file qsc_approximation_fcts.hpp.
Definition at line 106 of file qsc_approximation_fcts.hpp.
int degree | ( | ) | const [inline] |
Definition at line 107 of file qsc_approximation_fcts.hpp.
References Seq< C, R >::size().
Referenced by Bezier_curve< K >::diff(), Bezier_curve< K >::eval(), and Bezier_curve< K >::subdiv().
Bezier_curve diff | ( | ) | const [inline] |
Definition at line 119 of file qsc_approximation_fcts.hpp.
References Bezier_curve< K >::degree().
Referenced by Bezier_curve< K >::normal().
00119 { 00120 int n=degree(); 00121 Bezier_curve D(n-1); 00122 for (int k=0; k<n ; k++ ) 00123 D[k]= n* ( cpoints[k+1]-cpoints[k] ); 00124 return D; 00125 }
point<K> eval | ( | const K & | t | ) | const [inline] |
Definition at line 110 of file qsc_approximation_fcts.hpp.
References Bezier_curve< K >::degree().
Referenced by Bezier_curve< K >::normal(), and Bezier_curve< K >::sample().
00111 { 00112 Seq<VECT> tmp(cpoints); 00113 for (int k=degree() ; k!=0; k-- ) 00114 for (int i=0; i!=k; i++ ) 00115 tmp[i]= (1.0-t)*tmp[i]+t*tmp[i+1] ; 00116 return tmp[0]; 00117 }
point<K> normal | ( | const K & | t | ) | const [inline] |
Definition at line 95 of file qsc_approximation_fcts.hpp.
References Bezier_curve< K >::diff(), Bezier_curve< K >::eval(), and mmx::shape::orth_vect().
Referenced by Bezier_curve< K >::unormal().
int npoints | ( | ) | const [inline] |
Definition at line 108 of file qsc_approximation_fcts.hpp.
References Seq< C, R >::size().
point<K>& operator[] | ( | const int & | i | ) | [inline] |
Definition at line 105 of file qsc_approximation_fcts.hpp.
point<K> operator[] | ( | const int & | i | ) | const [inline] |
Definition at line 104 of file qsc_approximation_fcts.hpp.
void print | ( | viewer< axel, default_env > & | axl, | |
const int & | k = 50 | |||
) | [inline] |
Definition at line 165 of file qsc_approximation_fcts.hpp.
References Bezier_curve< K >::sample().
00165 { 00166 00167 Seq<VECT> P; 00168 sample(P, k); 00169 00170 axl<<" <curve type=\"mesh\">\n<vect>\nVECT\n"; 00171 axl<< k-1 <<" " 00172 <<2*k-2<<" " 00173 <<k-1<<"\n"; 00174 for(int i=1; i!=k;i++) axl<<"2 ";// 00175 axl<<"\n"; 00176 for(int i=1; i!=k;i++) axl<<"1 ";// 00177 axl<<"\n"; 00178 00179 for(int i=1; i!=k;i+=1) 00180 axl<< P[i-1].x()<<" "<< P[i-1].y()<< " 0 " << 00181 P[i].x()<<" "<< P[i].y()<< " 0 \n"; 00182 00183 for(int i=1; i!=k;i++) 00184 axl<< "0.314 0.979 1 1\n"; 00185 axl<<" </vect>\n </curve>\n"; 00186 00187 };
Definition at line 158 of file qsc_approximation_fcts.hpp.
References Bezier_curve< K >::eval(), and Seq< C, R >::size().
00159 { 00160 for (unsigned i=0; i!= TT.size(); i++ ) 00161 P << eval( TT[i] ); 00162 };
Definition at line 147 of file qsc_approximation_fcts.hpp.
References Bezier_curve< K >::eval().
Referenced by Bezier_curve< K >::print().
00148 { 00149 K t( 1.0/ K(k-1) ); 00150 00151 P << cpoints[0]; 00152 for (int i=1; i!=k-1; i++ ) 00153 P << eval(i*t); 00154 P << cpoints[ cpoints.size()-1 ]; 00155 };
Seq<Bezier_curve> subdiv | ( | const K | t = (K)0.5 |
) | const [inline] |
Definition at line 127 of file qsc_approximation_fcts.hpp.
References Bezier_curve< K >::Bezier_curve(), and Bezier_curve< K >::degree().
00127 { 00128 int n=degree(); 00129 Seq<VECT> l(n+1), r(cpoints); 00130 int k,i,j=0; 00131 00132 for (k = degree(); k!= 0; k--, j++ ) 00133 { 00134 l[j] = r[0]; 00135 for ( i = 0; i != k; i++ ) 00136 r[i] = ((K)1.0-t)*r[i]+t*r[i+1]; 00137 } 00138 l[j] = r[0]; 00139 00140 Seq<Bezier_curve> S; 00141 S<< Bezier_curve(l) <<Bezier_curve(r); 00142 return S; 00143 }
point<K> unormal | ( | const K & | t | ) | const [inline] |
Definition at line 98 of file qsc_approximation_fcts.hpp.
References Bezier_curve< K >::normal(), and VECT.