base_vect.h

00001 /*
00002  *  Definition of Lorene classes Base_vect
00003  *               Base_vect_cart
00004  *               Base_vect_spher
00005  *
00006  */
00007 
00008 /*
00009  *   Copyright (c) 2000-2001 Eric Gourgoulhon
00010  *
00011  *   This file is part of LORENE.
00012  *
00013  *   LORENE is free software; you can redistribute it and/or modify
00014  *   it under the terms of the GNU General Public License as published by
00015  *   the Free Software Foundation; either version 2 of the License, or
00016  *   (at your option) any later version.
00017  *
00018  *   LORENE is distributed in the hope that it will be useful,
00019  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00020  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00021  *   GNU General Public License for more details.
00022  *
00023  *   You should have received a copy of the GNU General Public License
00024  *   along with LORENE; if not, write to the Free Software
00025  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00026  *
00027  */
00028 
00029 
00030 #ifndef __BASE_VECT_H_ 
00031 #define __BASE_VECT_H_ 
00032 
00033 
00034 /*
00035  * $Id: base_vect.h,v 1.5 2004/03/22 13:12:40 j_novak Exp $
00036  * $Log: base_vect.h,v $
00037  * Revision 1.5  2004/03/22 13:12:40  j_novak
00038  * Modification of comments to use doxygen instead of doc++
00039  *
00040  * Revision 1.4  2002/10/16 14:36:28  j_novak
00041  * Reorganization of #include instructions of standard C++, in order to
00042  * use experimental version 3 of gcc.
00043  *
00044  * Revision 1.3  2002/09/13 09:17:31  j_novak
00045  * Modif. commentaires
00046  *
00047  * Revision 1.2  2002/06/17 14:05:16  j_novak
00048  * friend functions are now also declared outside the class definition
00049  *
00050  * Revision 1.1.1.1  2001/11/20 15:19:27  e_gourgoulhon
00051  * LORENE
00052  *
00053  * Revision 2.6  2000/02/28  15:42:15  eric
00054  * Ajout de la fonction Base_vect_cart::get_align().
00055  *
00056  * Revision 2.5  2000/02/09  14:45:40  eric
00057  * *** empty log message ***
00058  *
00059  * Revision 2.4  2000/02/09  13:22:50  eric
00060  * REFONTE COMPLETE DE LA CLASSE
00061  * L'identification n'est plus base sur un membre statique (numero
00062  *  d'instance) mais sur les caracteres physiques (rot_phi, etc...)
00063  * Ajout des constructeurs par copie et lecture de fichier.
00064  *
00065  * Revision 2.3  2000/01/12  16:27:13  eric
00066  * Les constructeurs a un seul argument sont declares explicit.
00067  *
00068  * Revision 2.2  2000/01/10  13:34:52  eric
00069  * Modif commentairez.
00070  *
00071  * Revision 2.1  2000/01/10  13:26:49  eric
00072  * Ajout de la fonction set_rot_phi.
00073  *
00074  * Revision 2.0  2000/01/10  12:43:15  eric
00075  * *** empty log message ***
00076  *
00077  *
00078  * $Header: /cvsroot/Lorene/C++/Include/base_vect.h,v 1.5 2004/03/22 13:12:40 j_novak Exp $
00079  *
00080  */
00081 
00082 // Headers C
00083 #include <stdio.h>
00084 #include "headcpp.h"
00085 
00086 // Lorene classes
00087 class Tenseur ; 
00088 
00089             //-----------------------------------//
00090             //      class Base_vect (base class) //
00091             //-----------------------------------//
00092 
00098 class Base_vect {
00099     
00100     // Data : 
00101     // -----
00102     protected:
00103     char name[100] ;        
00104 
00105 
00106     // Constructors - Destructor
00107     // -------------------------
00108     
00109     protected:
00110     Base_vect() ;               
00111 
00113     explicit Base_vect(const char* name_i) ; 
00114 
00115     Base_vect(const Base_vect& ) ;  
00116      
00117     protected:
00123     explicit Base_vect(FILE* ) ; 
00124 
00125     public:
00126     virtual ~Base_vect() ;          
00127 
00128     // Mutator / Assignment
00129     // --------------------
00130 
00131     private:
00133     void operator=(const Base_vect& ) ;   
00134 
00135 
00136     public: 
00138     void set_name(const char* name_i) ; 
00139 
00140 
00141     // Extraction of information
00142     // -------------------------
00143     public:
00144     const char* get_name() const ;  
00145     
00149     virtual int identify() const = 0 ; 
00150 
00151     // Outputs
00152     // -------
00153     public:
00154     virtual void sauve(FILE* ) const ;  
00155 
00157     friend ostream& operator<<(ostream& , const Base_vect& ) ;  
00158 
00159     protected: 
00160     virtual ostream& operator>>(ostream &) const = 0 ;    
00161 
00162     // Miscellaneous
00163     // -------------
00164     
00165     public:
00169     static Base_vect* bvect_from_file(FILE* ) ; 
00170 
00172     virtual bool operator==(const Base_vect& ) const = 0 ;  
00173 
00175     bool operator!=(const Base_vect& ) const ;  
00176     
00178     virtual void change_basis(Tenseur& ) const = 0 ; 
00179 
00180 };
00181 
00182 ostream& operator<<(ostream& , const Base_vect& ) ; 
00183 
00184 
00185             //-----------------------------------//
00186             //      class Base_vect_cart     //
00187             //-----------------------------------//
00188 
00189 
00194 class Base_vect_cart : public Base_vect {
00195     
00196     // Data : 
00197     // -----
00198     private:
00200     double rot_phi ;    
00201 
00210     int align ; 
00211 
00212     // Constructors - Destructor
00213     // -------------------------
00214     
00215     public:
00216     explicit Base_vect_cart(double rot_phi_i) ;   
00217 
00219     Base_vect_cart(double rot_phi_i, const char* name_i) ; 
00220 
00221     Base_vect_cart(const Base_vect_cart& ) ;    
00222      
00223     protected:
00229     explicit Base_vect_cart(FILE* ) ; 
00230 
00232     friend Base_vect* Base_vect::bvect_from_file(FILE* ) ; 
00233 
00234     public:
00235     virtual ~Base_vect_cart() ;         
00236 
00237     // Mutators
00238     // --------
00239 
00240     public:
00242     void operator=(const Base_vect_cart& ) ;
00243 
00247     void set_rot_phi(double rot_phi_i) ; 
00248 
00249     private: 
00251     void set_align() ; 
00252     
00253     // Miscellaneous
00254     // -------------
00255 
00256     public:     
00258     virtual bool operator==(const Base_vect& ) const ; 
00259 
00261     virtual void change_basis(Tenseur& ) const ; 
00262 
00266     virtual int identify() const ; 
00267 
00278     int get_align() const {return align;} ; 
00279 
00280     // Outputs
00281     // -------
00282 
00283     public: 
00284     virtual void sauve(FILE* ) const ;  
00285 
00286     protected: 
00287     virtual ostream& operator>>(ostream &) const ;    
00288 
00289 
00290 };
00291 
00292             //-----------------------------------//
00293             //      class Base_vect_spher    //
00294             //-----------------------------------//
00295 
00296 
00301 class Base_vect_spher : public Base_vect {
00302     
00303     // Data : 
00304     // -----
00305     private:
00306     double ori_x ;      
00307     double ori_y ;      
00308     double ori_z ;      
00309     
00311     double rot_phi ;    
00312 
00313     
00314 
00315     // Constructors - Destructor
00316     // -------------------------
00317     
00318     public:
00319     Base_vect_spher(double xa0, double ya0, double za0,  
00320             double rot_phi_i) ;   
00321 
00323     Base_vect_spher(double xa0, double ya0, double za0, 
00324             double rot_phi_i, const char* name_i) ; 
00325 
00326     Base_vect_spher(const Base_vect_spher& ) ;  
00327      
00328     protected:
00334     explicit Base_vect_spher(FILE* ) ; 
00335 
00337     friend Base_vect* Base_vect::bvect_from_file(FILE* ) ; 
00338 
00339     public:
00340     virtual ~Base_vect_spher() ;            
00341 
00342     // Mutators
00343     // --------
00344     public:
00346     void operator=(const Base_vect_spher& ) ;
00347 
00348     public:
00350     void set_ori(double xa0, double ya0, double za0) ;  
00351 
00355     void set_rot_phi(double rot_phi_i) ; 
00356 
00357     // Miscellaneous
00358     // -------------
00359         
00360     public:     
00362     virtual bool operator==(const Base_vect& ) const ; 
00363 
00365     virtual void change_basis(Tenseur& ) const ; 
00366 
00370     virtual int identify() const ; 
00371 
00372     // Outputs
00373     // -------
00374 
00375     public: 
00376     virtual void sauve(FILE* ) const ;  
00377 
00378     protected: 
00379     virtual ostream& operator>>(ostream &) const ;    
00380 
00381 
00382 };
00383 
00384 #endif

Generated on Tue Feb 7 01:35:14 2012 for LORENE by  doxygen 1.4.6