Changeset 1904 in Sophya for trunk/SophyaPI


Ignore:
Timestamp:
Feb 18, 2002, 11:37:22 PM (24 years ago)
Author:
ansari
Message:

Introduction de la classe PIGraphicAtt - Separation en fichiers separes
des classes PIElDrawer, et PIYfXDrawer - Ajout de methodes GetFontSz
et GetFontSzPt a la classe PIFont - Extension de l'enum PIFontSize.

Reza - 18/02/2002

Location:
trunk/SophyaPI/PI
Files:
6 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/Makefile

    r1837 r1904  
    44 
    55all: $(LIB)libPI.a
    6 $(LIB)libPI.a : $(OBJ)lut.o $(OBJ)parradapter.o $(OBJ)pi3ddrw.o $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)piaxestools.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapview.o $(OBJ)picmapx.o $(OBJ)picons.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawer.o $(OBJ)pidrawwin.o $(OBJ)pidrwtools.o $(OBJ)pievthandler.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pifontgen.o $(OBJ)pifontx.o $(OBJ)pigraph3d.o $(OBJ)pigraphgen.o $(OBJ)pigraphps.o $(OBJ)pigraphuc.o $(OBJ)pigraphx.o $(OBJ)piimage.o $(OBJ)piimgtools.o $(OBJ)pilistgen.o $(OBJ)pilistx.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)piperiodx.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)piscdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)pistzwin.o $(OBJ)pisurfdr.o $(OBJ)pitherm.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o $(OBJ)psfile.o
     6$(LIB)libPI.a : $(OBJ)lut.o $(OBJ)parradapter.o $(OBJ)pi3ddrw.o $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)piaxestools.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapview.o $(OBJ)picmapx.o $(OBJ)picons.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawer.o $(OBJ)pidrawwin.o $(OBJ)pidrwtools.o $(OBJ)pieldrw.o $(OBJ)pievthandler.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pifontgen.o $(OBJ)pifontx.o $(OBJ)pigraph3d.o $(OBJ)pigraphgen.o $(OBJ)pigraphps.o $(OBJ)pigraphuc.o $(OBJ)pigraphx.o $(OBJ)pigratt.o $(OBJ)piimage.o $(OBJ)piimgtools.o $(OBJ)pilistgen.o $(OBJ)pilistx.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)piperiodx.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)piscdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)pistzwin.o $(OBJ)pisurfdr.o $(OBJ)pitherm.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o $(OBJ)piyfxdrw.o $(OBJ)psfile.o
    77        $(AR) $(ARFLAGS)  $@ $($(ARARGS))
    88ifeq ($(CXX),cxx)
     
    1111 
    1212clean:
    13         rm -f $(OBJ)lut.o $(OBJ)parradapter.o $(OBJ)pi3ddrw.o $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)piaxestools.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapview.o $(OBJ)picmapx.o $(OBJ)picons.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawer.o $(OBJ)pidrawwin.o $(OBJ)pidrwtools.o $(OBJ)pievthandler.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pifontgen.o $(OBJ)pifontx.o $(OBJ)pigraph3d.o $(OBJ)pigraphgen.o $(OBJ)pigraphps.o $(OBJ)pigraphuc.o $(OBJ)pigraphx.o $(OBJ)piimage.o $(OBJ)piimgtools.o $(OBJ)pilistgen.o $(OBJ)pilistx.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)piperiodx.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)piscdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)pistzwin.o $(OBJ)pisurfdr.o $(OBJ)pitherm.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o $(OBJ)psfile.o
     13        rm -f $(OBJ)lut.o $(OBJ)parradapter.o $(OBJ)pi3ddrw.o $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)piaxestools.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapview.o $(OBJ)picmapx.o $(OBJ)picons.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawer.o $(OBJ)pidrawwin.o $(OBJ)pidrwtools.o $(OBJ)pieldrw.o $(OBJ)pievthandler.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pifontgen.o $(OBJ)pifontx.o $(OBJ)pigraph3d.o $(OBJ)pigraphgen.o $(OBJ)pigraphps.o $(OBJ)pigraphuc.o $(OBJ)pigraphx.o $(OBJ)pigratt.o $(OBJ)piimage.o $(OBJ)piimgtools.o $(OBJ)pilistgen.o $(OBJ)pilistx.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)piperiodx.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)piscdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)pistzwin.o $(OBJ)pisurfdr.o $(OBJ)pitherm.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o $(OBJ)piyfxdrw.o $(OBJ)psfile.o
    1414ifeq ($(CXX),cxx)
    1515        cd $(REPM); rm -f *.o
     
    2323 piwdgx.h piwdggen.h pimsghandler.h picolist.h picmap.h picmapx.h \
    2424 picmapgen.h pigraphx.h pigraphgen.h pifontx.h pifontgen.h pigraphuc.h \
    25  pievthandler.h psfile.h pigraph3d.h pibwdgx.h pigraphps.h \
    26  pidrwtools.h pistdwdgx.h pistdwdggen.h pioptmenux.h pioptmenugen.h \
    27  pimenux.h pimenugen.h piwindowx.h piwindowgen.h picontainerx.h \
    28  picontainergen.h piapplx.h piapplgen.h pimenubarx.h pimenubargen.h \
    29  picons.h
     25 pievthandler.h psfile.h pigratt.h pieldrw.h pigraph3d.h pibwdgx.h \
     26 pigraphps.h pidrwtools.h pistdwdgx.h pistdwdggen.h pioptmenux.h \
     27 pioptmenugen.h pimenux.h pimenugen.h piwindowx.h piwindowgen.h \
     28 picontainerx.h picontainergen.h piapplx.h piapplgen.h pimenubarx.h \
     29 pimenubargen.h picons.h
    3030$(OBJ)piapplgen.o: piapplgen.cc piapplgen.h pimsghandler.h \
    3131 $(INC)machdefs.h pisysdep.h picontainerx.h \
     
    4949 pimenubargen.h picons.h pibwdgx.h pibwdggen.h picmap.h picmapx.h \
    5050 picmapgen.h pigraphx.h pigraphgen.h pifontx.h pifontgen.h pigraphuc.h \
    51  pievthandler.h psfile.h pigraphps.h piscdrawwdg.h pidrawer.h
     51 pievthandler.h psfile.h pigraphps.h piscdrawwdg.h pidrawer.h \
     52 pigratt.h pieldrw.h
    5253$(OBJ)pibwdggen.o: pibwdggen.cc pibwdggen.h pisysdep.h \
    5354 $(INC)machdefs.h piwdgx.h piwdggen.h \
    5455 pimsghandler.h picolist.h picmap.h picmapx.h picmapgen.h pigraphx.h \
    5556 pigraphgen.h pifontx.h pifontgen.h pigraphuc.h pievthandler.h \
    56  psfile.h pidrawer.h pigraphps.h pidrwtools.h pistdwdgx.h \
     57 psfile.h pidrawer.h pigratt.h pigraphps.h pidrwtools.h pistdwdgx.h \
    5758 pistdwdggen.h pioptmenux.h pioptmenugen.h pimenux.h pimenugen.h \
    5859 piwindowx.h piwindowgen.h picontainerx.h picontainergen.h piapplx.h \
     
    9091 pidrawer.h pibwdggen.h pisysdep.h piwdgx.h piwdggen.h pimsghandler.h \
    9192 picolist.h picmap.h picmapx.h picmapgen.h pigraphx.h pigraphgen.h \
    92  pifontx.h pifontgen.h pigraphuc.h pievthandler.h psfile.h \
     93 pifontx.h pifontgen.h pigraphuc.h pievthandler.h psfile.h pigratt.h \
    9394 pidrwtools.h pistdwdgx.h pistdwdggen.h pioptmenux.h pioptmenugen.h \
    9495 pimenux.h pimenugen.h piwindowx.h piwindowgen.h picontainerx.h \
     
    101102 picmapgen.h pigraphx.h pigraphgen.h pifontx.h pifontgen.h pigraphuc.h \
    102103 pievthandler.h psfile.h pigraphps.h pistdwdgx.h pistdwdggen.h \
    103  pidrawer.h
     104 pidrawer.h pigratt.h pieldrw.h
    104105$(OBJ)pidrwtools.o: pidrwtools.cc pidrwtools.h pisysdep.h \
    105106 $(INC)machdefs.h pistdwdgx.h pistdwdggen.h \
     
    110111 picmapgen.h pigraphx.h pigraphgen.h pifontx.h pifontgen.h pigraphuc.h \
    111112 pievthandler.h psfile.h pigraphps.h piscdrawwdg.h pidrawer.h \
    112  pi3ddrw.h pigraph3d.h
     113 pigratt.h pieldrw.h pi3ddrw.h pigraph3d.h
     114$(OBJ)pieldrw.o: pieldrw.cc $(INC)machdefs.h \
     115 pieldrw.h pidrawer.h pibwdggen.h pisysdep.h piwdgx.h piwdggen.h \
     116 pimsghandler.h picolist.h picmap.h picmapx.h picmapgen.h pigraphx.h \
     117 pigraphgen.h pifontx.h pifontgen.h pigraphuc.h pievthandler.h \
     118 psfile.h pigratt.h
    113119$(OBJ)pievthandler.o: pievthandler.cc pievthandler.h pisysdep.h \
    114120 $(INC)machdefs.h pimsghandler.h piwdgx.h \
     
    153159 piwdggen.h pimsghandler.h picolist.h picmap.h picmapx.h picmapgen.h \
    154160 pifontx.h pifontgen.h
     161$(OBJ)pigratt.o: pigratt.cc pigratt.h pisysdep.h \
     162 $(INC)machdefs.h pigraphgen.h piwdgx.h \
     163 piwdggen.h pimsghandler.h picolist.h picmap.h picmapx.h picmapgen.h \
     164 pifontx.h pifontgen.h
    155165$(OBJ)piimage.o: piimage.cc piimage.h parradapter.h \
    156  $(INC)machdefs.h lut.h pisysdep.h pidrawer.h \
    157  pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h picolist.h picmap.h \
    158  picmapx.h picmapgen.h pigraphx.h pigraphgen.h pifontx.h pifontgen.h \
    159  pigraphuc.h pievthandler.h psfile.h pipixmapx.h pipixmapgen.h \
    160  pibwdgx.h pigraphps.h pistdwdgx.h pistdwdggen.h piwindowx.h \
    161  piwindowgen.h picontainerx.h picontainergen.h picmapview.h \
    162  piimgtools.h pioptmenux.h pioptmenugen.h pimenux.h pimenugen.h \
    163  piapplx.h piapplgen.h pimenubarx.h pimenubargen.h picons.h \
    164  pidrwtools.h piscdrawwdg.h
     166 $(INC)machdefs.h lut.h pisysdep.h pieldrw.h \
     167 pidrawer.h pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h picolist.h \
     168 picmap.h picmapx.h picmapgen.h pigraphx.h pigraphgen.h pifontx.h \
     169 pifontgen.h pigraphuc.h pievthandler.h psfile.h pigratt.h pipixmapx.h \
     170 pipixmapgen.h pibwdgx.h pigraphps.h pistdwdgx.h pistdwdggen.h \
     171 piwindowx.h piwindowgen.h picontainerx.h picontainergen.h \
     172 picmapview.h piimgtools.h pioptmenux.h pioptmenugen.h pimenux.h \
     173 pimenugen.h piapplx.h piapplgen.h pimenubarx.h pimenubargen.h \
     174 picons.h pidrwtools.h piscdrawwdg.h piyfxdrw.h
    165175$(OBJ)piimgtools.o: piimgtools.cc piimgtools.h pisysdep.h \
    166176 $(INC)machdefs.h pistdwdgx.h pistdwdggen.h \
     
    171181 picmapgen.h pigraphx.h pigraphgen.h pifontx.h pifontgen.h pigraphuc.h \
    172182 pievthandler.h psfile.h pigraphps.h piimage.h parradapter.h lut.h \
    173  pidrawer.h pipixmapx.h pipixmapgen.h picmapview.h
     183 pieldrw.h pidrawer.h pigratt.h pipixmapx.h pipixmapgen.h picmapview.h
    174184$(OBJ)pilistgen.o: pilistgen.cc pilistgen.h pisysdep.h \
    175185 $(INC)machdefs.h piwdgx.h piwdggen.h \
     
    229239 pifontgen.h pigraphuc.h pievthandler.h psfile.h pigraphps.h \
    230240 pistdwdgx.h pistdwdggen.h piwindowx.h piwindowgen.h picontainerx.h \
    231  picontainergen.h pidrawer.h pidrwtools.h pioptmenux.h pioptmenugen.h \
    232  pimenux.h pimenugen.h piapplx.h piapplgen.h pimenubarx.h \
    233  pimenubargen.h picons.h piaxestools.h parradapter.h lut.h
     241 picontainergen.h pidrawer.h pigratt.h pieldrw.h pidrwtools.h \
     242 pioptmenux.h pioptmenugen.h pimenux.h pimenugen.h piapplx.h \
     243 piapplgen.h pimenubarx.h pimenubargen.h picons.h piaxestools.h
    234244$(OBJ)pistdwdggen.o: pistdwdggen.cc pistdwdggen.h pisysdep.h \
    235245 $(INC)machdefs.h piwdgx.h piwdggen.h \
     
    249259 pidrawer.h pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h picolist.h \
    250260 picmap.h picmapx.h picmapgen.h pigraphx.h pigraphgen.h pifontx.h \
    251  pifontgen.h pigraphuc.h pievthandler.h psfile.h pigraph3d.h pibwdgx.h \
    252  pigraphps.h
     261 pifontgen.h pigraphuc.h pievthandler.h psfile.h pigratt.h pieldrw.h \
     262 pigraph3d.h pibwdgx.h pigraphps.h
    253263$(OBJ)pitherm.o: pitherm.cc pitherm.h pisysdep.h \
    254264 $(INC)machdefs.h pibwdgx.h pibwdggen.h \
     
    278288 pigraphx.h pigraphgen.h pifontx.h pifontgen.h pigraphuc.h \
    279289 pievthandler.h psfile.h pigraphps.h pixtbase.h
     290$(OBJ)piyfxdrw.o: piyfxdrw.cc $(INC)machdefs.h \
     291 piyfxdrw.h pisysdep.h parradapter.h lut.h pidrawer.h pibwdggen.h \
     292 piwdgx.h piwdggen.h pimsghandler.h picolist.h picmap.h picmapx.h \
     293 picmapgen.h pigraphx.h pigraphgen.h pifontx.h pifontgen.h pigraphuc.h \
     294 pievthandler.h psfile.h pigratt.h
    280295$(OBJ)psfile.o: psfile.cc psfile.h $(INC)machdefs.h \
    281296 pisysdep.h pifontgen.h pigraphgen.h piwdgx.h piwdggen.h \
  • trunk/SophyaPI/PI/objlist.list

    r1589 r1904  
    1717pidrawwin.o
    1818pidrwtools.o
     19pieldrw.o
    1920pievthandler.o
    2021pifilechogen.o
     
    2728pigraphuc.o
    2829pigraphx.o
     30pigratt.o
    2931piimage.o
    3032piimgtools.o
     
    5254piwindowx.o
    5355pixtbase.o
     56piyfxdrw.o
    5457psfile.o
  • trunk/SophyaPI/PI/pi3ddrw.cc

    r1827 r1904  
    141141                            double yl1, double yl2, double zl1, double zl2)
    142142{
    143   if (mLAtt == PI_NotDefLineAtt)    g3->SelLine(PI_ThinLine);
    144   if (mFSz == PI_NotDefFontSize)    g3->SelFontSz((YMax()-YMin())/150.);
     143  if (mGrAtt.GetLineAtt() == PI_NotDefLineAtt)    g3->SelLine(PI_ThinLine);
     144  // RZZZZZ  if (mGrAtt. == PI_NotDefFontSize)    g3->SelFontSz((YMax()-YMin())/150.);
    145145
    146146  PIGrCoord x1,y1,z1,x2,y2,z2;
  • trunk/SophyaPI/PI/pi3ddrw.h

    r348 r1904  
    99#include "pisysdep.h"
    1010#include "pidrawer.h"
     11#include "pieldrw.h"
    1112#include "pigraph3d.h"
    1213
  • trunk/SophyaPI/PI/picons.cc

    r1640 r1904  
    968968      break;
    969969    case 3103 :
    970       SelectFont(PI_BigSizeFont);
     970      SelectFont(PI_LargeSizeFont);
    971971      AutoSize();
    972972      break;
  • trunk/SophyaPI/PI/pidrawer.cc

    r1899 r1904  
    11// Module PI : Peida Interactive     PIDrawer
    2 // Classe de traceurs pouvat être attachés à une PIBaseWdg
     2// Classe de traceurs pouvant être attachés à une PIBaseWdg
    33//            E. Aubourg , R.Ansari     96-98
    44// LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA
     
    5656  mFgHighLight = false;  // Flag de control d'affichage en mode HighLight
    5757
    58   mFCol = mBCol = PI_NotDefColor;
    59   mLAtt = PI_NotDefLineAtt;
    60   mFSz = PI_NotDefFontSize;
    61   mFAtt = PI_NotDefFontAtt;
    62   mMSz = -1;
    63   mMrk = PI_NotDefMarker;
    64   mCmapid = CMAP_OTHER;
    65   mRevCmap = false;
    66   mFName = PI_DefaultFont;
    6758
    6859  // Nom par defaut : Le nom de la classe
     
    239230//--
    240231
    241 void
    242 PIDrawer::SetColAtt(PIColors fg, PIColors bg)
    243 {
    244   mFCol = fg;
    245   mBCol = bg;
    246 }
    247 
    248 void
    249 PIDrawer::SetLineAtt(PILineAtt lat)
    250 {
    251   mLAtt = lat;
    252 }
    253 
    254 void
    255 PIDrawer::SetFontAtt(PIFontSize fsz, PIFontAtt fat)
    256 {
    257   mFSz = fsz;
    258   mFAtt = fat;
    259 }
    260 
    261 void
    262 PIDrawer::SetFont(PIFontName fn, PIFontSize fsz, PIFontAtt fat)
    263 {
    264   mFName = fn;
    265   mFSz = fsz;
    266   mFAtt = fat;
    267 }
    268 
    269 void
    270 PIDrawer::SetMarkerAtt(int sz, PIMarker mrk)
    271 {
    272   mMSz = sz;
    273   mMrk = mrk;
    274 }
    275 
    276 void
    277 PIDrawer::SetArrowMarkerAtt(int sz, PIArrowMarker mrk)
    278 {
    279   mArrowMrkSz = sz;
    280   mArrowMrk = mrk;
    281 }
    282 
    283 void
    284 PIDrawer::SetColMapId(CMapId cid, bool rev)
    285 {
    286   mCmapid = cid;
    287   mRevCmap = rev;
    288 }
    289232
    290233void
    291234PIDrawer::SelGraAtt(PIGraphicUC* g)
    292235{
    293   if (mFCol != PI_NotDefColor)    g->SelForeground(mFCol);
    294   if (mBCol != PI_NotDefColor)    g->SelBackground(mBCol);
    295   if (mLAtt != PI_NotDefLineAtt)  g->SelLine(mLAtt);
    296   if (mFName != PI_DefaultFont) {
    297     PIFont myfont(mFName);
    298     myfont.SetFontAtt(mFAtt);
    299     myfont.SetFontSz(mFSz);
    300     g->SelFont(myfont);
    301   }
    302   else if ( (mFSz != PI_NotDefFontSize) || (mFAtt != PI_NotDefFontAtt)  )
    303                                   g->SelFont(mFSz, mFAtt);
    304   if ( (mMrk != PI_NotDefMarker) || (mMSz >= 0) )
    305                                   g->SelMarker(mMSz, mMrk);
     236  PIColors fcol = GetGraphicAtt().GetFgColor();
     237  if (fcol != PI_NotDefColor)    g->SelForeground(fcol);
     238  PIColors bcol = GetGraphicAtt().GetBgColor();
     239  if (bcol != PI_NotDefColor)    g->SelBackground(bcol);
     240  if (GetGraphicAtt().GetLineAtt() != PI_NotDefLineAtt) 
     241    g->SelLine(GetGraphicAtt().GetLineAtt());
     242  if ( (GetGraphicAtt().GetFontName() != PI_DefaultFont) ||
     243       (GetGraphicAtt().GetFontAtt() != PI_NotDefFontAtt) )
     244    g->SelFont(GetGraphicAtt().GetFont());
     245  if (GetGraphicAtt().GetMarker() != PI_NotDefMarker)
     246    g->SelMarker(GetGraphicAtt().GetMarkerSize(), GetGraphicAtt().GetMarker());
    306247}
    307248
     
    343284
    344285int
    345 PIDrawer::DecodeOptionString(vector<string> & opt)
     286PIDrawer::DecodeOptionString(vector<string> & opt, bool rmdecop)
    346287{
    347288  // a faire un jour OP+Reza 30/11/01
     
    422363{
    423364  g->NoClip();
    424   if (mLAtt == PI_NotDefLineAtt)  g->SelLine(PI_ThinLine);
    425   else g->SelLine(mLAtt);
    426   if (mFCol == PI_NotDefColor) g->SelForeground(PI_Black);
    427   else g->SelForeground(mFCol);
     365  if (GetGraphicAtt().GetLineAtt() == PI_NotDefLineAtt)  g->SelLine(PI_ThinLine);
     366  else g->SelLine(GetGraphicAtt().GetLineAtt());
     367  if (GetGraphicAtt().GetColor() == PI_NotDefColor) g->SelForeground(PI_Black);
     368  else g->SelForeground(GetGraphicAtt().GetColor());
    428369  //  On calcule les ticks
    429370  CalcTicks();
     
    575516  int kk;
    576517
    577   if (mFSz == PI_NotDefFontSize)
    578     g->SelFontSz(xMajTickLen*4., mFAtt);  // Passage de x3. a x4. - Reza Janvier 2002
     518  if (axesAFSz)
     519    g->SelFontSz(xMajTickLen*4.);  // Passage de x3. a x4. - Reza Janvier 2002
    579520
    580521  // Choix du bon format pour les labels des axes;
     
    606547  double xOffset = 0;
    607548
    608   if (mFSz == PI_NotDefFontSize)
    609     g->SelFontSz(xMajTickLen*4., mFAtt);    // Passage de x3. a x4. - Reza Janvier 2002
     549  if (axesAFSz)
     550    g->SelFontSz(xMajTickLen*4.);  // Passage de x3. a x4. - Reza Janvier 2002
    610551
    611552  // Choix du bon format pour les labels des axes;
     
    714655}
    715656
    716 /*  --------------------------------------------------------------  */
    717 /*  ------------------- Classe PIElDrawer ------------------------  */
    718 /*  --------------------------------------------------------------  */
    719 
    720 //++
    721 // Class        PIElDrawer
    722 // Lib          PI
    723 // include      pidrawer.h
    724 //
    725 //      Classe de traceur ("Drawer") capable de gérer et de
    726 //      tracer une liste d'éléments simples. Cette classe
    727 //      est utilisé pour le tracé des axes et des éléments de
    728 //      texte ds les "PIScDrawWdg", "PIDraw3DWdg" et "PIImage".
    729 //--
    730 //++
    731 // Links        Parents
    732 // PIDrawer
    733 //--
    734 
    735 //++
    736 // Titre        Constructeurs et méthodes
    737 //--
    738 
    739 //++
    740 // PIElDrawer()
    741 //      Constructeur
    742 //--
    743 
    744 /* --Methode-- */
    745 PIElDrawer::PIElDrawer()
    746 {
    747 mEn = 0;
    748 titleT = titleB = "";
    749 }
    750 
    751 /* --Methode-- */
    752 PIElDrawer::~PIElDrawer()
    753 {
    754 }
    755 
    756 
    757 //++
    758 //  void  SetTitles(const char* tt=NULL, const char* tb=NULL)
    759 //      Ajout de titres haut ("tt") et bas ("tb")
    760 //  void  SetTitles(string const & tt, string const & tb)
    761 //      Ajout de titres haut ("tt") et bas ("tb")
    762 //--
    763 
    764 /* --Methode-- */
    765 void PIElDrawer::SetTitles(const char* tt, const char* tb)
    766 {
    767 if (tt != NULL)  titleT = tt;
    768 if (tb != NULL)  titleB = tb;
    769 }
    770 
    771 /* --Methode-- */
    772 void PIElDrawer::SetTitles(string const & tt, string const & tb)
    773 {
    774 titleT = tt;  titleB = tb;
    775 }
    776 
    777 //++
    778 // int  ElAddText(PIGrCoord x, PIGrCoord y, const char* s, PIColors c=PI_NotDefColor)
    779 //      Ajout d'un élément texte avec un attribut de couleur.
    780 //      Renvoie le numéro identificateur de l'élément.
    781 // int  ElAddLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2, -
    782 //                 PIColors c=PI_NotDefColor)
    783 //      Ajout d'un élément de ligne avec un attribut de couleur.
    784 //      Renvoie le numéro identificateur de l'élément.
    785 // int  ElAddRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy, -
    786 //                PIColors c=PI_NotDefColor)
    787 //      Ajout d'un élément de type rectangle avec un attribut de couleur.
    788 //      Renvoie le numéro identificateur de l'élément.
    789 // int  ElAddFRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy, -
    790 //                PIColors c=PI_NotDefColor)
    791 //      Ajout d'un élément de type rectangle plein avec un attribut de couleur.
    792 //      Renvoie le numéro identificateur de l'élément.
    793 // int  ElAddCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r, PIColors c=PI_NotDefColor)
    794 //      Ajout d'un élément de type cercle avec un attribut de couleur.
    795 //      Renvoie le numéro identificateur de l'élément.
    796 // int  ElAddFCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r, PIColors c=PI_NotDefColor)
    797 //      Ajout d'un élément de type cercle plein avec un attribut de couleur.
    798 //      Renvoie le numéro identificateur de l'élément.
    799 //
    800 // void  ElDel(int id)
    801 //      Suppression de l'élément avec l'identificateur "id".
    802 // void  ElDelAll()
    803 //      Suppression de tous les éléments du dessin.
    804 //--
    805 
    806 /* --Methode-- */
    807 void  PIElDrawer::Draw(PIGraphicUC* g, double /*xmin*/, double /*ymin*/, double /*xmax*/, double /*ymax*/)
    808 {
    809 SelGraAtt(g);   // DrawAxes change certains attributs graphiques
    810 DrawAxes(g);   // Trace des axes
    811 g->SelFont(PI_NormalSizeFont, mFAtt);
    812 SelGraAtt(g);   // DrawAxes change certains attributs graphiques
    813 
    814 // Trace des titres
    815 if ( (titleT.length() > 0) || (titleB.length() > 0) ) {
    816   aXdir = false;  // Vrai si Axe X de Droite vers Gauche
    817   aYdir = false;  // Vrai si Axe Y de Haut vers Bas
    818   PIGrCoord gas, gds;
    819   double fx, fy, fh;
    820 //  fh = g->GetFontHeightUC(gas, gds);
    821   fh = 0.075*(YMax()-YMin());
    822   if ( titleT.length() > 0) {
    823       fx = g->CalcStringWidth(titleT.c_str());
    824       if(aXdir) fx = g->DeltaUCX(XMax(), -(XMax()-XMin()-fx)/2.);
    825       else fx = g->DeltaUCX(XMin(), (XMax()-XMin()-fx)/2.);
    826       if (g->isAxeYDirUpDown()) fy = g->DeltaUCY(YMin(), -fh);
    827       else fy = g->DeltaUCY(YMax(), fh);
    828       g->DrawString(fx, fy, titleT.c_str());
    829 //      printf(" PIElDrawer::Draw()/DBG (%g , %g) %s  - %g \n", fx, fy, titleT.c_str(), fh);
    830     }
    831   if ( titleB.length() > 0) {
    832       fx = g->CalcStringWidth(titleB.c_str());
    833       if(aXdir) fx = g->DeltaUCX(XMax(), -(XMax()-XMin()-fx)/2.);
    834       else fx = g->DeltaUCX(XMin(), (XMax()-XMin()-fx)/2.);
    835       if (g->isAxeYDirUpDown()) fy =  g->DeltaUCY(YMax(), fh*1.5);
    836       else fy = g->DeltaUCY(YMin(), -fh*1.5);
    837       g->DrawString(fx, fy, titleB.c_str());
    838 //      printf(" PIElDrawer::Draw()/DBG (%g , %g) %s  - %g \n", fx, fy, titleT.c_str(), fh);
    839     }
    840   }
    841 DrwElList::iterator it;
    842 PIColors cc = g->GetForeground();
    843 for (it = mElist.begin(); it != mElist.end(); it++)
    844   {
    845   if ((*it).col != PI_NotDefColor)  g->SelForeground((*it).col);
    846   switch ( (*it).etyp )
    847     {
    848     case PIDEL_Line :
    849       g->DrawLine((*it).ex, (*it).ey, (*it).edx, (*it).edy );
    850       break;
    851     case PIDEL_Text :
    852       g->DrawString((*it).ex, (*it).ey, (char*) ((*it).es.c_str()) );
    853       break;
    854     case PIDEL_Rect :
    855       g->DrawBox((*it).ex, (*it).ey, (*it).edx, (*it).edy );
    856       break;
    857     case PIDEL_FRect :
    858       g->DrawFBox((*it).ex, (*it).ey, (*it).edx, (*it).edy );
    859       break;
    860     case PIDEL_Circ :
    861       g->DrawCircle((*it).ex, (*it).ey, (*it).edx );
    862       break;
    863     case PIDEL_FCirc :
    864       g->DrawFCircle((*it).ex, (*it).ey, (*it).edx );
    865       break;
    866     default :
    867       break;
    868     }
    869   g->SelForeground(cc);
    870   }
    871 }
    872 
    873 
    874 /* --Methode-- */
    875 int PIElDrawer::ElAdd(int typ, PIGrCoord x, PIGrCoord  y, PIGrCoord dx, PIGrCoord dy, const char* s, PIColors c)
    876 {
    877 DrwEl dre;
    878 mEn++;
    879 dre.eid = mEn;  dre.etyp = typ;
    880 dre.ex = x;   dre.ey = y;
    881 dre.edx = dx;  dre.edy = dy;
    882 dre.col = c;
    883 if (s)  dre.es = s;
    884 mElist.push_back(dre);
    885 return(mEn);
    886 }
    887 
    888 /* --Methode-- */
    889 void  PIElDrawer::ElDel(int id)
    890 {
    891 DrwElList::iterator it;
    892 for (it = mElist.begin(); it != mElist.end(); it++)
    893   if ( (*it).eid == id) { mElist.erase(it);   break; }
    894 return;
    895 }
    896 
    897 /* --Methode-- */
    898 void  PIElDrawer::ElDelAll()
    899 {
    900 mElist.erase(mElist.begin(), mElist.end());
    901 return;
    902 }
    903 
  • trunk/SophyaPI/PI/pidrawer.h

    r1899 r1904  
    88#include "pibwdggen.h"
    99#include "pigraphuc.h"
     10#include "pigratt.h"
    1011
    1112
     
    3839                             { aXlog = logx; aYlog = logy; }
    3940
     41  virtual void       SetAxesFlags(unsigned int flags=kAxesNone);
     42  inline  void       SetAxesAutoFontSize(bool fg=true) { axesAFSz = fg; }
     43
    4044  virtual void       DrawAxes(PIGraphicUC* g);
    41   virtual void       SetAxesFlags(unsigned int flags=kAxesNone);
    42    
     45
    4346  virtual void       Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax);
    4447
     
    6669
    6770  inline unsigned int GetAxesFlags() { return(axesFlags); }
     71  inline  bool       isAxesAutoFontSize(bool fg=true) { return axesAFSz; }
    6872
    6973  inline PIGraphicUC*    GetGraphicUC() { return(mGrUC); }
     
    7276  inline void         FreeLimits() {limitsFixed = 0;}
    7377
     78  virtual void        SelGraAtt(PIGraphicUC* g);
     79
    7480// Changement des attributs graphiques
    75   virtual void       SetColAtt(PIColors fg=PI_NotDefColor,
    76                                PIColors bg=PI_NotDefColor);
    77   virtual void       SetLineAtt(PILineAtt lat=PI_NotDefLineAtt);
    78   virtual void       SetFontAtt(PIFontSize fsz=PI_NotDefFontSize,
    79                                 PIFontAtt fat=PI_NotDefFontAtt);
    80   virtual void       SetFont(PIFontName fn, PIFontSize fsz=PI_NotDefFontSize,
    81                              PIFontAtt fat=PI_NotDefFontAtt);
    82   virtual void       SetMarkerAtt(int sz=1, PIMarker mrk=PI_NotDefMarker);
    83   virtual void       SetArrowMarkerAtt(int sz=5, PIArrowMarker mrk=PI_NotDefArrowMarker);
    84   virtual void       SetColMapId(CMapId cid=CMAP_OTHER, bool rev=false);
    85 
    86   void               SelGraAtt(PIGraphicUC* g);
     81  inline void         SetGraphicAtt(PIGraphicAtt const& att) { mGrAtt = att; }
     82  inline void         UpdateGraphicAtt(PIGraphicAtt const& att)
     83                      { mGrAtt.UpdateFrom(att); }
    8784
    8885// Acces aux attributs graphiques
    89   inline PIColors    GetFgColAtt()  { return(mFCol); }
    90   inline PIColors    GetBgColAtt()  { return(mBCol); }
    91   inline PILineAtt   GetLineAtt()   { return(mLAtt); }
    92   inline PIFontSize  GetFontSz()    { return(mFSz);  }
    93   inline PIFontAtt   GetFontAtt()   { return(mFAtt); }
    94   inline PIFontName  GetFontName()  { return(mFName);}
    95   inline int         GetMarkerSz()  { return(mMSz);  }
    96   inline PIMarker    GetMarker()    { return(mMrk);  }
    97   inline int           GetArrowMarkerSz()  { return(mArrowMrkSz);  }
    98   inline PIArrowMarker GetArrowMarker()  { return(mArrowMrk);  }
    99   inline CMapId      GetColMapId()  { return(mCmapid); }
    100   inline CMapId      GetColMapId(bool & rev)  { rev = mRevCmap; return(mCmapid); }
    101 
     86  inline PIGraphicAtt  GetGraphicAtt() const { return(mGrAtt); }
     87  inline PIGraphicAtt& GetGraphicAtt() { return(mGrAtt); }
    10288
    10389//  Methode permettant l'affichage d'une fenetre de controle specialisee
     
    10793
    10894//   Methode permettant de decoder des options a partir de chaines
    109   virtual int        DecodeOptionString(vector<string> & opt);
     95  virtual int        DecodeOptionString(vector<string> & opt, bool rmdecopt=true);
    11096
    11197//   On peut donner un nom a un drawer (par defaut = nom de la classe)
     
    158144  int limitsFixed;
    159145  unsigned int axesFlags;
    160  
     146  bool axesAFSz;
    161147  PIBaseWdgGen* mBWdg;
    162148  PIGraphicUC* mGrUC;
     
    173159
    174160//  Gestion d attributs graphiques associes a chaque drawer
    175   PIColors           mFCol, mBCol;
    176   PILineAtt          mLAtt;
    177   PIFontName         mFName;
    178   PIFontSize         mFSz;
    179   PIFontAtt          mFAtt;
    180   int                mMSz;
    181   PIMarker           mMrk; 
    182   int                mArrowMrkSz;
    183   PIArrowMarker      mArrowMrk;
    184   CMapId             mCmapid;
    185   bool               mRevCmap;
     161  PIGraphicAtt   mGrAtt;
    186162
    187163};
    188164
    189165
    190 //  Classe avec gestion d une liste d elements a tracer
    191 
    192 class PIElDrawer : public PIDrawer
    193 {
    194 public:
    195   enum { PIDEL_Line = 1, PIDEL_Text = 2,
    196          PIDEL_Rect = 3, PIDEL_FRect = 4,
    197          PIDEL_Circ = 5, PIDEL_FCirc = 6 } ;
    198 
    199                      PIElDrawer();
    200   virtual           ~PIElDrawer();
    201 
    202   virtual void       SetTitles(const char* tt=NULL, const char* tb=NULL);
    203   virtual void       SetTitles(string const & tt, string const & tb);
    204 
    205   virtual void       Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax);
    206 
    207   inline int         ElAddLine(PIGrCoord x1, PIGrCoord y1, PIGrCoord x2, PIGrCoord y2,
    208                                PIColors c=PI_NotDefColor)
    209     { return( ElAdd(PIDEL_Line, x1, y1, x2, y2, NULL, c) ); } 
    210   inline int         ElAddText(PIGrCoord x, PIGrCoord y, const char* s, PIColors c=PI_NotDefColor)
    211     { return( ElAdd(PIDEL_Text, x, y, 0, 0, s, c) ); } 
    212   inline int         ElAddRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy,
    213                                PIColors c=PI_NotDefColor)
    214     { return( ElAdd(PIDEL_Rect, x, y, dx, dy, NULL, c) ); } 
    215   inline int         ElAddFRect(PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy,
    216                                PIColors c=PI_NotDefColor)
    217     { return( ElAdd(PIDEL_FRect, x, y, dx, dy, NULL, c) ); } 
    218   inline int         ElAddCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r, PIColors c=PI_NotDefColor)
    219     { return( ElAdd(PIDEL_Circ, x, y, r, r, NULL, c) ); } 
    220   inline int         ElAddFCirc(PIGrCoord x, PIGrCoord y, PIGrCoord r, PIColors c=PI_NotDefColor)
    221     { return( ElAdd(PIDEL_FCirc, x, y, r, r, NULL, c) ); } 
    222 
    223   void               ElDel(int id);
    224   void               ElDelAll();
    225 
    226 protected:
    227   int                ElAdd(int typ, PIGrCoord x, PIGrCoord y, PIGrCoord dx, PIGrCoord dy,
    228                            const char* s, PIColors c=PI_NotDefColor);
    229 #ifdef __DECCXX
    230 public:
    231 #endif
    232   struct DrwEl{
    233     int eid, etyp;
    234     PIGrCoord ex,ey;
    235     PIGrCoord edx,edy;
    236     string es;
    237     PIColors col;
    238   };
    239 #ifdef __DECCXX
    240 protected:
    241 #endif
    242   typedef list<DrwEl> DrwElList;
    243 
    244   DrwElList mElist;
    245   int mEn;
    246 
    247   string titleT, titleB;       // Titre Haut - Bas
    248 
    249 };
    250166
    251167#endif
  • trunk/SophyaPI/PI/pidrwtools.cc

    r1887 r1904  
    250250mOpt[7]->AppendItem("Small FontSz", 802);
    251251mOpt[7]->AppendItem("Normal FontSz", 803);
    252 mOpt[7]->AppendItem("Big FontSz", 804);
     252mOpt[7]->AppendItem("Large FontSz", 804);
    253253mOpt[7]->AppendItem("Huge FontSz", 805);
    254254mOpt[7]->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
     
    348348                               PI_ItalicFont, PI_BoldItalicFont };
    349349static PIFontSize fntsz[6] = { PI_NotDefFontSize, PI_TinySizeFont, PI_SmallSizeFont,
    350                                PI_NormalSizeFont, PI_BigSizeFont, PI_HugeSizeFont };
     350                               PI_NormalSizeFont, PI_LargeSizeFont, PI_HugeSizeFont };
    351351
    352352/* --Methode-- */
     
    438438if (!dr)  return;
    439439int ii,jj,kk;
    440 PIColors fc = dr->GetFgColAtt();
     440PIGraphicAtt const & gratt = dr->GetGraphicAtt();
     441PIColors fc = gratt.GetFgColor();
    441442for(kk=0; kk<MYNMXCOLORS; kk++)
    442443  if (fc == cols[kk])  { mOpt[0]->SetValue(100+kk);  break; }   
    443 CMapId cmi = dr->GetColMapId();
     444CMapId cmi = gratt.GetColMapId();
    444445if (cmi == CMAP_OTHER)  mOpt[1]->SetValue(200);
    445446else for(kk=0; kk<PIColorMap::NumberStandardColorMaps(); kk++)
    446447  if (cmi == PIColorMap::GetStandardColorMapId(kk)) { mOpt[1]->SetValue(201+kk);  break; } 
    447 PIMarker mk = dr->GetMarker();   
     448PIMarker mk = gratt.GetMarker();   
    448449for(kk=0; kk<12; kk++)
    449450  if (mk == mrk[kk])   { mOpt[2]->SetValue(300+kk);  break; }
    450 kk = dr->GetMarkerSz();
     451kk = gratt.GetMarkerSz();
    451452if (kk < 1)  kk = 1;
    452453if (kk > 15) kk = 15;
    453454if (kk%2 == 0) kk++;
    454455mOpt[3]->SetValue(400+kk);
    455 PIFontName fnm = dr->GetFontName();
    456 PIFontAtt fat = dr->GetFontAtt();
    457 PIFontSize fsz = dr->GetFontSz();
     456PIFontName fnm = gratt.GetFontName();
     457PIFontAtt fat = gratt.GetFontAtt();
     458PIFontSize fsz = gratt.GetFontSz();
     459
    458460for(ii=0; ii<5; ii++)
    459461  if (fnm ==  fntname[ii]) break;
     
    470472mOpt[7]->SetValue(800+jj);
    471473
    472 PILineAtt lat = dr->GetLineAtt();
     474PILineAtt lat = gratt.GetLineAtt();
    473475for(kk=0; kk<13; kk++)
    474476  if (lat == line[kk])   { mOpt[5]->SetValue(600+kk);  break; }
     
    484486  if (drw == NULL)  return;
    485487  mCurBW->SetActiveDrawer(mNDr);
     488  PIGraphicAtt gratt;
    486489  int k,ii,jj,kk;
    487490  k = mOpt[0]->GetValue()-100;
    488491  if ( (k < 0) || (k >= MYNMXCOLORS) )  k = 0;
    489   drw->SetColAtt(cols[k]);
     492  gratt.SetColAtt(cols[k]);
    490493  k = mOpt[1]->GetValue()-200;
    491   if (k == 0) drw->SetColMapId(CMAP_OTHER);
    492   else drw->SetColMapId(PIColorMap::GetStandardColorMapId(k-1));
     494  if (k == 0) gratt.SetColMapId(CMAP_OTHER);
     495  else gratt.SetColMapId(PIColorMap::GetStandardColorMapId(k-1));
    493496  k =  mOpt[2]->GetValue()-300;
    494497  if ( (k < 0) || (k > 11) )  k = 0;
     
    499502  //   kk = 3;
    500503  //  }
    501   drw->SetMarkerAtt(kk, mrk[k]);
     504  gratt.SetMarkerAtt(kk, mrk[k]);
    502505  ii =  (mOpt[4]->GetValue()-500);
    503506  jj =  (mOpt[6]->GetValue()-700);
    504507  kk =  (mOpt[7]->GetValue()-800);
    505   drw->SetFont(fntname[ii], fntsz[kk], fntatt[jj]);
     508  gratt.SetFontAtt(fntname[ii], fntsz[kk], fntatt[jj]);
    506509
    507510  k =  mOpt[5]->GetValue()-600;
    508511  if ( (k < 0) || (k > 12) )  k = 0;
    509   drw->SetLineAtt(PILineAtt(line[k]));
     512  gratt.SetLineAtt(PILineAtt(line[k]));
    510513  if (fgref)  mCurBW->Refresh();
    511514  else drw->Refresh();
     
    515518void PIDrwTools::Process(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/)
    516519{
    517   char strg[64];
    518520
    519521  PIMessage mod = ModMsg(msg);
  • trunk/SophyaPI/PI/pifontgen.cc

    r322 r1904  
    2121//      et de la taille *PIFontSize*.
    2222//      * PIFontName :
    23 //|     PI_DefaultFont , PI_CourierFont , PI_SymbolFont
     23//|     PI_DefaultFont , PI_CourierFont , PI_HelveticaFont,
     24//|     PI_TimesFont, PI_SymbolFont
    2425//      * PIFontSize :
    25 //|     PI_SmallSizeFont , PI_NormalSizeFont , PI_BigSizeFont, PI_HugeSizeFont
     26//|     PI_TinySizeFont, PI_SmallSizeFont , PI_NormalSizeFont ,
     27//|     PI_LargeSizeFont, PI_VeryLargeSizeFont, PI_HugeSizeFont
    2628//      * PIFontAtt :   
    27 //|     PI_RomanFont , PI_BoldFont , PI_ItalicFont
     29//|     PI_RomanFont , PI_BoldFont , PI_ItalicFont , PI_BoldItalicFont
    2830//--
    2931
     
    7678// PIFontAtt  GetFontAtt()
    7779//      Retourne l'attribut de fonte
    78 // int  GetFontSize()
     80// PIFontSize  GetFontSz()
     81//      Retourne la taille de fonte converti en enum PIFontSize
     82// int  GetFontSzPt()
    7983//      Retourne la taille de fonte en points (pixels)
     84// int  GetFontSeze()
     85//      Retourne la taille de fonte en points (pixels) - idem GetFontSzPt()
    8086// int GetFontHeight(int& asc, int& desc)
    8187//      Renvoie la hauteur des caractères, ainsi que la taille au dessus
  • trunk/SophyaPI/PI/pifontgen.h

    r1564 r1904  
    1414                  PI_TinySizeFont = 1,
    1515                  PI_SmallSizeFont = 2, PI_NormalSizeFont = 3,
    16                   PI_BigSizeFont = 4, PI_HugeSizeFont = 5 };
     16                  PI_LargeSizeFont = 4, PI_VeryLargeSizeFont = 5,
     17                  PI_HugeSizeFont = 6 };
    1718
    1819enum PIFontAtt { PI_NotDefFontAtt = -1,
     
    3536  virtual void          SetFontSzPt(int npt)            = 0;
    3637
    37   virtual PIFontName    GetFontName()                   = 0;
    38   virtual PIFontAtt     GetFontAtt()                    = 0;
    39   virtual int           GetFontSize()                   = 0;
     38  virtual PIFontName    GetFontName()  const            = 0;
     39  virtual PIFontAtt     GetFontAtt()  const             = 0;
     40  virtual PIFontSize    GetFontSz() const               = 0;
     41  virtual int           GetFontSzPt() const             = 0;
     42  inline  int           GetFontSize() const { return GetFontSzPt(); }
    4043
    41   virtual int           GetFontHeight(int& asc, int& desc)      = 0;
    42   virtual int           GetStringWidth(char const* s)           = 0;
     44  virtual int           GetFontHeight(int& asc, int& desc) const        = 0;
     45  virtual int           GetStringWidth(char const* s) const             = 0;
    4346};
    4447
  • trunk/SophyaPI/PI/pifontx.cc

    r1564 r1904  
    8282
    8383/* --Methode-- */
    84 PIFontName PIFontX::GetFontName()
     84PIFontName PIFontX::GetFontName() const
    8585{
    8686return(mFName);
     
    8888
    8989/* --Methode-- */
    90 PIFontAtt PIFontX::GetFontAtt()
     90PIFontAtt PIFontX::GetFontAtt() const
    9191{
    9292return(mFAtt);
     
    9494
    9595/* --Methode-- */
    96 int PIFontX::GetFontSize()
     96int PIFontX::GetFontSzPt() const
    9797{
    9898return(mFSize);
    9999}
    100100
    101 /* --Methode-- */
    102 int PIFontX::GetFontHeight(int& asc, int& desc)
     101
     102/* --Methode-- */
     103int PIFontX::GetFontHeight(int& asc, int& desc) const
    103104{
    104105char a[2];
     
    111112
    112113/* --Methode-- */
    113 int PIFontX::GetStringWidth(char const* s)
     114int PIFontX::GetStringWidth(char const* s) const
    114115{
    115116return(XTextWidth(mFSt, s, strlen(s)));
     
    117118
    118119
    119 #define NMAXFONTSZ    9
     120#define NMAXFONTSZ    13
    120121#define NMAXFONTATT   4
    121122#define NMAXFONTTYP   5
     
    123124/*  Variables globales pour la gestion des fontes  */
    124125static XFontStruct * fntst[NMAXFONTSZ][NMAXFONTATT][NMAXFONTTYP];
    125 static int fntsz[NMAXFONTSZ] = {8,9,10,11,12,14,18,24,36};
    126 static int TinyFontIndex = 0;
    127 static int SmallFontIndex = 2;
    128 static int NormalFontIndex = 4;
    129 static int BigFontIndex = 6;
    130 static int HugeFontIndex = 8;
     126static int fntsz[NMAXFONTSZ] = {8,9,10,11,12,14,16,18,20,24,28,32,36};
     127static int TinyFontIndex = 1;
     128static int SmallFontIndex = 3;
     129static int NormalFontIndex = 5;
     130static int LargeFontIndex = 7;
     131static int VeryLargeFontIndex = 9;
     132static int HugeFontIndex = 11;
    131133static  PIFontAtt fntatt[NMAXFONTATT] =
    132134        { PI_RomanFont, PI_BoldFont, PI_ItalicFont, PI_BoldItalicFont };
     
    136138
    137139/* --Methode-- */
     140PIFontSize PIFontX::GetFontSz() const
     141{
     142  int fnidx[6],k;
     143  fnidx[0] = TinyFontIndex;
     144  fnidx[1] = SmallFontIndex;
     145  fnidx[2] = NormalFontIndex;
     146  fnidx[3] = LargeFontIndex;
     147  fnidx[4] = VeryLargeFontIndex;
     148  fnidx[5] = HugeFontIndex;
     149  PIFontSize rfnsz[6] = {PI_TinySizeFont, PI_SmallSizeFont, PI_NormalSizeFont,
     150                         PI_LargeSizeFont, PI_VeryLargeSizeFont, PI_HugeSizeFont};
     151  PIFontSize rs = PI_NormalSizeFont;
     152  int diff = mFSize-fntsz[NormalFontIndex];
     153  int diffsz = (diff < 0) ? -diff : diff;
     154  for(k=0; k<6; k++) {
     155    diff = mFSize-fntsz[fnidx[k]];
     156    if (diff < 0)  diff = -diff;
     157    if (diff < diffsz) {
     158      diffsz = diff;
     159      rs = rfnsz[k];
     160    }
     161  }
     162return(rs);
     163}
     164
     165/* --Methode-- */
    138166void PIFontX::SelectFont(PIFontName fn, PIFontAtt fa, PIFontSize fs)
    139167{
     
    149177    isz = fntsz[NormalFontIndex];
    150178    break;
    151   case PI_BigSizeFont:
    152     isz = fntsz[BigFontIndex];
     179  case PI_LargeSizeFont:
     180    isz = fntsz[LargeFontIndex];
     181    break;
     182  case PI_VeryLargeSizeFont:
     183    isz = fntsz[VeryLargeFontIndex];
    153184    break;
    154185  case PI_HugeSizeFont:
     
    360391NormalFontIndex = kksel;
    361392SmallFontIndex = (kksel > 1) ? kksel-2 : 0 ;
    362 BigFontIndex =  (kksel < NMAXFONTSZ-2) ? kksel+2 :  NMAXFONTSZ-1;
     393TinyFontIndex = (kksel > 3) ? kksel-4 : 0 ; 
     394LargeFontIndex =  (kksel < NMAXFONTSZ-2) ? kksel+2 :  NMAXFONTSZ-1;
     395VeryLargeFontIndex =  (kksel < NMAXFONTSZ-4) ? kksel+4 :  NMAXFONTSZ-1;
     396HugeFontIndex =  (kksel < NMAXFONTSZ-6) ? kksel+6 :  NMAXFONTSZ-1;
    363397// On garde HugeFontIndex et TinyFontIndex aux tailles extremes
    364398// HugeFontIndex = NMAXFONTSZ-1;
  • trunk/SophyaPI/PI/pifontx.h

    r317 r1904  
    2828  virtual void          SetFontSzPt(int npt);
    2929
    30   virtual PIFontName    GetFontName();
    31   virtual PIFontAtt     GetFontAtt();
    32   virtual int           GetFontSize();
     30  virtual PIFontName    GetFontName() const ;
     31  virtual PIFontAtt     GetFontAtt() const ;
     32  virtual PIFontSize    GetFontSz() const;
     33  virtual int           GetFontSzPt() const ;
    3334
    34   virtual int           GetFontHeight(int& asc, int& desc);
    35   virtual int           GetStringWidth(char const* s);
     35  virtual int           GetFontHeight(int& asc, int& desc) const ;
     36  virtual int           GetStringWidth(char const* s) const ;
    3637
    3738// En public pour PIGraphicX
  • trunk/SophyaPI/PI/pigraphuc.cc

    r1899 r1904  
    4545//      Permet de modifier l'objet "PIGraphic" de départ et l'espace graphique correspondant.
    4646//
    47 // void  SelFontSz(PIGrCoord sz, PIFontAtt att=PI_RomanFont)
     47// void  SelFontSz(PIGrCoord sz)
    4848//      Sélection de fonte avec la taille exprimée en coordonnées utilisateur
     49// void  SelFontSz(PIGrCoord sz, PIFontAtt att)
     50//      Sélection de fonte avec la taille exprimée en coordonnées utilisateur, avec
     51//      Spécification d'attribut de fonte
    4952// void  SelMarkerSz(PIGrCoord msz, PIMarker mrk=PI_DotMarker)
    5053//      Sélection de marker avec la taille exprimée en coordonnées utilisateur
     
    802805
    803806/* --Methode-- */
     807void PIGraphicUC::SelFontSz(PIGrCoord sz)
     808{
     809  if (!mGrC) return;
     810  SelFontSz(sz, mGrC->GetFont().GetFontAtt());
     811}
     812
     813/* --Methode-- */
    804814void PIGraphicUC::SelFontSz(PIGrCoord sz, PIFontAtt att)
    805815{
  • trunk/SophyaPI/PI/pigraphuc.h

    r1899 r1904  
    8989  virtual void       SelFontSzPt(int npt=12, PIFontAtt att=PI_RomanFont);
    9090//  Fonctions specifiques a PIGraphicUC :
    91   virtual void       SelFontSz(PIGrCoord sz, PIFontAtt att=PI_RomanFont);
     91  virtual void       SelFontSz(PIGrCoord sz);
     92  virtual void       SelFontSz(PIGrCoord sz, PIFontAtt att);
    9293  virtual void       SelMarkerSz(PIGrCoord msz, PIMarker mrk=PI_DotMarker);
    9394
  • trunk/SophyaPI/PI/piimage.cc

    r1549 r1904  
    1313#include "pidrwtools.h"
    1414#include "piscdrawwdg.h"
     15#include "piyfxdrw.h"
    1516#include PIAPP_H
    1617
     
    352353  string dum = "";
    353354  drw = new PIYfXDrawer(cutarrx, NULL, true);
    354     drw->SetColAtt(PI_Red);
    355     drw->SetMarkerAtt(5, PI_CrossMarker);
    356     drw->SetLineAtt(PI_ThinLine);
     355    drw->GetGraphicAtt().SetColAtt(PI_Red);
     356    drw->GetGraphicAtt().SetMarkerAtt(5, PI_CrossMarker);
     357    drw->GetGraphicAtt().SetLineAtt(PI_ThinLine);
    357358    cutscw->AddScDrawer(drw, true);
    358359    dum += "Red: X, ";
    359360  drw = new PIYfXDrawer(cutarry, NULL, true);
    360     drw->SetColAtt(PI_Blue);
    361     drw->SetMarkerAtt(5, PI_TriangleMarker);
    362     drw->SetLineAtt(PI_ThinLine);
     361    drw->GetGraphicAtt().SetColAtt(PI_Blue);
     362    drw->GetGraphicAtt().SetMarkerAtt(5, PI_TriangleMarker);
     363    drw->GetGraphicAtt().SetLineAtt(PI_ThinLine);
    363364    cutscw->AddScDrawer(drw, true);
    364365    dum += "Blue: Y, ";
    365366  drw = new PIYfXDrawer(cutarrd, NULL, true);
    366     drw->SetColAtt(PI_Green);
    367     drw->SetMarkerAtt(5, PI_PlusMarker);
    368     drw->SetLineAtt(PI_ThinLine);
     367    drw->GetGraphicAtt().SetColAtt(PI_Green);
     368    drw->GetGraphicAtt().SetMarkerAtt(5, PI_PlusMarker);
     369    drw->GetGraphicAtt().SetLineAtt(PI_ThinLine);
    369370    cutscw->AddScDrawer(drw, true);
    370371    dum += "Green: XY, ";
    371372  drw = new PIYfXDrawer(cutarra, NULL, true);
    372     drw->SetColAtt(PI_Orange);
    373     drw->SetMarkerAtt(5, PI_BoxMarker);
    374     drw->SetLineAtt(PI_ThinLine);
     373    drw->GetGraphicAtt().SetColAtt(PI_Orange);
     374    drw->GetGraphicAtt().SetMarkerAtt(5, PI_BoxMarker);
     375    drw->GetGraphicAtt().SetLineAtt(PI_ThinLine);
    375376    cutscw->AddScDrawer(drw, true);
    376377    dum += "Orange: -XY";
     
    533534int cmapid = cmp->Type();
    534535if ( (cmapid == CMAP_GREY32) || (cmapid == CMAP_GREYINV32) ||
    535      (cmapid == CMAP_GREY128) || (cmapid == CMAP_GREYINV128))  mdrw->SetColAtt(PI_Red);
    536 else mdrw->SetColAtt(PI_Turquoise);
     536     (cmapid == CMAP_GREY128) || (cmapid == CMAP_GREYINV128))  mdrw->GetGraphicAtt().SetColAtt(PI_Red);
     537else mdrw->GetGraphicAtt().SetColAtt(PI_Turquoise);
    537538PIPixmap::SetColMap(cmp, refr);
    538539if (refr) { xcurs =  ycurs = -1; }
     
    547548{
    548549if ( (cmapid == CMAP_GREY32) || (cmapid == CMAP_GREYINV32) ||
    549      (cmapid == CMAP_GREY128) || (cmapid == CMAP_GREYINV128))  mdrw->SetColAtt(PI_Red);
    550 else mdrw->SetColAtt(PI_Turquoise);
     550     (cmapid == CMAP_GREY128) || (cmapid == CMAP_GREYINV128))  mdrw->GetGraphicAtt().SetColAtt(PI_Red);
     551else mdrw->GetGraphicAtt().SetColAtt(PI_Turquoise);
    551552PIPixmap::SetColMapId(cmapid, revidx, refr);
    552553if (zow)  zow->SetColMapId(cmapid, revidx, refr);
     
    10191020int cmapid = cmap->Type();
    10201021if ( (cmapid == CMAP_GREY32) || (cmapid == CMAP_GREYINV32) ||
    1021      (cmapid == CMAP_GREY128) || (cmapid == CMAP_GREYINV128)) gvdrw->SetColAtt(PI_Red);
    1022 else gvdrw->SetColAtt(PI_Turquoise);
    1023 gvdrw->SetLineAtt(PI_NormalLine);
     1022     (cmapid == CMAP_GREY128) || (cmapid == CMAP_GREYINV128))
     1023  gvdrw->GetGraphicAtt().SetColAtt(PI_Red);
     1024else gvdrw->GetGraphicAtt().SetColAtt(PI_Turquoise);
     1025gvdrw->GetGraphicAtt().SetLineAtt(PI_NormalLine);
    10241026gvdrw->ElAddRect(x,y,dx,dy);
    10251027gvw->AddDrawer(gvdrw, xw1, yw1, xw2, yw2, false);
  • trunk/SophyaPI/PI/piimage.h

    r1640 r1904  
    1111#include "pisysdep.h"
    1212
    13 #include "pidrawer.h"
     13#include "pieldrw.h"
    1414#include PIPIXMAP_H
    1515#include PISTDWDG_H
  • trunk/SophyaPI/PI/piscdrawwdg.cc

    r1884 r1904  
    1010#include "pidrwtools.h"
    1111#include "piaxestools.h"
    12 #include "parradapter.h"
    1312
    1413
     
    565564}
    566565
    567 // --------------------------------------------------------------------------
    568 // --------------------------------------------------------------------------
    569 // --------------------------------------------------------------------------
    570 // ----------------------------------------------------------
    571 //  Classe de trace de points/fonctions Y=f(X)
    572 //  Trace Y=ay->Value() = f(X= ax->Value()) si ax et ay != NULL
    573 //  Trace Y=ax->Value() = f(X= ax->X())  si ay == NULL
    574 // ----------------------------------------------------------
    575 // --------------------------------------------------------------------------
    576 
    577 //++
    578 // Class        PIYfXDrawer
    579 // Lib          PI
    580 // include      piscdrawwdg.h
    581 //
    582 //      Classe de traceur de points/fonctions Y = f(X).
    583 //--
    584 //++
    585 // Links        Parents
    586 // PIDrawer
    587 //--
    588 //++
    589 // Links        Voir aussi
    590 // P1DArrayAdapter
    591 //--
    592 //++
    593 // Titre        Constructeur
    594 //--
    595 
    596 //++
    597 // PIYfXDrawer(P1DArrayAdapter* ax, P1DArrayAdapter* ay, bool ad)
    598 //      Constructeur. Tracé de
    599 //|      Y=ay->Value() = f(X= ax->Value()) si ax et ay != NULL
    600 //|     Y=ax->Value() = f(X= ax->X())  si ay == NULL
    601 //      Si "ad==true" les objets "ax" et "ay" sont détruits par
    602 //      le destructeur de "PIYfXDrawer".
    603 //--
    604 
    605 /* --Methode-- */
    606 PIYfXDrawer::PIYfXDrawer(P1DArrayAdapter* ax, P1DArrayAdapter* ay, bool ad)
    607     : PIDrawer()
    608 {
    609   mAdDO = ad;
    610   mAx = ax;
    611   mAy = ay;
    612   mName = "YfXDrawer";
    613 }
    614 
    615 /* --Methode-- */
    616 PIYfXDrawer::~PIYfXDrawer()
    617 {
    618   if (mAdDO && mAx)  delete mAx;
    619   if (mAdDO && mAy)  delete mAy;
    620 }
    621 
    622 /* --Methode-- */
    623 void PIYfXDrawer::UpdateLimits()
    624 {
    625   if ((mAx == NULL))  mSz = 0;
    626   else {
    627     if (!mAy)  mSz = mAx->Size();
    628     else   mSz = (mAx->Size() < mAy->Size()) ? mAx->Size() :  mAy->Size();
    629     }
    630   if (mSz <= 0)  return;
    631   double xmin, xmax, ymin, ymax;
    632   int i=0;
    633   double cv;
    634   if (mAy) {
    635     xmin = xmax = mAx->Value(0);
    636     ymin = ymax = mAy->Value(0);
    637     for(i=1; i<mSz; i++) {
    638       cv = mAx->Value(i);
    639       if (cv < xmin)  xmin = cv;
    640       if (cv > xmax)  xmax = cv;
    641       cv = mAy->Value(i);
    642       if (cv < ymin)  ymin = cv;
    643       if (cv > ymax)  ymax = cv;
    644       }
    645     }
    646   else {
    647     xmin = xmax = mAx->X(0);
    648     ymin = ymax = mAx->Value(0);
    649     for(i=1; i<mSz; i++) {
    650       cv = mAx->X(i);
    651       if (cv < xmin)  xmin = cv;
    652       if (cv > xmax)  xmax = cv;
    653       cv = mAx->Value(i);
    654       if (cv < ymin)  ymin = cv;
    655       if (cv > ymax)  ymax = cv;
    656       }
    657     }
    658 
    659   double dx, dy;
    660   dx = 0.02*(xmax-xmin);
    661   dy = 0.02*(ymax-ymin);
    662 
    663   SetLimits(xmin-dx, xmax+dx, ymin-dy, ymax+dy);
    664   SetAxesFlags(kBoxAxes | kExtTicks | kLabels);
    665 }
    666 
    667 
    668 /* --Methode-- */
    669 void PIYfXDrawer::Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax)
    670 {
    671   double xp,yp;
    672   int i;
    673 
    674   if ((mAx == NULL))  mSz = 0;
    675   else {
    676     if (!mAy)  mSz = mAx->Size();
    677     else   mSz = (mAx->Size() < mAy->Size()) ? mAx->Size() :  mAy->Size();
    678     }
    679   if (mSz <= 0)  return;
    680 
    681 //  Trace des markers
    682   if ( (mMrk != PI_NotDefMarker) ||  (mLAtt == PI_NotDefLineAtt) ) {
    683     for(i=0; i<mSz; i++) {
    684       if (mAy) { xp = mAx->Value(i); yp = mAy->Value(i); }
    685       else { xp = mAx->X(i);  yp = mAx->Value(i); }
    686       if ( (xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax) )  continue;
    687       g->DrawMarker(xp, yp);
    688     }
    689   }
    690 
    691   if (mLAtt == PI_NotDefLineAtt)    return;
    692 
    693 // Trace des lignes
    694   double xp2, yp2;
    695   if (mAy) { xp2 = mAx->Value(0); yp2 = mAy->Value(0); }
    696   else { xp2 = mAx->X(0);  yp2 = mAx->Value(0); }
    697   for(i=1; i<mSz; i++) {
    698     xp = xp2; yp = yp2;
    699     if (mAy) { xp2 = mAx->Value(i); yp2 = mAy->Value(i); }
    700     else { xp2 = mAx->X(i);  yp2 = mAx->Value(i); }
    701     if ( ((xp < xmin) || (xp > xmax) || (yp < ymin) || (yp > ymax)) &&
    702          ((xp2 < xmin) || (xp2 > xmax) || (yp2 < ymin) || (yp2 > ymax)) )  continue;
    703     g->DrawLine(xp, yp, xp2, yp2);
    704   }
    705 }
    706 
    707 
    708 //================================================================
    709 // PIFuncDrawer
    710 // Classe de traceur de fonction  double = f(fouble)
    711 //================================================================
    712 
    713 //++
    714 // Class        PIFuncDrawer
    715 // Lib          PI
    716 // include      piscdrawwdg.h
    717 //
    718 //      Classe de traceur de fonctions Y = f(double X).
    719 //--
    720 //++
    721 // Links        Parents
    722 // PIDrawer
    723 //--
    724 //++
    725 // Titre        Constructeur
    726 //--
    727 //++
    728 //  PIFuncDrawer(FUNC f)
    729 //      Cosntructeur de traceur d'une fonction "FUNC f" avec
    730 //|     typedef double(*FUNC)(double)
    731 //--
    732 
    733 
    734 /* --Methode-- */
    735 PIFuncDrawer::PIFuncDrawer(PIFuncDrawer::FUNC f)
    736 : mFunc(f)
    737 {}
    738 
    739 /* --Methode-- */
    740 PIFuncDrawer::~PIFuncDrawer()
    741 {
    742 }
    743 
    744 /* --Methode-- */
    745 void
    746 PIFuncDrawer::Draw(PIGraphicUC* g, double /*xmin*/, double/*ymin*/, double/*xmax*/, double/*ymax*/)
    747 {
    748   PIGrCoord x1, x2, y1, y2;
    749   g->GetGrSpace(x1, x2, y1, y2);
    750   double xMax = x2;
    751   double xMin = x1;
    752   double yMax = y2;
    753   double yMin = y1;
    754   double xStep = (xMax - xMin)/100;
    755   double xOld = xMin;
    756   double yOld = mFunc(xMin);
    757   for (double x = xMin+xStep; x<xMax; x+=xStep) {
    758     double y = mFunc(x);
    759     if (y>yMin && yOld>yMin &&
    760         y<yMax && yOld<yMax)
    761            g->DrawLine(xOld, yOld, x, y);
    762     xOld = x;
    763     yOld = y;
    764   }
    765 }
     566
  • trunk/SophyaPI/PI/piscdrawwdg.h

    r1884 r1904  
    11// This may look like C code, but it is really -*- C++ -*-
    2 // Module PI : Peida Interactive  PIScDrawWdg PIYfXDrawer
     2// Module PI : Peida Interactive  PIScDrawWdg
    33// Gestionnaire Drawer-2D  E.Aubourg, R. Ansari  96-98
    44// LAL (Orsay) / IN2P3-CNRS  DAPNIA/SPP (Saclay) / CEA
     
    1212#include PIWIN_H
    1313#include "pidrawer.h"
     14#include "pieldrw.h"
    1415
    1516
     
    121122
    122123
    123 // ----------------------------------------------------------
    124 // Classe de traceur de points/fonction Y=F(x)
    125 // Trace Y=ay->Value() = f(X= ax->Value()) si ax et ay != NULL
    126 // Trace Y=ax->Value() = f(X= ax->X())  si ay == NULL
    127  
    128 class P1DArrayAdapter;
    129 class PIYfXDrawer : public PIDrawer {
    130 public:
    131                      PIYfXDrawer(P1DArrayAdapter* ax, P1DArrayAdapter* ay, bool ad);
    132   virtual           ~PIYfXDrawer();
    133  
    134   virtual void       Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax);
    135   virtual void       UpdateLimits();
    136  
    137        
    138 protected:
    139   P1DArrayAdapter* mAx;
    140   P1DArrayAdapter* mAy;
    141   int mSz;
    142   bool mAdDO;
    143 };
    144 
    145 // ----------------------------------------------------------
    146 // Classe de traceur de fonction  double = f(fouble)
    147 // ----------------------------------------------------------
    148 
    149 class PIFuncDrawer : public PIDrawer {
    150 public:
    151   typedef double(*FUNC)(double);
    152                      PIFuncDrawer(FUNC);
    153   virtual           ~PIFuncDrawer();
    154  
    155   virtual void       Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax);
    156 protected:
    157   FUNC               mFunc;
    158 };
    159124
    160125#endif
  • trunk/SophyaPI/PI/pisurfdr.cc

    r1855 r1904  
    226226
    227227  PIGrCoord xg[5],yg[5],zg[5];
    228   PIColors fgc;
    229 
    230 
    231   if (mCmapid == CMAP_OTHER) {   // Trace avec des lignes
    232     if (mLAtt == PI_NotDefLineAtt)    g3->SelLine(PI_ThinLine);
    233     fgc = ( mFCol == PI_NotDefColor ) ? PI_Black : mFCol;
     228  PIColors mfcol = GetGraphicAtt().GetFgColor();
     229  PIColors fgc = mfcol;
     230
     231
     232  if (GetGraphicAtt().GetColMapId() == CMAP_OTHER) {   // Trace avec des lignes
     233    if (GetGraphicAtt().GetLineAtt() == PI_NotDefLineAtt)    g3->SelLine(PI_ThinLine);
     234    fgc = (mfcol  == PI_NotDefColor ) ? PI_Black : mfcol;
    234235    for(l=0;l<k;l++) {
    235236      i =  ijzp[l].ij%xsz;
     
    254255  }
    255256  else {   // Trace avec niveaux de couleur
    256     PIColorMap* cmap = new PIColorMap(mCmapid);
    257     PIColors fgc;
    258     if ( (mCmapid == CMAP_GREY32) || (mCmapid == CMAP_GREYINV32) ||
    259          (mCmapid == CMAP_GREY128)  || (mCmapid == CMAP_GREYINV128) )
    260       fgc = ( mFCol == PI_NotDefColor ) ? PI_Red : mFCol;
    261     else  fgc = ( mFCol == PI_NotDefColor ) ? PI_Black : mFCol;
     257    PIColorMap* cmap = new PIColorMap(GetGraphicAtt().GetColMapId());
     258    CMapId mcmapid = GetGraphicAtt().GetColMapId();
     259    if ( (mcmapid == CMAP_GREY32) || (mcmapid == CMAP_GREYINV32) ||
     260         (mcmapid == CMAP_GREY128)  || (mcmapid == CMAP_GREYINV128) )
     261      fgc = ( mfcol == PI_NotDefColor ) ? PI_Red : mfcol;
     262    else  fgc = ( mfcol == PI_NotDefColor ) ? PI_Black : mfcol;
    262263    for(l=0;l<k;l++) {
    263264      i =  ijzp[l].ij%xsz;
     
    275276      g3->DrawFPolygon3D(xg,yg,zg,5);
    276277// On trace
    277       if (mLAtt == PI_NotDefLineAtt)   continue;
     278      if (GetGraphicAtt().GetLineAtt() == PI_NotDefLineAtt)   continue;
    278279      g3->SelForeground(fgc);
    279280      g3->DrawPolygon3D(xg,yg,zg,5);
  • trunk/SophyaPI/PI/psfile.cc

    r1899 r1904  
    5757  \
    5858  PI_RomanFont, PI_BoldFont, PI_ItalicFont, PI_NotDefFontAtt,\
    59   PI_SmallSizeFont, PI_NormalSizeFont, PI_BigSizeFont, PI_NotDefFontSize, \
     59  PI_SmallSizeFont, PI_NormalSizeFont, PI_LargeSizeFont, PI_NotDefFontSize, \
    6060  \
    6161  PI_NormalLine, PI_ThinLine, PI_ThickLine, PI_NotDefLineAtt
     
    9595%%/FS%-2d {8  scalefont setfont} bind def          %% PI_SmallSizeFont\n\
    9696%%/FS%-2d {12 scalefont setfont} bind def          %% PI_NormalSizeFont\n\
    97 %%/FS%-2d {16 scalefont setfont} bind def          %% PI_BigSizeFont\n\
     97%%/FS%-2d {16 scalefont setfont} bind def          %% PI_LargeSizeFont\n\
    9898/FS%-2d {}                     bind def          %% PI_NotDefFontSize\n\
    9999/L%-2d  {1    slw} bind def                      %% PI_NormalLine\n\
Note: See TracChangeset for help on using the changeset viewer.