Changeset 11 in Sophya


Ignore:
Timestamp:
Mar 29, 1996, 2:33:30 PM (30 years ago)
Author:
eros
Message:

Ajout de DrawPolygon et DrawFPolygon , GOXOR et GOCopy, DrawMarkers et
petites autres modifs (piimage et piscdrawwdg) Reza

Location:
trunk/SophyaPI/PI
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaPI/PI/Makefile

    r9 r11  
    3333 CCI := ${INC}/CInc/
    3434 CXI := ${INC}/CxxInc/
     35 GLB := ${GNU}/${MACHEROS}/lib/
    3536#--
    3637
     
    4748  CPPFLAGS :=  -I${INC} -D${MACHEROSD}
    4849endif
    49 AR       := ar
     50AR       := /usr/bin/ar
    5051ARFLAGS  := -rcs
    5152
     
    7778#------------------------------------------------- End of Makefile.h -------
    7879 
    79 all: $(LIB)libPI.a 
    80 $(LIB)libPI.a : $(OBJ)ex_dessin.o $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapx.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawwin.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pihisto.o $(OBJ)piimage.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)piscdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o
    81         ar -rs $@ $?
    82 
    83 $(OBJ)ex_dessin.o: ex_dessin.cc ex_dessin.h pisysdep.h pibwdgx.h pibwdggen.h \
    84  piwdgx.h piwdggen.h pimsghandler.h
    85 $(OBJ)piapplgen.o: piapplgen.cc piapplgen.h pimsghandler.h pisysdep.h \
     80all: $(LIB)libPI.a
     81$(LIB)libPI.a : $(OBJ)piapplgen.o $(OBJ)piapplx.o $(OBJ)pibwdggen.o $(OBJ)pibwdgx.o $(OBJ)picmap.o $(OBJ)picmapgen.o $(OBJ)picmapx.o $(OBJ)picontainergen.o $(OBJ)picontainerx.o $(OBJ)pidrawwin.o $(OBJ)pifilechogen.o $(OBJ)pifilechox.o $(OBJ)pihisto.o $(OBJ)piimage.o $(OBJ)pimenubargen.o $(OBJ)pimenubarx.o $(OBJ)pimenugen.o $(OBJ)pimenux.o $(OBJ)pimsghandler.o $(OBJ)pioptmenugen.o $(OBJ)pioptmenux.o $(OBJ)pipixmapgen.o $(OBJ)pipixmapx.o $(OBJ)piscdrawwdg.o $(OBJ)pistdwdggen.o $(OBJ)pistdwdgx.o $(OBJ)piwdggen.o $(OBJ)piwdgx.o $(OBJ)piwindowgen.o $(OBJ)piwindowx.o $(OBJ)pixtbase.o
     82        $(AR) $(ARFLAGS)  $@ $?
     83 
     84$(OBJ)piapplgen.o: ./piapplgen.cc piapplgen.h pimsghandler.h pisysdep.h \
    8685 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimenubarx.h \
    8786 pimenubargen.h pimenux.h pimenugen.h
    88 $(OBJ)piapplx.o: piapplx.cc piapplx.h piapplgen.h pimsghandler.h pisysdep.h \
    89  picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimenubarx.h \
    90  pimenubargen.h pimenux.h pimenugen.h
    91 $(OBJ)pibwdggen.o: pibwdggen.cc pibwdggen.h pisysdep.h piwdgx.h piwdggen.h \
     87$(OBJ)piapplx.o: ./piapplx.cc piapplx.h piapplgen.h pimsghandler.h \
     88 pisysdep.h picontainerx.h picontainergen.h piwdgx.h piwdggen.h \
     89 pimenubarx.h pimenubargen.h pimenux.h pimenugen.h
     90$(OBJ)pibwdggen.o: ./pibwdggen.cc pibwdggen.h pisysdep.h piwdgx.h piwdggen.h \
    9291 pimsghandler.h
    93 $(OBJ)pibwdgx.o: pibwdgx.cc pibwdgx.h pisysdep.h pibwdggen.h piwdgx.h \
     92$(OBJ)pibwdgx.o: ./pibwdgx.cc pibwdgx.h pisysdep.h pibwdggen.h piwdgx.h \
    9493 piwdggen.h pimsghandler.h pixtbaseP.h pixtbase.h
    95 $(OBJ)picmap.o: picmap.cc picmap.h pisysdep.h picmapx.h picmapgen.h
    96 $(OBJ)picmapgen.o: picmapgen.cc picmapgen.h pisysdep.h picmapx.h picmap.h
    97 $(OBJ)picmapx.o: picmapx.cc piwdgx.h piwdggen.h pimsghandler.h picmapx.h \
     94$(OBJ)picmap.o: ./picmap.cc picmap.h pisysdep.h picmapx.h picmapgen.h
     95$(OBJ)picmapgen.o: ./picmapgen.cc picmapgen.h pisysdep.h picmapx.h picmap.h
     96$(OBJ)picmapx.o: ./picmapx.cc piwdgx.h piwdggen.h pimsghandler.h picmapx.h \
    9897 picmapgen.h pisysdep.h
    99 $(OBJ)picontainergen.o: picontainergen.cc picontainergen.h pisysdep.h \
     98$(OBJ)picontainergen.o: ./picontainergen.cc picontainergen.h pisysdep.h \
    10099 piwdgx.h piwdggen.h pimsghandler.h
    101 $(OBJ)picontainerx.o: picontainerx.cc picontainerx.h pisysdep.h \
     100$(OBJ)picontainerx.o: ./picontainerx.cc picontainerx.h pisysdep.h \
    102101 picontainergen.h piwdgx.h piwdggen.h pimsghandler.h
    103 $(OBJ)pidrawwin.o: pidrawwin.cc pidrawwin.h pisysdep.h piwindowx.h \
    104  piwindowgen.h picontainerx.h picontainergen.h piwdgx.h piwdggen.h \
    105  pimsghandler.h piscdrawwdg.h pibwdgx.h pibwdggen.h
    106 $(OBJ)pifilechogen.o: pifilechogen.cc pifilechogen.h pisysdep.h piwdgx.h \
    107  piwdggen.h pimsghandler.h
    108 $(OBJ)pifilechox.o: pifilechox.cc pisysdep.h pifilechox.h pifilechogen.h \
    109  piwdgx.h piwdggen.h pimsghandler.h piwindowx.h piwindowgen.h \
    110  picontainerx.h picontainergen.h
    111 $(OBJ)pihisto.o: pihisto.cc pihisto.h piscdrawwdg.h pisysdep.h pibwdgx.h \
    112  pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h \
    113  $(INC)histos.h $(INC)peida.h \
    114  $(INC)defs.h $(INC)utils.h \
    115  $(INC)machine.h \
    116  $(INC)perrors.h \
    117  $(INC)exceptions.h
    118 $(OBJ)piimage.o: piimage.cc piimage.h $(INC)cimage.h \
    119  $(INC)rzimage.h \
    120  $(INC)rzvect.h \
    121  $(INC)machine.h $(INC)defs.h \
    122  $(INC)exceptions.h \
    123  $(INC)perrors.h \
    124  $(INC)datatypes.h $(INC)lut.h \
    125  pisysdep.h pipixmapx.h pipixmapgen.h pibwdgx.h pibwdggen.h piwdgx.h \
    126  piwdggen.h pimsghandler.h picmap.h picmapx.h picmapgen.h pistdwdgx.h \
    127  pistdwdggen.h $(INC)imageop.h
    128 $(OBJ)pimenubargen.o: pimenubargen.cc pimenubargen.h pisysdep.h pimenux.h \
    129  pimenugen.h piwdgx.h piwdggen.h pimsghandler.h piapplx.h piapplgen.h \
    130  picontainerx.h picontainergen.h pimenubarx.h
    131 $(OBJ)pimenubarx.o: pimenubarx.cc pimenubarx.h pimenubargen.h pisysdep.h \
    132  pimenux.h pimenugen.h piwdgx.h piwdggen.h pimsghandler.h piapplx.h \
    133  piapplgen.h picontainerx.h picontainergen.h
    134 $(OBJ)pimenugen.o: pimenugen.cc pimenugen.h pisysdep.h piwdgx.h piwdggen.h \
    135  pimsghandler.h
    136 $(OBJ)pimenux.o: pimenux.cc pimenux.h pimenugen.h pisysdep.h piwdgx.h \
    137  piwdggen.h pimsghandler.h
    138 $(OBJ)pimsghandler.o: pimsghandler.cc pimsghandler.h
    139 $(OBJ)pioptmenugen.o: pioptmenugen.cc pioptmenugen.h pisysdep.h \
    140  picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h \
    141  pimenux.h pimenugen.h
    142 $(OBJ)pioptmenux.o: pioptmenux.cc pisysdep.h pioptmenux.h pioptmenugen.h \
    143  picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h \
    144  pimenux.h pimenugen.h pistdwdgx.h pistdwdggen.h
    145 $(OBJ)pipixmapgen.o: pipixmapgen.cc pipixmapgen.h pisysdep.h pibwdgx.h \
    146  pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h picmap.h picmapx.h \
    147  picmapgen.h
    148 $(OBJ)pipixmapx.o: pipixmapx.cc pipixmapx.h pipixmapgen.h pisysdep.h \
    149  pibwdgx.h pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h picmap.h \
    150  picmapx.h picmapgen.h
    151 $(OBJ)piscdrawwdg.o: piscdrawwdg.cc piscdrawwdg.h pisysdep.h pibwdgx.h \
    152  pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h \
    153  $(INC)generalfit.h \
    154  $(INC)exceptions.h \
    155  $(INC)defs.h $(INC)matrix.h \
    156  $(INC)peida.h $(INC)utils.h \
    157  $(INC)machine.h \
    158  $(INC)perrors.h \
    159  $(INC)ppersist.h \
    160  $(INC)pclassids.h \
    161  $(INC)cvector.h
    162 $(OBJ)pistdwdggen.o: pistdwdggen.cc pistdwdggen.h pisysdep.h piwdgx.h \
    163  piwdggen.h pimsghandler.h
    164 $(OBJ)pistdwdgx.o: pistdwdgx.cc pisysdep.h pistdwdgx.h pistdwdggen.h \
    165  piwdgx.h piwdggen.h pimsghandler.h
    166 $(OBJ)piwdggen.o: piwdggen.cc piwdggen.h pimsghandler.h picontainergen.h \
    167  pisysdep.h piwdgx.h
    168 $(OBJ)piwdgx.o: piwdgx.cc piwdgx.h piwdggen.h pimsghandler.h picontainerx.h \
    169  pisysdep.h picontainergen.h
    170 $(OBJ)piwindowgen.o: piwindowgen.cc piwindowgen.h pisysdep.h picontainerx.h \
    171  picontainergen.h piwdgx.h piwdggen.h pimsghandler.h
    172 $(OBJ)piwindowx.o: piwindowx.cc piwindowx.h piwindowgen.h pisysdep.h \
    173  picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h
    174 $(OBJ)pixtbase.o: pixtbase.cc pixtbaseP.h pibwdgx.h pisysdep.h pibwdggen.h \
    175  piwdgx.h piwdggen.h pimsghandler.h pixtbase.h
    176 $(OBJ)sc_sample.o: sc_sample.cc sc_sample.h pisysdep.h piscdrawwdg.h \
    177  pibwdgx.h pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h
    178 $(OBJ)pidemo.o: pidemo.cc pidemo.h pidemoup.h \
     102$(OBJ)pidemo.o: ./pidemo.cc \
    179103 $(INC)perrors.h \
    180104 $(INC)exceptions.h \
     
    187111 $(INC)datatypes.h \
    188112 $(INC)fitsheader.h \
    189  $(INC)fitskeys.h pisysdep.h piapplx.h piapplgen.h \
    190  pimsghandler.h picontainerx.h picontainergen.h piwdgx.h piwdggen.h \
    191  pimenubarx.h pimenubargen.h pimenux.h pimenugen.h piwindowx.h \
    192  piwindowgen.h pioptmenux.h pioptmenugen.h pistdwdgx.h pistdwdggen.h \
    193  pifilechox.h pifilechogen.h piimage.h $(INC)lut.h \
     113 $(INC)fitskeys.h pidemo.h \
     114 pisysdep.h piapplx.h piapplgen.h pimsghandler.h picontainerx.h \
     115 picontainergen.h piwdgx.h piwdggen.h pimenubarx.h pimenubargen.h \
     116 pimenux.h pimenugen.h piwindowx.h piwindowgen.h pioptmenux.h \
     117 pioptmenugen.h pistdwdgx.h pistdwdggen.h pifilechox.h pifilechogen.h \
     118 piimage.h $(INC)lut.h \
    194119 pipixmapx.h pipixmapgen.h pibwdgx.h pibwdggen.h picmap.h picmapx.h \
    195120 picmapgen.h pihisto.h piscdrawwdg.h \
    196  $(INC)histos.h $(INC)peida.h \
    197  $(INC)utils.h pidrawwin.h
    198 $(OBJ)pidemoup.o: pidemoup.cc  pidemoup.h \
    199  $(INC)perrors.h \
    200  $(INC)exceptions.h \
    201  $(INC)defs.h \
    202  $(INC)fitsimage.h \
     121 $(INC)histos.h \
     122 $(INC)peida.h \
     123 $(INC)utils.h pidrawwin.h \
     124 $(INC)piup.h
     125$(OBJ)pidrawwin.o: ./pidrawwin.cc pidrawwin.h pisysdep.h piwindowx.h \
     126 piwindowgen.h picontainerx.h picontainergen.h piwdgx.h piwdggen.h \
     127 pimsghandler.h piscdrawwdg.h pibwdgx.h pibwdggen.h
     128$(OBJ)pifilechogen.o: ./pifilechogen.cc pifilechogen.h pisysdep.h piwdgx.h \
     129 piwdggen.h pimsghandler.h
     130$(OBJ)pifilechox.o: ./pifilechox.cc pisysdep.h pifilechox.h pifilechogen.h \
     131 piwdgx.h piwdggen.h pimsghandler.h piwindowx.h piwindowgen.h \
     132 picontainerx.h picontainergen.h
     133$(OBJ)pihisto.o: ./pihisto.cc pihisto.h piscdrawwdg.h pisysdep.h pibwdgx.h \
     134 pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h \
     135 $(INC)histos.h \
     136 $(INC)peida.h \
     137 $(INC)defs.h \
     138 $(INC)utils.h \
     139 $(INC)machine.h \
     140 $(INC)perrors.h \
     141 $(INC)exceptions.h
     142$(OBJ)piimage.o: ./piimage.cc piimage.h \
    203143 $(INC)cimage.h \
    204144 $(INC)rzimage.h \
    205145 $(INC)rzvect.h \
    206146 $(INC)machine.h \
     147 $(INC)defs.h \
     148 $(INC)exceptions.h \
     149 $(INC)perrors.h \
    207150 $(INC)datatypes.h \
     151 $(INC)lut.h pisysdep.h \
     152 pipixmapx.h pipixmapgen.h pibwdgx.h pibwdggen.h piwdgx.h piwdggen.h \
     153 pimsghandler.h picmap.h picmapx.h picmapgen.h pistdwdgx.h \
     154 pistdwdggen.h \
     155 $(INC)imageop.h \
     156 $(INC)fitsimage.h \
    208157 $(INC)fitsheader.h \
    209  $(INC)fitskeys.h \
    210  $(INC)utils.h $(INC)peida.h
    211 
    212 piapp : $(EXE)piapp
    213        
    214 $(EXE)piapp  : $(OBJ)pidemo.o $(OBJ)pidemoup.o \
    215                 $(SLB)libPI.so $(SLB)libpeida.so $(SLB)liberosc.so
    216         cc -o $(EXE)piapp $(OBJ)pidemo.o $(OBJ)pidemoup.o \
    217               -L$(SLB) -lPI -lpeida -lerosc -lgcxx -lXm -lXt -lX11 -lm 
    218 
    219 $(OBJ)pitestapp.o: pitestapp.cc pisysdep.h piapplx.h piapplgen.h \
    220  pimsghandler.h picontainerx.h picontainergen.h piwdgx.h piwdggen.h \
    221  pimenubarx.h pimenubargen.h pimenux.h pimenugen.h piwindowx.h \
    222  piwindowgen.h pioptmenux.h pioptmenugen.h pistdwdgx.h pistdwdggen.h \
    223  pibwdgx.h pibwdggen.h pipixmapx.h pipixmapgen.h picmap.h picmapx.h \
    224  picmapgen.h pifilechox.h pifilechogen.h ex_dessin.h piimage.h \
    225  $(INC)cimage.h \
    226  $(INC)rzimage.h \
    227  $(INC)rzvect.h \
    228  $(INC)machine.h $(INC)defs.h \
     158 $(INC)fitskeys.h
     159$(OBJ)pimenubargen.o: ./pimenubargen.cc pimenubargen.h pisysdep.h pimenux.h \
     160 pimenugen.h piwdgx.h piwdggen.h pimsghandler.h piapplx.h piapplgen.h \
     161 picontainerx.h picontainergen.h pimenubarx.h
     162$(OBJ)pimenubarx.o: ./pimenubarx.cc pimenubarx.h pimenubargen.h pisysdep.h \
     163 pimenux.h pimenugen.h piwdgx.h piwdggen.h pimsghandler.h piapplx.h \
     164 piapplgen.h picontainerx.h picontainergen.h
     165$(OBJ)pimenugen.o: ./pimenugen.cc pimenugen.h pisysdep.h piwdgx.h piwdggen.h \
     166 pimsghandler.h
     167$(OBJ)pimenux.o: ./pimenux.cc pimenux.h pimenugen.h pisysdep.h piwdgx.h \
     168 piwdggen.h pimsghandler.h
     169$(OBJ)pimsghandler.o: ./pimsghandler.cc pimsghandler.h
     170$(OBJ)pioptmenugen.o: ./pioptmenugen.cc pioptmenugen.h pisysdep.h \
     171 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h \
     172 pimenux.h pimenugen.h
     173$(OBJ)pioptmenux.o: ./pioptmenux.cc pisysdep.h pioptmenux.h pioptmenugen.h \
     174 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h \
     175 pimenux.h pimenugen.h pistdwdgx.h pistdwdggen.h
     176$(OBJ)pipixmapgen.o: ./pipixmapgen.cc pipixmapgen.h pisysdep.h pibwdgx.h \
     177 pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h picmap.h picmapx.h \
     178 picmapgen.h
     179$(OBJ)pipixmapx.o: ./pipixmapx.cc pipixmapx.h pipixmapgen.h pisysdep.h \
     180 pibwdgx.h pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h picmap.h \
     181 picmapx.h picmapgen.h
     182$(OBJ)piscdrawwdg.o: ./piscdrawwdg.cc piscdrawwdg.h pisysdep.h pibwdgx.h \
     183 pibwdggen.h piwdgx.h piwdggen.h pimsghandler.h \
     184 $(INC)generalfit.h \
    229185 $(INC)exceptions.h \
    230  $(INC)perrors.h \
    231  $(INC)datatypes.h $(INC)lut.h
    232 
    233 pitest : $(EXE)pitest
    234        
    235 $(EXE)pitest  : $(OBJ)pitestapp.o $(LIB)libPI.a
    236         g++ -v -o $(EXE)pitest $(OBJ)pitestapp.o -L$(LIB) -lPI -lImages -lOutils -lmath -lXm -lXt -lX11 -lm
     186 $(INC)defs.h \
     187 $(INC)matrix.h \
     188 $(INC)peida.h \
     189 $(INC)utils.h \
     190 $(INC)machine.h \
     191 $(INC)perrors.h \
     192 $(INC)ppersist.h \
     193 $(INC)pclassids.h \
     194 $(INC)cvector.h
     195$(OBJ)pistdwdggen.o: ./pistdwdggen.cc pistdwdggen.h pisysdep.h piwdgx.h \
     196 piwdggen.h pimsghandler.h
     197$(OBJ)pistdwdgx.o: ./pistdwdgx.cc pisysdep.h pistdwdgx.h pistdwdggen.h \
     198 piwdgx.h piwdggen.h pimsghandler.h
     199$(OBJ)piwdggen.o: ./piwdggen.cc piwdggen.h pimsghandler.h picontainergen.h \
     200 pisysdep.h piwdgx.h
     201$(OBJ)piwdgx.o: ./piwdgx.cc piwdgx.h piwdggen.h pimsghandler.h \
     202 picontainerx.h pisysdep.h picontainergen.h
     203$(OBJ)piwindowgen.o: ./piwindowgen.cc piwindowgen.h pisysdep.h \
     204 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h
     205$(OBJ)piwindowx.o: ./piwindowx.cc piwindowx.h piwindowgen.h pisysdep.h \
     206 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimsghandler.h
     207$(OBJ)pixtbase.o: ./pixtbase.cc pixtbaseP.h pibwdgx.h pisysdep.h pibwdggen.h \
     208 piwdgx.h piwdggen.h pimsghandler.h pixtbase.h
  • trunk/SophyaPI/PI/ex_dessin.cc

    r9 r11  
    1212
    1313{
    14 mfnt = nc = 0;
     14mmrk = mfnt = nc = 0;
    1515strcpy(str, "Bonjour");
    1616for(int i=strlen(str); i<20; i++) str[i] = ' ';
     
    4242void ExBWdg::Draw()
    4343{
     44EraseWindow();
    4445SelLine(PI_NormalLine);
    4546DrawBox(10,10, XSize()-20, YSize()-20);
     
    7071DrawFCircle(120, 60, 15);
    7172
     73int x[5] = { 20, 35, 50, 65, 80 };
     74int y[5] = { 130, 130, 130, 130, 130 };
     75
     76SelForeground(PI_Black);
     77DrawMarkers(x, y, 5);
    7278return;
    7379}
     
    94100{
    95101PIFontAtt att[3] = { PI_RomanFont, PI_BoldFont, PI_ItalicFont};
     102PIMarker  pmk[9] = { PI_DotMarker , PI_PlusMarker, PI_CrossMarker, 
     103                 PI_CircleMarker, PI_FCircleMarker,
     104                 PI_BoxMarker, PI_FBoxMarker,
     105                 PI_TriangleMarker, PI_FTriangleMarker };
     106
    96107if (++mfnt > 2)  mfnt = 0;
    97 
     108if (++mmrk > 8)  mmrk = 0;
    98109SelFont(PI_NormalSizeFont, att[mfnt]);
     110SelMarker(8, pmk[mmrk]);
    99111return;
    100112}
  • trunk/SophyaPI/PI/ex_dessin.h

    r2 r11  
    3333
    3434protected:
    35   int mfnt;
     35  int mfnt, mmrk;
    3636  int nc;
    3737  char str[21];
  • trunk/SophyaPI/PI/pibwdggen.cc

    r2 r11  
    4141
    4242/* --Methode-- */
    43 void PIBaseWdgGen::But1Press(int x, int y)
     43void PIBaseWdgGen::But1Press(int /*x*/, int /*y*/)
    4444{
    4545#ifdef DEBUG_RZXB
     
    5050
    5151/* --Methode-- */
    52 void PIBaseWdgGen::But1Release(int x, int y)
     52void PIBaseWdgGen::But1Release(int /*x*/, int /*y*/)
    5353{
    5454#ifdef DEBUG_RZXB
     
    8484
    8585/* --Methode-- */
    86 void PIBaseWdgGen::Ptr1Move(int x, int y)
     86void PIBaseWdgGen::Ptr1Move(int /*x*/, int /*y*/)
    8787{
    8888#ifdef DEBUG_RZXB
     
    106106
    107107/* --Methode-- */
    108 void PIBaseWdgGen::Keyboard(int key, PIKeyModifier kmod)
     108void PIBaseWdgGen::Keyboard(int /*key*/, PIKeyModifier /*kmod*/)
    109109{
    110110#ifdef DEBUG_RZXB
  • trunk/SophyaPI/PI/pibwdggen.h

    r9 r11  
    99enum PIKeyModifier { PIKM_Blank = 0, PIKM_Shift = 1, PIKM_Alt = 2, PIKM_Cntl = 4 } ;
    1010
    11 enum PIColors { PI_Black = 0, PI_White = 1,  PI_Grey = 2,
    12                 PI_Red = 3, PI_Blue = 4, PI_Green = 5, 
    13                 PI_Yellow = 5, PI_Magenta =6} ;
    14 enum PIFontSize {PI_SmallSizeFont = 1, PI_NormalSizeFont = 2, PI_BigSizeFont = 3 };
    15 enum PIFontAtt {PI_RomanFont = 1, PI_BoldFont = 2, PI_ItalicFont = 4 };
     11enum PIColors  { PI_Black = 0, PI_White = 1,  PI_Grey = 2,
     12                 PI_Red = 3, PI_Blue = 4, PI_Green = 5, 
     13                 PI_Yellow = 6, PI_Magenta =7 };
     14
     15enum PIFontSize { PI_SmallSizeFont = 1, PI_NormalSizeFont = 2, PI_BigSizeFont = 3 };
     16
     17enum PIFontAtt { PI_RomanFont = 1, PI_BoldFont = 2, PI_ItalicFont = 4 };
     18
    1619enum PILineAtt { PI_NormalLine = 0, PI_ThinLine = 1, PI_ThickLine = 2 };
     20
     21enum PIMarker  { PI_DotMarker = 0, PI_PlusMarker=1, PI_CrossMarker=2, 
     22                 PI_CircleMarker=3, PI_FCircleMarker=4,
     23                 PI_BoxMarker=5, PI_FBoxMarker=6,
     24                 PI_TriangleMarker=7, PI_FTriangleMarker=8,
     25                 PI_StarMarker=9, PI_FStarMarker=10 };
    1726
    1827enum PIPointer { PI_ArrowPointer = 1, PI_CrossPointer = 2,
    1928                 PI_HandPointer = 3, PI_TDLRArrowPointer = 4 };
     29
     30enum PIGOMode { PI_GOCopy = 0, PI_GOXOR = 1 };
    2031
    2132class PIBaseWdgGen : public PIWdg
     
    2839                     PIBaseWdgGen(PIContainerGen *par, char *nom,
    2940                                   int sx=10, int sy=10, int px=0, int py=0);
    30   virtual           ~PIBaseWdgGen();
     41  virtual            ~PIBaseWdgGen();
    3142
    32   virtual long    kind() {return ClassId; }
     43  virtual long       kind() {return ClassId; }
    3344
    3445//  Activation des evenements   
     
    4152  virtual void       EraseWindow()             = 0;
    4253  virtual void       DrawString(int x, int y, char* s, int pos = 0)        = 0;
    43   virtual void       DrawLine(int x1, int y1, int x2, int y2)              = 0; 
     54  virtual void       DrawLine(int x1, int y1, int x2, int y2)              = 0;
    4455  virtual void       DrawBox(int x0, int y0, int dx, int dy)               = 0;
    4556  virtual void       DrawFBox(int x0, int y0, int dx, int dy)              = 0;
    4657  virtual void       DrawCircle(int x0, int y0, int r)                     = 0;
    4758  virtual void       DrawFCircle(int x0, int y0, int r)                    = 0;
     59  virtual void       DrawPolygon(int *x, int *y, int n)                    = 0; 
     60  virtual void       DrawFPolygon(int *x, int *y, int n)                   = 0; 
     61  virtual void       DrawMarker(int x0, int y0)                            = 0;
     62  virtual void       DrawMarkers(int *x, int *y, int n)                    = 0;
     63
     64
    4865
    4966  virtual int        CalcStringWidth(char const* s)                        = 0;
    5067
     68// Modifications attributs graphiques
    5169  virtual void       SelForeground(PIColors col=PI_Black)                  = 0;
    5270  virtual void       SelBackground(PIColors col=PI_White)                  = 0;
     71  virtual void       SelGOMode(PIGOMode mod=PI_GOCopy)                     = 0;
    5372  virtual void       SelFont(PIFontSize sz=PI_NormalSizeFont,
    5473                             PIFontAtt att=PI_RomanFont)                   = 0;
    5574  virtual void       SelFontSzPt(int npt=12, PIFontAtt att=PI_RomanFont)   = 0;
    5675  virtual void       SelLine(PILineAtt att=PI_NormalLine)                  = 0;
    57   virtual void       SelPointerShape(PIPointer ptr)                        = 0;
     76  virtual void       SelPointerShape(PIPointer ptr=PI_ArrowPointer)        = 0;
     77  virtual void       SelMarker(int msz=3, PIMarker mrk=PI_DotMarker)       = 0;
     78
     79// Acces aux attributs graphiques
     80  virtual PIColors   GetForeground()    = 0;
     81  virtual PIColors   GetBackground()    = 0;
     82  virtual PIGOMode   GetGOMode()        = 0;
     83  virtual PIFontAtt  GetFontAtt()       = 0;
     84  virtual int        GetFontSize()      = 0;
     85  virtual PILineAtt  GetLineAtt()       = 0;
     86  virtual PIPointer  GetPointerShape()  = 0;
     87  virtual PIMarker   GetMarker()        = 0;
     88  virtual int        GetMarkerSize()    = 0;
    5889
    5990
    60   virtual void       Refresh()         = 0;
     91//  Fonction qui doit etre appelee pour rafraichir (retracer) tout
     92  virtual void       Refresh()          = 0;
    6193 
    6294// Traitement des evenements   
    63   virtual void       Resize()          = 0;
    64   virtual void       Draw()            = 0;
     95  virtual void       Resize()           = 0;
     96  virtual void       Draw()             = 0;
    6597  virtual void       Draw(int x0, int y0, int dx, int dy) = 0;
    6698
  • trunk/SophyaPI/PI/pibwdgx.cc

    r10 r11  
    4646
    4747mDefGC = XCreateGC (PIXDisplay(), XtWindow(PIXtTopWdg()), 0, NULL);
    48 
     48mGOm = PI_GOCopy;
     49
     50mFCol = mBCol = PI_Grey;
    4951SelForeground(PI_Black);
    5052SelBackground(PI_White);
     53mLAtt = PI_ThinLine;
    5154SelLine();
     55mFAtt = PI_BoldFont;  mFSize = 0;
    5256SelFont();
    53 SelPointerShape(PI_ArrowPointer);
    54 
     57mPtrS = PI_CrossPointer;
     58SelPointerShape();
     59SelMarker(1, PI_DotMarker);
    5560Manage();
    5661}
     
    139144}
    140145
     146 
    141147/* --Methode-- */
    142148void PIBaseWdgX::DrawLine(int x1, int y1, int x2, int y2)
     
    145151return;
    146152}
     153
    147154
    148155/* --Methode-- */
     
    182189}
    183190
     191// Pour les fonctions de trace avec un plusieurs coordonnees
     192#define NMXXPOINTS  30
     193
     194/* --Methode-- */
     195void PIBaseWdgX::DrawPolygon(int *x, int *y, int n)
     196{
     197XPoint multipoint[NMXXPOINTS];
     198XPoint *pxp;
     199int i;
     200
     201if (n <= 0)  return;
     202if (n > NMXXPOINTS)  pxp = new XPoint[n];
     203else pxp = multipoint;
     204for(i=0; i<n; i++)  { pxp[i].x = x[i];  pxp[i].y = y[i]; }
     205XDrawLines(XtDisplay(XtWdg()), XtWindow(XtWdg()), DefGC(), pxp, n, CoordModePrevious);
     206if (n > NMXXPOINTS)  delete[] pxp;
     207return;
     208}
     209
     210
     211/* --Methode-- */
     212void PIBaseWdgX::DrawFPolygon(int *x, int *y, int n)
     213{
     214XPoint multipoint[NMXXPOINTS];
     215XPoint *pxp;
     216int i;
     217
     218if (n <= 0)  return;
     219if (n > NMXXPOINTS)  pxp = new XPoint[n];
     220else pxp = multipoint;
     221for(i=0; i<n; i++)  { pxp[i].x = x[i];  pxp[i].y = y[i]; }
     222XFillPolygon(XtDisplay (XtWdg()), XtWindow(XtWdg()), DefGC(), pxp, n,
     223                        Complex, CoordModePrevious);
     224if (n > NMXXPOINTS)  delete[] pxp;
     225return;
     226}
     227
     228/* --Methode-- */
     229void PIBaseWdgX::DrawMarker(int x0, int y0)
     230{
     231int hmsz = mMrkSz/2;
     232int dmsz = mMrkSz-hmsz;
     233int x[4],y[4];
     234PILineAtt clatt;
     235
     236if (mMrk == PI_DotMarker)
     237  XDrawPoint(XtDisplay(XtWdg()), XtWindow(XtWdg()), DefGC(), x0, y0);
     238
     239else
     240  {
     241  clatt = mLAtt;
     242  SelLine(PI_ThinLine);
     243  switch (mMrk)
     244    {
     245    case  PI_PlusMarker :
     246      DrawLine(x0-hmsz, y0, x0+dmsz, y0);
     247      DrawLine(x0, y0-hmsz, x0, y0+dmsz);
     248      break;
     249    case  PI_CrossMarker :
     250      DrawLine(x0-hmsz, y0-hmsz, x0+dmsz, y0+dmsz);
     251      DrawLine(x0-hmsz, y0+dmsz, x0+dmsz, y0-hmsz);
     252      break; 
     253    case PI_CircleMarker :
     254      DrawCircle(x0, y0, hmsz);
     255      break;
     256    case PI_FCircleMarker :
     257      DrawFCircle(x0, y0, hmsz);
     258      break;
     259    case PI_BoxMarker :
     260      DrawBox(x0-hmsz, y0-hmsz, mMrkSz, mMrkSz);
     261      break;
     262    case PI_FBoxMarker :
     263      DrawFBox(x0-hmsz, y0-hmsz, mMrkSz, mMrkSz);
     264      break;
     265    case  PI_TriangleMarker :
     266      x[1] = mMrkSz; y[1] = 0; x[2] = -hmsz; y[2] = -mMrkSz;
     267      x[3] = -dmsz; y[3] = +mMrkSz; x[0] = x0-hmsz; y[0] = y0+hmsz; 
     268      DrawPolygon(x, y, 4);
     269      break;
     270    case  PI_FTriangleMarker :
     271      x[1] = mMrkSz; y[1] = 0; x[2] = -hmsz; y[2] = -mMrkSz;
     272      x[3] = -dmsz; y[3] = +mMrkSz; x[0] = x0-hmsz; y[0] = y0+hmsz; 
     273      DrawFPolygon(x, y, 4);
     274      break;
     275    default :
     276      XDrawPoint(XtDisplay(XtWdg()), XtWindow(XtWdg()), DefGC(), x0, y0);
     277      break;
     278    }
     279  SelLine(clatt);
     280  }
     281return;
     282}
     283
     284/* --Methode-- */
     285void PIBaseWdgX::DrawMarkers(int *x, int *y, int n)
     286{
     287int i;
     288
     289if (n <= 0)  return;
     290if (mMrk == PI_DotMarker)
     291  {
     292  XPoint multipoint[NMXXPOINTS];
     293  XPoint *pxp;
     294  if (n > NMXXPOINTS)  pxp = new XPoint[n];
     295  else pxp = multipoint;
     296  for(i=0; i<n; i++)  { pxp[i].x = x[i];  pxp[i].y = y[i]; }
     297  XDrawPoints(XtDisplay(XtWdg()), XtWindow(XtWdg()), DefGC(), pxp, n, CoordModeOrigin);
     298  if (n > NMXXPOINTS)  delete[] pxp; 
     299  }
     300else for(i=0; i<n; i++) DrawMarker(x[i], y[i]);
     301}
     302
    184303/* --Methode-- */
    185304int PIBaseWdgX::CalcStringWidth(char const* s)
     
    191310void PIBaseWdgX::SelForeground(PIColors col)
    192311{
     312if (col == mFCol)  return;
    193313if ( (col < 0) || (col >= NMAXCOL))  return;
    194314XSetForeground(XtDisplay(XtWdg()), DefGC(), colpix[col]);
     315mFCol = col;
    195316return;
    196317}
     
    199320void PIBaseWdgX::SelBackground(PIColors col)
    200321{
     322if (col == mBCol)  return;
    201323if ( (col < 0) || (col >= NMAXCOL))  return;
    202324XSetBackground(XtDisplay(XtWdg()), DefGC(), colpix[col]);
    203 return;
    204 }
     325mBCol = col;
     326return;
     327}
     328
     329/* --Methode-- */
     330void PIBaseWdgX::SelGOMode(PIGOMode mod)
     331{
     332if (mod == mGOm)  return;
     333switch (mod)
     334  {
     335  case PI_GOCopy :
     336    XSetFunction(XtDisplay(XtWdg()), DefGC(), GXcopy);
     337    mGOm = mod;
     338    break;
     339  case PI_GOXOR :
     340    XSetFunction(XtDisplay(XtWdg()), DefGC(), GXxor);
     341    mGOm = mod;
     342    break;
     343  }
     344return;
     345}
     346
    205347
    206348/* --Methode-- */
     
    209351int dsz,i,isel, j;
    210352
     353if ((npt == mFSize) && (att == mFAtt))  return;
    211354isel = 0;
    212355dsz = 9999;
     
    223366
    224367SelectFont(isel, j);
     368
    225369}
    226370
     
    269413unsigned int lt;
    270414
     415if (att == mLAtt)  return;
     416
    271417switch (att)
    272418  {
     
    285431  }
    286432   
    287 XSetLineAttributes(XtDisplay(XtWdg()), DefGC(), lt, LineSolid, CapNotLast, JoinMiter);
    288 
     433XSetLineAttributes(XtDisplay(XtWdg()), DefGC(), lt, LineSolid, CapButt, JoinMiter);
     434mLAtt = att;
    289435return;
    290436}
     
    294440void PIBaseWdgX::SelPointerShape(PIPointer ptr) 
    295441{
     442if (ptr == mPtrS)  return;
    296443if ( (ptr < 0) || (ptr >= NMAXCURS))  return;
    297444if ( XtIsRealized(XtWdg()) )
    298445  XDefineCursor(XtDisplay (XtWdg()), XtWindow(XtWdg()), curs[ptr]);
    299 return;
     446mPtrS = ptr;
     447return;
     448}
     449
     450/* --Methode-- */
     451void PIBaseWdgX::SelMarker(int msz, PIMarker mrk)
     452{
     453if (msz > 1)  { mMrk = mrk;  mMrkSz = msz; }
     454else  { mMrk = PI_DotMarker;  mMrkSz = 1; }
     455return;
     456}
     457
     458/* --Methode-- */
     459PIColors  PIBaseWdgX::GetForeground()
     460{
     461return (mFCol);
     462}
     463
     464/* --Methode-- */
     465PIColors  PIBaseWdgX::GetBackground()
     466{
     467return (mBCol);
     468}
     469
     470
     471/* --Methode-- */
     472PIGOMode   PIBaseWdgX::GetGOMode()
     473{
     474return (mGOm);
     475}
     476
     477/* --Methode-- */
     478PIFontAtt  PIBaseWdgX::GetFontAtt()
     479{
     480return (mFAtt);
     481}
     482
     483/* --Methode-- */
     484int        PIBaseWdgX::GetFontSize()
     485{
     486return (mFSize);
     487}
     488
     489/* --Methode-- */
     490PILineAtt  PIBaseWdgX::GetLineAtt()
     491{
     492return (mLAtt);
     493}
     494
     495/* --Methode-- */
     496PIPointer  PIBaseWdgX::GetPointerShape()
     497{
     498return (mPtrS);
     499}
     500
     501/* --Methode-- */
     502PIMarker   PIBaseWdgX::GetMarker()
     503{
     504return (mMrk);
     505}
     506
     507/* --Methode-- */
     508int        PIBaseWdgX::GetMarkerSize()
     509{
     510return (mMrkSz);
    300511}
    301512
     
    459670{
    460671char buff[256];
    461 int i,j,jj,k, count;
     672int i,j,k, count;
    462673char **list;
    463674XFontStruct * defnt;
  • trunk/SophyaPI/PI/pibwdgx.h

    r9 r11  
    3131  virtual void   DrawCircle(int x0, int y0, int r);
    3232  virtual void   DrawFCircle(int x0, int y0, int r);
     33  virtual void   DrawPolygon(int *x, int *y, int n); 
     34  virtual void   DrawFPolygon(int *x, int *y, int n); 
     35  virtual void   DrawMarker(int x0, int y0);
     36  virtual void   DrawMarkers(int *x, int *y, int n);
    3337
    3438  virtual int    CalcStringWidth(char const* s);
    3539
     40// Modifications attributs graphiques
    3641  virtual void   SelForeground(PIColors col=PI_Black);
    3742  virtual void   SelBackground(PIColors col=PI_White);
     43  virtual void   SelGOMode(PIGOMode mod=PI_GOCopy);
    3844  virtual void   SelFont(PIFontSize sz=PI_NormalSizeFont,
    3945                         PIFontAtt att=PI_RomanFont);
    4046  virtual void   SelFontSzPt(int npt=12, PIFontAtt att=PI_RomanFont);
    4147  virtual void   SelLine(PILineAtt att=PI_NormalLine);
    42   virtual void   SelPointerShape(PIPointer ptr);
     48  virtual void   SelPointerShape(PIPointer ptr=PI_ArrowPointer);
     49  virtual void   SelMarker(int msz, PIMarker mrk=PI_DotMarker);
    4350 
    4451
     52// Acces aux attributs graphiques
     53  virtual PIColors   GetForeground();
     54  virtual PIColors   GetBackground();
     55  virtual PIGOMode   GetGOMode();
     56  virtual PIFontAtt  GetFontAtt();
     57  virtual int        GetFontSize();
     58  virtual PILineAtt  GetLineAtt();
     59  virtual PIPointer  GetPointerShape();
     60  virtual PIMarker   GetMarker();
     61  virtual int        GetMarkerSize();
     62
     63//  Fonction qui doit etre appelee pour rafraichir (retracer) tout
    4564  virtual void   Refresh();
    4665
    4766// Traitement des evenements   
    48 
    4967  virtual void   Resize();
    5068  virtual void   Draw();
     
    7189
    7290  GC mDefGC;
     91  PIColors  mFCol, mBCol;
     92  PIGOMode mGOm;
     93  PIPointer mPtrS;
    7394  PIFontAtt mFAtt;
     95  PILineAtt mLAtt;
    7496  int mFSize;
    7597  XFontStruct *mFSt;
     98  PIMarker mMrk;
     99  int mMrkSz;
    76100};
    77101
  • trunk/SophyaPI/PI/pidemo.cc

    r10 r11  
    1212
    1313/*  Pour le link dynamique  */
    14 typedef FitsImageR4 * (* UsPrFunc) (FitsImageR4 * myimg, int xp, int yp,
     14typedef FitsImageR4 * (* UsPrFunc) (FitsImageR4 * myimg, int xp, int yp, int dx, int dy,
    1515                                    char * arg1, char * arg2);
    1616static UsPrFunc  userFunc[3] = { NULL, NULL, NULL };
     
    3737rc = 0;
    3838printf("PIDemo_DynLink(): Searching for PIUserProc_1 (Rc=%d) \n", rc);
    39 uf = dlsym(dlhandle, "PIUserProc_1__FPt9FitsImage1ZfiiPcT3");
     39uf = dlsym(dlhandle, "PIUserProc_1__FPt9FitsImage1ZfiiiiPcT5");
    4040if (uf != NULL)  userFunc[0] = uf;
    4141else rc += 2;
    4242printf("PIDemo_DynLink(): Searching for PIUserProc_3 (Rc=%d) \n", rc);
    43 uf = dlsym(dlhandle, "PIUserProc_2__FPt9FitsImage1ZfiiPcT3");
     43uf = dlsym(dlhandle, "PIUserProc_2__FPt9FitsImage1ZfiiiiPcT5");
    4444if (uf != NULL)  userFunc[1] = uf;
    4545else rc += 4;
    4646printf("PIDemo_DynLink(): Searching for PIUserProc_3 (Rc=%d) \n", rc);
    47 uf = dlsym(dlhandle, "PIUserProc_3__FPt9FitsImage1ZfiiPcT3");
     47uf = dlsym(dlhandle, "PIUserProc_3__FPt9FitsImage1ZfiiiiPcT5");
    4848if (uf != NULL)  userFunc[2] = uf;
    4949else rc += 8;
     
    678678{
    679679FitsImageR4 *mimg, *oimg;
    680 int xp, yp;
     680int xp, yp, dx, dy;
    681681
    682682switch (msg)
     
    692692    xp = (dap->CurrentPIImage())->XPave();
    693693    yp = (dap->CurrentPIImage())->YPave();
     694    dx = (dap->CurrentPIImage())->XSzPave();
     695    dy = (dap->CurrentPIImage())->YSzPave();
    694696    dap->SetBusy();
    695697    this->Hide();
     
    700702      case 2 :
    701703      case 3 :
    702         oimg = userFunc[mUpr-1] (mimg, xp, yp,
     704        oimg = userFunc[mUpr-1] (mimg, xp, yp, dx, dy,
    703705                            (char *) (mText[1]->GetText().c_str()),
    704706                            (char *) (mText[2]->GetText().c_str()));
     
    706708/*
    707709      case 2 :
    708         oimg = PIUserProc_2(mimg, xp, yp,
     710        oimg = PIUserProc_2(mimg, xp, yp, dx, dy,
    709711                            (char *) (mText[1]->GetText().c_str()),
    710712                            (char *) (mText[2]->GetText().c_str()));
     
    712714
    713715      case 3 :
    714         oimg = PIUserProc_3(mimg, xp, yp,
     716        oimg = PIUserProc_3(mimg, xp, yp, dx, dy,
    715717                            (char *) (mText[1]->GetText().c_str()),
    716718                            (char *) (mText[2]->GetText().c_str()));
  • trunk/SophyaPI/PI/piimage.cc

    r10 r11  
    2828offx = offy = 0;
    2929xpav = ypav = 0;
     30xszpav = yszpav = 1;
     31xmv0 = ymv0 = -1;
     32dxmv = dymv = 0;
    3033zoom = 1;
    3134
    3235SetColMap(CMAP_COLRJ32);
     36
     37SelForeground(PI_White);
     38SelBackground(PI_Black);
    3339
    3440ActivateButton(1);
     
    3642ActivateButton(2);
    3743ActivateMove(2);
     44ActivateButton(3);
     45ActivateMove(3);
    3846
    3947
     
    5462offx = offy = 0;
    5563xpav = ypav = 0;
     64xszpav = yszpav = 1;
    5665img = pim;
    5766if (img)
     
    192201if ( PosW2Img(x, y, &xp, &yp) )  return;
    193202SelPointerShape(PI_CrossPointer);
    194 xpav = xp;  ypav = yp; 
     203xpav = xp;  ypav = yp;
    195204Apply(false);
    196205return;
    197206}
    198207
     208
    199209/* --Methode-- */
    200210void PIImage::Ptr1Move(int x, int y)
     
    203213if (img == NULL)  return;
    204214if ( PosW2Img(x, y, &xp, &yp) )  return;
    205 xpav = xp;  ypav = yp; 
     215xpav = xp;  ypav = yp;
    206216Apply(false);
    207217return;
    208218}
    209219
     220
    210221/* --Methode-- */
    211222void PIImage::But1Release(int /*x*/,  int /*y*/)
     
    222233
    223234if (img == NULL)  return;
     235if ( PosW2Img(x, y, &xp, &yp) )  { xmv0 = -1;  return; }
     236xmv0 = x;  ymv0 = y;  dxmv = dymv = 0;
     237Send(PIMsg_ActiveWindow, (char *)this);
     238SelGOMode(PI_GOXOR);
     239SelForeground(PI_Yellow);
     240SelLine(PI_ThinLine);
     241return;
     242}
     243
     244/* --Methode-- */
     245void PIImage::Ptr2Move(int x, int y)
     246{
     247int xp, yp;
     248if (img == NULL)  return;
     249if (xmv0 < 0)  return;
    224250if ( PosW2Img(x, y, &xp, &yp) )  return;
     251DrawBox(xmv0, ymv0, dxmv, dymv);
     252dxmv = x-xmv0;  dymv = y-ymv0;
     253DrawBox(xmv0, ymv0, dxmv, dymv);
     254return;
     255}
     256
     257/* --Methode-- */
     258void PIImage::But2Release(int x, int y)
     259{
     260int xp, yp, xp2, yp2;
     261
     262if (img == NULL)  return;
     263if (img == NULL)  return;
     264if (xmv0 < 0)  return;
     265DrawBox(xmv0, ymv0, dxmv, dymv);
     266SelGOMode(PI_GOCopy);
     267SelForeground(PI_White);
     268PosW2Img(xmv0, ymv0, &xp, &yp);
     269if ( PosW2Img(x, y, &xp2, &yp2) ) 
     270  PosW2Img(xmv0+dxmv, ymv0+dymv, &xp2, &yp2);
     271xpav = (xp+xp2)/2;
     272ypav = (yp+yp2)/2;
     273xszpav = ((xp2-xp) > 0) ? (xp2-xp) : 1;
     274yszpav = ((yp2-yp) > 0) ? (yp2-yp) : 1;
     275
     276Apply(false);
     277return;
     278}
     279
     280
     281/* --Methode-- */
     282void PIImage::But3Press(int x, int y)
     283{
     284int xp, yp;
     285
     286if (img == NULL)  return;
     287if ( PosW2Img(x, y, &xp, &yp) )  { xmv0 = -1;  return; }
    225288SelPointerShape(PI_TDLRArrowPointer);
    226289xmv0 = xp;
     
    232295
    233296/* --Methode-- */
    234 void PIImage::Ptr2Move(int x, int y)
    235 {
    236 int xp, yp;
    237 if (img == NULL)  return;
     297void PIImage::Ptr3Move(int x, int y)
     298{
     299int xp, yp;
     300if (img == NULL)  return;
     301if (xmv0 < 0)  return;
    238302if ( PosW2Img(x, y, &xp, &yp) )  return;
    239303if (txw)
     
    246310
    247311/* --Methode-- */
    248 void PIImage::But2Release(int x, int y)
     312void PIImage::But3Release(int x, int y)
    249313{
    250314int xp, yp;
     
    252316SelPointerShape(PI_ArrowPointer);
    253317if (img == NULL)  return;
     318if (xmv0 < 0)  return;
    254319if ( PosW2Img(x, y, &xp, &yp) )  return;
    255320
     
    262327if (offy >= img->YSize())  offy = img->YSize();
    263328xpav = xmv0;  ypav = ymv0;
    264 
     329xmv0 = ymv0 = -1;
    265330Apply();
    266331return;
     
    465530xpav = offx+xwsz/2;
    466531ypav = offx+ywsz/2;
    467 
    468 return;
    469 }
     532xszpav = ((xwsz+ywsz)/20) ;
     533if (xszpav < 1) xszpav = 1;
     534yszpav = xszpav;
     535
     536return;
     537}
  • trunk/SophyaPI/PI/piimage.h

    r10 r11  
    1717{
    1818
    19 private:
    20   RzImage * img;
    21 
    22   unsigned char * pixm;
    23   int xspxm, yspxm;
    24 
    25   LUT * lut;
    26   int offx, offy;
    27 
    28   int zoom;
    29   PIPixmap * zow;
    30   unsigned char * zpixm;
    31   int xszpxm, yszpxm;
    32 
    33   PILabel * txw;
    34   int xpav, ypav;
    35   int xmv0, ymv0;
    3619public:
    3720//  Les methodes
     
    5942  inline int YPave() { return(ypav); } ;
    6043
     44  inline int XSzPave() { return(xszpav); }
     45  inline int YSzPave() { return(yszpav); }
     46
    6147  void Apply(bool mw=true);
    6248
     
    6955  virtual void But2Release(int x, int y);
    7056  virtual void Ptr2Move(int x, int y);
     57  virtual void But3Press(int x, int y);
     58  virtual void But3Release(int x, int y);
     59  virtual void Ptr3Move(int x, int y);
    7160
    7261private:
     
    8170  void SetOffset();
    8271  void SetPave();
     72  void SetPave(int x, int y, int dx=-1, int dy = -1);
     73
     74// Les donnees
     75
     76  RzImage * img;
     77
     78  unsigned char * pixm;
     79  int xspxm, yspxm;
     80
     81  LUT * lut;
     82  int offx, offy;
     83
     84  int zoom;
     85  PIPixmap * zow;
     86  unsigned char * zpixm;
     87  int xszpxm, yszpxm;
     88
     89  PILabel * txw;
     90  int xpav, ypav;
     91  int xmv0, ymv0;
     92  int dxmv, dymv;
     93  int xszpav, yszpav;
     94
    8395};
    8496
  • trunk/SophyaPI/PI/piscdrawwdg.cc

    r9 r11  
    1212  SetAxesFlags(kAxesDflt);
    1313  clip = true;
     14  ActivateButton(2);
     15  ActivateMove(2);
     16
    1417}
    1518
     
    5659  xScale = XSize() / (xMax-xMin + 2*margeH);
    5760  yScale = -YSize() / (yMax-yMin + 2*margeV);
    58   xOrg   = (-xMin + margeH) * xScale + XPos();
    59   yOrg   = (-yMax - margeV) * yScale + YPos();
     61  xOrg   = (-xMin + margeH) * xScale /* + XPos() */;  // $CHECK$ Reza Pourquoi + X,YPos() ?
     62  yOrg   = (-yMax - margeV) * yScale /* + YPos() */;
    6063}
    6164
     
    133136}
    134137
     138void
     139PIScDrawWdg::ScSelMarker(double size, PIMarker mrk)
     140{
     141  int isz = int(fabs(size * xScale)+.5);
     142  SelMarker( isz, mrk);
     143}
    135144
    136145void
     
    182191
    183192
     193
    184194void
    185195PIScDrawWdg::ScDrawBox(double x, double y, double dx, double dy)
     
    262272  rPix = r * xScale;
    263273  DrawFCircle(xPix, yPix, rPix);
    264 
     274}
     275
     276#define NMXMULTP  30   // Pour multipoint sans new
     277
     278void 
     279PIScDrawWdg::ScDrawPolygon(double *x, double *y, int n)
     280{
     281int ix[NMXMULTP], iy[NMXMULTP];
     282int *pxi, *pyi;
     283int i;
     284 
     285if (n <= 0)  return;
     286if (n > NMXMULTP) { pxi = new int[n];  pyi = new int[n]; }
     287else { pxi = ix;  pyi = iy; }
     288for(i=0; i<n; i++) 
     289  Sc2Local(x[i], y[i], pxi[i], pyi[i]);
     290DrawPolygon(pxi, pyi, n);
     291if (n > NMXMULTP) { delete[] pxi;  delete[] pyi; }
     292return;
     293}
     294 
     295void 
     296PIScDrawWdg::ScDrawFPolygon(double *x, double *y, int n)
     297{
     298int xi[NMXMULTP], yi[NMXMULTP];
     299int *pxi, *pyi;
     300int i;
     301 
     302if (n <= 0)  return;
     303if (n > NMXMULTP) { pxi = new int[n];  pyi = new int[pyi]; }
     304else { pxi = xi;  pyi = yi; }
     305for(i=0; i<n; i++) 
     306  Sc2Local(x[i], y[i], pxi[i], pyi[i]);
     307DrawFPolygon(pxi, pyi, n);
     308if (n > NMXMULTP) { delete[] pxi;  delete[] pyi; }
     309return;
     310}
     311
     312void 
     313PIScDrawWdg::ScDrawMarker(double x0, double y0)
     314{
     315  int xPix, yPix;
     316  Sc2Local(x0, y0, xPix, yPix);
     317  DrawMarker(xPix, yPix);
     318  return;
     319}
     320void 
     321PIScDrawWdg::ScDrawMarkers(double *x, double *y, int n)
     322{
     323int xi[NMXMULTP], yi[NMXMULTP];
     324int *pxi, *pyi;
     325int i;
     326 
     327if (n <= 0)  return;
     328if (n > NMXMULTP) { pxi = new int[n];  pyi = new int[pyi]; }
     329else { pxi = xi;  pyi = yi; }
     330for(i=0; i<n; i++) 
     331  Sc2Local(x[i], y[i], pxi[i], pyi[i]);
     332DrawMarkers(pxi, pyi, n);
     333if (n > NMXMULTP) { delete[] pxi;  delete[] pyi; }
     334return;
     335}
    265336
    266337void
     
    469540PIScDrawWdg::But2Press(int x, int y)
    470541{
    471   SelPointerShape(PI_CrossPointer);
    472542  xEndDrag = xBegDrag = x;
    473543  yEndDrag = yBegDrag = y;
    474 }
    475 
    476 void
    477 PIScDrawWdg::But2Release(int x, int y)
    478 {
    479 
    480   SelPointerShape(PI_ArrowPointer);
    481   SelForeground(PI_White);
     544  cForCol = GetForeground();
     545  cGOmod  = GetGOMode();
     546  cPointer = GetPointerShape();
     547  cLatt = GetLineAtt();
     548  SelPointerShape(PI_CrossPointer);
     549  SelForeground(PI_Magenta);
     550  SelGOMode(PI_GOXOR);
     551  SelLine(PI_ThinLine);
     552}
     553
     554void
     555PIScDrawWdg::But2Release(int /*x*/, int /*y*/)
     556{
     557
    482558  DrawBox(xBegDrag, yBegDrag, xEndDrag-xBegDrag, yEndDrag-yBegDrag);
    483   SelForeground(PI_Black);
     559
     560  SelForeground(cForCol);
     561  SelGOMode(cGOmod);
     562  SelPointerShape(cPointer);
     563  SelLine(cLatt);
    484564 
    485565  if (xBegDrag == xEndDrag || yBegDrag == yEndDrag)
     
    500580PIScDrawWdg::Ptr2Move(int x, int y)
    501581{
    502   SelForeground(PI_White);
    503582  DrawBox(xBegDrag, yBegDrag, xEndDrag-xBegDrag, yEndDrag-yBegDrag);
    504583  xEndDrag = x;
    505584  yEndDrag = y;
    506   SelForeground(PI_Black);
    507585  DrawBox(xBegDrag, yBegDrag, xEndDrag-xBegDrag, yEndDrag-yBegDrag);
    508586}
  • trunk/SophyaPI/PI/piscdrawwdg.h

    r9 r11  
    3030 
    3131  virtual void       ScDrawString(double x, double y, char* s, int pos = 0);
    32   virtual void       ScDrawLine(double x1, double y1, double x2, double y2); 
     32  virtual void       ScDrawLine(double x1, double y1, double x2, double y2);
    3333  virtual void       ScDrawBox(double x0, double y0, double dx, double dy);
    3434  virtual void       ScDrawFBox(double x0, double y0, double dx, double dy);
    3535  virtual void       ScDrawCircle(double x0, double y0, double r);
    3636  virtual void       ScDrawFCircle(double x0, double y0, double r);
     37  virtual void       ScDrawPolygon(double *x, double *y, int n); 
     38  virtual void       ScDrawFPolygon(double *x, double *y, int n);
     39  virtual void       ScDrawMarker(double x0, double y0);
     40  virtual void       ScDrawMarkers(double *x0, double *y0, int n);
     41
    3742  virtual double     ScStringWidth(char const*);
     43
    3844  virtual void       ScSelFontSz(double size, PIFontAtt att=PI_RomanFont);
     45  virtual void       ScSelMarker(double size=0, PIMarker mrk=PI_DotMarker);
    3946
    4047  virtual void       DrawAxes(int flags = -1);
     
    9299  int xBegDrag, yBegDrag;
    93100  int xEndDrag, yEndDrag;
    94  
     101  PIColors cForCol;
     102  PIGOMode cGOmod; 
     103  PIPointer cPointer;
     104  PILineAtt cLatt;
    95105  bool clip;
    96106 
  • trunk/SophyaPI/PI/pitestapp.cc

    r8 r11  
    1717
    1818#include "ex_dessin.h"
     19#include "sc_sample.h"
    1920#include "piimage.h"
    2021
     
    5455    PIText * text;
    5556    PIButton * bouton;
    56     PIButton * bouton2, * bouton3, * bouton4;
     57    PIButton * bouton2, * bouton3, * bouton4, *bouton5;
    5758    PILabel * label;
    5859    PIScale * scl;
     
    6263    PIPixmap * zoom;
    6364    PILabel  * labimg;
     65    ScSample * scs;
    6466
    6567};
     
    116118  label  = new PILabel(this->MainWin(), "Label", 140, 20, 20,80);
    117119  label->SetBorderWidth(1);
    118   bouton = new PIButton(this->MainWin(), "OK", 66, 40, 25, 20, 120);
     120  bouton = new PIButton(this->MainWin(), "OK", 33, 40, 25, 20, 120);
    119121  bouton2 = new PIButton(this->MainWin(), "Image", 133, 40, 25, 80, 120);
    120   bouton3 = new PIButton(this->MainWin(), "Test",  233, 40, 25, 140, 120);
    121   bouton4 = new PIButton(this->MainWin(), "Menu", 555, 40, 25, 200, 120);
     122  bouton3 = new PIButton(this->MainWin(), "ExDess",  233, 40, 25, 140, 120);
     123  bouton4 = new PIButton(this->MainWin(), "Dialog", 333, 40, 25, 200, 120);
     124  bouton5 = new PIButton(this->MainWin(), "ScDraw", 433, 40, 25, 260, 120);
    122125  scl = new PIScale(this->MainWin(), "Scale", 88, 5, 45, 100, 20, 10, 150);
    123126
     
    165168  delete bouton3;
    166169  delete bouton4;
     170  delete bouton5;
    167171  delete scl;
    168172  delete menu;
     
    182186static PIWindow *imgw[5];
    183187static PIImage *cur=NULL;
    184 
    185 static PIWindow * wp3, *wp2, *wp4;
     188static ScSample *scs1, *scs2;
     189
     190static PIWindow * wp3, *wp2, *wp4, *wp5;
    186191static PIPixmap * pxm;
    187192static unsigned char  pixels[25000];
     
    189194static bool  fgpxm = false;
    190195static bool  fgt = false;
     196static bool  fgt2 = false;
    191197
    192198void
     
    204210    { /* printf("Process: Setting active ImageWindow (%lx) \n", (long)data); */
    205211    cur = (PIImage *)data; }
     212
     213  if (msg == 33) ckb->SetState(true);
    206214   
    207215  if (msg == 133)
     
    226234    else { wp2->Show();  fgt = true; }
    227235    }
     236
     237  if (msg == 333)  wp4->Show();
     238  if ( (msg == 6001) || (msg == 6002) )  wp4->Hide();
     239
     240  if (msg == 433)
     241    {
     242    if (fgt2) { wp5->Hide();  fgt2 = false; }
     243    else { wp5->Show();  fgt2 = true; }
     244    }
     245
    228246//  if (msg == 555)   (this->menu)->Show();
    229247
     
    247265    }
    248266
    249   if (msg == 555)  wp4->Show();
    250   if ( (msg == 6001) || (msg == 6002) )  wp4->Hide();
    251267
    252268  if ((msg > 8000) && data) printf("PITestApp::MenubarReturn: %s \n", (char *)data);
     
    273289    else printf("PITestApp::Process(5000) (data=NULL) \n");  }
    274290
    275   if (msg == 66) ckb->SetState(true);
    276291  if ((msg / 100) == 56)
    277292    printf("PITestApp::Process(%d) : %s \n", (int)msg, (char *)data);
     
    301316  wp3 = new PIWindow(app, "Window-3", PIWK_normal, 200, 200, 350, 350);
    302317  pxm = new PIPixmap(wp3, "myPixmap", 150, 150, 10, 10);
    303  
    304318  pxm->SetBinding(true, true, true, true);
    305319  pxm->SetPixmap(pixels, 150, 150);
     320
     321  wp5 = new PIWindow(app, "Window-5", PIWK_normal,  400, 200, 200, 200);
     322  scs1 = new ScSample(wp5, "ScSample", 200, 200, 0, 0);
     323  scs1->SetBinding(true, true, true, true);
     324  scs2 = new ScSample(wp5, "ScSample", 200, 200, 200, 0);
     325  scs2->SetBinding(true, true, true, true);
    306326
    307327  //  wp4 = new PIWindow(app, "Open...", PIWK_dialog, 300, 300, 400, 400);
  • trunk/SophyaPI/PI/piup.h

    r9 r11  
    11#include "fitsimage.h"
    22
    3 FitsImageR4 * PIUserProc_1(FitsImageR4 * myimg, int xp, int yp,
     3FitsImageR4 * PIUserProc_1(FitsImageR4 * myimg, int xp, int yp, int dx, int dy,
    44                           char * arg1, char * arg2);
    5 FitsImageR4 * PIUserProc_2(FitsImageR4 * myimg, int xp, int yp,
     5FitsImageR4 * PIUserProc_2(FitsImageR4 * myimg, int xp, int yp, int dx, int dy,
    66                           char * arg1, char * arg2);
    7 FitsImageR4 * PIUserProc_3(FitsImageR4 * myimg, int xp, int yp,
     7FitsImageR4 * PIUserProc_3(FitsImageR4 * myimg, int xp, int yp, int dx, int dy,
    88                           char * arg1, char * arg2);
  • trunk/SophyaPI/PI/piup_def.cc

    r9 r11  
    88#include "piup.h"
    99
    10 FitsImageR4 * PIUserProc_1(FitsImageR4 * myimg, int xp, int yp,
     10FitsImageR4 * PIUserProc_1(FitsImageR4 * , int xp, int yp, int dx, int dy,
    1111                           char * arg1, char * arg2)
    1212{
    13 printf("PIUserProc_1/Dummy (%d %d %s %s) ne fait rien !\n", xp, yp, arg1, arg2);
     13printf("PIUserProc_1/Dummy Pave[%d,%d] en (%d %d) %s %s ne fait rien !\n",
     14       dx, dy, xp, yp, arg1, arg2);
    1415return(NULL);
    1516}
    1617 
    17 FitsImageR4 * PIUserProc_2(FitsImageR4 * myimg, int xp, int yp,
     18FitsImageR4 * PIUserProc_2(FitsImageR4 * , int xp, int yp, int dx, int dy,
    1819                           char * arg1, char * arg2)
    1920{
    20 printf("PIUserProc_2/Dummy (%d %d %s %s) ne fait rien !\n", xp, yp, arg1, arg2);
     21printf("PIUserProc_2/Dummy Pave[%d,%d] en (%d %d) %s %s ne fait rien !\n",
     22       dx, dy, xp, yp, arg1, arg2);
    2123return(NULL);
    2224}
    2325 
    24 FitsImageR4 * PIUserProc_3(FitsImageR4 * /*myimg*/, int xp, int yp,
     26FitsImageR4 * PIUserProc_3(FitsImageR4 * , int xp, int yp, int dx, int dy,
    2527                           char * arg1, char * arg2)
    2628{
    27 printf("PIUserProc_3/Dummy (%d %d %s %s) ne fait rien !\n", xp, yp, arg1, arg2);
     29printf("PIUserProc_3/Dummy Pave[%d,%d] en (%d %d) %s %s ne fait rien !\n",
     30       dx, dy, xp, yp, arg1, arg2);
    2831return(NULL);
    2932}
  • trunk/SophyaPI/PI/piwdggen.h

    r8 r11  
    99
    1010#include "pimsghandler.h"
     11
     12void PIBeep();
    1113
    1214class PIContainerGen;
     
    5658
    5759
    58 void PIBeep(); 
     60 
    5961
    6062#endif/* PIWDG_H_SEEN */
  • trunk/SophyaPI/PI/pixtbase.cc

    r2 r11  
    121121/* Nouvelle-Fonction */
    122122static void init_pixtbase (Widget request, Widget wdg,
    123                           ArgList args, Cardinal* narg)
     123                          ArgList /*args*/, Cardinal* /*narg*/)
    124124{
    125125PIXtBaseWidget wdgp;
     
    137137
    138138/* Nouvelle-Fonction */
    139 static void destroy_pixtbase (Widget wdgp)
     139static void destroy_pixtbase (Widget /*wdgp*/)
    140140{
    141141#ifdef DEBUG_PIXTB
     
    155155
    156156/* Nouvelle-Fonction */
    157 static void expose_pixtbase (Widget  wdgp, XEvent* event, Region region)
     157static void expose_pixtbase (Widget  wdgp, XEvent* /*event*/, Region region)
    158158{
    159159#ifdef DEBUG_PIXTB
     
    174174
    175175/* Nouvelle-Fonction */
    176 static void enter_pixtbase (Widget wdgp, XEvent* evt,
    177                        String* args, Cardinal* narg)
     176static void enter_pixtbase (Widget wdgp, XEvent* /*evt*/,
     177                            String* /*args*/, Cardinal* /*narg*/)
    178178{
    179179if (((PIXtBaseWidget)wdgp)->pixtbase.objet)
     
    183183
    184184/* Nouvelle-Fonction */
    185 static void leave_pixtbase (Widget wdgp, XEvent* evt,
    186                        String* args, Cardinal* narg)
     185static void leave_pixtbase (Widget wdgp, XEvent* /*evt*/,
     186                            String* /*args*/, Cardinal* /*narg*/)
    187187{
    188188if (((PIXtBaseWidget)wdgp)->pixtbase.objet)
     
    193193/* Nouvelle-Fonction */
    194194static void bud1_pixtbase (Widget wdgp, XEvent* evt,
    195                        String* args, Cardinal* narg)
     195                           String* /*args*/, Cardinal* /*narg*/)
    196196
    197197{
     
    208208/* Nouvelle-Fonction */
    209209static void buu1_pixtbase (Widget wdgp, XEvent* evt,
    210                        String* args, Cardinal* narg)
     210                           String* /*args*/, Cardinal* /*narg*/)
    211211
    212212{
     
    222222/* Nouvelle-Fonction */
    223223static void bud2_pixtbase (Widget wdgp, XEvent* evt,
    224                        String* args, Cardinal* narg)
     224                           String* /*args*/, Cardinal* /*narg*/)
    225225
    226226{
     
    237237/* Nouvelle-Fonction */
    238238static void buu2_pixtbase (Widget wdgp, XEvent* evt,
    239                        String* args, Cardinal* narg)
    240 
     239                           String* /*args*/, Cardinal* /*narg*/)
    241240{
    242241if (((PIXtBaseWidget)wdgp)->pixtbase.objet)
     
    253252/* Nouvelle-Fonction */
    254253static void bud3_pixtbase (Widget wdgp, XEvent* evt,
    255                        String* args, Cardinal* narg)
     254                           String* /*args*/, Cardinal* /*narg*/)
    256255
    257256{
     
    268267/* Nouvelle-Fonction */
    269268static void buu3_pixtbase (Widget wdgp, XEvent* evt,
    270                        String* args, Cardinal* narg)
     269                           String* /*args*/, Cardinal* /*narg*/)
    271270
    272271{
     
    283282/* Nouvelle-Fonction */
    284283static void mov1_pixtbase (Widget wdgp, XEvent* evt,
    285                          String* args, Cardinal* narg)
     284                           String* /*args*/, Cardinal* /*narg*/)
    286285{
    287286if (((PIXtBaseWidget)wdgp)->pixtbase.objet) 
     
    297296/* Nouvelle-Fonction */
    298297static void mov2_pixtbase (Widget wdgp, XEvent* evt,
    299                          String* args, Cardinal* narg)
     298                           String* /*args*/, Cardinal* /*narg*/)
    300299{
    301300if (((PIXtBaseWidget)wdgp)->pixtbase.objet) 
     
    311310/* Nouvelle-Fonction */
    312311static void mov3_pixtbase (Widget wdgp, XEvent* evt,
    313                          String* args, Cardinal* narg)
     312                           String* /*args*/, Cardinal* /*narg*/)
    314313{
    315314if (((PIXtBaseWidget)wdgp)->pixtbase.objet) 
     
    325324/* Nouvelle-Fonction */
    326325static void keyb_pixtbase (Widget wdgp, XEvent* evt,
    327                           String* args, Cardinal* narg)
     326                           String* /*args*/, Cardinal* /*narg*/)
    328327{
    329328if (((PIXtBaseWidget)wdgp)->pixtbase.objet) 
  • trunk/SophyaPI/PI/sc_sample.cc

    r9 r11  
    11#include "sc_sample.h"
    22
     3static double f(double x) {return x*x;}
    34
    45ScSample::ScSample(PIContainerGen *par, char *nom,
     
    78
    89{
     10PIScFuncDrawer * mfd;
     11mfd = new PIScFuncDrawer(f);
    912  SetLimits(-3,3,-4,4);
     13AddDrawer(mfd);
     14SetAxesFlags();
    1015}
    1116
    1217ScSample::~ScSample()
    13 {}
     18{
     19DeleteDrawers();
     20}
    1421
    15 static double f(double x) {return x*x;}
    1622
    1723void
    18 ScSample::Draw()
     24ScSample::DrawSelf()
    1925{
    20   DrawAxes();
    21   PlotFunc(f);
     26double x[5] = {-2, -1., 1., 1.7, 2.2};
     27double y[5] = {-2.5, -2.0, -1.5, -2., -2.5};
     28
     29int i;
     30SelForeground(PI_Green);
     31ScSelMarker(0.3, PI_BoxMarker);
     32ScDrawMarkers(x, y, 5);
     33SelForeground(PI_Magenta);
     34ScSelMarker(0.3, PI_FCircleMarker);
     35for(i=0; i<5; i++)
     36   y[i]+=1.;
     37ScDrawMarkers(x, y, 5);
     38SelForeground(PI_Black);
     39
     40return; 
    2241}
     42
  • trunk/SophyaPI/PI/sc_sample.h

    r8 r11  
    1010
    1111 
    12   void Draw();
     12  virtual void DrawSelf();
    1313
    1414};
Note: See TracChangeset for help on using the changeset viewer.