Changeset 154 in Sophya for trunk/SophyaPI


Ignore:
Timestamp:
Oct 14, 1998, 7:11:53 PM (27 years ago)
Author:
ercodmgr
Message:

Correction bug Backing-store Reza+CMV 14/10/98

Location:
trunk/SophyaPI/PI
Files:
9 edited

Legend:

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

    r103 r154  
    6666// J'active le backing store pour la fenetre X
    6767XSetWindowAttributes xswa;
    68 Window mwi;
    69 mwi = XtWindow(XtWdg());
     68if (!XtIsRealized(XtWdg())) XtRealizeWidget( XtWdg() ) ;
     69
     70Window mwi = XtWindow(XtWdg());
     71
     72/*
     73XWindowAttributes xwa;
     74XGetWindowAttributes(PIXDisplay(), mwi, &xwa);
     75printf("PIBaseWdgX::FinishCreate()  BS= %d  (No=%d Map=%d Always=%d) planes=%lx \n",
     76       xwa.backing_store, NotUseful, WhenMapped, Always, (long)xwa.backing_planes);
     77*/
    7078xswa.backing_store = WhenMapped;
    71 xswa.backing_planes = ~0;
    72 XChangeWindowAttributes(PIXDisplay(), XtWindow(XtWdg()), CWBackingPlanes|CWBackingStore, &xswa);
     79// xswa.backing_planes = ~0;
     80// XChangeWindowAttributes(PIXDisplay(), XtWindow(XtWdg()), CWBackingPlanes|CWBackingStore, &xswa);
     81XChangeWindowAttributes(PIXDisplay(), mwi, CWBackingStore, &xswa);
    7382}
    7483
  • trunk/SophyaPI/PI/picontainergen.cc

    r140 r154  
    6161PIContainerGen::PIContainerGen(PIContainerGen *par, char *nom,
    6262                               int sx, int sy, int px, int py)
    63 : PIWdg(par, nom, sx, sy, px, py) , stvis(0)
     63: PIWdg(par, nom, sx, sy, px, py)
    6464{
    6565mNCh = 0;
     
    6868mChilds = new (PIWdg* [NCHALGRP]);
    6969mMxCh = NCHALGRP;
     70stvis = false;
     71stfcr = false;
    7072}
    7173
     
    9395void PIContainerGen::Show()
    9496{
    95 stvis = 1;
     97stvis = true;
    9698Manage();
    9799return;
     
    101103void PIContainerGen::Hide()
    102104{
    103 stvis = 0;
     105stvis = false;
    104106UnManage();
    105107return;
     
    107109
    108110/* --Methode-- */
    109 int PIContainerGen::Visible()
     111bool PIContainerGen::Visible()
    110112{
    111 return(stvis);
     113if (Parent())  return(stvis && Parent()->Visible());
     114else return(stvis && IsVisible());
    112115}
    113116
     
    125128  } 
    126129mChilds[mNCh] = child;   mNCh++;
     130// Reza 13/10/98 : il faut que child->FinishCreate()
     131// soit appele pour les PIWdg ajoute quand le  container est deja affiche et son FinishCreate() appele
     132if (stfcr)  child->FinishCreate();
    127133return;
    128134}
     
    162168return;
    163169}
     170
     171/* --Methode-- */
     172void PIContainerGen::FinishCreate()
     173{
     174if (stfcr)  return;
     175int k;
     176for(k=0; k<mNCh; k++)  mChilds[k]->FinishCreate();
     177stfcr = true;
     178}
     179
  • trunk/SophyaPI/PI/picontainergen.h

    r140 r154  
    2222  virtual void         Show();
    2323  virtual void         Hide();
    24   virtual int          Visible();
     24  virtual bool         Visible();
    2525
    2626  virtual void         ChildAdd(PIWdg* child);
     
    2929  virtual PIWdg*       GetChild(int n);
    3030
    31   void                 SetAutoDelChilds(bool ad = false);
     31          void         SetAutoDelChilds(bool ad = false);
     32  virtual void         FinishCreate(); // appelle FinishCreate() pour les descendants
     33
    3234protected:
    33   int                  stvis;
     35  bool                 stvis, stfcr;  // Statut visible ou pas, FinishCreate appele ou pas
    3436  PIWdg                ** mChilds;
    3537  int                  mNCh, mMxCh;
    36   bool                 mPaSup,mACSup;
     38  bool                 mPaSup, mACSup;
    3739};
    3840
  • trunk/SophyaPI/PI/picontainerx.cc

    r126 r154  
    2929{}
    3030
    31 /* --Methode-- */
    32 void PIContainerX::FinishCreate()
    33 {
    34 int k;
    35 for(k=0; k<mNCh; k++)  mChilds[k]->FinishCreate();
    36 }
    3731
    3832/* --Methode-- */
  • trunk/SophyaPI/PI/picontainerx.h

    r126 r154  
    1616                           int sx=10, int sy=10, int px=0, int py=0);
    1717
    18   virtual void        FinishCreate(); // appelle FinishCreate() pour les descendants
    19 
    2018  virtual             ~PIContainerX();
    2119
  • trunk/SophyaPI/PI/pigraph3d.cc

    r113 r154  
    5757// (Teta,Phi) = Direction de visee
    5858// Les angles d'Euler correspondants sont Teta, Phi+Pi/2
     59// Le Pi/2 vient que les rotations d'euler se font dans l'ordre
     60//  Autour de oZ d'angle Phi, autour de oN (nouvel axe X) d'angle Teta
     61//  Autour du nouvel axe Z (x3) d'angle Psi
    5962  double cf = cos((double)fO+M_PI_2);
    6063  double sf = sin((double)fO+M_PI_2);
     
    110113// (Teta,Phi) = Direction de visee
    111114// Les angles d'Euler correspondants sont Teta, Phi+Pi/2
     115// Le Pi/2 vient que les rotations d'euler se font dans l'ordre
     116//  Autour de oZ d'angle Phi, autour de oN (nouvel axe X) d'angle Teta
     117//  Autour du nouvel axe Z (x3) d'angle Psi
    112118  cf = cos((double)fO+M_PI_2);
    113119  sf = sin((double)fO+M_PI_2);
     
    201207  xc = x-xO;   yc = y-yO;    zc = z-zO;
    202208  xp = RE[0][0]*xc+RE[0][1]*yc+RE[0][2]*zc;
    203   yp = RE[1][0]*xc+RE[1][1]*yc+RE[1][2]*zc;
     209  yp = RE[1][0]*xc+RE[1][1]*yc+RE[1][2]*zc; 
    204210  zp = RE[2][0]*xc+RE[2][1]*yc+RE[2][2]*zc;
    205211}
     
    211217  float xp, yp, zp;
    212218  xc = x-xO;   yc = y-yO;    zc = z-zO;
    213   xp = RE[0][0]*xc+RE[0][1]*yc+RE[0][2]*zc;
     219  xp = RE[0][0]*xc+RE[0][1]*yc+RE[0][2]*zc;   
    214220  yp = RE[1][0]*xc+RE[1][1]*yc+RE[1][2]*zc;
    215221  zp = RE[2][0]*xc+RE[2][1]*yc+RE[2][2]*zc;
  • trunk/SophyaPI/PI/pisurfdr.cc

    r120 r154  
    171171  PIColors fgc;
    172172
    173   if (mLAtt == PI_NotDefLineAtt)    g3->SelLine(PI_ThinLine);
    174173
    175174  if (mCmapid == CMAP_OTHER) {   // Trace avec des lignes
     175    if (mLAtt == PI_NotDefLineAtt)    g3->SelLine(PI_ThinLine);
    176176    fgc = ( mFCol == PI_NotDefColor ) ? PI_Black : mFCol;
    177177    for(l=0;l<k;l++) {
     
    218218      g3->DrawFPolygon3D(xg,yg,zg,5);
    219219// On trace
     220      if (mLAtt == PI_NotDefLineAtt)   continue;
    220221      g3->SelForeground(fgc);
    221222      g3->DrawPolygon3D(xg,yg,zg,5);
  • trunk/SophyaPI/PI/piwindowx.cc

    r117 r154  
    148148    XSetTransientForHint(mdsp, XtWindow(PIXtTopWdg()), XtWindow(pwm->XtWdg()));
    149149  //  Pour faire les actions sur les fenetres X, sinon fenetre pas cree
    150   int k;
    151   for(k=0; k<mNCh; k++)  mChilds[k]->FinishCreate();
     150  PIContainerGen::FinishCreate();
    152151  }
    153152
  • trunk/SophyaPI/PI/psfile.cc

    r147 r154  
    526526
    527527        if(currentPage->orientation == PI_Portrait) {
    528             if( (tw/Dx) < (th/Dy) )
     528//          if( (tw/Dx) < (th/Dy) )
    529529//              scale = tw/Dx ;
    530                 scale = tw/Tw ;
    531             else
     530//                scale = tw/Tw ;
     531//          else
    532532//              scale = th/Dy;
    533                 scale = th/Th;
     533//                scale = th/Th;
     534//          fprintf(mPSFile,
     535//                  "%.2f %.2f %.2f cm %.2f cm %.2f cm %.2f cm newref\n",
     536//                  Dx, Dy,
     537//                  Dx*scale, Dy*scale,
     538//                  Tw*scale, Th*scale,
     539//                  0.5*(Tw-tw), -0.5*(Th+th)) ;
     540            scale = (tw/Dx)<(th/Dy) ? tw/Dx : th/Dy ;
     541            tw = scale*Dx ; th = scale*Dy ;
    534542            fprintf(mPSFile,
    535543                    "%.2f %.2f %.2f cm %.2f cm %.2f cm %.2f cm newref\n",
    536544                    Dx, Dy,
    537 //                  Dx*scale, Dy*scale,
    538                     Tw*scale, Th*scale,
     545                    tw, th,
    539546                    0.5*(Tw-tw), -0.5*(Th+th)) ;
    540547        }
    541548        if(currentPage->orientation == PI_Landscape) {
    542549            /* Idem avec X<->Y */
    543             if( (th/Dx) < (th/Dy) )
     550//          if( (th/Dx) < (th/Dy) )
    544551//              scale = th/Dx;
    545                 scale = th/Tw;
    546             else
     552//                scale = th/Tw;
     553//          else
    547554//              scale = tw/Dy ;
    548                 scale = tw/Th;
     555//                scale = tw/Th;
     556//          fprintf(mPSFile,
     557//             "-90 rotate %.2f %.2f %.2f cm %.2f cm %.2f cm %.2f cm newref\n",
     558//             Dx, Dy,
     559//             Dx*scale, Dy*scale,
     560//             Th*scale, Tw*scale,
     561//             0.5*(Th-th), 0.5*(Tw-tw));
     562
     563            scale = (th/Dx)<(tw/Dy) ? th/Dx : tw/Dy ;
     564            th = scale*Dx ; tw = scale*Dy ;
    549565            fprintf(mPSFile,
    550566               "-90 rotate %.2f %.2f %.2f cm %.2f cm %.2f cm %.2f cm newref\n",
    551567               Dx, Dy,
    552 //             Dx*scale, Dy*scale,
    553                Th*scale, Tw*scale,
     568               th, tw,
    554569               0.5*(Th-th), 0.5*(Tw-tw));
    555570        }
Note: See TracChangeset for help on using the changeset viewer.