23char des_coupe_x_C[] =
"$Header: /cvsroot/Lorene/C++/Source/Non_class_members/Graphics/des_coupe_x.C,v 1.6 2014/10/13 08:53:22 j_novak Exp $" ;
88#include "utilitaires.h"
94void des_coupe_x(
const Cmp& uu,
double x0,
int nzdes,
const char* title,
95 const Cmp* defsurf,
double zoom,
bool draw_bound,
96 int ncour,
int ny,
int nz) {
98 const Map& mp = *(uu.get_mp()) ;
100 double a1 = mp.val_r(nzdes-1, 1., M_PI/2., 0.) ;
101 double a2 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI/2.) ;
102 double a3 = mp.val_r(nzdes-1, 1., M_PI/2., M_PI) ;
103 double ray = mp.val_r(nzdes-1, 1., 0., 0.) ;
105 ray = ( a1 > ray ) ? a1 : ray ;
106 ray = ( a2 > ray ) ? a2 : ray ;
107 ray = ( a3 > ray ) ? a3 : ray ;
111 double y_min = mp.get_ori_y() - ray ;
112 double y_max = mp.get_ori_y() + ray ;
113 double z_min = mp.get_ori_z() - ray ;
114 double z_max = mp.get_ori_z() + ray ;
116 des_coupe_x(uu, x0, y_min, y_max, z_min, z_max, title, defsurf, draw_bound,
125void des_coupe_x(
const Cmp& uu,
double x0,
double y_min,
double y_max,
126 double z_min,
double z_max,
const char* title,
const Cmp* defsurf,
127 bool draw_bound,
int ncour,
int ny,
int nz) {
131 const Map& mp = *(uu.get_mp()) ;
136 float* uutab =
new float[ny*nz] ;
138 double hy = (y_max - y_min) /
double(ny-1) ;
139 double hza = (z_max - z_min) /
double(nz-1) ;
141 for (
int j=0; j<nz; j++) {
143 double z = z_min + hza * j ;
145 for (
int i=0; i<ny; i++) {
147 double y = y_min + hy * i ;
150 double r, theta, phi ;
151 mp.convert_absolute(x0, y, z, r, theta, phi) ;
153 uutab[ny*j+i] = float(uu.val_point(r, theta, phi)) ;
157 float ymin1 = float(y_min / km) ;
158 float ymax1 = float(y_max / km) ;
159 float zmin1 = float(z_min / km) ;
160 float zmax1 = float(z_max / km) ;
162 const char* nomy =
"y [km]" ;
163 const char* nomz =
"z [km]" ;
169 const char* device = 0x0 ;
170 int newgraph = ( (defsurf != 0x0) || draw_bound ) ? 1 : 3 ;
172 des_equipot(uutab, ny, nz, ymin1, ymax1, zmin1, zmax1, ncour, nomy, nomz,
173 title, device, newgraph) ;
180 if (defsurf != 0x0) {
182 assert(defsurf->get_mp() == uu.get_mp()) ;
184 newgraph = draw_bound ? 0 : 2 ;
196 int ndom = mp.get_mg()->get_nzone() ;
198 for (
int l=0; l<ndom-1; l++) {
201 newgraph = (l == ndom-2) ? 2 : 0 ;
void des_domaine_x(const Map &mp, int l0, double x0, const char *device=0x0, int newgraph=3, double y_min=-1, double y_max=1, double z_min=-1, double z_max=1, const char *nomy=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 X=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=0x0, int newgraph=3, int nxpage=1, int nypage=1)
Basic routine for drawing isocontours.
void des_coupe_x(const Scalar &uu, double x0, int nzdes, const char *title=0x0, const Scalar *defsurf=0x0, double zoom=1.2, bool draw_bound=true, int ncour=15, int ny=100, int nz=100)
Draws isocontour lines of a Scalar in a plane X=constant.
void des_surface_x(const Scalar &defsurf, double x0, const char *device=0x0, int newgraph=3, double y_min=-1, double y_max=1, double z_min=-1, double z_max=1, const char *nomy=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 X=constant.
Standard units of space, time and mass.