Changeset 72 in Sophya


Ignore:
Timestamp:
Feb 13, 1998, 11:57:38 AM (28 years ago)
Author:
ansari
Message:

Debug et Ajout de PIConsole - Reza 13/02/98

Location:
trunk/SophyaPI/PI
Files:
2 added
12 edited

Legend:

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

    r63 r72  
    4040
    4141/* --Methode-- */
    42 void ExBWdg::Draw()
     42void ExBWdg::Draw(PIGraphicGen* g)
    4343{
    4444EraseWindow();
    45 SelLine(PI_NormalLine);
    46 DrawBox(10,10, XSize()-20, YSize()-20);
     45g->SelLine(PI_NormalLine);
     46g->DrawBox(10,10, XSize()-20, YSize()-20);
    4747
    48 SelLine(PI_ThinLine);
    49 DrawFBox(20, 20, 20, 20);
    50 DrawCircle(30, 30, 15);
     48g->SelLine(PI_ThinLine);
     49g->DrawFBox(20, 20, 20, 20);
     50g->DrawCircle(30, 30, 15);
    5151
    52 SelForeground(PI_Red);
    53 DrawFCircle(70, 30, 15);
     52g->SelForeground(PI_Red);
     53g->DrawFCircle(70, 30, 15);
    5454
    55 SelForeground(PI_Yellow);
    56 DrawFBox(10, 60, 100, 15);
     55g->SelForeground(PI_Yellow);
     56g->DrawFBox(10, 60, 100, 15);
    5757
    58 SelForeground(PI_Black);
    59 DrawString(20, 90, str);
     58g->SelForeground(PI_Black);
     59g->DrawString(20, 90, str);
    6060
    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);
     61g->SelLine(PI_ThinLine);
     62g->DrawLine(10, 120, 40, 120);
     63g->SelLine(PI_NormalLine);
     64g->DrawLine(40, 120, 70, 120);
     65g->SelLine(PI_ThickLine);
     66g->DrawLine(70, 120, 100, 120);
    6767
    68 SelForeground(PI_Magenta);
    69 DrawFCircle(120, 30, 15);
    70 SelForeground(PI_Grey);
    71 DrawFCircle(120, 60, 15);
     68g->SelForeground(PI_Magenta);
     69g->DrawFCircle(120, 30, 15);
     70g->SelForeground(PI_Grey);
     71g->DrawFCircle(120, 60, 15);
    7272
    73 int x[5] = { 20, 35, 50, 65, 80 };
    74 int y[5] = { 130, 130, 130, 130, 130 };
     73PIGrCoord x[5] = { 20, 35, 50, 65, 80 };
     74PIGrCoord y[5] = { 130, 130, 130, 130, 130 };
    7575
    76 SelForeground(PI_Black);
    77 DrawMarkers(x, y, 5);
     76g->SelForeground(PI_Black);
     77g->DrawMarkers(x, y, 5);
    7878return;
    7979}
     
    107107if (++mfnt > 2)  mfnt = 0;
    108108if (++mmrk > 8)  mmrk = 0;
    109 SelFont(PI_NormalSizeFont, att[mfnt]);
    110 SelMarker(8, pmk[mmrk]);
     109mWGrC->SelFont(PI_NormalSizeFont, att[mfnt]);
     110mWGrC->SelMarker(8, pmk[mmrk]);
    111111return;
    112112}
     
    123123{
    124124SelPointerShape(PI_HandPointer);
    125 SelForeground(PI_Blue);
    126 DrawFBox(0, 0, 8, 8);
     125mWGrC->SelForeground(PI_Blue);
     126mWGrC->DrawFBox(0, 0, 8, 8);
    127127return;
    128128}
     
    131131void ExBWdg::But3Release(int x, int y)
    132132{
    133 SelForeground(PI_White);
    134 DrawFBox(0, 0, 8, 8);
    135 SelForeground(PI_Black);
     133mWGrC->SelForeground(PI_White);
     134mWGrC->DrawFBox(0, 0, 8, 8);
     135mWGrC->SelForeground(PI_Black);
    136136SelPointerShape(PI_ArrowPointer);
    137137return;
     
    149149
    150150printf("ExBWdg::Keyboard: Key= %d (%c) , Mod= %d \n", key, (char)key, (int)kmod);
    151 SelFont(PI_BigSizeFont, PI_BoldFont);
    152 DrawString(20, 75, buf);
     151mWGrC->SelFont(PI_BigSizeFont, PI_BoldFont);
     152mWGrC->DrawString(20, 75, buf);
    153153
    154154if ( (kmod == PIKM_Alt) && (key == 'c') ) {
  • trunk/SophyaPI/PI/ex_dessin.h

    r11 r72  
    2222
    2323  virtual void   Resize();
    24   virtual void   Draw();
     24  virtual void   Draw(PIGraphicGen* g);
    2525
    2626  virtual void   But1Press(int x, int y);
  • trunk/SophyaPI/PI/picmap.cc

    r63 r72  
    9191  mColTNums[mCTId]--;
    9292  if ( mColTNums[mCTId] == 0 )  { FreeColors();  mColTNums[mCTId] = 0; }
    93   printf("\n");
     93//  printf("\n");
    9494}
    9595
  • trunk/SophyaPI/PI/picmapx.cc

    r64 r72  
    138138{
    139139if (NTotColors > 0)  return(NTotColors);
    140 Visual* vis;
     140// Visual* vis;
    141141// DefaultVisual(PIXDisplay(),  PIXScreen() );
    142142int k,kk;
  • trunk/SophyaPI/PI/pidrawer.cc

    r71 r72  
    265265  float xOffset = 0;
    266266  int kk;
    267   g->SelFontSz(yMajTickLen*4.);
     267  g->SelFontSz(xMajTickLen*4.);
    268268  for (float x=xBeg; x<=xMax; x += xStep) {
    269269      char label[20]; sprintf(label, "%-6g", x);
     
    280280      g->DrawString(x+xOffset, y, label);
    281281  }
    282   printf(" DBGDBG Out of PIDrawer::DrawHLabels  \n");
    283282}
    284283
     
    287286{
    288287  float xOffset = 0;
    289   g->SelFontSz(yMajTickLen*4.);
     288  g->SelFontSz(xMajTickLen*4.);
    290289  for (float y=yBeg; y<=yMax; y += yStep) {
    291290      char label[20]; sprintf(label, "%-6g", y);
  • trunk/SophyaPI/PI/pigraphuc.cc

    r71 r72  
    451451{
    452452  if (!mGrC) return;
    453   printf("-DBG- PIGraphicUC::SelFont(sz=%d) \n", sz);
    454453  mGrC->SelFont(sz, att);
    455454  return; 
     
    460459{
    461460  if (!mGrC) return;
    462   printf("-DBG- PIGraphicUC::SelFontSzPt(npt=%d) \n", npt);
    463461  mGrC->SelFontSzPt(npt, att);
    464462  return; 
     
    490488  if (npt < 8) npt = 8;
    491489  if (npt > 127) npt = 127;
    492   printf("-DBG- PIGraphicUC::SelFontSz(%g->%g,%g ) %d \n", (float)sz, fx, fy, npt);
    493490  mGrC->SelFontSzPt(npt, att);
    494491}
     
    502499  DUC2GrC((float)sz, (float)sz, fx, fy);
    503500  int isz = int(0.5*(fx+fy+1));
    504   printf("-DBG- PIGraphicUC::SelMarkerSzSz(%g->%g,%g ) %d \n", (float)sz, fx, fy, isz);
    505501  mGrC->SelMarker( isz, mrk);
    506502}
     
    589585  float dx = mGrC->CalcStringWidth(s);
    590586  float dxx, dxy;
    591   DUC2GrC(dx, dx, dxx, dxy);
     587  DGrC2UC(dx, dx, dxx, dxy);
    592588  return(dxx);
    593589}
  • trunk/SophyaPI/PI/pigraphx.cc

    r71 r72  
    347347if (att & PI_BoldFont) j = 1;
    348348if (att & PI_ItalicFont) j = 2;
    349 printf(" >DBg< PIGraphicX::SelFontSzPt(%d , ) \n", npt);
    350349SelectFont(isel, j);
    351350
     
    376375if (att & PI_BoldFont) j = 1;
    377376if (att & PI_ItalicFont) j = 2;
    378 
    379 printf(" >DBg< PIGraphicX::SelFont(sz=%d  ) \n", sz);
    380377
    381378SelectFont(i, j);
     
    685682    if (count > 0)  break;
    686683    }
    687   if (count > 0) {
     684  if (count > 0)
    688685    fntst[isz][jat] = XLoadQueryFont(mdsp, buff);
    689     printf("PIGraphicX::SelectFont-DBG-/ font %s loaded \n", buff); }
    690686  else
    691687    { printf("PIGraphicX::SelectFont/ Pb font %s - Using default \n", buff);   
     
    696692mFSize = fntsz[isz];
    697693mFSt = fntst[isz][jat];
    698 printf("PIGraphicX::SelectFont-DBG-/ %d %d -> %d \n", isz, jat, mFSize);
    699694XSetFont(XtDisplay(MyWdg()), DefGC(), fntst[isz][jat]->fid);
    700695return;
  • trunk/SophyaPI/PI/pintuple.cc

    r71 r72  
    7575float xp,yp,xer,yer;
    7676char buff[128];
    77 int nok, nl2;
     77int nok;
    7878
    7979if (!mNT) return;
  • trunk/SophyaPI/PI/piscdrawwdg.cc

    r71 r72  
    181181}
    182182
    183 void
    184 PIScDrawWdg::DrawSelf(PIGraphicUC*)
    185 {
    186 return;
    187 }
    188183
    189184void
     
    391386  PIScContDrw* rd;
    392387  if (mDrawWdg) mDrawWdg->RemoveScDrawer(this);
    393   mDrawWdg = NULL;  mDrawer = rd;
    394388  rd = new PIScContDrw(this);
     389  mDrawWdg = NULL;    mDrawer = rd;
    395390  UpdateSize();
    396391  return((PIDrawer*)rd);
  • trunk/SophyaPI/PI/piscdrawwdg.h

    r71 r72  
    2828  virtual void       Draw(PIGraphicGen* g);
    2929  virtual void       Draw(PIGraphicGen* g, int x0, int y0, int dx, int dy);
    30   virtual void       DrawSelf(PIGraphicUC* g);
    3130  virtual void       DrawSelf(PIGraphicUC* g, float xmin, float ymin, float xmax, float ymax);
    3231 
  • trunk/SophyaPI/PI/sc_sample.cc

    r52 r72  
     1#include <stdlib.h>
     2#include <stdio.h>
     3#include <string>
     4
    15#include "sc_sample.h"
    26
     
    1115mfd = new PIScFuncDrawer(f);
    1216  SetLimits(-3,3,-4,4);
    13 AddDrawer(mfd);
    14 SetAxesFlags();
     17AddScDrawer(mfd);
     18SetAxesFlags(kAxesDflt);
    1519}
    1620
     
    2226
    2327void
    24 ScSample::DrawSelf()
     28ScSample::DrawSelf(PIGraphicUC* g, float, float, float, float)
    2529{
    26 double x[5] = {-2, -1., 1., 1.7, 2.2};
    27 double y[5] = {-2.5, -2.0, -1.5, -2., -2.5};
     30PIGrCoord x[5] = {-2, -1., 1., 1.7, 2.2};
     31PIGrCoord y[5] = {-2.5, -2.0, -1.5, -2., -2.5};
    2832
    2933int 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);
     34g->SelForeground(PI_Green);
     35g->SelMarkerSz(0.3, PI_BoxMarker);
     36g->DrawMarkers(x, y, 5);
     37g->SelForeground(PI_Magenta);
     38printf(" +DBG+ ScSample::DrawSelf - Marker(%g) \n", 0.3);
     39g->SelMarkerSz(0.3, PI_FCircleMarker);
    3540for(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.;
     42g->DrawMarkers(x, y, 5);
     43g->SelForeground(PI_Black);
    3944
    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);
     45g->DrawLine(-4, -4, 4, 4);
     46g->DrawLine(-2, -5, 5, 2);
     47g->DrawLine(-5, -4, -2, -2);
     48g->DrawLine(1, -10, 1, 10);
    4449return; 
    4550}
  • trunk/SophyaPI/PI/sc_sample.h

    r11 r72  
    1 #include "pisysdep.h"
     1// #include "pisysdep.h"
    22
    33#include "piscdrawwdg.h"
     
    1010
    1111 
    12   virtual void DrawSelf();
     12  virtual void DrawSelf(PIGraphicUC* g, float, float, float, float);
    1313
    1414};
Note: See TracChangeset for help on using the changeset viewer.