84 #include "graphique.h" 86 #include "utilitaires.h" 92 void des_coupe_z(
const Cmp& uu,
double z0,
int nzdes,
const char* title,
93 const Cmp* defsurf,
double zoom,
bool draw_bound,
94 int ncour,
int nx,
int ny) {
96 const Map& mp = *(uu.get_mp()) ;
98 double a1 = mp.val_r(nzdes-1, 1., M_PI/2., 0.) ;
99 double a2 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI/2.) ;
100 double a3 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI) ;
101 double ray = mp.val_r(nzdes-1, 1., 0., 0.) ;
103 ray = ( a1 > ray ) ? a1 : ray ;
104 ray = ( a2 > ray ) ? a2 : ray ;
105 ray = ( a3 > ray ) ? a3 : ray ;
109 double x_min = mp.get_ori_x() - ray ;
110 double x_max = mp.get_ori_x() + ray ;
111 double y_min = mp.get_ori_y() - ray ;
112 double y_max = mp.get_ori_y() + ray ;
114 des_coupe_z(uu, z0, x_min, x_max, y_min, y_max, title, defsurf, draw_bound,
121 void des_coupe_z(
const Cmp& uu,
double z0,
double x_min,
double x_max,
122 double y_min,
double y_max,
const char* title,
const Cmp* defsurf,
123 bool draw_bound,
int ncour,
int nx,
int ny) {
127 const Map& mp = *(uu.get_mp()) ;
132 float* uutab =
new float[ny*nx] ;
134 double hy = (y_max - y_min) /
double(ny-1) ;
135 double hx = (x_max - x_min) /
double(nx-1) ;
137 for (
int j=0; j<ny; j++) {
139 double y = y_min + hy * j ;
141 for (
int i=0; i<nx; i++) {
143 double x = x_min + hx * i ;
146 double r, theta, phi ;
147 mp.convert_absolute(x, y, z0, r, theta, phi) ;
149 uutab[nx*j+i] = float(uu.val_point(r, theta, phi)) ;
153 float ymin1 = float(y_min / km) ;
154 float ymax1 = float(y_max / km) ;
155 float xmin1 = float(x_min / km) ;
156 float xmax1 = float(x_max / km) ;
158 const char* nomy =
"y [km]" ;
159 const char* nomx =
"x [km]" ;
165 const char* device = 0x0 ;
166 int newgraph = ( (defsurf != 0x0) || draw_bound ) ? 1 : 3 ;
168 des_equipot(uutab, nx, ny, xmin1, xmax1, ymin1, ymax1, ncour, nomx, nomy,
169 title, device, newgraph) ;
177 if (defsurf != 0x0) {
179 assert(defsurf->get_mp() == uu.get_mp()) ;
181 newgraph = draw_bound ? 0 : 2 ;
192 int ndom = mp.get_mg()->get_nzone() ;
194 for (
int l=0; l<ndom-1; l++) {
197 newgraph = (l == ndom-2) ? 2 : 0 ;
void des_coupe_z(const Scalar &uu, double z0, int nzdes, const char *title=0x0, const Scalar *defsurf=0x0, double zoom=1.2, bool draw_bound=true, int ncour=15, int nx=100, int ny=100)
Draws isocontour lines of a Scalar in a plane Z=constant.
void des_domaine_z(const Map &mp, int l0, double z0, const char *device=0x0, int newgraph=3, double x_min=-1, double x_max=1, double y_min=-1, double y_max=1, const char *nomx=0x0, const char *nomz=0x0, const char *title=0x0, int nxpage=1, int nypage=1)
Basic routine for drawing the outer boundary of a given domain in a plane Z=constant.
Standard units of space, time and mass.
void des_surface_z(const Scalar &defsurf, double z0, const char *device=0x0, int newgraph=3, double x_min=-1, double x_max=1, double y_min=-1, double y_max=1, const char *nomx=0x0, const char *nomz=0x0, const char *title=0x0, int nxpage=1, int nypage=1)
Basic routine for drawing a stellar surface in a plane Z=constant.
void des_equipot(float *uutab, int nx, int ny, float xmin, float xmax, float ymin, float ymax, int ncour, const char *nomx, const char *nomy, const char *title, const char *device, int newgraph, int nxpage, int nypage)
Basic routine for drawing isocontours.