Changeset 2399 in Sophya for trunk/SophyaPI/PI/pisurfdr.cc
- Timestamp:
- Jun 6, 2003, 4:57:47 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pisurfdr.cc
r2164 r2399 45 45 arr->XYfromxy(0,0,mXmin, mYmin); 46 46 arr->XYfromxy(arr->XSize(),arr->YSize(),mXmax, mYmax); 47 double scm=1.; 48 if (asxy) { 49 mScy = (mXmax-mXmin)/(mYmax-mYmin); 50 scm = mXmax-mXmin; 51 } 52 else scm = ((mXmax-mXmin) > (mYmax-mYmin)) ? (mXmax-mXmin) : (mYmax-mYmin); 47 48 mAutoScaleXY = asxy; 49 mAutoScaleZ = asz; 50 53 51 int i,j; double cv; 54 52 mZmin = mZmax = arr->Value(0,0); … … 60 58 } 61 59 if ((mZmax-mZmin) <= 1.e-19) mZmax = mZmin + 1.e-19; 62 if (asz) mScz = scm/(mZmax-mZmin);63 60 // printf("PISurfaceDrawer::PISurfaceDrawer Min/Max: %g,%g %g,%g %g,%g Sc: %g %g %g \n", 64 61 // mXmin, mXmax, mYmin, mYmax, mZmin, mZmax, mScx, mScy, mScz); … … 82 79 { 83 80 if (mArr == NULL) return; 81 ComputeScaleFactor(mXmin, mXmax, mYmin, mYmax, mZmin, mZmax, 82 mAutoScaleXY, mAutoScaleZ, mScy, mScz); 84 83 double xmin, xmax, ymin, ymax, zmin, zmax; 85 84 xmin = mXmin*mScx; xmax = mXmax*mScx; … … 96 95 (xmin+xmax)/2.+D , (ymin+ymax)/2.-2.5*D , zmin+(zmax-zmin)*0.85, 0.25, 0.25); 97 96 98 Set3DBox(xmin, xmax, ymin, ymax, zmin-PERC_GARDE*(zmax-zmin), zmax+PERC_GARDE*(zmax-zmin)); 97 Set3DBox(xmin, xmax, ymin, ymax, zmin-PERC_GARDE*(zmax-zmin), 98 zmax+PERC_GARDE*(zmax-zmin), mScx, mScy, mScz); 99 99 100 100 // printf("PISurfaceDrawer::UpdateLimits() : %g-%g %g-%g %g-%g (%g) \n", xmin,xmax,ymin,ymax,zmin,zmax,D); … … 119 119 } 120 120 121 /* --Methode-- */121 /* --Methode-- 122 122 void PISurfaceDrawer::DrawAxes(PIGraphicUC* g) 123 123 { … … 132 132 mZmin-PERC_GARDE*(mZmax-mZmin),mZmax+PERC_GARDE*(mZmax-mZmin)); 133 133 } 134 */ 134 135 135 136 /* --Methode-- */ … … 289 290 delete[] zw; 290 291 } 292 293 /* --Methode-- */ 294 int PISurfaceDrawer::DecodeOptionString(vector<string> & opt, bool rmdecopt) 295 { 296 int optsz1 = opt.size(); 297 if(optsz1<1) return(0); 298 // On appelle d'abord le decodage de la classe PIDrawer de laquelle 299 // on herite. (Pas obligatoire) on decode donc ici les attributs de 300 // couleur, fontes ... 301 int ndec1 = PIDrawer::DecodeOptionString(opt, rmdecopt); 302 if(optsz1-ndec1<1) return(ndec1); // si tout a ete decode 303 304 vector<string> udopt; // On gardera ici les options non decodees 305 unsigned int k = 0; 306 int ndec = opt.size(); 307 for( k=0; k<opt.size(); k++ ) { 308 string opts = opt[k]; 309 if (opts == "rescalexy") mAutoScaleXY = true; 310 else if (opts == "norescalexy") mAutoScaleXY = false; 311 else if (opts == "rescalez") mAutoScaleZ = true; 312 else if (opts == "norescalez") mAutoScaleZ = false; 313 else { 314 // Si option non decode 315 ndec--; 316 // S'il faut supprimer les options decodees 317 if (rmdecopt) udopt.push_back(opts); 318 } 319 } 320 // S'il faut supprimer les options decodees, on remplace l'argument opt 321 // par le vecteur des options non decodees. 322 if (rmdecopt) opt = udopt; 323 return(ndec+ndec1); 324 } 325 326 /* --Methode-- */ 327 void PISurfaceDrawer::GetOptionsHelpInfo(string& info) 328 { 329 info += " ---- PISurfaceDrawer options help info : \n" ; 330 info += " rescalexy / norescalexy rescalez / norescalez \n"; 331 info += " and usual color/line/marker/... attribute decoding \n"; 332 // On recupere ensuite la chaine info de la classe de base 333 PIDrawer::GetOptionsHelpInfo(info); 334 return; 335 }
Note:
See TracChangeset
for help on using the changeset viewer.