Changeset 11 in Sophya
- Timestamp:
- Mar 29, 1996, 2:33:30 PM (30 years ago)
- Location:
- trunk/SophyaPI/PI
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PI/Makefile
r9 r11 33 33 CCI := ${INC}/CInc/ 34 34 CXI := ${INC}/CxxInc/ 35 GLB := ${GNU}/${MACHEROS}/lib/ 35 36 #-- 36 37 … … 47 48 CPPFLAGS := -I${INC} -D${MACHEROSD} 48 49 endif 49 AR := ar50 AR := /usr/bin/ar 50 51 ARFLAGS := -rcs 51 52 … … 77 78 #------------------------------------------------- End of Makefile.h ------- 78 79 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 \ 80 all: $(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 \ 86 85 picontainerx.h picontainergen.h piwdgx.h piwdggen.h pimenubarx.h \ 87 86 pimenubargen.h pimenux.h pimenugen.h 88 $(OBJ)piapplx.o: piapplx.cc piapplx.h piapplgen.h pimsghandler.h pisysdep.h \89 pi containerx.h picontainergen.h piwdgx.h piwdggen.h pimenubarx.h \90 pimenubar gen.h pimenux.h pimenugen.h91 $(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 \ 92 91 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 \ 94 93 piwdggen.h pimsghandler.h pixtbaseP.h pixtbase.h 95 $(OBJ)picmap.o: picmap.cc picmap.h pisysdep.h picmapx.h picmapgen.h96 $(OBJ)picmapgen.o: picmapgen.cc picmapgen.h pisysdep.h picmapx.h picmap.h97 $(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 \ 98 97 picmapgen.h pisysdep.h 99 $(OBJ)picontainergen.o: picontainergen.cc picontainergen.h pisysdep.h \98 $(OBJ)picontainergen.o: ./picontainergen.cc picontainergen.h pisysdep.h \ 100 99 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 \ 102 101 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 \ 179 103 $(INC)perrors.h \ 180 104 $(INC)exceptions.h \ … … 187 111 $(INC)datatypes.h \ 188 112 $(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 \ 194 119 pipixmapx.h pipixmapgen.h pibwdgx.h pibwdggen.h picmap.h picmapx.h \ 195 120 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 \ 203 143 $(INC)cimage.h \ 204 144 $(INC)rzimage.h \ 205 145 $(INC)rzvect.h \ 206 146 $(INC)machine.h \ 147 $(INC)defs.h \ 148 $(INC)exceptions.h \ 149 $(INC)perrors.h \ 207 150 $(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 \ 208 157 $(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 \ 229 185 $(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 12 12 13 13 { 14 m fnt = nc = 0;14 mmrk = mfnt = nc = 0; 15 15 strcpy(str, "Bonjour"); 16 16 for(int i=strlen(str); i<20; i++) str[i] = ' '; … … 42 42 void ExBWdg::Draw() 43 43 { 44 EraseWindow(); 44 45 SelLine(PI_NormalLine); 45 46 DrawBox(10,10, XSize()-20, YSize()-20); … … 70 71 DrawFCircle(120, 60, 15); 71 72 73 int x[5] = { 20, 35, 50, 65, 80 }; 74 int y[5] = { 130, 130, 130, 130, 130 }; 75 76 SelForeground(PI_Black); 77 DrawMarkers(x, y, 5); 72 78 return; 73 79 } … … 94 100 { 95 101 PIFontAtt att[3] = { PI_RomanFont, PI_BoldFont, PI_ItalicFont}; 102 PIMarker pmk[9] = { PI_DotMarker , PI_PlusMarker, PI_CrossMarker, 103 PI_CircleMarker, PI_FCircleMarker, 104 PI_BoxMarker, PI_FBoxMarker, 105 PI_TriangleMarker, PI_FTriangleMarker }; 106 96 107 if (++mfnt > 2) mfnt = 0; 97 108 if (++mmrk > 8) mmrk = 0; 98 109 SelFont(PI_NormalSizeFont, att[mfnt]); 110 SelMarker(8, pmk[mmrk]); 99 111 return; 100 112 } -
trunk/SophyaPI/PI/ex_dessin.h
r2 r11 33 33 34 34 protected: 35 int mfnt ;35 int mfnt, mmrk; 36 36 int nc; 37 37 char str[21]; -
trunk/SophyaPI/PI/pibwdggen.cc
r2 r11 41 41 42 42 /* --Methode-- */ 43 void PIBaseWdgGen::But1Press(int x, int y)43 void PIBaseWdgGen::But1Press(int /*x*/, int /*y*/) 44 44 { 45 45 #ifdef DEBUG_RZXB … … 50 50 51 51 /* --Methode-- */ 52 void PIBaseWdgGen::But1Release(int x, int y)52 void PIBaseWdgGen::But1Release(int /*x*/, int /*y*/) 53 53 { 54 54 #ifdef DEBUG_RZXB … … 84 84 85 85 /* --Methode-- */ 86 void PIBaseWdgGen::Ptr1Move(int x, int y)86 void PIBaseWdgGen::Ptr1Move(int /*x*/, int /*y*/) 87 87 { 88 88 #ifdef DEBUG_RZXB … … 106 106 107 107 /* --Methode-- */ 108 void PIBaseWdgGen::Keyboard(int key, PIKeyModifier kmod)108 void PIBaseWdgGen::Keyboard(int /*key*/, PIKeyModifier /*kmod*/) 109 109 { 110 110 #ifdef DEBUG_RZXB -
trunk/SophyaPI/PI/pibwdggen.h
r9 r11 9 9 enum PIKeyModifier { PIKM_Blank = 0, PIKM_Shift = 1, PIKM_Alt = 2, PIKM_Cntl = 4 } ; 10 10 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 }; 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 = 6, PI_Magenta =7 }; 14 15 enum PIFontSize { PI_SmallSizeFont = 1, PI_NormalSizeFont = 2, PI_BigSizeFont = 3 }; 16 17 enum PIFontAtt { PI_RomanFont = 1, PI_BoldFont = 2, PI_ItalicFont = 4 }; 18 16 19 enum PILineAtt { PI_NormalLine = 0, PI_ThinLine = 1, PI_ThickLine = 2 }; 20 21 enum 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 }; 17 26 18 27 enum PIPointer { PI_ArrowPointer = 1, PI_CrossPointer = 2, 19 28 PI_HandPointer = 3, PI_TDLRArrowPointer = 4 }; 29 30 enum PIGOMode { PI_GOCopy = 0, PI_GOXOR = 1 }; 20 31 21 32 class PIBaseWdgGen : public PIWdg … … 28 39 PIBaseWdgGen(PIContainerGen *par, char *nom, 29 40 int sx=10, int sy=10, int px=0, int py=0); 30 virtual ~PIBaseWdgGen();41 virtual ~PIBaseWdgGen(); 31 42 32 virtual long kind() {return ClassId; }43 virtual long kind() {return ClassId; } 33 44 34 45 // Activation des evenements … … 41 52 virtual void EraseWindow() = 0; 42 53 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; 44 55 virtual void DrawBox(int x0, int y0, int dx, int dy) = 0; 45 56 virtual void DrawFBox(int x0, int y0, int dx, int dy) = 0; 46 57 virtual void DrawCircle(int x0, int y0, int r) = 0; 47 58 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 48 65 49 66 virtual int CalcStringWidth(char const* s) = 0; 50 67 68 // Modifications attributs graphiques 51 69 virtual void SelForeground(PIColors col=PI_Black) = 0; 52 70 virtual void SelBackground(PIColors col=PI_White) = 0; 71 virtual void SelGOMode(PIGOMode mod=PI_GOCopy) = 0; 53 72 virtual void SelFont(PIFontSize sz=PI_NormalSizeFont, 54 73 PIFontAtt att=PI_RomanFont) = 0; 55 74 virtual void SelFontSzPt(int npt=12, PIFontAtt att=PI_RomanFont) = 0; 56 75 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; 58 89 59 90 60 virtual void Refresh() = 0; 91 // Fonction qui doit etre appelee pour rafraichir (retracer) tout 92 virtual void Refresh() = 0; 61 93 62 94 // Traitement des evenements 63 virtual void Resize() = 0;64 virtual void Draw() = 0;95 virtual void Resize() = 0; 96 virtual void Draw() = 0; 65 97 virtual void Draw(int x0, int y0, int dx, int dy) = 0; 66 98 -
trunk/SophyaPI/PI/pibwdgx.cc
r10 r11 46 46 47 47 mDefGC = XCreateGC (PIXDisplay(), XtWindow(PIXtTopWdg()), 0, NULL); 48 48 mGOm = PI_GOCopy; 49 50 mFCol = mBCol = PI_Grey; 49 51 SelForeground(PI_Black); 50 52 SelBackground(PI_White); 53 mLAtt = PI_ThinLine; 51 54 SelLine(); 55 mFAtt = PI_BoldFont; mFSize = 0; 52 56 SelFont(); 53 SelPointerShape(PI_ArrowPointer); 54 57 mPtrS = PI_CrossPointer; 58 SelPointerShape(); 59 SelMarker(1, PI_DotMarker); 55 60 Manage(); 56 61 } … … 139 144 } 140 145 146 141 147 /* --Methode-- */ 142 148 void PIBaseWdgX::DrawLine(int x1, int y1, int x2, int y2) … … 145 151 return; 146 152 } 153 147 154 148 155 /* --Methode-- */ … … 182 189 } 183 190 191 // Pour les fonctions de trace avec un plusieurs coordonnees 192 #define NMXXPOINTS 30 193 194 /* --Methode-- */ 195 void PIBaseWdgX::DrawPolygon(int *x, int *y, int n) 196 { 197 XPoint multipoint[NMXXPOINTS]; 198 XPoint *pxp; 199 int i; 200 201 if (n <= 0) return; 202 if (n > NMXXPOINTS) pxp = new XPoint[n]; 203 else pxp = multipoint; 204 for(i=0; i<n; i++) { pxp[i].x = x[i]; pxp[i].y = y[i]; } 205 XDrawLines(XtDisplay(XtWdg()), XtWindow(XtWdg()), DefGC(), pxp, n, CoordModePrevious); 206 if (n > NMXXPOINTS) delete[] pxp; 207 return; 208 } 209 210 211 /* --Methode-- */ 212 void PIBaseWdgX::DrawFPolygon(int *x, int *y, int n) 213 { 214 XPoint multipoint[NMXXPOINTS]; 215 XPoint *pxp; 216 int i; 217 218 if (n <= 0) return; 219 if (n > NMXXPOINTS) pxp = new XPoint[n]; 220 else pxp = multipoint; 221 for(i=0; i<n; i++) { pxp[i].x = x[i]; pxp[i].y = y[i]; } 222 XFillPolygon(XtDisplay (XtWdg()), XtWindow(XtWdg()), DefGC(), pxp, n, 223 Complex, CoordModePrevious); 224 if (n > NMXXPOINTS) delete[] pxp; 225 return; 226 } 227 228 /* --Methode-- */ 229 void PIBaseWdgX::DrawMarker(int x0, int y0) 230 { 231 int hmsz = mMrkSz/2; 232 int dmsz = mMrkSz-hmsz; 233 int x[4],y[4]; 234 PILineAtt clatt; 235 236 if (mMrk == PI_DotMarker) 237 XDrawPoint(XtDisplay(XtWdg()), XtWindow(XtWdg()), DefGC(), x0, y0); 238 239 else 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 } 281 return; 282 } 283 284 /* --Methode-- */ 285 void PIBaseWdgX::DrawMarkers(int *x, int *y, int n) 286 { 287 int i; 288 289 if (n <= 0) return; 290 if (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 } 300 else for(i=0; i<n; i++) DrawMarker(x[i], y[i]); 301 } 302 184 303 /* --Methode-- */ 185 304 int PIBaseWdgX::CalcStringWidth(char const* s) … … 191 310 void PIBaseWdgX::SelForeground(PIColors col) 192 311 { 312 if (col == mFCol) return; 193 313 if ( (col < 0) || (col >= NMAXCOL)) return; 194 314 XSetForeground(XtDisplay(XtWdg()), DefGC(), colpix[col]); 315 mFCol = col; 195 316 return; 196 317 } … … 199 320 void PIBaseWdgX::SelBackground(PIColors col) 200 321 { 322 if (col == mBCol) return; 201 323 if ( (col < 0) || (col >= NMAXCOL)) return; 202 324 XSetBackground(XtDisplay(XtWdg()), DefGC(), colpix[col]); 203 return; 204 } 325 mBCol = col; 326 return; 327 } 328 329 /* --Methode-- */ 330 void PIBaseWdgX::SelGOMode(PIGOMode mod) 331 { 332 if (mod == mGOm) return; 333 switch (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 } 344 return; 345 } 346 205 347 206 348 /* --Methode-- */ … … 209 351 int dsz,i,isel, j; 210 352 353 if ((npt == mFSize) && (att == mFAtt)) return; 211 354 isel = 0; 212 355 dsz = 9999; … … 223 366 224 367 SelectFont(isel, j); 368 225 369 } 226 370 … … 269 413 unsigned int lt; 270 414 415 if (att == mLAtt) return; 416 271 417 switch (att) 272 418 { … … 285 431 } 286 432 287 XSetLineAttributes(XtDisplay(XtWdg()), DefGC(), lt, LineSolid, Cap NotLast, JoinMiter);288 433 XSetLineAttributes(XtDisplay(XtWdg()), DefGC(), lt, LineSolid, CapButt, JoinMiter); 434 mLAtt = att; 289 435 return; 290 436 } … … 294 440 void PIBaseWdgX::SelPointerShape(PIPointer ptr) 295 441 { 442 if (ptr == mPtrS) return; 296 443 if ( (ptr < 0) || (ptr >= NMAXCURS)) return; 297 444 if ( XtIsRealized(XtWdg()) ) 298 445 XDefineCursor(XtDisplay (XtWdg()), XtWindow(XtWdg()), curs[ptr]); 299 return; 446 mPtrS = ptr; 447 return; 448 } 449 450 /* --Methode-- */ 451 void PIBaseWdgX::SelMarker(int msz, PIMarker mrk) 452 { 453 if (msz > 1) { mMrk = mrk; mMrkSz = msz; } 454 else { mMrk = PI_DotMarker; mMrkSz = 1; } 455 return; 456 } 457 458 /* --Methode-- */ 459 PIColors PIBaseWdgX::GetForeground() 460 { 461 return (mFCol); 462 } 463 464 /* --Methode-- */ 465 PIColors PIBaseWdgX::GetBackground() 466 { 467 return (mBCol); 468 } 469 470 471 /* --Methode-- */ 472 PIGOMode PIBaseWdgX::GetGOMode() 473 { 474 return (mGOm); 475 } 476 477 /* --Methode-- */ 478 PIFontAtt PIBaseWdgX::GetFontAtt() 479 { 480 return (mFAtt); 481 } 482 483 /* --Methode-- */ 484 int PIBaseWdgX::GetFontSize() 485 { 486 return (mFSize); 487 } 488 489 /* --Methode-- */ 490 PILineAtt PIBaseWdgX::GetLineAtt() 491 { 492 return (mLAtt); 493 } 494 495 /* --Methode-- */ 496 PIPointer PIBaseWdgX::GetPointerShape() 497 { 498 return (mPtrS); 499 } 500 501 /* --Methode-- */ 502 PIMarker PIBaseWdgX::GetMarker() 503 { 504 return (mMrk); 505 } 506 507 /* --Methode-- */ 508 int PIBaseWdgX::GetMarkerSize() 509 { 510 return (mMrkSz); 300 511 } 301 512 … … 459 670 { 460 671 char buff[256]; 461 int i,j, jj,k, count;672 int i,j,k, count; 462 673 char **list; 463 674 XFontStruct * defnt; -
trunk/SophyaPI/PI/pibwdgx.h
r9 r11 31 31 virtual void DrawCircle(int x0, int y0, int r); 32 32 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); 33 37 34 38 virtual int CalcStringWidth(char const* s); 35 39 40 // Modifications attributs graphiques 36 41 virtual void SelForeground(PIColors col=PI_Black); 37 42 virtual void SelBackground(PIColors col=PI_White); 43 virtual void SelGOMode(PIGOMode mod=PI_GOCopy); 38 44 virtual void SelFont(PIFontSize sz=PI_NormalSizeFont, 39 45 PIFontAtt att=PI_RomanFont); 40 46 virtual void SelFontSzPt(int npt=12, PIFontAtt att=PI_RomanFont); 41 47 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); 43 50 44 51 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 45 64 virtual void Refresh(); 46 65 47 66 // Traitement des evenements 48 49 67 virtual void Resize(); 50 68 virtual void Draw(); … … 71 89 72 90 GC mDefGC; 91 PIColors mFCol, mBCol; 92 PIGOMode mGOm; 93 PIPointer mPtrS; 73 94 PIFontAtt mFAtt; 95 PILineAtt mLAtt; 74 96 int mFSize; 75 97 XFontStruct *mFSt; 98 PIMarker mMrk; 99 int mMrkSz; 76 100 }; 77 101 -
trunk/SophyaPI/PI/pidemo.cc
r10 r11 12 12 13 13 /* Pour le link dynamique */ 14 typedef FitsImageR4 * (* UsPrFunc) (FitsImageR4 * myimg, int xp, int yp, 14 typedef FitsImageR4 * (* UsPrFunc) (FitsImageR4 * myimg, int xp, int yp, int dx, int dy, 15 15 char * arg1, char * arg2); 16 16 static UsPrFunc userFunc[3] = { NULL, NULL, NULL }; … … 37 37 rc = 0; 38 38 printf("PIDemo_DynLink(): Searching for PIUserProc_1 (Rc=%d) \n", rc); 39 uf = dlsym(dlhandle, "PIUserProc_1__FPt9FitsImage1Zfii PcT3");39 uf = dlsym(dlhandle, "PIUserProc_1__FPt9FitsImage1ZfiiiiPcT5"); 40 40 if (uf != NULL) userFunc[0] = uf; 41 41 else rc += 2; 42 42 printf("PIDemo_DynLink(): Searching for PIUserProc_3 (Rc=%d) \n", rc); 43 uf = dlsym(dlhandle, "PIUserProc_2__FPt9FitsImage1Zfii PcT3");43 uf = dlsym(dlhandle, "PIUserProc_2__FPt9FitsImage1ZfiiiiPcT5"); 44 44 if (uf != NULL) userFunc[1] = uf; 45 45 else rc += 4; 46 46 printf("PIDemo_DynLink(): Searching for PIUserProc_3 (Rc=%d) \n", rc); 47 uf = dlsym(dlhandle, "PIUserProc_3__FPt9FitsImage1Zfii PcT3");47 uf = dlsym(dlhandle, "PIUserProc_3__FPt9FitsImage1ZfiiiiPcT5"); 48 48 if (uf != NULL) userFunc[2] = uf; 49 49 else rc += 8; … … 678 678 { 679 679 FitsImageR4 *mimg, *oimg; 680 int xp, yp ;680 int xp, yp, dx, dy; 681 681 682 682 switch (msg) … … 692 692 xp = (dap->CurrentPIImage())->XPave(); 693 693 yp = (dap->CurrentPIImage())->YPave(); 694 dx = (dap->CurrentPIImage())->XSzPave(); 695 dy = (dap->CurrentPIImage())->YSzPave(); 694 696 dap->SetBusy(); 695 697 this->Hide(); … … 700 702 case 2 : 701 703 case 3 : 702 oimg = userFunc[mUpr-1] (mimg, xp, yp, 704 oimg = userFunc[mUpr-1] (mimg, xp, yp, dx, dy, 703 705 (char *) (mText[1]->GetText().c_str()), 704 706 (char *) (mText[2]->GetText().c_str())); … … 706 708 /* 707 709 case 2 : 708 oimg = PIUserProc_2(mimg, xp, yp, 710 oimg = PIUserProc_2(mimg, xp, yp, dx, dy, 709 711 (char *) (mText[1]->GetText().c_str()), 710 712 (char *) (mText[2]->GetText().c_str())); … … 712 714 713 715 case 3 : 714 oimg = PIUserProc_3(mimg, xp, yp, 716 oimg = PIUserProc_3(mimg, xp, yp, dx, dy, 715 717 (char *) (mText[1]->GetText().c_str()), 716 718 (char *) (mText[2]->GetText().c_str())); -
trunk/SophyaPI/PI/piimage.cc
r10 r11 28 28 offx = offy = 0; 29 29 xpav = ypav = 0; 30 xszpav = yszpav = 1; 31 xmv0 = ymv0 = -1; 32 dxmv = dymv = 0; 30 33 zoom = 1; 31 34 32 35 SetColMap(CMAP_COLRJ32); 36 37 SelForeground(PI_White); 38 SelBackground(PI_Black); 33 39 34 40 ActivateButton(1); … … 36 42 ActivateButton(2); 37 43 ActivateMove(2); 44 ActivateButton(3); 45 ActivateMove(3); 38 46 39 47 … … 54 62 offx = offy = 0; 55 63 xpav = ypav = 0; 64 xszpav = yszpav = 1; 56 65 img = pim; 57 66 if (img) … … 192 201 if ( PosW2Img(x, y, &xp, &yp) ) return; 193 202 SelPointerShape(PI_CrossPointer); 194 xpav = xp; ypav = yp; 203 xpav = xp; ypav = yp; 195 204 Apply(false); 196 205 return; 197 206 } 198 207 208 199 209 /* --Methode-- */ 200 210 void PIImage::Ptr1Move(int x, int y) … … 203 213 if (img == NULL) return; 204 214 if ( PosW2Img(x, y, &xp, &yp) ) return; 205 xpav = xp; ypav = yp; 215 xpav = xp; ypav = yp; 206 216 Apply(false); 207 217 return; 208 218 } 209 219 220 210 221 /* --Methode-- */ 211 222 void PIImage::But1Release(int /*x*/, int /*y*/) … … 222 233 223 234 if (img == NULL) return; 235 if ( PosW2Img(x, y, &xp, &yp) ) { xmv0 = -1; return; } 236 xmv0 = x; ymv0 = y; dxmv = dymv = 0; 237 Send(PIMsg_ActiveWindow, (char *)this); 238 SelGOMode(PI_GOXOR); 239 SelForeground(PI_Yellow); 240 SelLine(PI_ThinLine); 241 return; 242 } 243 244 /* --Methode-- */ 245 void PIImage::Ptr2Move(int x, int y) 246 { 247 int xp, yp; 248 if (img == NULL) return; 249 if (xmv0 < 0) return; 224 250 if ( PosW2Img(x, y, &xp, &yp) ) return; 251 DrawBox(xmv0, ymv0, dxmv, dymv); 252 dxmv = x-xmv0; dymv = y-ymv0; 253 DrawBox(xmv0, ymv0, dxmv, dymv); 254 return; 255 } 256 257 /* --Methode-- */ 258 void PIImage::But2Release(int x, int y) 259 { 260 int xp, yp, xp2, yp2; 261 262 if (img == NULL) return; 263 if (img == NULL) return; 264 if (xmv0 < 0) return; 265 DrawBox(xmv0, ymv0, dxmv, dymv); 266 SelGOMode(PI_GOCopy); 267 SelForeground(PI_White); 268 PosW2Img(xmv0, ymv0, &xp, &yp); 269 if ( PosW2Img(x, y, &xp2, &yp2) ) 270 PosW2Img(xmv0+dxmv, ymv0+dymv, &xp2, &yp2); 271 xpav = (xp+xp2)/2; 272 ypav = (yp+yp2)/2; 273 xszpav = ((xp2-xp) > 0) ? (xp2-xp) : 1; 274 yszpav = ((yp2-yp) > 0) ? (yp2-yp) : 1; 275 276 Apply(false); 277 return; 278 } 279 280 281 /* --Methode-- */ 282 void PIImage::But3Press(int x, int y) 283 { 284 int xp, yp; 285 286 if (img == NULL) return; 287 if ( PosW2Img(x, y, &xp, &yp) ) { xmv0 = -1; return; } 225 288 SelPointerShape(PI_TDLRArrowPointer); 226 289 xmv0 = xp; … … 232 295 233 296 /* --Methode-- */ 234 void PIImage::Ptr2Move(int x, int y) 235 { 236 int xp, yp; 237 if (img == NULL) return; 297 void PIImage::Ptr3Move(int x, int y) 298 { 299 int xp, yp; 300 if (img == NULL) return; 301 if (xmv0 < 0) return; 238 302 if ( PosW2Img(x, y, &xp, &yp) ) return; 239 303 if (txw) … … 246 310 247 311 /* --Methode-- */ 248 void PIImage::But 2Release(int x, int y)312 void PIImage::But3Release(int x, int y) 249 313 { 250 314 int xp, yp; … … 252 316 SelPointerShape(PI_ArrowPointer); 253 317 if (img == NULL) return; 318 if (xmv0 < 0) return; 254 319 if ( PosW2Img(x, y, &xp, &yp) ) return; 255 320 … … 262 327 if (offy >= img->YSize()) offy = img->YSize(); 263 328 xpav = xmv0; ypav = ymv0; 264 329 xmv0 = ymv0 = -1; 265 330 Apply(); 266 331 return; … … 465 530 xpav = offx+xwsz/2; 466 531 ypav = offx+ywsz/2; 467 468 return; 469 } 532 xszpav = ((xwsz+ywsz)/20) ; 533 if (xszpav < 1) xszpav = 1; 534 yszpav = xszpav; 535 536 return; 537 } -
trunk/SophyaPI/PI/piimage.h
r10 r11 17 17 { 18 18 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;36 19 public: 37 20 // Les methodes … … 59 42 inline int YPave() { return(ypav); } ; 60 43 44 inline int XSzPave() { return(xszpav); } 45 inline int YSzPave() { return(yszpav); } 46 61 47 void Apply(bool mw=true); 62 48 … … 69 55 virtual void But2Release(int x, int y); 70 56 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); 71 60 72 61 private: … … 81 70 void SetOffset(); 82 71 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 83 95 }; 84 96 -
trunk/SophyaPI/PI/piscdrawwdg.cc
r9 r11 12 12 SetAxesFlags(kAxesDflt); 13 13 clip = true; 14 ActivateButton(2); 15 ActivateMove(2); 16 14 17 } 15 18 … … 56 59 xScale = XSize() / (xMax-xMin + 2*margeH); 57 60 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() */; 60 63 } 61 64 … … 133 136 } 134 137 138 void 139 PIScDrawWdg::ScSelMarker(double size, PIMarker mrk) 140 { 141 int isz = int(fabs(size * xScale)+.5); 142 SelMarker( isz, mrk); 143 } 135 144 136 145 void … … 182 191 } 183 192 193 184 194 void 185 195 PIScDrawWdg::ScDrawBox(double x, double y, double dx, double dy) … … 262 272 rPix = r * xScale; 263 273 DrawFCircle(xPix, yPix, rPix); 264 } 274 } 275 276 #define NMXMULTP 30 // Pour multipoint sans new 277 278 void 279 PIScDrawWdg::ScDrawPolygon(double *x, double *y, int n) 280 { 281 int ix[NMXMULTP], iy[NMXMULTP]; 282 int *pxi, *pyi; 283 int i; 284 285 if (n <= 0) return; 286 if (n > NMXMULTP) { pxi = new int[n]; pyi = new int[n]; } 287 else { pxi = ix; pyi = iy; } 288 for(i=0; i<n; i++) 289 Sc2Local(x[i], y[i], pxi[i], pyi[i]); 290 DrawPolygon(pxi, pyi, n); 291 if (n > NMXMULTP) { delete[] pxi; delete[] pyi; } 292 return; 293 } 294 295 void 296 PIScDrawWdg::ScDrawFPolygon(double *x, double *y, int n) 297 { 298 int xi[NMXMULTP], yi[NMXMULTP]; 299 int *pxi, *pyi; 300 int i; 301 302 if (n <= 0) return; 303 if (n > NMXMULTP) { pxi = new int[n]; pyi = new int[pyi]; } 304 else { pxi = xi; pyi = yi; } 305 for(i=0; i<n; i++) 306 Sc2Local(x[i], y[i], pxi[i], pyi[i]); 307 DrawFPolygon(pxi, pyi, n); 308 if (n > NMXMULTP) { delete[] pxi; delete[] pyi; } 309 return; 310 } 311 312 void 313 PIScDrawWdg::ScDrawMarker(double x0, double y0) 314 { 315 int xPix, yPix; 316 Sc2Local(x0, y0, xPix, yPix); 317 DrawMarker(xPix, yPix); 318 return; 319 } 320 void 321 PIScDrawWdg::ScDrawMarkers(double *x, double *y, int n) 322 { 323 int xi[NMXMULTP], yi[NMXMULTP]; 324 int *pxi, *pyi; 325 int i; 326 327 if (n <= 0) return; 328 if (n > NMXMULTP) { pxi = new int[n]; pyi = new int[pyi]; } 329 else { pxi = xi; pyi = yi; } 330 for(i=0; i<n; i++) 331 Sc2Local(x[i], y[i], pxi[i], pyi[i]); 332 DrawMarkers(pxi, pyi, n); 333 if (n > NMXMULTP) { delete[] pxi; delete[] pyi; } 334 return; 335 } 265 336 266 337 void … … 469 540 PIScDrawWdg::But2Press(int x, int y) 470 541 { 471 SelPointerShape(PI_CrossPointer);472 542 xEndDrag = xBegDrag = x; 473 543 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 554 void 555 PIScDrawWdg::But2Release(int /*x*/, int /*y*/) 556 { 557 482 558 DrawBox(xBegDrag, yBegDrag, xEndDrag-xBegDrag, yEndDrag-yBegDrag); 483 SelForeground(PI_Black); 559 560 SelForeground(cForCol); 561 SelGOMode(cGOmod); 562 SelPointerShape(cPointer); 563 SelLine(cLatt); 484 564 485 565 if (xBegDrag == xEndDrag || yBegDrag == yEndDrag) … … 500 580 PIScDrawWdg::Ptr2Move(int x, int y) 501 581 { 502 SelForeground(PI_White);503 582 DrawBox(xBegDrag, yBegDrag, xEndDrag-xBegDrag, yEndDrag-yBegDrag); 504 583 xEndDrag = x; 505 584 yEndDrag = y; 506 SelForeground(PI_Black);507 585 DrawBox(xBegDrag, yBegDrag, xEndDrag-xBegDrag, yEndDrag-yBegDrag); 508 586 } -
trunk/SophyaPI/PI/piscdrawwdg.h
r9 r11 30 30 31 31 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); 33 33 virtual void ScDrawBox(double x0, double y0, double dx, double dy); 34 34 virtual void ScDrawFBox(double x0, double y0, double dx, double dy); 35 35 virtual void ScDrawCircle(double x0, double y0, double r); 36 36 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 37 42 virtual double ScStringWidth(char const*); 43 38 44 virtual void ScSelFontSz(double size, PIFontAtt att=PI_RomanFont); 45 virtual void ScSelMarker(double size=0, PIMarker mrk=PI_DotMarker); 39 46 40 47 virtual void DrawAxes(int flags = -1); … … 92 99 int xBegDrag, yBegDrag; 93 100 int xEndDrag, yEndDrag; 94 101 PIColors cForCol; 102 PIGOMode cGOmod; 103 PIPointer cPointer; 104 PILineAtt cLatt; 95 105 bool clip; 96 106 -
trunk/SophyaPI/PI/pitestapp.cc
r8 r11 17 17 18 18 #include "ex_dessin.h" 19 #include "sc_sample.h" 19 20 #include "piimage.h" 20 21 … … 54 55 PIText * text; 55 56 PIButton * bouton; 56 PIButton * bouton2, * bouton3, * bouton4 ;57 PIButton * bouton2, * bouton3, * bouton4, *bouton5; 57 58 PILabel * label; 58 59 PIScale * scl; … … 62 63 PIPixmap * zoom; 63 64 PILabel * labimg; 65 ScSample * scs; 64 66 65 67 }; … … 116 118 label = new PILabel(this->MainWin(), "Label", 140, 20, 20,80); 117 119 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); 119 121 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); 122 125 scl = new PIScale(this->MainWin(), "Scale", 88, 5, 45, 100, 20, 10, 150); 123 126 … … 165 168 delete bouton3; 166 169 delete bouton4; 170 delete bouton5; 167 171 delete scl; 168 172 delete menu; … … 182 186 static PIWindow *imgw[5]; 183 187 static PIImage *cur=NULL; 184 185 static PIWindow * wp3, *wp2, *wp4; 188 static ScSample *scs1, *scs2; 189 190 static PIWindow * wp3, *wp2, *wp4, *wp5; 186 191 static PIPixmap * pxm; 187 192 static unsigned char pixels[25000]; … … 189 194 static bool fgpxm = false; 190 195 static bool fgt = false; 196 static bool fgt2 = false; 191 197 192 198 void … … 204 210 { /* printf("Process: Setting active ImageWindow (%lx) \n", (long)data); */ 205 211 cur = (PIImage *)data; } 212 213 if (msg == 33) ckb->SetState(true); 206 214 207 215 if (msg == 133) … … 226 234 else { wp2->Show(); fgt = true; } 227 235 } 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 228 246 // if (msg == 555) (this->menu)->Show(); 229 247 … … 247 265 } 248 266 249 if (msg == 555) wp4->Show();250 if ( (msg == 6001) || (msg == 6002) ) wp4->Hide();251 267 252 268 if ((msg > 8000) && data) printf("PITestApp::MenubarReturn: %s \n", (char *)data); … … 273 289 else printf("PITestApp::Process(5000) (data=NULL) \n"); } 274 290 275 if (msg == 66) ckb->SetState(true);276 291 if ((msg / 100) == 56) 277 292 printf("PITestApp::Process(%d) : %s \n", (int)msg, (char *)data); … … 301 316 wp3 = new PIWindow(app, "Window-3", PIWK_normal, 200, 200, 350, 350); 302 317 pxm = new PIPixmap(wp3, "myPixmap", 150, 150, 10, 10); 303 304 318 pxm->SetBinding(true, true, true, true); 305 319 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); 306 326 307 327 // wp4 = new PIWindow(app, "Open...", PIWK_dialog, 300, 300, 400, 400); -
trunk/SophyaPI/PI/piup.h
r9 r11 1 1 #include "fitsimage.h" 2 2 3 FitsImageR4 * PIUserProc_1(FitsImageR4 * myimg, int xp, int yp, 3 FitsImageR4 * PIUserProc_1(FitsImageR4 * myimg, int xp, int yp, int dx, int dy, 4 4 char * arg1, char * arg2); 5 FitsImageR4 * PIUserProc_2(FitsImageR4 * myimg, int xp, int yp, 5 FitsImageR4 * PIUserProc_2(FitsImageR4 * myimg, int xp, int yp, int dx, int dy, 6 6 char * arg1, char * arg2); 7 FitsImageR4 * PIUserProc_3(FitsImageR4 * myimg, int xp, int yp, 7 FitsImageR4 * PIUserProc_3(FitsImageR4 * myimg, int xp, int yp, int dx, int dy, 8 8 char * arg1, char * arg2); -
trunk/SophyaPI/PI/piup_def.cc
r9 r11 8 8 #include "piup.h" 9 9 10 FitsImageR4 * PIUserProc_1(FitsImageR4 * myimg, int xp, int yp,10 FitsImageR4 * PIUserProc_1(FitsImageR4 * , int xp, int yp, int dx, int dy, 11 11 char * arg1, char * arg2) 12 12 { 13 printf("PIUserProc_1/Dummy (%d %d %s %s) ne fait rien !\n", xp, yp, arg1, arg2); 13 printf("PIUserProc_1/Dummy Pave[%d,%d] en (%d %d) %s %s ne fait rien !\n", 14 dx, dy, xp, yp, arg1, arg2); 14 15 return(NULL); 15 16 } 16 17 17 FitsImageR4 * PIUserProc_2(FitsImageR4 * myimg, int xp, int yp,18 FitsImageR4 * PIUserProc_2(FitsImageR4 * , int xp, int yp, int dx, int dy, 18 19 char * arg1, char * arg2) 19 20 { 20 printf("PIUserProc_2/Dummy (%d %d %s %s) ne fait rien !\n", xp, yp, arg1, arg2); 21 printf("PIUserProc_2/Dummy Pave[%d,%d] en (%d %d) %s %s ne fait rien !\n", 22 dx, dy, xp, yp, arg1, arg2); 21 23 return(NULL); 22 24 } 23 25 24 FitsImageR4 * PIUserProc_3(FitsImageR4 * /*myimg*/, int xp, int yp,26 FitsImageR4 * PIUserProc_3(FitsImageR4 * , int xp, int yp, int dx, int dy, 25 27 char * arg1, char * arg2) 26 28 { 27 printf("PIUserProc_3/Dummy (%d %d %s %s) ne fait rien !\n", xp, yp, arg1, arg2); 29 printf("PIUserProc_3/Dummy Pave[%d,%d] en (%d %d) %s %s ne fait rien !\n", 30 dx, dy, xp, yp, arg1, arg2); 28 31 return(NULL); 29 32 } -
trunk/SophyaPI/PI/piwdggen.h
r8 r11 9 9 10 10 #include "pimsghandler.h" 11 12 void PIBeep(); 11 13 12 14 class PIContainerGen; … … 56 58 57 59 58 void PIBeep();60 59 61 60 62 #endif/* PIWDG_H_SEEN */ -
trunk/SophyaPI/PI/pixtbase.cc
r2 r11 121 121 /* Nouvelle-Fonction */ 122 122 static void init_pixtbase (Widget request, Widget wdg, 123 ArgList args, Cardinal* narg)123 ArgList /*args*/, Cardinal* /*narg*/) 124 124 { 125 125 PIXtBaseWidget wdgp; … … 137 137 138 138 /* Nouvelle-Fonction */ 139 static void destroy_pixtbase (Widget wdgp)139 static void destroy_pixtbase (Widget /*wdgp*/) 140 140 { 141 141 #ifdef DEBUG_PIXTB … … 155 155 156 156 /* Nouvelle-Fonction */ 157 static void expose_pixtbase (Widget wdgp, XEvent* event, Region region)157 static void expose_pixtbase (Widget wdgp, XEvent* /*event*/, Region region) 158 158 { 159 159 #ifdef DEBUG_PIXTB … … 174 174 175 175 /* Nouvelle-Fonction */ 176 static void enter_pixtbase (Widget wdgp, XEvent* evt,177 String* args, Cardinal* narg)176 static void enter_pixtbase (Widget wdgp, XEvent* /*evt*/, 177 String* /*args*/, Cardinal* /*narg*/) 178 178 { 179 179 if (((PIXtBaseWidget)wdgp)->pixtbase.objet) … … 183 183 184 184 /* Nouvelle-Fonction */ 185 static void leave_pixtbase (Widget wdgp, XEvent* evt,186 String* args, Cardinal* narg)185 static void leave_pixtbase (Widget wdgp, XEvent* /*evt*/, 186 String* /*args*/, Cardinal* /*narg*/) 187 187 { 188 188 if (((PIXtBaseWidget)wdgp)->pixtbase.objet) … … 193 193 /* Nouvelle-Fonction */ 194 194 static void bud1_pixtbase (Widget wdgp, XEvent* evt, 195 String* args, Cardinal* narg)195 String* /*args*/, Cardinal* /*narg*/) 196 196 197 197 { … … 208 208 /* Nouvelle-Fonction */ 209 209 static void buu1_pixtbase (Widget wdgp, XEvent* evt, 210 String* args, Cardinal* narg)210 String* /*args*/, Cardinal* /*narg*/) 211 211 212 212 { … … 222 222 /* Nouvelle-Fonction */ 223 223 static void bud2_pixtbase (Widget wdgp, XEvent* evt, 224 String* args, Cardinal* narg)224 String* /*args*/, Cardinal* /*narg*/) 225 225 226 226 { … … 237 237 /* Nouvelle-Fonction */ 238 238 static void buu2_pixtbase (Widget wdgp, XEvent* evt, 239 String* args, Cardinal* narg) 240 239 String* /*args*/, Cardinal* /*narg*/) 241 240 { 242 241 if (((PIXtBaseWidget)wdgp)->pixtbase.objet) … … 253 252 /* Nouvelle-Fonction */ 254 253 static void bud3_pixtbase (Widget wdgp, XEvent* evt, 255 String* args, Cardinal* narg)254 String* /*args*/, Cardinal* /*narg*/) 256 255 257 256 { … … 268 267 /* Nouvelle-Fonction */ 269 268 static void buu3_pixtbase (Widget wdgp, XEvent* evt, 270 String* args, Cardinal* narg)269 String* /*args*/, Cardinal* /*narg*/) 271 270 272 271 { … … 283 282 /* Nouvelle-Fonction */ 284 283 static void mov1_pixtbase (Widget wdgp, XEvent* evt, 285 String* args, Cardinal* narg)284 String* /*args*/, Cardinal* /*narg*/) 286 285 { 287 286 if (((PIXtBaseWidget)wdgp)->pixtbase.objet) … … 297 296 /* Nouvelle-Fonction */ 298 297 static void mov2_pixtbase (Widget wdgp, XEvent* evt, 299 String* args, Cardinal* narg)298 String* /*args*/, Cardinal* /*narg*/) 300 299 { 301 300 if (((PIXtBaseWidget)wdgp)->pixtbase.objet) … … 311 310 /* Nouvelle-Fonction */ 312 311 static void mov3_pixtbase (Widget wdgp, XEvent* evt, 313 String* args, Cardinal* narg)312 String* /*args*/, Cardinal* /*narg*/) 314 313 { 315 314 if (((PIXtBaseWidget)wdgp)->pixtbase.objet) … … 325 324 /* Nouvelle-Fonction */ 326 325 static void keyb_pixtbase (Widget wdgp, XEvent* evt, 327 String* args, Cardinal* narg)326 String* /*args*/, Cardinal* /*narg*/) 328 327 { 329 328 if (((PIXtBaseWidget)wdgp)->pixtbase.objet) -
trunk/SophyaPI/PI/sc_sample.cc
r9 r11 1 1 #include "sc_sample.h" 2 2 3 static double f(double x) {return x*x;} 3 4 4 5 ScSample::ScSample(PIContainerGen *par, char *nom, … … 7 8 8 9 { 10 PIScFuncDrawer * mfd; 11 mfd = new PIScFuncDrawer(f); 9 12 SetLimits(-3,3,-4,4); 13 AddDrawer(mfd); 14 SetAxesFlags(); 10 15 } 11 16 12 17 ScSample::~ScSample() 13 {} 18 { 19 DeleteDrawers(); 20 } 14 21 15 static double f(double x) {return x*x;}16 22 17 23 void 18 ScSample::Draw ()24 ScSample::DrawSelf() 19 25 { 20 DrawAxes(); 21 PlotFunc(f); 26 double x[5] = {-2, -1., 1., 1.7, 2.2}; 27 double y[5] = {-2.5, -2.0, -1.5, -2., -2.5}; 28 29 int i; 30 SelForeground(PI_Green); 31 ScSelMarker(0.3, PI_BoxMarker); 32 ScDrawMarkers(x, y, 5); 33 SelForeground(PI_Magenta); 34 ScSelMarker(0.3, PI_FCircleMarker); 35 for(i=0; i<5; i++) 36 y[i]+=1.; 37 ScDrawMarkers(x, y, 5); 38 SelForeground(PI_Black); 39 40 return; 22 41 } 42 -
trunk/SophyaPI/PI/sc_sample.h
r8 r11 10 10 11 11 12 v oid Draw();12 virtual void DrawSelf(); 13 13 14 14 };
Note:
See TracChangeset
for help on using the changeset viewer.