Changeset 154 in Sophya for trunk/SophyaPI
- Timestamp:
- Oct 14, 1998, 7:11:53 PM (27 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/pibwdgx.cc
r103 r154 66 66 // J'active le backing store pour la fenetre X 67 67 XSetWindowAttributes xswa; 68 Window mwi; 69 mwi = XtWindow(XtWdg()); 68 if (!XtIsRealized(XtWdg())) XtRealizeWidget( XtWdg() ) ; 69 70 Window mwi = XtWindow(XtWdg()); 71 72 /* 73 XWindowAttributes xwa; 74 XGetWindowAttributes(PIXDisplay(), mwi, &xwa); 75 printf("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 */ 70 78 xswa.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); 81 XChangeWindowAttributes(PIXDisplay(), mwi, CWBackingStore, &xswa); 73 82 } 74 83 -
trunk/SophyaPI/PI/picontainergen.cc
r140 r154 61 61 PIContainerGen::PIContainerGen(PIContainerGen *par, char *nom, 62 62 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) 64 64 { 65 65 mNCh = 0; … … 68 68 mChilds = new (PIWdg* [NCHALGRP]); 69 69 mMxCh = NCHALGRP; 70 stvis = false; 71 stfcr = false; 70 72 } 71 73 … … 93 95 void PIContainerGen::Show() 94 96 { 95 stvis = 1;97 stvis = true; 96 98 Manage(); 97 99 return; … … 101 103 void PIContainerGen::Hide() 102 104 { 103 stvis = 0;105 stvis = false; 104 106 UnManage(); 105 107 return; … … 107 109 108 110 /* --Methode-- */ 109 intPIContainerGen::Visible()111 bool PIContainerGen::Visible() 110 112 { 111 return(stvis); 113 if (Parent()) return(stvis && Parent()->Visible()); 114 else return(stvis && IsVisible()); 112 115 } 113 116 … … 125 128 } 126 129 mChilds[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 132 if (stfcr) child->FinishCreate(); 127 133 return; 128 134 } … … 162 168 return; 163 169 } 170 171 /* --Methode-- */ 172 void PIContainerGen::FinishCreate() 173 { 174 if (stfcr) return; 175 int k; 176 for(k=0; k<mNCh; k++) mChilds[k]->FinishCreate(); 177 stfcr = true; 178 } 179 -
trunk/SophyaPI/PI/picontainergen.h
r140 r154 22 22 virtual void Show(); 23 23 virtual void Hide(); 24 virtual intVisible();24 virtual bool Visible(); 25 25 26 26 virtual void ChildAdd(PIWdg* child); … … 29 29 virtual PIWdg* GetChild(int n); 30 30 31 void SetAutoDelChilds(bool ad = false); 31 void SetAutoDelChilds(bool ad = false); 32 virtual void FinishCreate(); // appelle FinishCreate() pour les descendants 33 32 34 protected: 33 int stvis;35 bool stvis, stfcr; // Statut visible ou pas, FinishCreate appele ou pas 34 36 PIWdg ** mChilds; 35 37 int mNCh, mMxCh; 36 bool mPaSup, mACSup;38 bool mPaSup, mACSup; 37 39 }; 38 40 -
trunk/SophyaPI/PI/picontainerx.cc
r126 r154 29 29 {} 30 30 31 /* --Methode-- */32 void PIContainerX::FinishCreate()33 {34 int k;35 for(k=0; k<mNCh; k++) mChilds[k]->FinishCreate();36 }37 31 38 32 /* --Methode-- */ -
trunk/SophyaPI/PI/picontainerx.h
r126 r154 16 16 int sx=10, int sy=10, int px=0, int py=0); 17 17 18 virtual void FinishCreate(); // appelle FinishCreate() pour les descendants19 20 18 virtual ~PIContainerX(); 21 19 -
trunk/SophyaPI/PI/pigraph3d.cc
r113 r154 57 57 // (Teta,Phi) = Direction de visee 58 58 // 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 59 62 double cf = cos((double)fO+M_PI_2); 60 63 double sf = sin((double)fO+M_PI_2); … … 110 113 // (Teta,Phi) = Direction de visee 111 114 // 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 112 118 cf = cos((double)fO+M_PI_2); 113 119 sf = sin((double)fO+M_PI_2); … … 201 207 xc = x-xO; yc = y-yO; zc = z-zO; 202 208 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; 204 210 zp = RE[2][0]*xc+RE[2][1]*yc+RE[2][2]*zc; 205 211 } … … 211 217 float xp, yp, zp; 212 218 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; 214 220 yp = RE[1][0]*xc+RE[1][1]*yc+RE[1][2]*zc; 215 221 zp = RE[2][0]*xc+RE[2][1]*yc+RE[2][2]*zc; -
trunk/SophyaPI/PI/pisurfdr.cc
r120 r154 171 171 PIColors fgc; 172 172 173 if (mLAtt == PI_NotDefLineAtt) g3->SelLine(PI_ThinLine);174 173 175 174 if (mCmapid == CMAP_OTHER) { // Trace avec des lignes 175 if (mLAtt == PI_NotDefLineAtt) g3->SelLine(PI_ThinLine); 176 176 fgc = ( mFCol == PI_NotDefColor ) ? PI_Black : mFCol; 177 177 for(l=0;l<k;l++) { … … 218 218 g3->DrawFPolygon3D(xg,yg,zg,5); 219 219 // On trace 220 if (mLAtt == PI_NotDefLineAtt) continue; 220 221 g3->SelForeground(fgc); 221 222 g3->DrawPolygon3D(xg,yg,zg,5); -
trunk/SophyaPI/PI/piwindowx.cc
r117 r154 148 148 XSetTransientForHint(mdsp, XtWindow(PIXtTopWdg()), XtWindow(pwm->XtWdg())); 149 149 // 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(); 152 151 } 153 152 -
trunk/SophyaPI/PI/psfile.cc
r147 r154 526 526 527 527 if(currentPage->orientation == PI_Portrait) { 528 if( (tw/Dx) < (th/Dy) )528 // if( (tw/Dx) < (th/Dy) ) 529 529 // scale = tw/Dx ; 530 scale = tw/Tw ; 531 else530 // scale = tw/Tw ; 531 // else 532 532 // 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 ; 534 542 fprintf(mPSFile, 535 543 "%.2f %.2f %.2f cm %.2f cm %.2f cm %.2f cm newref\n", 536 544 Dx, Dy, 537 // Dx*scale, Dy*scale, 538 Tw*scale, Th*scale, 545 tw, th, 539 546 0.5*(Tw-tw), -0.5*(Th+th)) ; 540 547 } 541 548 if(currentPage->orientation == PI_Landscape) { 542 549 /* Idem avec X<->Y */ 543 if( (th/Dx) < (th/Dy) )550 // if( (th/Dx) < (th/Dy) ) 544 551 // scale = th/Dx; 545 scale = th/Tw;546 else552 // scale = th/Tw; 553 // else 547 554 // 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 ; 549 565 fprintf(mPSFile, 550 566 "-90 rotate %.2f %.2f %.2f cm %.2f cm %.2f cm %.2f cm newref\n", 551 567 Dx, Dy, 552 // Dx*scale, Dy*scale, 553 Th*scale, Tw*scale, 568 th, tw, 554 569 0.5*(Th-th), 0.5*(Tw-tw)); 555 570 }
Note:
See TracChangeset
for help on using the changeset viewer.