Changeset 72 in Sophya
- Timestamp:
- Feb 13, 1998, 11:57:38 AM (28 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/ex_dessin.cc
r63 r72 40 40 41 41 /* --Methode-- */ 42 void ExBWdg::Draw( )42 void ExBWdg::Draw(PIGraphicGen* g) 43 43 { 44 44 EraseWindow(); 45 SelLine(PI_NormalLine);46 DrawBox(10,10, XSize()-20, YSize()-20);45 g->SelLine(PI_NormalLine); 46 g->DrawBox(10,10, XSize()-20, YSize()-20); 47 47 48 SelLine(PI_ThinLine);49 DrawFBox(20, 20, 20, 20);50 DrawCircle(30, 30, 15);48 g->SelLine(PI_ThinLine); 49 g->DrawFBox(20, 20, 20, 20); 50 g->DrawCircle(30, 30, 15); 51 51 52 SelForeground(PI_Red);53 DrawFCircle(70, 30, 15);52 g->SelForeground(PI_Red); 53 g->DrawFCircle(70, 30, 15); 54 54 55 SelForeground(PI_Yellow);56 DrawFBox(10, 60, 100, 15);55 g->SelForeground(PI_Yellow); 56 g->DrawFBox(10, 60, 100, 15); 57 57 58 SelForeground(PI_Black);59 DrawString(20, 90, str);58 g->SelForeground(PI_Black); 59 g->DrawString(20, 90, str); 60 60 61 SelLine(PI_ThinLine);62 DrawLine(10, 120, 40, 120);63 SelLine(PI_NormalLine);64 DrawLine(40, 120, 70, 120);65 SelLine(PI_ThickLine);66 DrawLine(70, 120, 100, 120);61 g->SelLine(PI_ThinLine); 62 g->DrawLine(10, 120, 40, 120); 63 g->SelLine(PI_NormalLine); 64 g->DrawLine(40, 120, 70, 120); 65 g->SelLine(PI_ThickLine); 66 g->DrawLine(70, 120, 100, 120); 67 67 68 SelForeground(PI_Magenta);69 DrawFCircle(120, 30, 15);70 SelForeground(PI_Grey);71 DrawFCircle(120, 60, 15);68 g->SelForeground(PI_Magenta); 69 g->DrawFCircle(120, 30, 15); 70 g->SelForeground(PI_Grey); 71 g->DrawFCircle(120, 60, 15); 72 72 73 intx[5] = { 20, 35, 50, 65, 80 };74 inty[5] = { 130, 130, 130, 130, 130 };73 PIGrCoord x[5] = { 20, 35, 50, 65, 80 }; 74 PIGrCoord y[5] = { 130, 130, 130, 130, 130 }; 75 75 76 SelForeground(PI_Black);77 DrawMarkers(x, y, 5);76 g->SelForeground(PI_Black); 77 g->DrawMarkers(x, y, 5); 78 78 return; 79 79 } … … 107 107 if (++mfnt > 2) mfnt = 0; 108 108 if (++mmrk > 8) mmrk = 0; 109 SelFont(PI_NormalSizeFont, att[mfnt]);110 SelMarker(8, pmk[mmrk]);109 mWGrC->SelFont(PI_NormalSizeFont, att[mfnt]); 110 mWGrC->SelMarker(8, pmk[mmrk]); 111 111 return; 112 112 } … … 123 123 { 124 124 SelPointerShape(PI_HandPointer); 125 SelForeground(PI_Blue);126 DrawFBox(0, 0, 8, 8);125 mWGrC->SelForeground(PI_Blue); 126 mWGrC->DrawFBox(0, 0, 8, 8); 127 127 return; 128 128 } … … 131 131 void ExBWdg::But3Release(int x, int y) 132 132 { 133 SelForeground(PI_White);134 DrawFBox(0, 0, 8, 8);135 SelForeground(PI_Black);133 mWGrC->SelForeground(PI_White); 134 mWGrC->DrawFBox(0, 0, 8, 8); 135 mWGrC->SelForeground(PI_Black); 136 136 SelPointerShape(PI_ArrowPointer); 137 137 return; … … 149 149 150 150 printf("ExBWdg::Keyboard: Key= %d (%c) , Mod= %d \n", key, (char)key, (int)kmod); 151 SelFont(PI_BigSizeFont, PI_BoldFont);152 DrawString(20, 75, buf);151 mWGrC->SelFont(PI_BigSizeFont, PI_BoldFont); 152 mWGrC->DrawString(20, 75, buf); 153 153 154 154 if ( (kmod == PIKM_Alt) && (key == 'c') ) { -
trunk/SophyaPI/PI/ex_dessin.h
r11 r72 22 22 23 23 virtual void Resize(); 24 virtual void Draw( );24 virtual void Draw(PIGraphicGen* g); 25 25 26 26 virtual void But1Press(int x, int y); -
trunk/SophyaPI/PI/picmap.cc
r63 r72 91 91 mColTNums[mCTId]--; 92 92 if ( mColTNums[mCTId] == 0 ) { FreeColors(); mColTNums[mCTId] = 0; } 93 printf("\n");93 // printf("\n"); 94 94 } 95 95 -
trunk/SophyaPI/PI/picmapx.cc
r64 r72 138 138 { 139 139 if (NTotColors > 0) return(NTotColors); 140 Visual* vis;140 // Visual* vis; 141 141 // DefaultVisual(PIXDisplay(), PIXScreen() ); 142 142 int k,kk; -
trunk/SophyaPI/PI/pidrawer.cc
r71 r72 265 265 float xOffset = 0; 266 266 int kk; 267 g->SelFontSz( yMajTickLen*4.);267 g->SelFontSz(xMajTickLen*4.); 268 268 for (float x=xBeg; x<=xMax; x += xStep) { 269 269 char label[20]; sprintf(label, "%-6g", x); … … 280 280 g->DrawString(x+xOffset, y, label); 281 281 } 282 printf(" DBGDBG Out of PIDrawer::DrawHLabels \n");283 282 } 284 283 … … 287 286 { 288 287 float xOffset = 0; 289 g->SelFontSz( yMajTickLen*4.);288 g->SelFontSz(xMajTickLen*4.); 290 289 for (float y=yBeg; y<=yMax; y += yStep) { 291 290 char label[20]; sprintf(label, "%-6g", y); -
trunk/SophyaPI/PI/pigraphuc.cc
r71 r72 451 451 { 452 452 if (!mGrC) return; 453 printf("-DBG- PIGraphicUC::SelFont(sz=%d) \n", sz);454 453 mGrC->SelFont(sz, att); 455 454 return; … … 460 459 { 461 460 if (!mGrC) return; 462 printf("-DBG- PIGraphicUC::SelFontSzPt(npt=%d) \n", npt);463 461 mGrC->SelFontSzPt(npt, att); 464 462 return; … … 490 488 if (npt < 8) npt = 8; 491 489 if (npt > 127) npt = 127; 492 printf("-DBG- PIGraphicUC::SelFontSz(%g->%g,%g ) %d \n", (float)sz, fx, fy, npt);493 490 mGrC->SelFontSzPt(npt, att); 494 491 } … … 502 499 DUC2GrC((float)sz, (float)sz, fx, fy); 503 500 int isz = int(0.5*(fx+fy+1)); 504 printf("-DBG- PIGraphicUC::SelMarkerSzSz(%g->%g,%g ) %d \n", (float)sz, fx, fy, isz);505 501 mGrC->SelMarker( isz, mrk); 506 502 } … … 589 585 float dx = mGrC->CalcStringWidth(s); 590 586 float dxx, dxy; 591 D UC2GrC(dx, dx, dxx, dxy);587 DGrC2UC(dx, dx, dxx, dxy); 592 588 return(dxx); 593 589 } -
trunk/SophyaPI/PI/pigraphx.cc
r71 r72 347 347 if (att & PI_BoldFont) j = 1; 348 348 if (att & PI_ItalicFont) j = 2; 349 printf(" >DBg< PIGraphicX::SelFontSzPt(%d , ) \n", npt);350 349 SelectFont(isel, j); 351 350 … … 376 375 if (att & PI_BoldFont) j = 1; 377 376 if (att & PI_ItalicFont) j = 2; 378 379 printf(" >DBg< PIGraphicX::SelFont(sz=%d ) \n", sz);380 377 381 378 SelectFont(i, j); … … 685 682 if (count > 0) break; 686 683 } 687 if (count > 0) {684 if (count > 0) 688 685 fntst[isz][jat] = XLoadQueryFont(mdsp, buff); 689 printf("PIGraphicX::SelectFont-DBG-/ font %s loaded \n", buff); }690 686 else 691 687 { printf("PIGraphicX::SelectFont/ Pb font %s - Using default \n", buff); … … 696 692 mFSize = fntsz[isz]; 697 693 mFSt = fntst[isz][jat]; 698 printf("PIGraphicX::SelectFont-DBG-/ %d %d -> %d \n", isz, jat, mFSize);699 694 XSetFont(XtDisplay(MyWdg()), DefGC(), fntst[isz][jat]->fid); 700 695 return; -
trunk/SophyaPI/PI/pintuple.cc
r71 r72 75 75 float xp,yp,xer,yer; 76 76 char buff[128]; 77 int nok , nl2;77 int nok; 78 78 79 79 if (!mNT) return; -
trunk/SophyaPI/PI/piscdrawwdg.cc
r71 r72 181 181 } 182 182 183 void184 PIScDrawWdg::DrawSelf(PIGraphicUC*)185 {186 return;187 }188 183 189 184 void … … 391 386 PIScContDrw* rd; 392 387 if (mDrawWdg) mDrawWdg->RemoveScDrawer(this); 393 mDrawWdg = NULL; mDrawer = rd;394 388 rd = new PIScContDrw(this); 389 mDrawWdg = NULL; mDrawer = rd; 395 390 UpdateSize(); 396 391 return((PIDrawer*)rd); -
trunk/SophyaPI/PI/piscdrawwdg.h
r71 r72 28 28 virtual void Draw(PIGraphicGen* g); 29 29 virtual void Draw(PIGraphicGen* g, int x0, int y0, int dx, int dy); 30 virtual void DrawSelf(PIGraphicUC* g);31 30 virtual void DrawSelf(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax); 32 31 -
trunk/SophyaPI/PI/sc_sample.cc
r52 r72 1 #include <stdlib.h> 2 #include <stdio.h> 3 #include <string> 4 1 5 #include "sc_sample.h" 2 6 … … 11 15 mfd = new PIScFuncDrawer(f); 12 16 SetLimits(-3,3,-4,4); 13 Add Drawer(mfd);14 SetAxesFlags( );17 AddScDrawer(mfd); 18 SetAxesFlags(kAxesDflt); 15 19 } 16 20 … … 22 26 23 27 void 24 ScSample::DrawSelf( )28 ScSample::DrawSelf(PIGraphicUC* g, float, float, float, float) 25 29 { 26 doublex[5] = {-2, -1., 1., 1.7, 2.2};27 doubley[5] = {-2.5, -2.0, -1.5, -2., -2.5};30 PIGrCoord x[5] = {-2, -1., 1., 1.7, 2.2}; 31 PIGrCoord y[5] = {-2.5, -2.0, -1.5, -2., -2.5}; 28 32 29 33 int i; 30 SelForeground(PI_Green); 31 BaseDrawer()->SelMarker(0.3, PI_BoxMarker); 32 BaseDrawer()->DrawMarkers(x, y, 5); 33 SelForeground(PI_Magenta); 34 BaseDrawer()->SelMarker(0.3, PI_FCircleMarker); 34 g->SelForeground(PI_Green); 35 g->SelMarkerSz(0.3, PI_BoxMarker); 36 g->DrawMarkers(x, y, 5); 37 g->SelForeground(PI_Magenta); 38 printf(" +DBG+ ScSample::DrawSelf - Marker(%g) \n", 0.3); 39 g->SelMarkerSz(0.3, PI_FCircleMarker); 35 40 for(i=0; i<5; i++) 36 y[i] +=1.;37 BaseDrawer()->DrawMarkers(x, y, 5);38 SelForeground(PI_Black);41 y[i] = (float)(y[i]) + 1.; 42 g->DrawMarkers(x, y, 5); 43 g->SelForeground(PI_Black); 39 44 40 BaseDrawer()->DrawLine(-4, -4, 4, 4);41 BaseDrawer()->DrawLine(-2, -5, 5, 2);42 BaseDrawer()->DrawLine(-5, -4, -2, -2);43 BaseDrawer()->DrawLine(1, -10, 1, 10);45 g->DrawLine(-4, -4, 4, 4); 46 g->DrawLine(-2, -5, 5, 2); 47 g->DrawLine(-5, -4, -2, -2); 48 g->DrawLine(1, -10, 1, 10); 44 49 return; 45 50 } -
trunk/SophyaPI/PI/sc_sample.h
r11 r72 1 #include "pisysdep.h"1 // #include "pisysdep.h" 2 2 3 3 #include "piscdrawwdg.h" … … 10 10 11 11 12 virtual void DrawSelf( );12 virtual void DrawSelf(PIGraphicUC* g, float, float, float, float); 13 13 14 14 };
Note:
See TracChangeset
for help on using the changeset viewer.