Changeset 1538 in Sophya


Ignore:
Timestamp:
Jun 18, 2001, 3:08:38 PM (24 years ago)
Author:
ansari
Message:

Fin (provisoire) modifs de PSFile et PIColorMapView - Reza 18/6/2001

Location:
trunk/SophyaPI/PI
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/Tests/pit0.cc

    r1512 r1538  
    232232
    233233// Gestion des actions en fonctions des messages
     234      printf("DBG-PITApp::Process() Msg= %d (%d - %d) - Sender=%lx - %lx\n",
     235            (int)msg, (int)UserMsg(msg),(int)ModMsg(msg), (long)sender, (long)this);
    234236
    235237switch(UserMsg(msg))    {
  • trunk/SophyaPI/PI/picmapview.cc

    r1512 r1538  
    122122      dx = (sx-xc)/(cmap->NCol()-k);
    123123      g->SelForeground((*cmap), k);
    124       g->DrawFBox(xc, 0, dx, sy);
     124      g->DrawFBox(xc, 0, dx+1, sy);
    125125      xc += dx;
    126126    }
     
    133133      yc -= dy;
    134134      g->SelForeground((*cmap), k);
    135       g->DrawFBox(0, yc, sx, dy);
     135      g->DrawFBox(0, yc, sx, dy+1);
    136136    }
    137137  }
     
    140140  if ( (cmap->Type() == CMAP_GREY32) || (cmap->Type() == CMAP_GREYINV32) ||
    141141       (cmap->Type() == CMAP_GREY128) || (cmap->Type() == CMAP_GREYINV128) )  g->SelForeground(PI_Red);
    142   else g->SelForeground(PI_Turquoise);
     142  else g->SelForeground(PI_Green);
    143143
    144144  if (sx > sy) {    // horizontal
    145     int fsz = (sy < 20) ? sy-8 : 12;
     145    int fsz = (sy < 20) ? sy-6 : 14;
    146146    g->SelFontSzPt(fsz, PI_BoldFont);
    147147    char buff[32];
     
    157157    }
    158158  else {   // vertical
    159     int fsz = (sx < 40) ? sx/4 : 12;
     159    int fsz = (sx < 64) ? sx/4 : 14;
    160160    g->SelFontSzPt(fsz, PI_BoldFont);
    161161    char buff[32];
  • trunk/SophyaPI/PI/pigraphps.cc

    r1534 r1538  
    3333//      "(x0, y0)" détermine l'origine du nouveau bloc rectangulaire sur
    3434//      la page et "dx, dy" l'extension du bloc.
    35 // PIGraphicPS(PSFile * psf, PIWdg* wdg, double ofx, double ofy)
     35// PIGraphicPS(PSFile * psf, PIWdg* wdg, double ofx, double ofy, double scale_x, double scale_y)
    3636//      Création d'un objet "PIGraphicPS" à partir d'un objet "PSFIle* psf"
    3737//|     x0 = wdg->XPos()+ofx    y0 = wdg->YPos()+ofy
    38 //|     dx = wdg->XSize()       dy = wdg->YSize()
     38//|     Extension du bloc dans la page:
     39//|     Tx = wdg->XSize()*scale_x    Ty = wdg->YSize()*scale_y
    3940//
    4041// int kind()
     
    4849{
    4950BuildFromPSFile(psf, (double)wdg->XPos()+ofx, (double)wdg->YPos()+ofy,
    50                 (double)wdg->XSize(), (double)wdg->YSize(),
    51                 (double)wdg->XSize()*scale_x, (double)wdg->YSize()*scale_y ); 
     51                (double)wdg->XSize()*scale_x, (double)wdg->YSize()*scale_y,
     52                (double)wdg->XSize(), (double)wdg->YSize());
    5253}
    5354
  • trunk/SophyaPI/PI/psfile.cc

    r684 r1538  
    472472}
    473473
     474//++
     475// NewPage(double Dx, double Dy, PIOrientation orientation)
     476//      Debut de nouvelle page, (Dx,Dy) indique l'extension
     477//      (taille) du systeme de coordonnees utilisees pour la page
     478// EndPage()
     479//      Fin de page
     480//--
     481
    474482void  PSFile::NewPage(double Dx, double Dy, PIOrientation orientation) {
    475483
     
    642650
    643651
     652//++
     653// NewBloc(double x0, double y0, double Tx, double Ty, double Dx, double Dy)
     654//      Debut de bloc.
     655//|     x0,y0 : position du bloc ds la page
     656//|     Tx,Ty : Taille du bloc dans la page
     657//|     Dx,Dy : Extension (taille) du systeme de coordonnees utilisateur
     658//|     dans le bloc
     659//
     660// EndBloc()
     661//      Fin de bloc
     662//--
     663
     664
    644665void  PSFile::NewBloc(double x0, double y0, double Tx, double Ty,
    645666                              double Dx, double Dy){
     
    857878
    858879    /* Dessin du fond */
    859     if ( (FillColor != PI_NotDefColor) || (FillColor != mFillColor) )
    860         mFillColor = FillColor;
    861     fprintf(mPSFile, "C%d ", mFillColor) ;
     880    if ( (FillColor != PI_NotDefColor) || (FillColor != mFillColor) ) {
     881      mFillColor = FillColor;
     882      fprintf(mPSFile, "C%d ", mFillColor) ;
     883    }
    862884    fprintf(mPSFile, "gs n %.2f Ux %.2f Uy %.2f Ux %.2f Uy box f gr\n",
    863885            Tx, Ty, x0, y0) ;
    864886   
    865887    /* Dessin du contour (s'il y a lieu) */
    866     if ( (DrawColor != PI_NotDefColor) && (FillColor != DrawColor) )
     888    if ( (DrawColor != PI_NotDefColor) && (FillColor != DrawColor) ) {
    867889        mDrawColor = DrawColor;
    868     fprintf(mPSFile, "C%d ", mDrawColor) ;
    869     fprintf(mPSFile, "gs n %.2f Ux %.2f Uy %.2f Ux %.2f Uy box s gr\n",
    870             Tx, Ty, x0, y0) ;
     890        fprintf(mPSFile, "C%d ", mDrawColor) ;
     891        fprintf(mPSFile, "gs n %.2f Ux %.2f Uy %.2f Ux %.2f Uy box s gr\n",
     892                Tx, Ty, x0, y0) ;
     893    }
    871894}
    872895
     
    971994
    972995    /* Dessin du fond... */
    973     if ( (FillColor != PI_NotDefColor) || (FillColor != mFillColor) )
     996    if ( (FillColor != PI_NotDefColor) || (FillColor != mFillColor) ) {
    974997        mFillColor = FillColor;
    975     fprintf(mPSFile, "C%d ", mFillColor) ;
     998        fprintf(mPSFile, "C%d ", mFillColor) ;
     999    }
    9761000    fprintf(mPSFile, "%.2f Ux %.2f Uy m\n", x[0], y[0]);
    9771001    int i;
     
    9811005
    9821006    /* ...puis du contour (s'il y a lieu) */
    983     if ( (DrawColor != PI_NotDefColor) && (DrawColor != FillColor) )
    984         mDrawColor = DrawColor;
    985     fprintf(mPSFile, "C%d ", mDrawColor) ;
    986     fprintf(mPSFile, "%.2f Ux %.2f Uy m\n", x[0], y[0]);
    987     for(i = 1; i<n; i++)
    988       fprintf(mPSFile, cmd, x[i], y[i]);
    989     fprintf(mPSFile, "c s\n");
     1007    if ( (DrawColor != PI_NotDefColor) && (DrawColor != FillColor) ) {
     1008      mDrawColor = DrawColor;
     1009      fprintf(mPSFile, "C%d ", mDrawColor) ;
     1010      fprintf(mPSFile, "%.2f Ux %.2f Uy m\n", x[0], y[0]);
     1011      for(i = 1; i<n; i++)
     1012        fprintf(mPSFile, cmd, x[i], y[i]);
     1013      fprintf(mPSFile, "c s\n");
     1014    }
    9901015}
    9911016
Note: See TracChangeset for help on using the changeset viewer.