Changeset 2399 in Sophya for trunk/SophyaPI/PI/pisurfdr.cc


Ignore:
Timestamp:
Jun 6, 2003, 4:57:47 PM (22 years ago)
Author:
ansari
Message:

Modifs pour la prise en charge du trace d'axes par ls BaseDrawer ds les traces 3D - Reza 6 Juin 2003

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/pisurfdr.cc

    r2164 r2399  
    4545  arr->XYfromxy(0,0,mXmin, mYmin);
    4646  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
    5351  int i,j;   double cv;
    5452  mZmin = mZmax = arr->Value(0,0);
     
    6058    }
    6159  if ((mZmax-mZmin) <= 1.e-19)  mZmax = mZmin + 1.e-19;
    62   if (asz) mScz = scm/(mZmax-mZmin);
    6360//  printf("PISurfaceDrawer::PISurfaceDrawer Min/Max: %g,%g  %g,%g  %g,%g  Sc: %g %g %g \n",
    6461//          mXmin, mXmax, mYmin, mYmax, mZmin, mZmax, mScx, mScy, mScz);
     
    8279{
    8380  if (mArr == NULL)  return;
     81  ComputeScaleFactor(mXmin, mXmax, mYmin, mYmax, mZmin, mZmax,
     82                     mAutoScaleXY, mAutoScaleZ, mScy, mScz);
    8483  double xmin, xmax, ymin, ymax, zmin, zmax;
    8584  xmin = mXmin*mScx;  xmax = mXmax*mScx;
     
    9695            (xmin+xmax)/2.+D , (ymin+ymax)/2.-2.5*D , zmin+(zmax-zmin)*0.85, 0.25, 0.25); 
    9796
    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);
    9999
    100100//  printf("PISurfaceDrawer::UpdateLimits() : %g-%g  %g-%g  %g-%g (%g) \n", xmin,xmax,ymin,ymax,zmin,zmax,D);
     
    119119}
    120120
    121 /* --Methode-- */
     121/* --Methode--
    122122void PISurfaceDrawer::DrawAxes(PIGraphicUC* g)
    123123{
     
    132132            mZmin-PERC_GARDE*(mZmax-mZmin),mZmax+PERC_GARDE*(mZmax-mZmin));
    133133}
     134*/
    134135
    135136/* --Methode-- */
     
    289290  delete[] zw;
    290291}
     292
     293/* --Methode-- */
     294int 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-- */
     327void PISurfaceDrawer::GetOptionsHelpInfo(string& info)
     328{
     329info += " ---- PISurfaceDrawer options help info : \n" ;
     330info += "  rescalexy / norescalexy   rescalez / norescalez \n";
     331info += "  and usual color/line/marker/... attribute decoding  \n";
     332// On recupere ensuite la chaine info de la classe de base
     333PIDrawer::GetOptionsHelpInfo(info);
     334return;
     335}
Note: See TracChangeset for help on using the changeset viewer.