Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

gunu::bezier_ninfo Class Template Reference

List of all members.

Public Methods

 bezier_ninfo (T in_tol1, T in_tol2)
virtual bool evaluate (const gul::Ptr< T > &dom)
void setCurrentPoint (const EP *inP, const point_ninfo< T, HP, EP > *inSP)

Public Attributes

last_u
last_v
bool last_result
const EP * P
const point_ninfo< T, HP,
EP > * 
SP
Ptr< Ptr< EP > > SKL
tol1
tol2
bool init

template<class T, class HP, class EP>
class gunu::bezier_ninfo< T, HP, EP >


Constructor & Destructor Documentation

template<class T, class HP, class EP>
gunu::bezier_ninfo< T, HP, EP >::bezier_ninfo   in_tol1,
  in_tol2
[inline]
 

Definition at line 109 of file gunu_project.cpp.

References init, P, SKL, tol1, and tol2.

00110           : newton_info<T>( 2, (T)0.0001, in_tol2 )
00111   {
00112     int i;
00113     
00114     tol1 = in_tol1;
00115     tol2 = in_tol2;
00116   
00117     init = false;
00118     P = 0;
00119     SP = 0;
00120    
00121     SKL.reserve_pool(3);
00122     for( i = 0; i < 3; i++ )
00123       SKL[i].reserve_pool(3);
00124   }


Member Function Documentation

template<class T, class HP, class EP>
bool gunu::bezier_ninfo< T, HP, EP >::evaluate const gul::Ptr< T > &    dom [virtual]
 

Definition at line 139 of file gunu_project.cpp.

References gunu::BezierSurfaceDerivatives(), GULAPI, init, last_result, last_u, last_v, P, SKL, SP, tol1, and tol2.

00140 {
00141   T u = dom[0], v = dom[1], rootPS;
00142   EP S, Su, Sv, Suu, Svv, Suv, PS;
00143   T SuSu, SvSv, b1, b2;
00144 
00145   if( init && (u == last_u) && (v == last_v) )
00146     return last_result;
00147   else
00148   {
00149     init = true;
00150     last_u = u;
00151     last_v = v;
00152   }   
00153 
00154   if( u < 0.0 ) u = 0.0;
00155   else if( u > 1.0 ) u = 1.0;  
00156 
00157   if( v < 0.0 ) v = 0.0;
00158   else if( v > 1.0 ) v = 1.0;  
00159 
00160   BezierSurfaceDerivatives( 
00161               u, v,  SP->S[0].pu, SP->S[0].U, SP->S[0].pv, SP->S[0].V, 
00162               SP->S[0].Pw, 2, SKL );
00163 
00164   S = SKL[0][0];
00165   Su = SKL[1][0];
00166   Sv = SKL[0][1];
00167   Suu = SKL[2][0];
00168   Suv = SKL[1][1];
00169   Svv = SKL[0][2];
00170 
00171   PS = S - *P;
00172   SuSu = Su*Su;
00173   SvSv = Sv*Sv;
00174 
00175   fjac[0][0] = PS*Suu + SuSu;
00176   fjac[0][1] = fjac[1][0] = PS*Suv + Su*Sv;
00177   fjac[1][1] = PS*Svv + SvSv;
00178   
00179   fvec[0] = Su*PS;
00180   fvec[1] = Sv*PS;
00181 
00182   if( rel_equal(S,*P,tol1) )
00183   {
00184     last_result = true;
00185     return true;
00186   }
00187 
00188   rootPS = rtr<T>::sqrt(PS*PS);
00189   b1 = rtr<T>::sqrt(SuSu)*rootPS;
00190   b2 = rtr<T>::sqrt(SvSv)*rootPS;
00191 
00192   if( rel_equal(fvec[0]+b1,b1,tol2) &&
00193       rel_equal(fvec[1]+b2,b2,tol2) )
00194   {
00195     last_result = true;
00196     return true;
00197   }
00198 
00199   last_result = false;
00200   return false;
00201 }

template<class T, class HP, class EP>
void gunu::bezier_ninfo< T, HP, EP >::setCurrentPoint const EP *    inP,
const point_ninfo< T, HP, EP > *    inSP
[inline]
 

Definition at line 128 of file gunu_project.cpp.

References init, and P.

00129   {
00130     init = false;
00131 
00132     P = inP;
00133     SP = inSP; 
00134   }


Member Data Documentation

template<class T, class HP, class EP>
bool gunu::bezier_ninfo::init
 

Definition at line 107 of file gunu_project.cpp.

Referenced by bezier_ninfo(), evaluate(), and setCurrentPoint().

template<class T, class HP, class EP>
bool gunu::bezier_ninfo::last_result
 

Definition at line 101 of file gunu_project.cpp.

Referenced by evaluate().

template<class T, class HP, class EP>
T gunu::bezier_ninfo::last_u
 

Definition at line 99 of file gunu_project.cpp.

Referenced by evaluate().

template<class T, class HP, class EP>
T gunu::bezier_ninfo::last_v
 

Definition at line 100 of file gunu_project.cpp.

Referenced by evaluate().

template<class T, class HP, class EP>
const EP* gunu::bezier_ninfo::P
 

Definition at line 102 of file gunu_project.cpp.

Referenced by bezier_ninfo(), evaluate(), and setCurrentPoint().

template<class T, class HP, class EP>
Ptr< Ptr<EP> > gunu::bezier_ninfo::SKL
 

Definition at line 104 of file gunu_project.cpp.

Referenced by bezier_ninfo(), and evaluate().

template<class T, class HP, class EP>
const point_ninfo<T,HP,EP>* gunu::bezier_ninfo::SP
 

Definition at line 103 of file gunu_project.cpp.

Referenced by evaluate().

template<class T, class HP, class EP>
T gunu::bezier_ninfo::tol1
 

Definition at line 105 of file gunu_project.cpp.

Referenced by bezier_ninfo(), and evaluate().

template<class T, class HP, class EP>
T gunu::bezier_ninfo::tol2
 

Definition at line 106 of file gunu_project.cpp.

Referenced by bezier_ninfo(), and evaluate().


The documentation for this class was generated from the following file:
Generated on Mon Jan 21 04:18:11 2002 for GUL 0.6 - Geometry Utility Library by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001