00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef __BASE_VECT_H_
00031 #define __BASE_VECT_H_
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083 #include <stdio.h>
00084 #include "headcpp.h"
00085
00086
00087 class Tenseur ;
00088
00089
00090
00091
00092
00098 class Base_vect {
00099
00100
00101
00102 protected:
00103 char name[100] ;
00104
00105
00106
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
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
00142
00143 public:
00144 const char* get_name() const ;
00145
00149 virtual int identify() const = 0 ;
00150
00151
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
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
00187
00188
00189
00194 class Base_vect_cart : public Base_vect {
00195
00196
00197
00198 private:
00200 double rot_phi ;
00201
00210 int align ;
00211
00212
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
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
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
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
00294
00295
00296
00301 class Base_vect_spher : public Base_vect {
00302
00303
00304
00305 private:
00306 double ori_x ;
00307 double ori_y ;
00308 double ori_z ;
00309
00311 double rot_phi ;
00312
00313
00314
00315
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
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
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
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