Changeset 2400 in Sophya for trunk/SophyaPI/PIext


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

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

Location:
trunk/SophyaPI/PIext
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PIext/pintup3d.cc

    r2373 r2400  
    4848  mNT = nt;
    4949  mAdDO = ad;
     50  mAutoScaleXY = mAutoScaleZ = true;
    5051  UseSizeScale(true, 5);
    5152  UseColorScale(true);
     53  ConnectPoints(false);
    5254  SelectXYZ(NULL, NULL, NULL);
    5355  SelectWt(NULL);
     
    139141  mNT->GetMinMax(zK, zmin, zmax);
    140142
     143  ComputeScaleFactor(xmin, xmax, ymin, ymax, zmin, zmax,
     144                     mAutoScaleXY, mAutoScaleZ, mScy, mScz);
     145 
     146  // cout << " DEBUG - NTup3D X:" << XMin3() << "-" << XMax3() " s=" << mScx
     147  //     <<  " Y:" YMin3() << "-" << YMax3() << "
     148  xmin *= mScx;  xmax *= mScx;
     149  ymin *= mScy;  ymax *= mScy;
     150  zmin *= mScz;  zmax *= mScz;
    141151// Centre du champ en C = (xmin+xmax)/2., (ymin+ymax)/2  (zmin+zmax)*0.5
    142152// Distance D = Max(xmax-xmin,ymin-ymax)*2
     
    149159            (xmin+xmax)/2.+D , (ymin+ymax)/2.-2.5*D , zmin+(zmax-zmin)*0.85, 0.25, 0.25); 
    150160
     161  Set3DBox(xmin, xmax, ymin, ymax, zmin, zmax, mScx, mScy, mScz);
     162
    151163  /*
    152164  x3Min = xmin;  // - PERC_GARDE*(xmax-xmin);
     
    158170  */
    159171
    160   Set3DBox(xmin, xmax, ymin, ymax, zmin, zmax);
    161172
    162173//  printf("PINTuple3D::UpdateLimits() : %g .. %g  %g .. %g  %g .. %g (%g) \n", xmin,xmax,ymin,ymax,zmin,zmax,D);
     
    241252
    242253  if ( (i > 0) && connectPts ) // On relie les points ...
    243     g3->DrawLine3D(xl, yl, zl, xp, yp, zp);
     254    g3->DrawLine3D(xl*mScx, yl*mScy, zl*mScz, xp*mScx, yp*mScy, zp*mScz);
    244255  nok++;
    245256  if ( xebK >= 0 ) {
    246257    xer = mNT->GetCell(i, xebK);
    247     g3->DrawLine3D(xp-xer, yp, zp, xp+xer, yp, zp);
     258    g3->DrawLine3D((xp-xer)*mScx, yp*mScy, zp*mScz, (xp+xer)*mScx, yp*mScy, zp*mScz);
    248259  }
    249260  if ( yebK >= 0 ) {
    250261    yer = mNT->GetCell(i, yebK);
    251     g3->DrawLine3D(xp, yp-yer, zp, xp, yp+yer, zp);
     262    g3->DrawLine3D(xp*mScx, (yp-yer)*mScy, zp*mScz, xp*mScx, (yp+yer)*mScy, zp*mScz);
    252263  }
    253264  if ( zebK >= 0 ) {
    254265    zer = mNT->GetCell(i, zebK);
    255     g3->DrawLine3D(xp, yp, zp-zer, xp, yp, zp+zer);
     266    g3->DrawLine3D(xp*mScx, yp*mScy, (zp-zer)*mScz, xp*mScx, yp*mScy, (zp+zer)*mScz);
    256267  }
    257268  // Trace du marker
    258   if ((wK >= 0)||(lK < 0)||(mmrk != PI_NotDefMarker))  g3->DrawMarker3D(xp, yp, zp);
     269  if ((wK >= 0)||(lK < 0)||(mmrk != PI_NotDefMarker)) 
     270    g3->DrawMarker3D(xp*mScx, yp*mScy, zp*mScz);
    259271  // Trace eventuel du label
    260   if (lK >= 0) g3->DrawString3D(xp, yp, zp, mNT->GetCelltoString(i, lK).c_str());
     272  if (lK >= 0) g3->DrawString3D(xp*mScx, yp*mScy, zp*mScz,
     273                                mNT->GetCelltoString(i, lK).c_str());
    261274}
    262275
     
    303316      UseSizeScale(true, nbn);
    304317    }
     318    else if (opts == "rescalexy") mAutoScaleXY = true;
     319    else if (opts == "norescalexy") mAutoScaleXY = false;
     320    else if (opts == "rescalez") mAutoScaleZ = true;
     321    else if (opts == "norescalez") mAutoScaleZ = false;
    305322    else {
    306323      // Si option non decode
     
    325342void PINTuple3D::GetOptionsHelpInfo(string& info)
    326343{
    327 // On recupere d'abord la chaine info de la classe de base
    328 PIDrawer::GetOptionsHelpInfo(info);
    329344info += " ---- PINTuple3D options help info : \n" ;
    330345info += "  connectpoints: The points are connected by a line \n";
     
    332347info += "  colorscale/nocolorscale (Use color scale for weight) \n";
    333348info += "  sizescale/sizescale=nbins/nosizescale (Use marker size for weight) \n";
     349info += "  rescalexy / norescalexy   rescalez / norescalez \n";
    334350info += "  and usual color/line/marker/... attribute decoding  \n";
     351// On recupere ensuite la chaine info de la classe de base
     352PIDrawer::GetOptionsHelpInfo(info);
    335353return;
    336354}
  • trunk/SophyaPI/PIext/pintup3d.h

    r2373 r2400  
    3737  NTupleInterface* mNT;
    3838  bool mAdDO;
     39  bool mAutoScaleXY, mAutoScaleZ;
    3940  int xK, yK, zK;           // Index du nom de variable en X/Y/Z ds le ntuple
    4041  int xebK, yebK, zebK;     // Index du nom de variable en ErrBarX/Y/Z ds le ntuple
Note: See TracChangeset for help on using the changeset viewer.