00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 char des_coupe_y_C[] = "$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Graphics/des_coupe_y.C,v 1.4 2008/08/19 06:42:00 j_novak Exp $" ;
00024
00025
00026
00027
00028
00029
00030
00031
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 #include <math.h>
00078
00079
00080 #include "cmp.h"
00081 #include "graphique.h"
00082 #include "param.h"
00083 #include "utilitaires.h"
00084 #include "unites.h"
00085
00086
00087
00088 void des_coupe_y(const Cmp& uu, double y0, int nzdes, const char* title,
00089 const Cmp* defsurf, double zoom, bool draw_bound,
00090 int ncour, int nx, int nz) {
00091
00092 const Map& mp = *(uu.get_mp()) ;
00093
00094 double a1 = mp.val_r(nzdes-1, 1., M_PI/2., 0.) ;
00095 double a2 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI/2.) ;
00096 double a3 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI) ;
00097 double ray = mp.val_r(nzdes-1, 1., 0., 0.) ;
00098
00099 ray = ( a1 > ray ) ? a1 : ray ;
00100 ray = ( a2 > ray ) ? a2 : ray ;
00101 ray = ( a3 > ray ) ? a3 : ray ;
00102
00103 ray *= zoom ;
00104
00105 double x_min = mp.get_ori_x() - ray ;
00106 double x_max = mp.get_ori_x() + ray ;
00107 double z_min = mp.get_ori_z() - ray ;
00108 double z_max = mp.get_ori_z() + ray ;
00109
00110 des_coupe_y(uu, y0, x_min, x_max, z_min, z_max, title, defsurf, draw_bound,
00111 ncour, nx, nz) ;
00112
00113 }
00114
00115
00116
00117 void des_coupe_y(const Cmp& uu, double y0, double x_min, double x_max,
00118 double z_min, double z_max, const char* title, const Cmp* defsurf,
00119 bool draw_bound, int ncour, int nx, int nz) {
00120
00121 using namespace Unites ;
00122
00123 const Map& mp = *(uu.get_mp()) ;
00124
00125
00126
00127
00128 float* uutab = new float[nx*nz] ;
00129
00130 double hx = (x_max - x_min) / double(nx-1) ;
00131 double hza = (z_max - z_min) / double(nz-1) ;
00132
00133
00134
00135 for (int j=0; j<nz; j++) {
00136
00137 double z = z_min + hza * j ;
00138
00139 for (int i=0; i<nx; i++) {
00140
00141 double x = x_min + hx * i ;
00142
00143
00144 double r, theta, phi ;
00145 mp.convert_absolute(x, y0, z, r, theta, phi) ;
00146
00147 uutab[nx*j+i] = float(uu.val_point(r, theta, phi)) ;
00148 }
00149 }
00150
00151 float xmin1 = float(x_min / km) ;
00152 float xmax1 = float(x_max / km) ;
00153 float zmin1 = float(z_min / km) ;
00154 float zmax1 = float(z_max / km) ;
00155
00156 const char* nomx = "x [km]" ;
00157 const char* nomz = "z [km]" ;
00158
00159 if (title == 0x0) {
00160 title = "" ;
00161 }
00162
00163
00164 const char* device = 0x0 ;
00165 int newgraph = ( (defsurf != 0x0) || draw_bound ) ? 1 : 3 ;
00166
00167 des_equipot(uutab, nx, nz, xmin1, xmax1, zmin1, zmax1, ncour, nomx, nomz,
00168 title, device, newgraph) ;
00169
00170
00171
00172
00173 if (defsurf != 0x0) {
00174
00175 assert(defsurf->get_mp() == uu.get_mp()) ;
00176
00177 newgraph = draw_bound ? 0 : 2 ;
00178
00179 des_surface_y(*defsurf, y0, device, newgraph) ;
00180
00181 }
00182
00183 delete [] uutab ;
00184
00185
00186
00187
00188 if (draw_bound) {
00189
00190 int ndom = mp.get_mg()->get_nzone() ;
00191
00192 for (int l=0; l<ndom-1; l++) {
00193
00194
00195 newgraph = (l == ndom-2) ? 2 : 0 ;
00196
00197 des_domaine_y(mp, l, y0, device, newgraph) ;
00198 }
00199 }
00200
00201
00202 }