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

RotProfToProfAxisCAO Struct Reference

#include <Modeleur.hpp>

Inheritance diagram for RotProfToProfAxisCAO::

AxisCAO RotAxisCAO List of all members.

Public Methods

 RotProfToProfAxisCAO (Cardinal c, Sommet3D *pf, Sommet3D *pf1, double a, UINT p, Vector3D &v, char *name=NULL)
int GenerateVertex (FILE *f)
numerotationAllocNumerotation ()
char * GetErrorMsg ()

Public Attributes

double angle
Sommet3Dprofil1

Constructor & Destructor Documentation

RotProfToProfAxisCAO::RotProfToProfAxisCAO Cardinal    c,
Sommet3D   pf,
Sommet3D   pf1,
double    a,
UINT    p,
Vector3D   v,
char *    name = NULL
[inline]
 

Definition at line 71 of file Modeleur.hpp.

00077                                               : angle  (a),
00078                                                 profil1(pf1),
00079                                                 AxisCAO( name,
00080                                                             c,
00081                                                             pf,
00082                                                             v,
00083                                                             p   ) { }


Member Function Documentation

numerotation * RotProfToProfAxisCAO::AllocNumerotation   [virtual]
 

Reimplemented from AxisCAO.

Definition at line 169 of file Modeleur.cpp.

00170 {
00171 if ( globalresult.type.phor == HOR_CLOSE )
00172    {
00173    if ( globalresult.type.pvert == VERT_OPEN )
00174       switch ( globalresult.type.ponaxis )
00175      {
00176    case EXTR_BOTH : return new FermeOuvertOnAxisBoth(pas-1,cardprofil-1);
00177    case EXTR_SUP  : return new FermeOuvertOnAxisSup(pas-1,cardprofil-1);
00178    case EXTR_INF  : return new FermeOuvertOnAxisInf(pas-1,cardprofil-1);
00179    default        : return new FermeOuvert(pas-1,cardprofil-1) ;
00180      }
00181    return new FermeFerme(pas-1,cardprofil-2); // le dernier point
00182                       //  est suprimé !!!
00183    }
00184 
00185  if ( globalresult.type.pvert == VERT_CLOSE )
00186     return new OuvertFerme(pas-1,cardprofil-2);
00187 
00188  switch ( globalresult.type.ponaxis )
00189       {
00190       case EXTR_BOTH : return new OuvertOuvertOnAxisBoth(pas-1,cardprofil-1);
00191       case EXTR_SUP  : return new OuvertOuvertOnAxisSup(pas-1,cardprofil-1);
00192       case EXTR_INF  : return new OuvertOuvertOnAxisInf(pas-1,cardprofil-1);
00193       default        : return new OuvertOuvert(pas-1,cardprofil-1)   ;
00194       }
00195 }

int RotProfToProfAxisCAO::GenerateVertex FILE *    f [virtual]
 

Reimplemented from AxisCAO.

Definition at line 77 of file Modeleur.cpp.

00078 {
00079   int           error;
00080   Sommet3D*     tbl;
00081   UINT          card;
00082 
00083   realtype      sinalpha, cosalpha,
00084                 sinbeta,  cosbeta,
00085                 lgr, x, y, z;
00086 
00087   x =  axis.b.x - axis.a.x;
00088   y =  axis.b.y - axis.a.y;
00089   z =  axis.b.z - axis.a.z;
00090   lgr = sqrt( x*x + y*y + z*z );
00091 
00092   /* 90-beta; 90-alpha;*/
00093 
00094   cosalpha = (z == 0)?(0):(lgr/z);
00095   sinalpha = sqrt( 1 - (cosalpha*cosalpha) );
00096   cosbeta  = (x == 0)?(0):(lgr/x);
00097   sinbeta  = sqrt( 1-(cosbeta*cosbeta));
00098 
00099   // on effectue les changements de repere vers l'axe Z.
00100   // ---------------------------------------------------
00101 
00102   for( UINT i = 0; i != cardprofil; i++ ) {
00103     TransVertex ( profil+i, -axis.a.x, -axis.a.y, -axis.a.z );
00104     RotateVertex( profil+i, cosbeta, sinbeta, Z_AXIS );
00105     RotateVertex( profil+i, cosalpha, -sinalpha, Y_AXIS );
00106   };
00107 
00108   // on génère la forme.
00109   // -------------------
00110   if ( ( error = ModeleurRotationZ( 
00111          profil,
00112          profil1,
00113          (UINT) cardprofil,
00114          &tbl,
00115          &card,
00116          &(globalresult.type),
00117         angle,
00118         pas        
00119 
00120       ) ) != SUCCESS ) return globalresult.error =error;
00121 
00122   // On retransforme en inverse.
00123   // --------------------------
00124   // nb- On rappelle : cos(-a) = cos (a) et sin(-a) = -sin(a).
00125   // ---------------------------------------------------------
00126   for ( i = 0; i != card; i++ )
00127       {
00128       RotateVertex( tbl+i, cosalpha, sinalpha, Y_AXIS );
00129       RotateVertex( tbl+i, cosbeta, -sinbeta, Z_AXIS );
00130       TransVertex ( tbl+i, axis.a.x, axis.a.y, axis.a.z );
00131       }
00132   for ( i = 0; i != cardprofil; i++ )
00133       {
00134       RotateVertex( profil+i, cosalpha, sinalpha, Y_AXIS );
00135       RotateVertex( profil+i, cosbeta, -sinbeta, Z_AXIS );
00136       TransVertex ( profil+i, axis.a.x, axis.a.y, axis.a.z );
00137       }
00138 
00139   // La boite limite.
00140   // ----------------
00141   BoiteLim  bl;
00142   SetBoiteLimite( tbl, card,&bl );
00143 
00144   // On sauve sur fichier.
00145   // ---------------------
00146   if ( fprintf ( f, "%f %f %f %f %f %f\n%u\n", bl.S1.x,
00147                      bl.S1.y,
00148                      bl.S1.z,
00149                      bl.S2.x,
00150                      bl.S2.y,
00151                      bl.S2.z,
00152                      card    ) == EOF )
00153           return globalresult.error =MOD_SOM_ERROR_BAD_FIC_WRITE;
00154 
00155   for ( i = 0; i != card; i++ )
00156       if ( fprintf ( f, "%lf %lf %lf\n", tbl[i].x,
00157                    tbl[i].y,
00158                    tbl[i].z   ) == EOF )
00159    return globalresult.error =MOD_SOM_ERROR_BAD_FIC_WRITE;
00160 
00161   fprintf ( f, "\n" );
00162 
00163   // on met à jour les renseignements.
00164   // ---------------------------------
00165   globalresult.cardsommet    = card;
00166 
00167   return SUCCESS; }

char * RotProfToProfAxisCAO::GetErrorMsg   [virtual]
 

Reimplemented from AxisCAO.

Definition at line 336 of file Modeleur.cpp.

00336                                         {
00337  if ( globalresult.error >= __ReservedMsg)
00338      return  G_modetbmsg[ globalresult.error - __ReservedMsg ];
00339   return GetModelRotatErrorMsg( globalresult.error  );
00340 }


Member Data Documentation

double RotProfToProfAxisCAO::angle
 

Definition at line 68 of file Modeleur.hpp.

Sommet3D* RotProfToProfAxisCAO::profil1
 

Definition at line 69 of file Modeleur.hpp.


The documentation for this struct was generated from the following files:
Generated on Sun Oct 14 18:49:35 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001