[293] | 1 | #include "machdefs.h"
|
---|
[165] | 2 | #include <stdlib.h>
|
---|
| 3 | #include <stdio.h>
|
---|
| 4 | #include <string.h>
|
---|
| 5 |
|
---|
[295] | 6 | #include <typeinfo>
|
---|
| 7 |
|
---|
[165] | 8 | #include <string>
|
---|
| 9 | #include <vector>
|
---|
| 10 |
|
---|
| 11 | #include "strutil.h"
|
---|
| 12 | #include "timing.h"
|
---|
| 13 | #include "perrors.h"
|
---|
| 14 | #include "ctimer.h"
|
---|
| 15 |
|
---|
| 16 | #include "psighand.h"
|
---|
| 17 |
|
---|
| 18 | #include "cimage.h" // pour pouvoir faire extract
|
---|
| 19 |
|
---|
| 20 | #include "pistdimgapp.h"
|
---|
[2263] | 21 | #include "servnobjm.h"
|
---|
[1856] | 22 | // #include "pihisto2d.h"
|
---|
[165] | 23 | #include "psfile.h"
|
---|
| 24 | #include "piimgtools.h"
|
---|
| 25 | #include "pidrwtools.h"
|
---|
[1590] | 26 | #include "piaxestools.h"
|
---|
[165] | 27 |
|
---|
| 28 | #include "pistzwin.h"
|
---|
| 29 |
|
---|
[295] | 30 | #include "piinit.h"
|
---|
[374] | 31 | #include "piversion.h"
|
---|
| 32 | #include "piaversion.h"
|
---|
[165] | 33 |
|
---|
[295] | 34 |
|
---|
[165] | 35 | static char ImgDir[256];
|
---|
| 36 | static char WorkDir[256];
|
---|
[692] | 37 | // Initialiseur
|
---|
| 38 | static PIAppInitiator * glst_piai = NULL;
|
---|
[165] | 39 |
|
---|
[686] | 40 | // Pour la creation de fenetre info (about piapp)
|
---|
| 41 | static void createInfoWindow(PIStdImgApp* app);
|
---|
| 42 | static void deleteInfoWindow();
|
---|
| 43 | static void showInfoWindow(PIStdImgApp* app);
|
---|
| 44 | static void hideInfoWindow(PIStdImgApp* app);
|
---|
[165] | 45 |
|
---|
[2106] | 46 |
|
---|
[165] | 47 | /* ........................................................... */
|
---|
[2106] | 48 | /* Classe SIA_RU__Periodic : mise a jour periodique de */
|
---|
| 49 | /* la fenetre Stat/Ressource info */
|
---|
[2188] | 50 | /* + execution de commande soumis de l'exterieur */
|
---|
[2106] | 51 | /* ........................................................... */
|
---|
| 52 |
|
---|
| 53 | class SIA_RU__Periodic : public PIPeriodic
|
---|
| 54 | {
|
---|
| 55 | public:
|
---|
| 56 | SIA_RU__Periodic(PIStdImgApp* app);
|
---|
| 57 | virtual ~SIA_RU__Periodic();
|
---|
| 58 | virtual void DoPeriodic();
|
---|
| 59 | private:
|
---|
| 60 | PIStdImgApp* _app;
|
---|
| 61 | };
|
---|
| 62 |
|
---|
| 63 | SIA_RU__Periodic::SIA_RU__Periodic(PIStdImgApp* app)
|
---|
| 64 | : PIPeriodX(1)
|
---|
| 65 | {
|
---|
| 66 | _app = app;
|
---|
| 67 | }
|
---|
| 68 |
|
---|
| 69 | SIA_RU__Periodic::~SIA_RU__Periodic()
|
---|
| 70 | {
|
---|
| 71 | }
|
---|
| 72 |
|
---|
| 73 | void SIA_RU__Periodic::DoPeriodic()
|
---|
| 74 | {
|
---|
[2188] | 75 | if (_app) {
|
---|
| 76 | _app->ExecuteExtCommand();
|
---|
| 77 | _app->UpdateStatResourceInfo();
|
---|
| 78 | }
|
---|
[2106] | 79 | }
|
---|
| 80 |
|
---|
| 81 | /* ............................................................. */
|
---|
| 82 |
|
---|
| 83 |
|
---|
| 84 | /* ........................................................... */
|
---|
[165] | 85 | /* Classe PIStdImgApp */
|
---|
| 86 | /* ........................................................... */
|
---|
| 87 |
|
---|
| 88 | /* --Methode-- */
|
---|
| 89 | PIStdImgApp::PIStdImgApp(int narg, char* arg[])
|
---|
| 90 | : PIApplication(420, 320, narg, arg)
|
---|
| 91 | {
|
---|
| 92 |
|
---|
| 93 | // Les menus
|
---|
| 94 | m[0] = new PIMenu(Menubar(),"Fichier");
|
---|
[686] | 95 | m[0]->AppendItem("About piapp", 10150);
|
---|
[165] | 96 | m[0]->AppendItem("Open-Fits", 10120);
|
---|
| 97 | m[0]->AppendItem("Open-PPF", 10130);
|
---|
[2263] | 98 | #ifndef SANS_EVOLPLANCK
|
---|
| 99 | m[0]->AppendItem("Open-ASCII", 10140);
|
---|
| 100 | #endif
|
---|
[165] | 101 | // m[0]->AppendItem("Options", 10101);
|
---|
[686] | 102 | m[0]->AppendItem("Help", 10100);
|
---|
[1513] | 103 | m[0]->AppendSeparator();
|
---|
[165] | 104 | m[0]->AppendItem("Exit", 10105);
|
---|
| 105 |
|
---|
| 106 | m[1] = new PIMenu(Menubar(),"Objets");
|
---|
| 107 | m[1]->AppendItem("ObjectManager", 10201);
|
---|
| 108 | m[1]->AppendItem("OpenOutPPF", 10220);
|
---|
| 109 | m[1]->AppendItem("CloseOutPPF", 10230);
|
---|
[686] | 110 | m[1]->AppendItem("Delete CurWdg", 10270);
|
---|
[165] | 111 |
|
---|
| 112 | m[2] = new PIMenu(Menubar(),"Tools");
|
---|
| 113 | m[2]->AppendItem("Show ImageTools", 10301);
|
---|
| 114 | m[2]->AppendItem("Show DrawerTools", 10302);
|
---|
[1590] | 115 | m[2]->AppendItem("Show AxesTools", 10303);
|
---|
| 116 | m[2]->AppendItem("CxxExecutorWindow", 10304);
|
---|
| 117 | m[2]->AppendItem("Ext.Pave", 10311);
|
---|
| 118 | m[2]->SetSensitivityMsg(10311, false);
|
---|
| 119 | m[2]->AppendItem("Ext.Pave+Org", 10312);
|
---|
| 120 | m[2]->SetSensitivityMsg(10312, false);
|
---|
| 121 | m[2]->AppendItem("Cuts X,Y", 10313);
|
---|
| 122 | m[2]->SetSensitivityMsg(10313, false);
|
---|
[165] | 123 | mc = new PIMenu(m[2], "StackTools");
|
---|
| 124 | mc->AppendItem("DispNext", 10320);
|
---|
[191] | 125 | mc->AppendItem("Blink 0.5s", 10321);
|
---|
| 126 | mc->AppendItem("Blink 1s", 10322);
|
---|
| 127 | mc->AppendItem("Blink 2s", 10324);
|
---|
[165] | 128 | mc->AppendItem("Stop Blink", 10329);
|
---|
| 129 | mc->AppendItem("RemoveCurrent", 10330);
|
---|
| 130 | m[2]->AppendPDMenu(mc);
|
---|
| 131 | m[2]->SetSensitivity("StackTools", false);
|
---|
| 132 |
|
---|
| 133 | m[3] = new PIMenu(Menubar(),"Window");
|
---|
| 134 | m[3]->AppendItem("StackWindow", 10400);
|
---|
| 135 | m[3]->AppendItem("Window", 10411);
|
---|
| 136 | m[3]->AppendItem("Window 2x1", 10421);
|
---|
[1971] | 137 | // m[3]->AppendItem("Window 1x2", 10412);
|
---|
[165] | 138 | m[3]->AppendItem("Window 2x2", 10422);
|
---|
[1971] | 139 | // m[3]->AppendItem("Window 3x1", 10431);
|
---|
[165] | 140 | m[3]->AppendItem("Window 3x3", 10433);
|
---|
[558] | 141 | m[3]->AppendItem("Cur->LastWdg", 10441);
|
---|
[686] | 142 | m[3]->AppendItem("Close CurWin", 10460);
|
---|
[1971] | 143 | m[3]->AppendCheckItem("StatZoomWin", 10470);
|
---|
| 144 | m[3]->SetStateMsg(10470, true);
|
---|
[165] | 145 |
|
---|
| 146 | m[4] = new PIMenu(Menubar(),"PostScript");
|
---|
| 147 | m[4]->AppendItem("OpenPS", 10501);
|
---|
| 148 | m[4]->AppendItem("ClosePS", 10505);
|
---|
| 149 | m[4]->AppendItem("Window->PS", 10511);
|
---|
| 150 | m[4]->AppendItem("Image->PS", 10515);
|
---|
| 151 | m[4]->AppendItem("Window->EPS", 10512);
|
---|
| 152 | m[4]->AppendItem("Image->EPS", 10516);
|
---|
| 153 | m[4]->SetSensitivityMsg(10515, false);
|
---|
| 154 | m[4]->SetSensitivityMsg(10516, false);
|
---|
| 155 |
|
---|
| 156 | m[5] = new PIMenu(Menubar(),"Special");
|
---|
| 157 | m[5]->AppendItem("CloseAll", 10601);
|
---|
| 158 | m[5]->AppendCheckItem("Red.Out/Err", 10602);
|
---|
[374] | 159 | m[5]->AppendCheckItem("Catch SigFPE", 10603);
|
---|
| 160 | m[5]->AppendCheckItem("Catch SigSEGV", 10604);
|
---|
[449] | 161 | m[5]->AppendCheckItem("ObjMgr Verb", 10605);
|
---|
[1319] | 162 | m[5]->AppendItem("CxxExecOption", 10606);
|
---|
[165] | 163 |
|
---|
[293] | 164 | m[6] = new PIMenu(Menubar(),"Modules");
|
---|
| 165 |
|
---|
[165] | 166 | AppendMenu(m[0]);
|
---|
| 167 | AppendMenu(m[1]);
|
---|
| 168 | AppendMenu(m[2]);
|
---|
| 169 | AppendMenu(m[3]);
|
---|
| 170 | AppendMenu(m[4]);
|
---|
| 171 | AppendMenu(m[5]);
|
---|
[374] | 172 | // AppendMenu(m[6]); Menu Modules vide pour le moment
|
---|
[165] | 173 |
|
---|
| 174 | int scsx, scsy;
|
---|
[1593] | 175 | ScreenSize(scsx, scsy);
|
---|
[165] | 176 | if (scsy <= 600) mFgScSz = 0;
|
---|
| 177 | else if (scsy <= 800) mFgScSz = 1;
|
---|
| 178 | else if (scsy <= 1024) mFgScSz = 2;
|
---|
| 179 | else mFgScSz = 3;
|
---|
| 180 | int msx = 420+mFgScSz*60;
|
---|
| 181 | int msy = 320+mFgScSz*40;
|
---|
| 182 | MainWin()->SetSize(msx, msy);
|
---|
| 183 |
|
---|
[1971] | 184 | //------------------------------------------------------
|
---|
| 185 | // On cree un container intermediaire permettant de gerer
|
---|
| 186 | // le widget zoom, colormap, stats, ...
|
---|
| 187 |
|
---|
[165] | 188 | int bss = 100+mFgScSz*15;
|
---|
[1971] | 189 |
|
---|
| 190 | int statc_szy = bss+10+14+mFgScSz*2+5;
|
---|
| 191 | statcont = new PIContainer(MainWin(), "ZGCSCont", msx, statc_szy, 0, 0);
|
---|
| 192 | statcont->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free);
|
---|
| 193 |
|
---|
| 194 | gimv = new PIPixmap(statcont, "GloV", bss, bss, 5, 5);
|
---|
[165] | 195 | gimv->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_free, PIBK_free);
|
---|
[1971] | 196 | zoom = new PIPixmap(statcont, "Zoom", bss, bss, bss+10, 5);
|
---|
[165] | 197 | zoom->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_free, PIBK_free);
|
---|
[1971] | 198 | cmapv = new PICMapView(statcont, "CMapView", msx-10, 14+mFgScSz*2, 5, bss+10);
|
---|
[165] | 199 | cmapv->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free);
|
---|
[2106] | 200 |
|
---|
| 201 | // Widget pour affichage des stats / ressources
|
---|
| 202 | lab_mem = new PILabel(statcont, "memlab", msx-2*(bss+20), 20, 2*bss+20, 10);
|
---|
| 203 | lab_mem->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free);
|
---|
| 204 | lab_mem->SetLabel("MemoryUsage");
|
---|
| 205 | lab_mem->SetForegroundColor(PI_Red);
|
---|
| 206 | lab_mem->SetBorderWidth(1);
|
---|
| 207 | therm_mem = new PIThermometer(statcont, "memtherm", msx-2*(bss+20), 20, 2*bss+20, 35);
|
---|
| 208 | therm_mem->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free);
|
---|
| 209 | therm_mem->SetThreshold(0.5, 0.75);
|
---|
| 210 |
|
---|
| 211 | lab_cpu = new PILabel(statcont, "cpulab", msx-2*(bss+20), 20, 2*bss+20, 60);
|
---|
| 212 | lab_cpu->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free);
|
---|
| 213 | lab_cpu->SetLabel("CPUUsage");
|
---|
| 214 | lab_cpu->SetForegroundColor(PI_Black);
|
---|
| 215 | lab_cpu->SetBorderWidth(1);
|
---|
| 216 | therm_cpu = new PIThermometer(statcont, "cputherm", msx-2*(bss+20), 20, 2*bss+20, 85);
|
---|
| 217 | therm_cpu->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_free);
|
---|
| 218 | therm_cpu->SetThreshold(0.75, 0.90);
|
---|
| 219 |
|
---|
[2188] | 220 | fg_exc_cmd = false;
|
---|
[2106] | 221 | UpdateStatResourceInfo();
|
---|
| 222 | resupd_periodic = new SIA_RU__Periodic(this);
|
---|
| 223 | //resupd_periodic->SetIntervalms(500);
|
---|
| 224 | resupd_periodic->Start();
|
---|
| 225 |
|
---|
[1971] | 226 | statcont->Show();
|
---|
| 227 | // StatZoomWindowSetVisible(true);
|
---|
| 228 | //------------------------------------------------------
|
---|
[165] | 229 |
|
---|
[1971] | 230 | //int cpy = bss+10+14+mFgScSz*2+5;
|
---|
| 231 | int cpy = statc_szy;
|
---|
[165] | 232 |
|
---|
| 233 | // Creation d'une console avec gestion des commandes
|
---|
[1971] | 234 | consolecont = new PIContainer(MainWin(), "ConsoleCont", msx, msy-cpy, 0, cpy );
|
---|
| 235 | consolecont->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_fixed);
|
---|
| 236 | mCons = new PIConsole(consolecont, "Console", 30200, 512, 132, msx, msy-cpy, 0, 0 );
|
---|
[165] | 237 | mCons->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_fixed);
|
---|
| 238 | mCons->AcceptCmd(true, 50);
|
---|
[1971] | 239 | consolecont->Show();
|
---|
[293] | 240 | redirecout = false;
|
---|
[165] | 241 | // RedirectStdOutErr(true); pas par defaut
|
---|
| 242 |
|
---|
| 243 | mObjMgr = new NamedObjMgr;
|
---|
| 244 | mCmd = new PIACmd(mObjMgr, this);
|
---|
| 245 |
|
---|
[449] | 246 | // Pas trop de message de la part de NamedObjMgr
|
---|
| 247 | m[5]->SetStateMsg(10605, false);
|
---|
| 248 | mObjMgr->SetVerbose(false);
|
---|
| 249 |
|
---|
[165] | 250 | char* varenv;
|
---|
| 251 | ImgDir[0] = WorkDir[0] = '\0';
|
---|
| 252 | if ( (varenv=getenv("PEIDA_IMAGES")) != NULL ) strncpy(ImgDir, varenv, 256);
|
---|
| 253 | if ( (varenv=getenv("PEIDA_WORK")) != NULL ) strncpy(WorkDir, varenv, 256);
|
---|
| 254 |
|
---|
[685] | 255 | pfc_fits = new PIFileChooser(this,"FITS-FileChooser", 10125);
|
---|
| 256 | pfc_ppf = new PIFileChooser(this,"PPF-FileChooser", 10135);
|
---|
[2263] | 257 | pfc_ascii = new PIFileChooser(this,"ASCII-FileChooser", 10145);
|
---|
[685] | 258 | pfc_ps = new PIFileChooser(this,"PS-FileChooser", 10525);
|
---|
[165] | 259 |
|
---|
| 260 | mObjmgrw = new ObjMgrWind(this);
|
---|
| 261 | mPpinmgrw = new PPInMgrWind(this);
|
---|
| 262 |
|
---|
[333] | 263 | // Attention : A faire apres creation de ObjMgrWind !!!
|
---|
| 264 | mObjMgr->SetImgApp(this);
|
---|
| 265 |
|
---|
[165] | 266 | // Gestion des feneteres widgets et drawers
|
---|
| 267 | mWId = mDId = mBWId = 0;
|
---|
| 268 | mCurWin = NULL;
|
---|
| 269 | mCurWdg = NULL;
|
---|
| 270 | mLastWdg = NULL;
|
---|
| 271 | mGrW = NULL;
|
---|
| 272 | mStW = NULL;
|
---|
| 273 | mGrIdx = mStIdx = -1;
|
---|
| 274 |
|
---|
| 275 | mFCMsg = 0;
|
---|
| 276 | mFgCWImg = false;
|
---|
| 277 |
|
---|
| 278 | // Gestion fichiers PS
|
---|
| 279 | num_eps = 0;
|
---|
| 280 | name_ps = "";
|
---|
| 281 | name_ps = "pia.ps";
|
---|
| 282 | mpsfile = new PSFile(name_ps.c_str(),PI_Portrait, PI_A4, 2., 2.);
|
---|
| 283 |
|
---|
| 284 | // Gestion OUT-PPF
|
---|
| 285 | mPpfout = NULL;
|
---|
| 286 | name_outppf = "";
|
---|
| 287 |
|
---|
| 288 | // Attributs graphiques courants
|
---|
[203] | 289 | mAxesFlags = kBoxAxes | kExtTicks | kLabels;
|
---|
[548] | 290 | SetInsetLimits(0.4, 0.6, 0.4, 0.6);
|
---|
[1131] | 291 | mAddTitle = true;
|
---|
[165] | 292 |
|
---|
[295] | 293 | // Initialisation
|
---|
[692] | 294 | glst_piai = new PIAppInitiator(this);
|
---|
[600] | 295 |
|
---|
| 296 | char buff[128];
|
---|
| 297 | mCons->AddStr(" ............ starting piapp .............\n", PIVA_Blue );
|
---|
| 298 | #ifdef SANS_EVOLPLANCK
|
---|
| 299 | sprintf(buff, "Version: piapp=%g PI=%g PEIDA=%g \n", (double)PIAPP_VERSIONNUMBER,
|
---|
| 300 | (double)PI_VERSIONNUMBER, (float)PeidaVersion());
|
---|
| 301 | #else
|
---|
| 302 | sprintf(buff, "Version: piapp=%g PI=%g SOPHYA=%g \n", (double)PIAPP_VERSIONNUMBER,
|
---|
[692] | 303 | (double)PI_VERSIONNUMBER, glst_piai->Version());
|
---|
[600] | 304 | #endif
|
---|
| 305 | mCons->AddStr(buff, PIVA_Blue );
|
---|
| 306 | mCons->AddStr(" ..........................................\n", PIVA_Blue );
|
---|
| 307 | // PrintPeidaVersion();
|
---|
| 308 |
|
---|
[685] | 309 | pfc_fits->SetPath(ImgDir);
|
---|
| 310 | pfc_ppf->SetPath(WorkDir);
|
---|
| 311 | pfc_ps->SetPath(WorkDir);
|
---|
| 312 |
|
---|
[165] | 313 | SetReady();
|
---|
| 314 | }
|
---|
| 315 |
|
---|
| 316 | /* --Methode-- */
|
---|
| 317 | PIStdImgApp::~PIStdImgApp()
|
---|
| 318 | {
|
---|
| 319 | int i;
|
---|
| 320 |
|
---|
[1075] | 321 | // On inactive la fenetre principale
|
---|
| 322 | // Sinon, ca peut provoquer un SEGV ds delete de console ?? - Reza 07/2000
|
---|
| 323 | MainWin()->Hide();
|
---|
| 324 |
|
---|
[558] | 325 | // Destrucion de tous les objets de NameObjMgr
|
---|
| 326 | string patt = "/*/*";
|
---|
| 327 | mObjMgr->DelObjects(patt, true);
|
---|
| 328 |
|
---|
[205] | 329 | delete mc;
|
---|
[293] | 330 | for(i=0; i<7; i++)
|
---|
[165] | 331 | if (m[i]) delete m[i];
|
---|
| 332 |
|
---|
| 333 | WindMList::iterator it;
|
---|
| 334 | for(it = mWList.begin(); it != mWList.end(); it++) delete (*it).second;
|
---|
| 335 |
|
---|
| 336 | delete mObjMgr;
|
---|
| 337 | delete mCmd;
|
---|
| 338 |
|
---|
| 339 | delete zoom;
|
---|
| 340 | delete gimv;
|
---|
| 341 | delete cmapv;
|
---|
| 342 |
|
---|
[2106] | 343 | delete lab_mem;
|
---|
| 344 | delete therm_mem;
|
---|
| 345 | delete lab_cpu;
|
---|
| 346 | delete therm_cpu;
|
---|
| 347 |
|
---|
[1971] | 348 | delete statcont;
|
---|
| 349 |
|
---|
[685] | 350 | delete pfc_fits;
|
---|
| 351 | delete pfc_ppf;
|
---|
[2263] | 352 | delete pfc_ascii;
|
---|
[685] | 353 | delete pfc_ps;
|
---|
[165] | 354 |
|
---|
| 355 | delete mCons;
|
---|
[2106] | 356 | delete consolecont;
|
---|
[165] | 357 |
|
---|
| 358 | delete mObjmgrw;
|
---|
| 359 | delete mPpinmgrw;
|
---|
| 360 |
|
---|
[686] | 361 | deleteInfoWindow();
|
---|
| 362 |
|
---|
[165] | 363 | // Les fichiers
|
---|
| 364 | if (mpsfile) delete mpsfile;
|
---|
| 365 | if (mPpfout) delete mPpfout;
|
---|
| 366 |
|
---|
[2106] | 367 | if (resupd_periodic) delete resupd_periodic;
|
---|
| 368 |
|
---|
[692] | 369 | if (glst_piai) delete glst_piai; glst_piai = NULL;
|
---|
[2106] | 370 |
|
---|
[165] | 371 | }
|
---|
| 372 |
|
---|
| 373 | /* --Methode-- */
|
---|
| 374 | void PIStdImgApp::Process(PIMessage msg, PIMsgHandler* sender, void* data)
|
---|
| 375 | {
|
---|
| 376 | PIWdg *sndw;
|
---|
| 377 | PIMessage tmsg, smm;
|
---|
| 378 |
|
---|
| 379 | tmsg = msg;
|
---|
| 380 | msg = UserMsg(msg);
|
---|
| 381 | smm = ModMsg(tmsg);
|
---|
| 382 |
|
---|
| 383 | //printf("SuperDebug: msg=%d Mod=%d State=%d\n", (int)msg, (int)smm, (int)GetState());
|
---|
| 384 | if ((GetState()) && (msg != mFCMsg)) { PIBeep(); return; }
|
---|
| 385 |
|
---|
| 386 | // Messages active-window
|
---|
| 387 | if (smm == PIMsg_Active)
|
---|
| 388 | {
|
---|
[293] | 389 | sndw = dynamic_cast<PIWdg *>(sender);
|
---|
[165] | 390 | switch(sndw->kind())
|
---|
| 391 | {
|
---|
| 392 | case PIWindow::ClassId :
|
---|
[293] | 393 | mCurWin = dynamic_cast<PIWindow *>(sndw);
|
---|
[165] | 394 | break;
|
---|
| 395 |
|
---|
| 396 | case PIScDrawWdg::ClassId :
|
---|
| 397 | case PIDraw3DWdg::ClassId :
|
---|
[293] | 398 | mCurWdg = dynamic_cast<PIBaseWdg *>(sender);
|
---|
[165] | 399 | // cerr << "*DBG11* ImgTools -> NonSensitive " << sndw->kind() << endl;
|
---|
| 400 | if (mFgCWImg) {
|
---|
| 401 | // cerr << "*DBG* ImgTools -> NonSensitive " << endl;
|
---|
[1590] | 402 | m[2]->SetSensitivityMsg(10311, false);
|
---|
| 403 | m[2]->SetSensitivityMsg(10312, false);
|
---|
| 404 | m[2]->SetSensitivityMsg(10313, false);
|
---|
[165] | 405 | m[4]->SetSensitivityMsg(10515, false);
|
---|
| 406 | m[4]->SetSensitivityMsg(10516, false);
|
---|
| 407 | mFgCWImg = false;
|
---|
| 408 | }
|
---|
| 409 | break;
|
---|
| 410 | case PIImage::ClassId :
|
---|
[293] | 411 | mCurWdg = dynamic_cast<PIBaseWdg *>(sender);
|
---|
[165] | 412 | if (!mFgCWImg) {
|
---|
| 413 | // cerr << "*DBG* ImgTools -> Sensitive " << endl;
|
---|
[1590] | 414 | m[2]->SetSensitivityMsg(10311, true);
|
---|
| 415 | m[2]->SetSensitivityMsg(10312, true);
|
---|
| 416 | m[2]->SetSensitivityMsg(10313, true);
|
---|
[165] | 417 | m[4]->SetSensitivityMsg(10515, true);
|
---|
| 418 | m[4]->SetSensitivityMsg(10516, true);
|
---|
| 419 | mFgCWImg = true;
|
---|
| 420 | }
|
---|
| 421 | break;
|
---|
[293] | 422 | /*
|
---|
| 423 | default :
|
---|
| 424 | mCurWdg = NULL;
|
---|
| 425 | if (mFgCWImg) {
|
---|
[1590] | 426 | m[2]->SetSensitivityMsg(10311, false);
|
---|
| 427 | m[2]->SetSensitivityMsg(10312, false);
|
---|
| 428 | m[2]->SetSensitivityMsg(10313, false);
|
---|
[293] | 429 | m[4]->SetSensitivityMsg(10515, false);
|
---|
| 430 | m[4]->SetSensitivityMsg(10516, false);
|
---|
| 431 | mFgCWImg = false;
|
---|
| 432 | }
|
---|
| 433 | break;
|
---|
| 434 | */
|
---|
[165] | 435 | }
|
---|
| 436 | }
|
---|
| 437 | // Message window-close
|
---|
| 438 | else if (smm == PIMsg_Close)
|
---|
| 439 | {
|
---|
| 440 | sndw = (PIWdg *)sender;
|
---|
| 441 | if(sndw->kind() == PIWindow::ClassId)
|
---|
| 442 | {
|
---|
| 443 | mCurWin = (PIWindow *)sender;
|
---|
| 444 | if (mCurWin == mStW) m[2]->SetSensitivity("StackTools", false);
|
---|
| 445 | DeleteWindow(mCurWin);
|
---|
| 446 | }
|
---|
| 447 | else
|
---|
| 448 | printf("PIStdImgApp/Bug ? CloseMsd received from NonWindow (%d %d %lx) \n",
|
---|
| 449 | (int)tmsg, (int)sndw->kind(), (long)sender);
|
---|
| 450 | }
|
---|
| 451 |
|
---|
| 452 | // Traitement des messages des menus
|
---|
| 453 | else if ( (msg >= 10100) && (msg < 10200) ) MBProcess1(msg, sender, data);
|
---|
| 454 | else if ( (msg >= 10200) && (msg < 10300) ) MBProcess2(msg, sender, data);
|
---|
| 455 | else if ( (msg >= 10300) && (msg < 10400) ) MBProcess3(msg, sender, data);
|
---|
| 456 | else if ( (msg >= 10400) && (msg < 10500) ) MBProcess4(msg, sender, data);
|
---|
| 457 | else if ( (msg >= 10500) && (msg < 10600) ) MBProcess5(msg, sender, data);
|
---|
| 458 | else if ( (msg >= 10600) && (msg < 10700) ) MBProcess6(msg, sender, data);
|
---|
| 459 | else if ( msg == 30200 ) { // Objet PIConsole
|
---|
| 460 | string s = mCons->GetCmdString();
|
---|
[1265] | 461 | // string s2 = "\nExecuting " + s + "\n";
|
---|
| 462 | mCons->AddStr("Cmd> ", PIVA_Blue, false);
|
---|
| 463 | // s2 = s + "\n";
|
---|
| 464 | mCons->AddStr(s.c_str(), PIVA_Blue|PIVA_Bold, false);
|
---|
| 465 | mCons->AddChar('\n', PIVA_Def, true);
|
---|
[165] | 466 | SetBusy();
|
---|
[495] | 467 | #ifdef SANS_EVOLPLANCK
|
---|
[165] | 468 | TRY {
|
---|
[293] | 469 | mCmd->Interpret(s);
|
---|
[165] | 470 | } CATCH(merr) {
|
---|
| 471 | fflush(stdout);
|
---|
| 472 | cout << endl;
|
---|
| 473 | cerr << endl;
|
---|
| 474 | string es = PeidaExc(merr);
|
---|
[495] | 475 | cerr << "PIStdImgApp::Process()/ Cmd->Do() Exception :" << es << " (" << merr << ")" << endl ;
|
---|
| 476 | }
|
---|
| 477 | #else
|
---|
| 478 | try {
|
---|
| 479 | mCmd->Interpret(s);
|
---|
| 480 | }
|
---|
[1276] | 481 | catch ( PThrowable & exc ) {
|
---|
| 482 | cerr << "\n PIStdImgApp::Process()/ Cmd->Interpret() Exception :"
|
---|
| 483 | << (string)typeid(exc).name() << " Msg= "
|
---|
| 484 | << exc.Msg() << endl;
|
---|
[495] | 485 | cout << endl;
|
---|
[165] | 486 | }
|
---|
[1276] | 487 | catch ( ... ) {
|
---|
| 488 | cerr << "\n PIStdImgApp::Process()/ Cmd->Interpret() Catched Exception ..."
|
---|
| 489 | << endl;
|
---|
| 490 | cout << endl;
|
---|
| 491 | }
|
---|
| 492 |
|
---|
[495] | 493 | #endif
|
---|
[165] | 494 | SetReady();
|
---|
| 495 | }
|
---|
| 496 |
|
---|
| 497 | else printf("PIStdImgApp::Process() BUG?? Msg %d (%d-%d) \n",
|
---|
| 498 | (int)tmsg,(int)msg,(int)smm);
|
---|
| 499 |
|
---|
| 500 |
|
---|
| 501 | return;
|
---|
| 502 | }
|
---|
| 503 |
|
---|
[194] | 504 | /* --Methode-- */
|
---|
| 505 | void PIStdImgApp::SetReady()
|
---|
| 506 | {
|
---|
| 507 | mCons->SetSensitive();
|
---|
| 508 | gimv->SetSensitive();
|
---|
| 509 | PIApplication::SetReady();
|
---|
| 510 | }
|
---|
[165] | 511 |
|
---|
[194] | 512 | /* --Methode-- */
|
---|
| 513 | void PIStdImgApp::SetBusy()
|
---|
| 514 | {
|
---|
| 515 | mCons->SetUnSensitive();
|
---|
| 516 | gimv->SetUnSensitive();
|
---|
| 517 | PIApplication::SetBusy();
|
---|
[1321] | 518 | // Attention : Appel XSync specifique X11 - en attendant multi-thread
|
---|
| 519 | XSync(PIXDisplay(), False);
|
---|
[194] | 520 | }
|
---|
[165] | 521 |
|
---|
[194] | 522 | /* --Methode-- */
|
---|
| 523 | void PIStdImgApp::SetBlocked()
|
---|
| 524 | {
|
---|
| 525 | mCons->SetUnSensitive();
|
---|
| 526 | gimv->SetUnSensitive();
|
---|
| 527 | PIApplication::SetBlocked();
|
---|
[1321] | 528 | // Attention : Appel XSync specifique X11 - en attendant multi-thread
|
---|
| 529 | XSync(PIXDisplay(), False);
|
---|
[194] | 530 | }
|
---|
[165] | 531 |
|
---|
[194] | 532 |
|
---|
[165] | 533 | /* --Methode-- */
|
---|
[1971] | 534 | int PIStdImgApp::DispImage(P2DArrayAdapter* nouv, string const & name, string const& sop, int oid)
|
---|
[165] | 535 | {
|
---|
| 536 | PIImage* pii;
|
---|
| 537 | PIWindow* win;
|
---|
| 538 | int sx, sy, px, py, flag;
|
---|
| 539 |
|
---|
| 540 | if (nouv == NULL)
|
---|
| 541 | {
|
---|
| 542 | printf("PIStdImgApp::DispImage_Error Cannot Display NULL image \n");
|
---|
| 543 | return(-1);
|
---|
| 544 | }
|
---|
| 545 |
|
---|
| 546 | if ( (nouv->XSize() <= 0) || (nouv->YSize() <= 0))
|
---|
| 547 | {
|
---|
| 548 | printf("PIStdImgApp::DispImage_Error Pb Size Sz=%d*%d \n",
|
---|
| 549 | nouv->XSize(), nouv->YSize());
|
---|
| 550 | return(-1);
|
---|
| 551 | }
|
---|
| 552 |
|
---|
[1971] | 553 | // On decode les options graphiques
|
---|
| 554 | vector<string> opts;
|
---|
| 555 | DispWinEnum dwopt = ParseDisplayOption(sop, opts);
|
---|
[165] | 556 |
|
---|
[1971] | 557 | // Pas de same ou inset pour DispImage
|
---|
| 558 | if ((dwopt == Disp_Same) || (dwopt == Disp_Inset) ) dwopt = Disp_Next;
|
---|
[165] | 559 |
|
---|
[1971] | 560 | // Choix de la taille de fenetre
|
---|
| 561 | #define MINPIIMGSIZE 100
|
---|
| 562 | sx = (nouv->XSize() > MINPIIMGSIZE) ? nouv->XSize() : MINPIIMGSIZE;
|
---|
| 563 | sy = (nouv->YSize() > MINPIIMGSIZE) ? nouv->XSize() : MINPIIMGSIZE;
|
---|
[165] | 564 | if (sx > 400+mFgScSz*100) sx = 400+mFgScSz*100;
|
---|
| 565 | if (sy > 400+mFgScSz*100) sy = 400+mFgScSz*100;
|
---|
| 566 | px = py = 0;
|
---|
[1971] | 567 | win = GetWindow(dwopt, sx, sy, px, py, flag, (char *)name.c_str());
|
---|
[165] | 568 | pii = new PIImage(win, (char *)name.c_str(), sx, sy, px,py);
|
---|
| 569 | pii->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
|
---|
| 570 | pii->SetZoomWin(zoom, false);
|
---|
| 571 | pii->SetGloVWin(gimv, false);
|
---|
| 572 | pii->SetCMapWin(cmapv, false);
|
---|
| 573 | pii->ShowCursor(true);
|
---|
[331] | 574 | pii->SetUserData(NULL, oid);
|
---|
[1971] | 575 |
|
---|
| 576 |
|
---|
| 577 | // On recalcule la taille de la fenetre si Disp_Win
|
---|
| 578 | if (dwopt == Disp_Win) {
|
---|
| 579 | int sx2 = (int)((float)nouv->XSize()*pii->GetZoomF());
|
---|
| 580 | int sy2 = (int)((float)nouv->YSize()*pii->GetZoomF());
|
---|
| 581 |
|
---|
| 582 | if (sx2 > 400+mFgScSz*100) sx2 = 400+mFgScSz*100;
|
---|
| 583 | if (sy2 > 400+mFgScSz*100) sy2 = 400+mFgScSz*100;
|
---|
| 584 | if (sx2 < MINPIIMGSIZE) sx = MINPIIMGSIZE;
|
---|
| 585 | if (sy2 < MINPIIMGSIZE) sy = MINPIIMGSIZE;
|
---|
| 586 | if ((sx2 != sx) || (sy2 != sy)) win->SetSize(sx2, sy2);
|
---|
| 587 | }
|
---|
| 588 |
|
---|
[2118] | 589 | pii->SetImage(nouv, true, false);
|
---|
[1971] | 590 |
|
---|
[2118] | 591 | // decode des options en chaine de caracteres
|
---|
[2217] | 592 | if (mAxesAtt.size() > 0)
|
---|
| 593 | pii->DecodeOptionString(mAxesAtt, false); // Les options d'axe
|
---|
| 594 | if (mDefaultAtt.size() > 0)
|
---|
| 595 | pii->DecodeOptionString(mDefaultAtt, false); // d'abord les options par defaut
|
---|
| 596 | if (opts.size() > 0)
|
---|
| 597 | pii->DecodeOptionString(opts); // ensuite, les options specifies en argument
|
---|
[2118] | 598 |
|
---|
[165] | 599 | // printf("!!DBG!! PIImage Pos= %d %d Size= %d %d \n", pii->XPos(), pii->YPos(), pii->XSize(), pii->YSize() );
|
---|
| 600 | mCurWin = win;
|
---|
| 601 | mCurWdg = pii;
|
---|
| 602 | mLastWdg = pii;
|
---|
| 603 | mBWId++;
|
---|
| 604 | mBWList[mBWId] = pii;
|
---|
[2118] | 605 | // pii->Refresh();
|
---|
| 606 | pii->Apply();
|
---|
| 607 | cmapv->Refresh();
|
---|
[165] | 608 | return(mBWId);
|
---|
| 609 | }
|
---|
| 610 |
|
---|
| 611 |
|
---|
| 612 | /* --Methode-- */
|
---|
[1971] | 613 | int PIStdImgApp::DispScDrawer(PIDrawer* scd, string const & name, string const& sop,
|
---|
| 614 | string title, int oid)
|
---|
[165] | 615 | {
|
---|
| 616 | if (scd == NULL)
|
---|
| 617 | {
|
---|
| 618 | printf("PIStdImgApp::DispScDrawer_Error Cannot Add NULL ScDrawer \n");
|
---|
| 619 | return(-1);
|
---|
| 620 | }
|
---|
| 621 |
|
---|
[1971] | 622 | // On decode les options graphiques
|
---|
| 623 | vector<string> opts;
|
---|
| 624 | DispWinEnum dwopt = ParseDisplayOption(sop, opts);
|
---|
| 625 | if ( (!mLastWdg) && ( (dwopt == Disp_Same) || (dwopt == Disp_Inset) ) ) dwopt = Disp_Next;
|
---|
| 626 | // Trace en superpoistion
|
---|
| 627 | if ( (dwopt == Disp_Same) && (mLastWdg) ) {
|
---|
| 628 | // Les options
|
---|
| 629 | scd->DecodeOptionString(mDefaultAtt, false);
|
---|
| 630 | scd->DecodeOptionString(opts, true);
|
---|
[165] | 631 |
|
---|
| 632 | if (mLastWdg->kind() == PIScDrawWdg::ClassId) ((PIScDrawWdg*)mLastWdg)->AddScDrawer(scd, true);
|
---|
| 633 | else mLastWdg->AddDrawer(scd, true, true, true);
|
---|
[548] | 634 | scd->Refresh();
|
---|
| 635 | mDId++;
|
---|
| 636 | mDrwList[mDId] = scd;
|
---|
| 637 | return(-mDId);
|
---|
| 638 | }
|
---|
| 639 | // Trace en medaillon
|
---|
[1971] | 640 | else if ( (dwopt == Disp_Inset) && (mLastWdg) ) {
|
---|
[548] | 641 | PIGrCoord x1, x2, y1, y2;
|
---|
| 642 | x1 = mIXmin; x2 = mIXmax;
|
---|
| 643 | y2 = 1.-mIYmin; y1 = 1.-mIYmax;
|
---|
[1971] | 644 | // Les options
|
---|
| 645 | scd->DecodeOptionString(mDefaultAtt, false);
|
---|
| 646 | scd->DecodeOptionString(opts, true);
|
---|
| 647 |
|
---|
[548] | 648 | scd->SetAxesFlags(mAxesFlags);
|
---|
[1971] | 649 | scd->UpdateLimits();
|
---|
[548] | 650 | mLastWdg->AddDrawer(scd, x1, y1, x2, y2, true, false, true);
|
---|
[165] | 651 | scd->Refresh();
|
---|
| 652 | mDId++;
|
---|
| 653 | mDrwList[mDId] = scd;
|
---|
| 654 | return(-mDId);
|
---|
| 655 | }
|
---|
| 656 |
|
---|
[1971] | 657 | // Creation d'un nouveau PIScDrawWdg
|
---|
[165] | 658 | PIWindow* win;
|
---|
| 659 | PIScDrawWdg* scw;
|
---|
| 660 | int sx, sy, px, py, flag;
|
---|
| 661 | sx = 200+mFgScSz*100;
|
---|
| 662 | sy = 200+mFgScSz*100;
|
---|
[1971] | 663 | win = GetWindow(dwopt, sx, sy, px, py, flag, (char *)name.c_str());
|
---|
| 664 |
|
---|
[1856] | 665 | scw = new PIScDrawWdg(win, (char *)name.c_str(), sx, sy, px, py);
|
---|
[165] | 666 | scw->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
|
---|
[331] | 667 | scw->SetUserData(NULL, oid);
|
---|
[1971] | 668 |
|
---|
| 669 | // Decodage des options :
|
---|
| 670 | vector<string> scwatt;
|
---|
[203] | 671 | scw->SetAxesFlags(mAxesFlags);
|
---|
[1971] | 672 | if ( mDefaultAtt.size() > 0) {
|
---|
| 673 | scwatt = mDefaultAtt;
|
---|
[2217] | 674 | scd->DecodeOptionString(scwatt, true);
|
---|
[1971] | 675 | scw->DecodeOptionString(scwatt, true);
|
---|
| 676 | }
|
---|
| 677 | if ( mAxesAtt.size() > 0) {
|
---|
| 678 | scwatt = mAxesAtt;
|
---|
| 679 | scw->DecodeOptionString(scwatt, true);
|
---|
| 680 | }
|
---|
| 681 | if (opts.size() > 0)
|
---|
| 682 | scd->DecodeOptionString(opts, true);
|
---|
| 683 | if (opts.size() > 0)
|
---|
| 684 | scw->DecodeOptionString(opts, false);
|
---|
| 685 |
|
---|
[165] | 686 | // Titre du plot
|
---|
[1131] | 687 | if (mAddTitle) {
|
---|
| 688 | if (title.length() <= 0) title = name; string t2="";
|
---|
| 689 | scw->SetTitles(title, t2);
|
---|
| 690 | }
|
---|
[1569] | 691 |
|
---|
[1971] | 692 | scw->AddScDrawer(scd, true);
|
---|
[293] | 693 | // scw->Refresh(); ? Pas necessaire Reza 19/08/98, 05/05/99 $CHECK$
|
---|
[1971] | 694 |
|
---|
[165] | 695 | mCurWin = win;
|
---|
| 696 | mCurWdg = scw;
|
---|
| 697 | mLastWdg = scw;
|
---|
| 698 | mBWId++;
|
---|
| 699 | mBWList[mBWId] = scw;
|
---|
| 700 | return(mBWId);
|
---|
| 701 | }
|
---|
| 702 |
|
---|
| 703 | /* --Methode-- */
|
---|
[1971] | 704 | int PIStdImgApp::Disp3DDrawer(PIDrawer3D* dr3, string const & name, string const& sop,
|
---|
| 705 | string title, int oid)
|
---|
[165] | 706 | {
|
---|
| 707 | if (dr3 == NULL)
|
---|
| 708 | {
|
---|
| 709 | printf("PIStdImgApp::Disp3DDrawer_Error Cannot Add NULL 3DDrawer \n");
|
---|
| 710 | return(-1);
|
---|
| 711 | }
|
---|
| 712 |
|
---|
[1971] | 713 | // On decode les options graphiques
|
---|
| 714 | vector<string> opts;
|
---|
| 715 | DispWinEnum dwopt = ParseDisplayOption(sop, opts);
|
---|
[165] | 716 |
|
---|
[1971] | 717 | if ( (!mLastWdg) && ( (dwopt == Disp_Same) || (dwopt == Disp_Inset) ) ) dwopt = Disp_Next;
|
---|
[548] | 718 | // Trace en superpoistion
|
---|
[1971] | 719 | if ( (dwopt == Disp_Same) && (mLastWdg) ) {
|
---|
| 720 | // Les options
|
---|
| 721 | dr3->DecodeOptionString(mDefaultAtt, false);
|
---|
| 722 | dr3->DecodeOptionString(opts, true);
|
---|
| 723 |
|
---|
[165] | 724 | if (mLastWdg->kind() == PIDraw3DWdg::ClassId) ((PIDraw3DWdg*)mLastWdg)->AddDrawer3D(dr3, true);
|
---|
| 725 | else mLastWdg->AddDrawer(dr3, true, true, true);
|
---|
| 726 | dr3->Refresh();
|
---|
| 727 | mDId++;
|
---|
| 728 | mDrwList[mDId] = dr3;
|
---|
| 729 | return(-mDId);
|
---|
| 730 | }
|
---|
[548] | 731 | // Trace en medaillon
|
---|
[1971] | 732 | else if ( (dwopt == Disp_Inset) && (mLastWdg) ) {
|
---|
[548] | 733 | PIGrCoord x1, x2, y1, y2;
|
---|
| 734 | x1 = mIXmin; x2 = mIXmax;
|
---|
| 735 | y2 = 1.-mIYmin; y1 = 1.-mIYmax;
|
---|
[1971] | 736 | // Les options
|
---|
| 737 | dr3->DecodeOptionString(mDefaultAtt, false);
|
---|
| 738 | dr3->DecodeOptionString(opts, true);
|
---|
| 739 |
|
---|
[548] | 740 | dr3->SetAxesFlags(mAxesFlags);
|
---|
| 741 | dr3->UpdateLimits();
|
---|
| 742 | mLastWdg->AddDrawer(dr3, x1, y1, x2, y2, true, false, true);
|
---|
| 743 | dr3->Refresh();
|
---|
| 744 | mDId++;
|
---|
| 745 | mDrwList[mDId] = dr3;
|
---|
| 746 | return(-mDId);
|
---|
| 747 | }
|
---|
[165] | 748 |
|
---|
[548] | 749 |
|
---|
[165] | 750 | PIWindow* win;
|
---|
| 751 | int sx, sy, px, py, flag;
|
---|
| 752 | sx = 200+mFgScSz*100;
|
---|
| 753 | sy = 200+mFgScSz*100;
|
---|
[1971] | 754 | win = GetWindow(dwopt, sx, sy, px, py, flag, (char *)name.c_str());
|
---|
[165] | 755 | PIDraw3DWdg* wd3 = new PIDraw3DWdg(win, (char *)name.c_str(), sx, sy, px, py);
|
---|
| 756 | wd3->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic);
|
---|
[331] | 757 | wd3->SetUserData(NULL, oid);
|
---|
[1971] | 758 |
|
---|
| 759 | // Decodage des options :
|
---|
| 760 | vector<string> scwatt;
|
---|
| 761 | // wd3->SetAxesFlags(mAxesFlags); Attributs d'axes 3D a faire
|
---|
| 762 | if ( mDefaultAtt.size() > 0) {
|
---|
| 763 | scwatt = mDefaultAtt;
|
---|
[2217] | 764 | dr3->DecodeOptionString(scwatt, true);
|
---|
[1971] | 765 | wd3->DecodeOptionString(scwatt, true);
|
---|
| 766 | }
|
---|
| 767 | if ( mAxesAtt.size() > 0) {
|
---|
| 768 | scwatt = mAxesAtt;
|
---|
| 769 | wd3->DecodeOptionString(scwatt, true);
|
---|
| 770 | }
|
---|
| 771 | if (opts.size() > 0)
|
---|
| 772 | dr3->DecodeOptionString(opts, true);
|
---|
| 773 | if (opts.size() > 0)
|
---|
| 774 | wd3->DecodeOptionString(opts, false);
|
---|
| 775 |
|
---|
[165] | 776 | // Titre du plot
|
---|
[1131] | 777 | if (mAddTitle) {
|
---|
| 778 | if (title.length() <= 0) title = name; string t2="";
|
---|
| 779 | wd3->SetTitles(title, t2);
|
---|
| 780 | }
|
---|
[1971] | 781 |
|
---|
| 782 | wd3->AddDrawer3D(dr3, true);
|
---|
[293] | 783 | // wd3->Refresh(); ?Pas necessaire $CHECK$ 05/05/99
|
---|
[1971] | 784 |
|
---|
[165] | 785 | mCurWin = win;
|
---|
| 786 | mCurWdg = wd3;
|
---|
| 787 | mLastWdg = wd3;
|
---|
| 788 | mBWId++;
|
---|
| 789 | mBWList[mBWId] = wd3;
|
---|
| 790 | return(mBWId);
|
---|
| 791 | }
|
---|
| 792 |
|
---|
[349] | 793 | /* --Methode-- */
|
---|
[2188] | 794 | int PIStdImgApp::ExecuteExtCommand()
|
---|
| 795 | {
|
---|
| 796 | if (!fg_exc_cmd) return(0);
|
---|
| 797 | else {
|
---|
| 798 | fg_exc_cmd = false;
|
---|
| 799 | return CmdInterpreter()->Interpret(exc_command);
|
---|
| 800 | }
|
---|
| 801 | }
|
---|
| 802 |
|
---|
| 803 | /* --Methode-- */
|
---|
[2263] | 804 | void PIStdImgApp::AddText(string const & txt, double xp, double yp, string const& sop, bool fgcn)
|
---|
[349] | 805 | {
|
---|
[2165] | 806 | PIDrawer *eld=CurrentElDrawer();
|
---|
[1642] | 807 | if (eld == NULL) return;
|
---|
[2165] | 808 | PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld);
|
---|
| 809 | PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld);
|
---|
| 810 | if ((eld2 == NULL) && (eld3 == NULL)) return;
|
---|
| 811 | PIElDrwMgr* elmgr;
|
---|
| 812 | if (eld2) elmgr = &(eld2->ElDrwMgr());
|
---|
| 813 | else if (eld3) elmgr = &(eld3->ElDrwMgr());
|
---|
| 814 | if (elmgr == NULL) return;
|
---|
[1642] | 815 |
|
---|
[1971] | 816 | vector<string> opts;
|
---|
| 817 | ParseDisplayOption(sop, opts);
|
---|
| 818 | PIGraphicAtt gratt(opts);
|
---|
[2243] | 819 | unsigned long tpd = 0;
|
---|
| 820 | gratt.DecodeTextPosDirAtt(opts, tpd, false);
|
---|
[2263] | 821 | elmgr->ElAddText(xp,yp,txt.c_str(), gratt, tpd, fgcn);
|
---|
[1642] | 822 | eld->Refresh();
|
---|
[349] | 823 | }
|
---|
[1642] | 824 |
|
---|
[1131] | 825 | /* --Methode-- */
|
---|
[2263] | 826 | void PIStdImgApp::AddCompText(string const & txt, string const & txtup, string const & txtdn,
|
---|
| 827 | double xp, double yp, string const& sop,
|
---|
| 828 | string const& optss, bool fgcn)
|
---|
| 829 | {
|
---|
| 830 | PIDrawer *eld=CurrentElDrawer();
|
---|
| 831 | if (eld == NULL) return;
|
---|
| 832 | PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld);
|
---|
| 833 | PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld);
|
---|
| 834 | if ((eld2 == NULL) && (eld3 == NULL)) return;
|
---|
| 835 | PIElDrwMgr* elmgr;
|
---|
| 836 | if (eld2) elmgr = &(eld2->ElDrwMgr());
|
---|
| 837 | else if (eld3) elmgr = &(eld3->ElDrwMgr());
|
---|
| 838 | if (elmgr == NULL) return;
|
---|
| 839 |
|
---|
| 840 | vector<string> opts;
|
---|
| 841 | ParseDisplayOption(sop, opts);
|
---|
| 842 | PIGraphicAtt gratt(opts);
|
---|
| 843 | unsigned long tpd = 0;
|
---|
| 844 | gratt.DecodeTextPosDirAtt(opts, tpd, false);
|
---|
| 845 | ParseDisplayOption(optss, opts);
|
---|
| 846 | PIGraphicAtt grattss(opts);
|
---|
| 847 | elmgr->ElAddCompText(xp,yp,txt.c_str(), gratt, txtup, txtdn, grattss, tpd, fgcn);
|
---|
| 848 | eld->Refresh();
|
---|
| 849 | }
|
---|
| 850 |
|
---|
| 851 | /* --Methode-- */
|
---|
[2243] | 852 | void PIStdImgApp::AddLine(double xp1, double yp1, double xp2, double yp2,
|
---|
[2263] | 853 | string const& sop, bool fgarrow, bool fgcn)
|
---|
[1642] | 854 | {
|
---|
[2165] | 855 | PIDrawer *eld=CurrentElDrawer();
|
---|
[1642] | 856 | if (eld == NULL) return;
|
---|
[2165] | 857 | PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld);
|
---|
| 858 | PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld);
|
---|
| 859 | if ((eld2 == NULL) && (eld3 == NULL)) return;
|
---|
| 860 | PIElDrwMgr* elmgr = NULL;
|
---|
| 861 | if (eld2) elmgr = &(eld2->ElDrwMgr());
|
---|
| 862 | else if (eld3) elmgr = &(eld3->ElDrwMgr());
|
---|
| 863 | if (elmgr == NULL) return;
|
---|
[1642] | 864 |
|
---|
[1971] | 865 | vector<string> opts;
|
---|
| 866 | ParseDisplayOption(sop, opts);
|
---|
| 867 | PIGraphicAtt gratt(opts);
|
---|
[2243] | 868 | if (fgarrow)
|
---|
[2263] | 869 | elmgr->ElAddArrow(xp1, yp1, xp2, yp2, gratt, fgcn);
|
---|
| 870 | else elmgr->ElAddLine(xp1, yp1, xp2, yp2, gratt, fgcn);
|
---|
[1642] | 871 | eld->Refresh();
|
---|
| 872 | }
|
---|
| 873 |
|
---|
| 874 | /* --Methode-- */
|
---|
[1971] | 875 | void PIStdImgApp::AddRectangle(double xp1, double yp1, double xp2, double yp2,
|
---|
[2263] | 876 | string const& sop, bool fgfill, bool fgcn)
|
---|
[1642] | 877 | {
|
---|
[2165] | 878 | PIDrawer *eld=CurrentElDrawer();
|
---|
[1642] | 879 | if (eld == NULL) return;
|
---|
[2165] | 880 | PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld);
|
---|
| 881 | PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld);
|
---|
| 882 | if ((eld2 == NULL) && (eld3 == NULL)) return;
|
---|
| 883 | PIElDrwMgr* elmgr = NULL;
|
---|
| 884 | if (eld2) elmgr = &(eld2->ElDrwMgr());
|
---|
| 885 | else if (eld3) elmgr = &(eld3->ElDrwMgr());
|
---|
[1642] | 886 |
|
---|
| 887 | double xp,yp;
|
---|
| 888 | double dx, dy;
|
---|
| 889 | if (xp1 < xp2) {
|
---|
| 890 | xp = xp1; dx = xp2-xp1;
|
---|
| 891 | }
|
---|
| 892 | else {
|
---|
| 893 | xp = xp2; dx = xp1-xp2;
|
---|
| 894 | }
|
---|
| 895 | if (yp1 < yp2) {
|
---|
| 896 | yp = yp1; dy = yp2-yp1;
|
---|
| 897 | }
|
---|
| 898 | else {
|
---|
| 899 | yp = yp2; dy = yp1-yp2;
|
---|
| 900 | }
|
---|
[1971] | 901 |
|
---|
| 902 | vector<string> opts;
|
---|
| 903 | ParseDisplayOption(sop, opts);
|
---|
| 904 | PIGraphicAtt gratt(opts);
|
---|
| 905 |
|
---|
[2263] | 906 | if (fgfill) elmgr->ElAddFRect(xp, yp, dx, dy, gratt, fgcn);
|
---|
| 907 | else elmgr->ElAddRect(xp, yp, dx, dy, gratt, fgcn);
|
---|
[1642] | 908 | eld->Refresh();
|
---|
| 909 | }
|
---|
| 910 |
|
---|
| 911 | /* --Methode-- */
|
---|
[2263] | 912 | void PIStdImgApp::AddCircle(double xc, double yc, double r, string const& sop,
|
---|
| 913 | bool fgfill, bool fgcn)
|
---|
[1642] | 914 | {
|
---|
[2165] | 915 | PIDrawer *eld=CurrentElDrawer();
|
---|
[1642] | 916 | if (eld == NULL) return;
|
---|
[2165] | 917 | PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld);
|
---|
| 918 | PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld);
|
---|
| 919 | if ((eld2 == NULL) && (eld3 == NULL)) return;
|
---|
| 920 | PIElDrwMgr* elmgr = NULL;
|
---|
| 921 | if (eld2) elmgr = &(eld2->ElDrwMgr());
|
---|
| 922 | else if (eld3) elmgr = &(eld3->ElDrwMgr());
|
---|
[1642] | 923 |
|
---|
[1971] | 924 | vector<string> opts;
|
---|
| 925 | ParseDisplayOption(sop, opts);
|
---|
| 926 | PIGraphicAtt gratt(opts);
|
---|
[2243] | 927 | if (r < -0.5)
|
---|
| 928 | elmgr->ElAddMarker(xc, yc, gratt);
|
---|
| 929 | else {
|
---|
[2263] | 930 | if (fgfill) elmgr->ElAddFCirc(xc, yc, r, gratt, fgcn);
|
---|
| 931 | else elmgr->ElAddCirc(xc, yc, r, gratt, fgcn);
|
---|
[2243] | 932 | }
|
---|
| 933 | eld->Refresh();
|
---|
| 934 | }
|
---|
[2265] | 935 | /* --Methode-- */
|
---|
| 936 | void PIStdImgApp::AddArc(double xc, double yc, double r, double a, double da,
|
---|
| 937 | string const& sop, bool fgfill, bool fgcn)
|
---|
| 938 | {
|
---|
| 939 | PIDrawer *eld=CurrentElDrawer();
|
---|
| 940 | if (eld == NULL) return;
|
---|
| 941 | PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld);
|
---|
| 942 | PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld);
|
---|
| 943 | if ((eld2 == NULL) && (eld3 == NULL)) return;
|
---|
| 944 | PIElDrwMgr* elmgr = NULL;
|
---|
| 945 | if (eld2) elmgr = &(eld2->ElDrwMgr());
|
---|
| 946 | else if (eld3) elmgr = &(eld3->ElDrwMgr());
|
---|
[1971] | 947 |
|
---|
[2265] | 948 | vector<string> opts;
|
---|
| 949 | ParseDisplayOption(sop, opts);
|
---|
| 950 | PIGraphicAtt gratt(opts);
|
---|
| 951 | if (fgfill) elmgr->ElAddFArc(xc, yc, r, a, da, gratt, fgcn);
|
---|
| 952 | else elmgr->ElAddArc(xc, yc, r, a, da, gratt, fgcn);
|
---|
| 953 | eld->Refresh();
|
---|
| 954 | }
|
---|
| 955 |
|
---|
[2243] | 956 | /* --Methode-- */
|
---|
| 957 | void PIStdImgApp::AddArc(double x1, double y1, double x2, double y2,
|
---|
[2263] | 958 | double x3, double y3, string const& sop, bool fgfill, bool fgcn)
|
---|
[2243] | 959 | {
|
---|
| 960 | PIDrawer *eld=CurrentElDrawer();
|
---|
| 961 | if (eld == NULL) return;
|
---|
| 962 | PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld);
|
---|
| 963 | PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld);
|
---|
| 964 | if ((eld2 == NULL) && (eld3 == NULL)) return;
|
---|
| 965 | PIElDrwMgr* elmgr = NULL;
|
---|
| 966 | if (eld2) elmgr = &(eld2->ElDrwMgr());
|
---|
| 967 | else if (eld3) elmgr = &(eld3->ElDrwMgr());
|
---|
| 968 | if (elmgr == NULL) return;
|
---|
| 969 |
|
---|
| 970 | vector<string> opts;
|
---|
| 971 | ParseDisplayOption(sop, opts);
|
---|
| 972 | PIGraphicAtt gratt(opts);
|
---|
| 973 | if (fgfill)
|
---|
[2263] | 974 | elmgr->ElAddFArc(x1, y1, x2, y2, x3, y3, gratt, fgcn);
|
---|
| 975 | else elmgr->ElAddArc(x1, y1, x2, y2, x3, y3, gratt, fgcn);
|
---|
[1642] | 976 | eld->Refresh();
|
---|
| 977 | }
|
---|
| 978 |
|
---|
| 979 | /* --Methode-- */
|
---|
[2263] | 980 | void PIStdImgApp::AddPoly(vector<double>& xpol, vector<double>& ypol,
|
---|
| 981 | string const& sop, bool fgfill, bool fgcn)
|
---|
| 982 | {
|
---|
| 983 | PIDrawer *eld=CurrentElDrawer();
|
---|
| 984 | if (eld == NULL) return;
|
---|
| 985 | PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld);
|
---|
| 986 | PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld);
|
---|
| 987 | if ((eld2 == NULL) && (eld3 == NULL)) return;
|
---|
| 988 | PIElDrwMgr* elmgr = NULL;
|
---|
| 989 | if (eld2) elmgr = &(eld2->ElDrwMgr());
|
---|
| 990 | else if (eld3) elmgr = &(eld3->ElDrwMgr());
|
---|
| 991 | if (elmgr == NULL) return;
|
---|
| 992 |
|
---|
| 993 | vector<string> opts;
|
---|
| 994 | ParseDisplayOption(sop, opts);
|
---|
| 995 | PIGraphicAtt gratt(opts);
|
---|
| 996 | if (fgfill)
|
---|
| 997 | elmgr->ElAddFPoly(xpol, ypol, gratt, fgcn);
|
---|
| 998 | else elmgr->ElAddPoly(xpol, ypol, gratt, fgcn);
|
---|
| 999 | eld->Refresh();
|
---|
| 1000 |
|
---|
| 1001 | }
|
---|
| 1002 |
|
---|
| 1003 |
|
---|
| 1004 | /* --Methode-- */
|
---|
[2165] | 1005 | void PIStdImgApp::SetTitle(string const & titletop, string const & titlebottom, string const& sop)
|
---|
[1131] | 1006 | {
|
---|
[2165] | 1007 | PIDrawer *eld=CurrentElDrawer();
|
---|
[1642] | 1008 | if (eld == NULL) return;
|
---|
[2165] | 1009 | PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld);
|
---|
| 1010 | PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld);
|
---|
| 1011 | if ((eld2 == NULL) && (eld3 == NULL)) return;
|
---|
[1642] | 1012 |
|
---|
[2165] | 1013 | vector<string> opts;
|
---|
| 1014 | ParseDisplayOption(sop, opts);
|
---|
| 1015 | PIGraphicAtt gratt(opts);
|
---|
| 1016 |
|
---|
| 1017 | if (eld2) {
|
---|
| 1018 | eld2->SetTitles(titletop, titlebottom, gratt);
|
---|
| 1019 | eld2->ShowTitles(true);
|
---|
| 1020 | }
|
---|
| 1021 | else if (eld3) {
|
---|
| 1022 | eld3->SetTitles(titletop, titlebottom, gratt);
|
---|
| 1023 | eld3->ShowTitles(true);
|
---|
| 1024 | }
|
---|
[1642] | 1025 | eld->Refresh();
|
---|
| 1026 | }
|
---|
[2165] | 1027 | /* --Methode-- */
|
---|
| 1028 | void PIStdImgApp::SetAxeLabels(string const & xLabel, string const & yLabel, string const& sop)
|
---|
| 1029 | {
|
---|
| 1030 | PIDrawer *eld=CurrentElDrawer();
|
---|
| 1031 | if (eld == NULL) return;
|
---|
| 1032 | PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld);
|
---|
| 1033 | if (eld2 == NULL) return;
|
---|
[1642] | 1034 |
|
---|
[2165] | 1035 | vector<string> opts;
|
---|
| 1036 | ParseDisplayOption(sop, opts);
|
---|
| 1037 | PIGraphicAtt gratt(opts);
|
---|
| 1038 |
|
---|
| 1039 | eld2->SetAxesLabels(xLabel, yLabel, gratt);
|
---|
| 1040 | eld2->ShowAxesLabels(true);
|
---|
| 1041 |
|
---|
| 1042 | eld->Refresh();
|
---|
| 1043 | }
|
---|
| 1044 |
|
---|
[1642] | 1045 | /* --Methode-- */
|
---|
[2165] | 1046 | PIDrawer* PIStdImgApp::CurrentElDrawer()
|
---|
[1642] | 1047 | {
|
---|
[2165] | 1048 | PIDrawer *eld=NULL;
|
---|
[1642] | 1049 | if (!mLastWdg) return(eld);
|
---|
[1131] | 1050 | PIScDrawWdg* sdw=NULL;
|
---|
| 1051 | PIDraw3DWdg* w3d=NULL;
|
---|
| 1052 | PIImage* imgw;
|
---|
| 1053 | switch(mLastWdg->kind()) {
|
---|
| 1054 | case PIScDrawWdg::ClassId :
|
---|
| 1055 | sdw = dynamic_cast<PIScDrawWdg *>(mLastWdg);
|
---|
| 1056 | if (sdw) eld = sdw->BaseDrawer();
|
---|
| 1057 | break;
|
---|
| 1058 | case PIDraw3DWdg::ClassId :
|
---|
| 1059 | w3d = dynamic_cast<PIDraw3DWdg *>(mLastWdg);
|
---|
| 1060 | if (w3d) eld = w3d->BaseDrawer();
|
---|
| 1061 | break;
|
---|
| 1062 | case PIImage::ClassId :
|
---|
| 1063 | imgw = dynamic_cast<PIImage *>(mLastWdg);
|
---|
[1642] | 1064 | if (imgw) eld = imgw->BaseDrawer();
|
---|
[1131] | 1065 | break;
|
---|
| 1066 | default :
|
---|
| 1067 | break;
|
---|
| 1068 | }
|
---|
[1642] | 1069 | return(eld);
|
---|
[1131] | 1070 | }
|
---|
[165] | 1071 |
|
---|
| 1072 | /* --Methode-- */
|
---|
| 1073 | void PIStdImgApp::CreateGraphWin(int nx, int ny, int sx, int sy)
|
---|
| 1074 | {
|
---|
| 1075 | if (nx < 1) nx = 1;
|
---|
| 1076 | if (ny < 1) ny = 1;
|
---|
| 1077 | if (nx > 8) nx = 8;
|
---|
| 1078 | if (ny > 8) ny = 8;
|
---|
| 1079 | if ( (sx < 50) && (sy < 50) ) sx = sy = 400+mFgScSz*100;
|
---|
| 1080 | char buff[64];
|
---|
| 1081 | mWId++;
|
---|
[210] | 1082 | int px, py;
|
---|
| 1083 | MainWin()->GetScreenPos(px, py);
|
---|
| 1084 | sprintf(buff, "PI-GraphicWin (%d)",mWId);
|
---|
| 1085 | PIZoneWindow* win = new PIZoneWindow(this, buff, PIWK_normal, nx, ny, sx, sy, px+MainWin()->XSize()+30, 0);
|
---|
[165] | 1086 | win->SetUserData(NULL, ny*10+nx); // UserFlag= nY*10 + nX
|
---|
| 1087 | mWList[mWId*10+1] = (PIWindow*)win;
|
---|
| 1088 | win->SetAutoDelChilds(true);
|
---|
[293] | 1089 | // win->Show();
|
---|
[165] | 1090 | mGrW = win;
|
---|
| 1091 | mGrIdx = 0;
|
---|
| 1092 | }
|
---|
| 1093 |
|
---|
| 1094 | /* --Methode-- */
|
---|
| 1095 | void PIStdImgApp::CreateStackWin(int sx, int sy)
|
---|
| 1096 | {
|
---|
| 1097 | if ( (sx < 50) && (sy < 50) ) sx = sy = 300+mFgScSz*100;
|
---|
| 1098 | char buff[64];
|
---|
| 1099 | mWId++;
|
---|
[210] | 1100 | int px, py;
|
---|
| 1101 | MainWin()->GetScreenPos(px, py);
|
---|
[165] | 1102 | sprintf(buff, "PI-StackWin (%d)",mWId);
|
---|
[210] | 1103 | PIStackWindow* win = new PIStackWindow(this, buff, PIWK_normal, sx, sy, px+MainWin()->XSize()+30, 100);
|
---|
[165] | 1104 | win->SetUserData(NULL, 9999); // UserFlag= 9999
|
---|
| 1105 | mWList[mWId*10+2] = (PIWindow*)win;
|
---|
| 1106 | win->SetAutoDelChilds(true);
|
---|
[293] | 1107 | // win->Show();
|
---|
[165] | 1108 | mStW = win;
|
---|
| 1109 | m[2]->SetSensitivity("StackTools", true);
|
---|
| 1110 | mStIdx = 0;
|
---|
| 1111 | }
|
---|
| 1112 |
|
---|
| 1113 | /* --Methode-- */
|
---|
[1971] | 1114 | PIWindow* PIStdImgApp::GetWindow(DispWinEnum typ, int& sx, int& sy, int& px, int& py, int& flag, char * nom)
|
---|
[165] | 1115 | {
|
---|
| 1116 | PIWindow* rw;
|
---|
| 1117 |
|
---|
| 1118 | switch (typ) {
|
---|
| 1119 | case Disp_Next : // Fenetre graphique courante
|
---|
[1971] | 1120 | case Disp_Default :
|
---|
[165] | 1121 | {
|
---|
| 1122 | if (mGrW == NULL) CreateGraphWin();
|
---|
| 1123 | int nx, ny;
|
---|
| 1124 | mGrW->NbZone(nx, ny);
|
---|
| 1125 | PIWdg* nw = mGrW->NextChildPosSize(px, py, sx, sy);
|
---|
| 1126 | // cerr << "**DBG** PIStdImgApp::GetWindow() DispNext : nw = " << (long)nw << endl;
|
---|
| 1127 | if (nw) DeleteBaseWidget((PIBaseWdg*)nw, false, false);
|
---|
| 1128 | flag = mGrIdx;
|
---|
| 1129 | mGrIdx = (mGrIdx+1)%(nx*ny);
|
---|
| 1130 | rw = mGrW;
|
---|
| 1131 | break;
|
---|
| 1132 | }
|
---|
| 1133 |
|
---|
| 1134 | case Disp_Stack : // Fenetre de type stack (empilement)
|
---|
| 1135 | {
|
---|
| 1136 | if (mStW == NULL) CreateStackWin(sx, sy);
|
---|
| 1137 | px = py = 0;
|
---|
| 1138 | sx = mStW->XSize();
|
---|
| 1139 | sy = mStW->YSize();
|
---|
| 1140 | flag = mStIdx;
|
---|
| 1141 | mStIdx++;
|
---|
| 1142 | rw = mStW;
|
---|
| 1143 | }
|
---|
| 1144 | break;
|
---|
| 1145 |
|
---|
| 1146 | default : // Fenetre ordinaire
|
---|
| 1147 | {
|
---|
[210] | 1148 | int pwx, pwy;
|
---|
| 1149 | MainWin()->GetScreenPos(pwx, pwy);
|
---|
[165] | 1150 | if ( (sx < 50) && (sy < 50) ) sx = sy = 300+mFgScSz*100;
|
---|
[210] | 1151 | rw = new PIWindow(this, nom, PIWK_normal, sx, sy, pwx+MainWin()->XSize()+30, 300);
|
---|
[165] | 1152 | rw->SetUserData(NULL, 0); // UserFlag= 0
|
---|
| 1153 | mWId++;
|
---|
| 1154 | mWList[mWId*10] = rw;
|
---|
| 1155 | rw->SetAutoDelChilds(true);
|
---|
[293] | 1156 | // rw->Show();
|
---|
[165] | 1157 | px = py = 0;
|
---|
| 1158 | flag = 0;
|
---|
| 1159 | break;
|
---|
| 1160 | }
|
---|
| 1161 | }
|
---|
| 1162 |
|
---|
[293] | 1163 | rw->Show();
|
---|
[165] | 1164 | mCurWin = rw;
|
---|
| 1165 | return(rw);
|
---|
| 1166 | }
|
---|
| 1167 |
|
---|
| 1168 | /* --Methode-- */
|
---|
| 1169 | void PIStdImgApp::SetZone(int nzx, int nzy)
|
---|
| 1170 | {
|
---|
| 1171 | if (!mGrW) CreateGraphWin(nzx, nzy);
|
---|
| 1172 | else {
|
---|
| 1173 | int k;
|
---|
| 1174 | PIWdg* cwd;
|
---|
| 1175 | for(k=0; k<mGrW->NbChilds(); k++) {
|
---|
| 1176 | if ((cwd = mGrW->GetChild(k)) == NULL) continue;
|
---|
| 1177 | DeleteBaseWidget((PIBaseWdg*)cwd, false, false);
|
---|
| 1178 | }
|
---|
| 1179 | mGrW->SetZone(nzx, nzy);
|
---|
| 1180 | }
|
---|
| 1181 | }
|
---|
| 1182 |
|
---|
| 1183 | /* --Methode-- */
|
---|
| 1184 | void PIStdImgApp::StackWinNext()
|
---|
| 1185 | {
|
---|
| 1186 | if (mStW) mStW->DispNext();
|
---|
| 1187 | }
|
---|
| 1188 |
|
---|
| 1189 | /* --Methode-- */
|
---|
| 1190 | void PIStdImgApp::DeleteWindow(PIWindow* w)
|
---|
| 1191 | {
|
---|
| 1192 | if (w == NULL) return;
|
---|
| 1193 | w->Hide();
|
---|
[344] | 1194 | bool ownwindow=false; // To Check if this is one of our windows
|
---|
[165] | 1195 | WindMList::iterator it;
|
---|
| 1196 | for(it = mWList.begin(); it != mWList.end(); it++)
|
---|
[344] | 1197 | if ((*it).second == w) { mWList.erase(it); ownwindow = true; break; }
|
---|
[165] | 1198 | if (w == mGrW) { mGrW = NULL; mGrIdx = -1; }
|
---|
| 1199 | if (w == mStW) { mStW = NULL; mStIdx = -1; m[2]->SetSensitivity("StackTools", false); }
|
---|
| 1200 | if (w == mCurWin) mCurWin = NULL;
|
---|
[344] | 1201 |
|
---|
| 1202 | if (!ownwindow) return; // We do nothing if this is not a window we have created ...
|
---|
| 1203 |
|
---|
[165] | 1204 | int k;
|
---|
| 1205 | PIWdg* cwd;
|
---|
| 1206 | for(k=0; k<w->NbChilds(); k++) {
|
---|
| 1207 | if ((cwd = w->GetChild(k)) == NULL) continue;
|
---|
| 1208 | DeleteBaseWidget((PIBaseWdg*)cwd,false,false);
|
---|
| 1209 | }
|
---|
| 1210 | delete w;
|
---|
| 1211 | return;
|
---|
| 1212 | }
|
---|
| 1213 |
|
---|
| 1214 | /* --Methode-- */
|
---|
| 1215 | void PIStdImgApp::DeleteBaseWidget(PIBaseWdg* w, bool dw, bool dwin)
|
---|
| 1216 | {
|
---|
| 1217 | if (w == NULL) return;
|
---|
| 1218 | BWMList::iterator it;
|
---|
| 1219 | for(it = mBWList.begin(); it != mBWList.end(); it++)
|
---|
| 1220 | if ((*it).second == w) { mBWList.erase(it); break; }
|
---|
| 1221 | int k;
|
---|
| 1222 | PIDrawer* drw;
|
---|
| 1223 | for(k=0; k<w->NbDrawers(); k++) {
|
---|
| 1224 | if ((drw = w->GetDrawer(k)) == NULL) continue;
|
---|
| 1225 | DrwMList::iterator itt;
|
---|
| 1226 | for(itt = mDrwList.begin(); itt != mDrwList.end(); itt++)
|
---|
| 1227 | if ((*itt).second == drw) { mDrwList.erase(itt); break; }
|
---|
| 1228 | }
|
---|
| 1229 |
|
---|
| 1230 | if (w == mCurWdg) {
|
---|
| 1231 | mCurWdg = NULL;
|
---|
| 1232 | if (mFgCWImg) {
|
---|
| 1233 | m[4]->SetSensitivityMsg(10515, false);
|
---|
| 1234 | m[4]->SetSensitivityMsg(10516, false);
|
---|
| 1235 | mFgCWImg = false;
|
---|
| 1236 | }
|
---|
| 1237 | }
|
---|
| 1238 |
|
---|
| 1239 | if (w == mLastWdg) mLastWdg = NULL;
|
---|
| 1240 |
|
---|
| 1241 | PIWdg* pw=NULL;
|
---|
| 1242 | if (dwin) pw = (PIWdg*)(w->Parent());
|
---|
| 1243 | //DBG printf("DeleteBaseWidget(%lx)-DBG kind = %d - %d %d \n", (long)w, w->kind(), (int)dw, (int)dwin);
|
---|
| 1244 | if (dw) delete w;
|
---|
| 1245 | if (pw && (pw->kind() == PIWindow::ClassId )) {
|
---|
| 1246 | PIWindow* pww = (PIWindow*) pw;
|
---|
| 1247 | if ((pww != (PIWindow*)mGrW) && (pww != (PIWindow*)mStW) && (pww->NbChilds()==0))
|
---|
| 1248 | DeleteWindow((PIWindow*)pw);
|
---|
| 1249 | }
|
---|
| 1250 | return;
|
---|
| 1251 | }
|
---|
| 1252 |
|
---|
| 1253 |
|
---|
| 1254 |
|
---|
| 1255 | /* --Methode-- */
|
---|
| 1256 | void PIStdImgApp::DelWRsId(int k)
|
---|
| 1257 | {
|
---|
| 1258 | //DBG cerr << "-DBG- PIStdImgApp::DelWRsId(" << k << ")" << endl;
|
---|
| 1259 | if (k > 0) { // C'est un BaseWidget
|
---|
| 1260 | BWMList::iterator it;
|
---|
| 1261 | it = mBWList.find(k);
|
---|
| 1262 | if (it == mBWList.end()) return;
|
---|
| 1263 | PIBaseWdg* wd = (*it).second;
|
---|
| 1264 | //DBG cerr << "-DBG- PIStdImgApp::DelWRsId Deleting BaseWidget " << (long)(wd) << endl ;
|
---|
| 1265 | DeleteBaseWidget(wd, true, true);
|
---|
| 1266 | }
|
---|
| 1267 | else { // C'est un drawer
|
---|
| 1268 | DrwMList::iterator it;
|
---|
| 1269 | it = mDrwList.find(-k);
|
---|
| 1270 | if (it == mDrwList.end()) return;
|
---|
[2231] | 1271 | (*it).second->SetAutoRefreshOnDelete(true);
|
---|
[165] | 1272 | delete (*it).second;
|
---|
| 1273 | mDrwList.erase(it);
|
---|
| 1274 | // cerr << "+DBG+ PIStdImgApp::DelWRsId Deleting Drawer " << (long)((*it).second) << endl ;
|
---|
| 1275 | }
|
---|
| 1276 | }
|
---|
[368] | 1277 | /* --Methode-- */
|
---|
| 1278 | bool PIStdImgApp::CheckWRsId(int k)
|
---|
| 1279 | {
|
---|
| 1280 | if (k > 0) { // C'est un BaseWidget
|
---|
| 1281 | BWMList::iterator it;
|
---|
| 1282 | it = mBWList.find(k);
|
---|
| 1283 | if (it == mBWList.end()) return(false);
|
---|
| 1284 | else return(true);
|
---|
| 1285 | }
|
---|
| 1286 | else { // C'est un drawer
|
---|
| 1287 | DrwMList::iterator it;
|
---|
| 1288 | it = mDrwList.find(-k);
|
---|
| 1289 | if (it == mDrwList.end()) return(false);
|
---|
| 1290 | else return(true);
|
---|
| 1291 | }
|
---|
| 1292 | }
|
---|
[165] | 1293 |
|
---|
[1971] | 1294 | /* --Methode-- */
|
---|
| 1295 | void PIStdImgApp::StatZoomWindowSetVisible(bool fg)
|
---|
| 1296 | {
|
---|
[165] | 1297 |
|
---|
[1971] | 1298 | if (fg) {
|
---|
| 1299 | consolecont->SetBinding(PIBK_free,PIBK_free,PIBK_free, PIBK_free);
|
---|
| 1300 | int szy = MainWin()->YSize();
|
---|
| 1301 | MainWin()->SetSize(MainWin()->XSize(), szy+statcont->YSize());
|
---|
| 1302 | consolecont->SetPos(0, statcont->YSize());
|
---|
| 1303 | consolecont->SetSize(MainWin()->XSize(), szy);
|
---|
| 1304 | consolecont->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_fixed);
|
---|
| 1305 | statcont->Show();
|
---|
| 1306 | m[3]->SetStateMsg(10470, true);
|
---|
| 1307 | }
|
---|
| 1308 | else {
|
---|
| 1309 | statcont->Hide();
|
---|
| 1310 | consolecont->SetBinding(PIBK_free,PIBK_free,PIBK_free, PIBK_free);
|
---|
| 1311 | MainWin()->SetSize(MainWin()->XSize(), MainWin()->YSize()-statcont->YSize());
|
---|
| 1312 | consolecont->SetPos(0, 0);
|
---|
| 1313 | consolecont->SetSize(MainWin()->XSize(), MainWin()->YSize());
|
---|
| 1314 | consolecont->SetBinding(PIBK_fixed,PIBK_fixed,PIBK_fixed, PIBK_fixed);
|
---|
| 1315 | m[3]->SetStateMsg(10470, false);
|
---|
| 1316 | }
|
---|
| 1317 |
|
---|
| 1318 | }
|
---|
| 1319 |
|
---|
[165] | 1320 | /* --Methode-- */
|
---|
[2106] | 1321 | void PIStdImgApp::UpdateStatResourceInfo()
|
---|
| 1322 | {
|
---|
| 1323 | resusg.Update();
|
---|
| 1324 | char buff[256];
|
---|
| 1325 | string lab;
|
---|
| 1326 | double frac;
|
---|
[2158] | 1327 | sprintf(buff, "Mem: %ld/Max= %ld kb" , (long)resusg.getMemorySize(),
|
---|
| 1328 | (long)resusg.getMaxMemorySize());
|
---|
[2106] | 1329 | lab = buff;
|
---|
| 1330 | lab_mem->SetLabel(lab);
|
---|
| 1331 | frac = (double)resusg.getMemorySize()/(double)resusg.getMaxMemorySize();
|
---|
| 1332 | therm_mem->SetValue(frac);
|
---|
| 1333 |
|
---|
[2158] | 1334 | sprintf(buff, "CPU: %ld/elap= %ld ms" , (long)resusg.getCPUTime(),
|
---|
| 1335 | (long)resusg.getElapsedTime());
|
---|
[2106] | 1336 | lab = buff;
|
---|
| 1337 | lab_cpu->SetLabel(lab);
|
---|
[2259] | 1338 | if (resusg.getCPULoad() > resusg.getAverageCPULoad())
|
---|
| 1339 | therm_cpu->SetValue(resusg.getCPULoad());
|
---|
| 1340 | else
|
---|
| 1341 | therm_cpu->SetValue(resusg.getAverageCPULoad());
|
---|
[2106] | 1342 | }
|
---|
| 1343 |
|
---|
| 1344 | /* --Methode-- */
|
---|
[165] | 1345 | void PIStdImgApp::RedirectStdOutErr(bool fg)
|
---|
| 1346 | {
|
---|
| 1347 | if (fg) {
|
---|
| 1348 | RedirectOutStream(mCons);
|
---|
| 1349 | RedirectErrStream(mCons);
|
---|
| 1350 | m[5]->SetStateMsg(10602, true);
|
---|
[293] | 1351 | redirecout = true;
|
---|
[165] | 1352 | }
|
---|
| 1353 | else {
|
---|
| 1354 | RedirectOutStream(NULL);
|
---|
| 1355 | RedirectErrStream(NULL);
|
---|
| 1356 | m[5]->SetStateMsg(10602, false);
|
---|
[293] | 1357 | redirecout = false;
|
---|
[165] | 1358 | }
|
---|
| 1359 | return;
|
---|
| 1360 | }
|
---|
| 1361 |
|
---|
| 1362 | /* --Methode-- */
|
---|
[374] | 1363 | void PIStdImgApp::CatchSignals(bool fgfpe, bool fgsegv)
|
---|
[165] | 1364 | {
|
---|
[912] | 1365 | #ifdef SANS_EVOLPLANCK
|
---|
[374] | 1366 | PeidaConfigureSignalhandling(fgfpe, fgsegv, true, true);
|
---|
[912] | 1367 | #else
|
---|
| 1368 | SophyaConfigureSignalhandling(fgfpe, fgsegv, true, true);
|
---|
| 1369 | #endif
|
---|
[374] | 1370 | m[5]->SetStateMsg(10603, fgfpe);
|
---|
| 1371 | m[5]->SetStateMsg(10604, fgsegv);
|
---|
[165] | 1372 | }
|
---|
| 1373 |
|
---|
| 1374 | /* --Methode-- */
|
---|
| 1375 | void PIStdImgApp::CloseAllWindows()
|
---|
| 1376 | {
|
---|
| 1377 | WindMList::iterator it;
|
---|
| 1378 | for(it = mWList.begin(); it != mWList.end(); it++) delete (*it).second;
|
---|
| 1379 | mWList.clear();
|
---|
| 1380 | mBWList.clear();
|
---|
| 1381 | mDrwList.clear();
|
---|
[454] | 1382 | mGrW = NULL;
|
---|
| 1383 | mStW = NULL;
|
---|
| 1384 | mCurWin = NULL;
|
---|
| 1385 | mCurWdg = NULL;
|
---|
| 1386 | mLastWdg = NULL;
|
---|
| 1387 | m[4]->SetSensitivityMsg(10515, false);
|
---|
| 1388 | m[4]->SetSensitivityMsg(10516, false);
|
---|
[165] | 1389 | }
|
---|
| 1390 |
|
---|
[1971] | 1391 | //---------------------------------------------------------------------------
|
---|
| 1392 | //--------- Gestion des attributs graphiques et autres options de trace -----
|
---|
| 1393 |
|
---|
[165] | 1394 | /* --Methode-- */
|
---|
[1971] | 1395 | void PIStdImgApp::SetInsetLimits(double xmin, double xmax, double ymin, double ymax)
|
---|
| 1396 | {
|
---|
| 1397 | mIXmin = xmin; mIXmax= xmax;
|
---|
| 1398 | mIYmin = ymin; mIYmax= ymax;
|
---|
| 1399 | }
|
---|
| 1400 |
|
---|
| 1401 | /* --Methode-- */
|
---|
| 1402 | void PIStdImgApp::SetDefaultGraphicAttributes(string const & opt)
|
---|
| 1403 | {
|
---|
| 1404 | ParseDisplayOption(opt, mDefaultAtt);
|
---|
| 1405 | }
|
---|
| 1406 |
|
---|
| 1407 | /* --Methode-- */
|
---|
| 1408 | void PIStdImgApp::SetDefaultAxesAttributes(string const & opt)
|
---|
| 1409 | {
|
---|
| 1410 | ParseDisplayOption(opt, mAxesAtt);
|
---|
| 1411 | }
|
---|
| 1412 |
|
---|
| 1413 | /* --Methode-- */
|
---|
| 1414 | DispWinEnum PIStdImgApp::ParseDisplayOption(string const & sop, vector<string>& opts)
|
---|
| 1415 | {
|
---|
| 1416 | DispWinEnum rc = Disp_Next;
|
---|
| 1417 | //DBG cerr << " DBG-Parse-A sop=" << sop << " sop.length()= " << sop.length() << endl;
|
---|
| 1418 | if (opts.size() > 0) opts.erase(opts.begin(), opts.end());
|
---|
| 1419 | if (sop.length() < 1) return(rc);
|
---|
| 1420 | string gratt = sop;
|
---|
| 1421 | for(int i=0; i<gratt.length(); i++) gratt[i] = tolower(gratt[i]);
|
---|
| 1422 | if ( (gratt == "def") || (gratt == "default") ) return(rc);
|
---|
| 1423 | // On separe en mots espaces par des blancs ou tabulation
|
---|
| 1424 | size_t p = 0;
|
---|
| 1425 | size_t q = 0;
|
---|
| 1426 | size_t l = gratt.length();
|
---|
| 1427 | string token;
|
---|
| 1428 | while (q < l) {
|
---|
| 1429 | p = gratt.find_first_not_of(" \t",q); // au debut d'un token
|
---|
| 1430 | if (p >= l) break;
|
---|
| 1431 | q = gratt.find_first_of(" \t",p); // Premier blanc ou tab suivant
|
---|
| 1432 | if (q<l) token = gratt.substr(p,q-p);
|
---|
| 1433 | else token = gratt.substr(p);
|
---|
| 1434 | if (token == "") continue;
|
---|
| 1435 | // Decodage option fenetre d'affichage (win, next, ...)
|
---|
| 1436 | if (token == "win") rc = Disp_Win;
|
---|
| 1437 | else if (token == "same") rc = Disp_Same;
|
---|
| 1438 | else if (token == "inset") rc = Disp_Inset;
|
---|
| 1439 | else if (token == "stack") rc = Disp_Stack;
|
---|
[2118] | 1440 | else if (token == "next") rc = Disp_Next;
|
---|
[1971] | 1441 | // Option a etre decode par les drawers, etc ...
|
---|
| 1442 | else opts.push_back(token);
|
---|
| 1443 | }
|
---|
| 1444 |
|
---|
| 1445 | //DBG cerr << " DBG-Parse-B opts.size()=" << opts.size() << endl;
|
---|
| 1446 | return (rc);
|
---|
| 1447 | }
|
---|
| 1448 |
|
---|
| 1449 | //---------------------------------------------------------------------------
|
---|
| 1450 | //------------ Methodes privees (MBProcessx, ...) ----------
|
---|
| 1451 |
|
---|
| 1452 | /* --Methode-- */
|
---|
[165] | 1453 | void PIStdImgApp::MBProcess1(PIMessage msg, PIMsgHandler* /*sender*/, void* data)
|
---|
| 1454 | {
|
---|
| 1455 |
|
---|
| 1456 | switch(msg)
|
---|
| 1457 | {
|
---|
[686] | 1458 | case 10150 :
|
---|
| 1459 | showInfoWindow(this);
|
---|
| 1460 | break;
|
---|
| 1461 |
|
---|
| 1462 | case 10155 :
|
---|
| 1463 | hideInfoWindow(this);
|
---|
| 1464 | break;
|
---|
| 1465 |
|
---|
[293] | 1466 | case 10100 :
|
---|
| 1467 | mCmd->ShowHelpWindow();
|
---|
| 1468 | break;
|
---|
| 1469 |
|
---|
[165] | 1470 | case 10120 :
|
---|
[685] | 1471 | pfc_fits->AcceptNewFile(false);
|
---|
[165] | 1472 | mFCMsg = 10125;
|
---|
[685] | 1473 | pfc_fits->SetMsg(mFCMsg);
|
---|
[165] | 1474 | SetBlocked();
|
---|
[685] | 1475 | pfc_fits->Show();
|
---|
[165] | 1476 | break;
|
---|
| 1477 |
|
---|
| 1478 | case 10125 :
|
---|
| 1479 | SetBusy();
|
---|
| 1480 | if (data) {
|
---|
[331] | 1481 | string nomobj="";
|
---|
[685] | 1482 | ObjMgr()->ReadFits(pfc_fits->GetFileName(), nomobj);
|
---|
[331] | 1483 | ObjMgr()->DisplayObj(nomobj, "win");
|
---|
[165] | 1484 | }
|
---|
| 1485 | mFCMsg = 0;
|
---|
| 1486 | SetReady();
|
---|
| 1487 | break;
|
---|
| 1488 |
|
---|
| 1489 | case 10130 :
|
---|
[685] | 1490 | pfc_ppf->AcceptNewFile(false);
|
---|
[165] | 1491 | mFCMsg = 10135;
|
---|
[685] | 1492 | pfc_ppf->SetMsg(mFCMsg);
|
---|
[165] | 1493 | SetBlocked();
|
---|
[685] | 1494 | pfc_ppf->Show();
|
---|
[165] | 1495 | break;
|
---|
| 1496 |
|
---|
| 1497 | case 10135 :
|
---|
| 1498 | mFCMsg = 0;
|
---|
| 1499 | if (data) {
|
---|
[685] | 1500 | PPInMgrW()->SetFile(pfc_ppf->GetFileName());
|
---|
[165] | 1501 | PPInMgrW()->Show();
|
---|
| 1502 | }
|
---|
| 1503 | SetReady();
|
---|
| 1504 | break;
|
---|
| 1505 |
|
---|
[2263] | 1506 | #ifndef SANS_EVOLPLANCK
|
---|
| 1507 | case 10140 :
|
---|
| 1508 | pfc_ascii->AcceptNewFile(false);
|
---|
| 1509 | mFCMsg = 10145;
|
---|
| 1510 | pfc_ascii->SetMsg(mFCMsg);
|
---|
| 1511 | SetBlocked();
|
---|
| 1512 | pfc_ascii->Show();
|
---|
| 1513 | break;
|
---|
| 1514 |
|
---|
| 1515 | case 10145 :
|
---|
| 1516 | SetBusy();
|
---|
| 1517 | if (data) {
|
---|
| 1518 | string afname = pfc_ascii->GetFileName();
|
---|
| 1519 | string nomobj = ObjMgr()->GetServiceObj()->FileName2Name(afname);
|
---|
| 1520 | string cmd = "mtxfrascii ";
|
---|
| 1521 | cmd += nomobj; cmd += " "; cmd += afname;
|
---|
| 1522 | try {
|
---|
| 1523 | mCmd->Interpret(cmd);
|
---|
| 1524 | }
|
---|
| 1525 | catch ( PThrowable & exc ) {
|
---|
| 1526 | cerr << "\n PIStdImgApp::Process()/ Cmd->Interpret() Exception :"
|
---|
| 1527 | << (string)typeid(exc).name() << " Msg= "
|
---|
| 1528 | << exc.Msg() << endl;
|
---|
| 1529 | cout << endl;
|
---|
| 1530 | }
|
---|
| 1531 | catch ( ... ) {
|
---|
| 1532 | cerr << "\n PIStdImgApp::Process()/ Cmd->Interpret() Catched Exception ... " << endl;
|
---|
| 1533 | cout << endl;
|
---|
| 1534 | }
|
---|
| 1535 |
|
---|
| 1536 | }
|
---|
| 1537 | mFCMsg = 0;
|
---|
| 1538 | SetReady();
|
---|
| 1539 | break;
|
---|
| 1540 | #endif
|
---|
| 1541 |
|
---|
[165] | 1542 | case 10105:
|
---|
| 1543 | Stop();
|
---|
| 1544 | break;
|
---|
| 1545 |
|
---|
| 1546 | }
|
---|
| 1547 | return;
|
---|
| 1548 | }
|
---|
| 1549 |
|
---|
| 1550 |
|
---|
| 1551 |
|
---|
| 1552 | /* --Methode-- */
|
---|
| 1553 | void PIStdImgApp::MBProcess2(PIMessage msg, PIMsgHandler* /*sender*/, void* data)
|
---|
| 1554 | {
|
---|
| 1555 |
|
---|
| 1556 | switch (msg) {
|
---|
| 1557 | case 10201 :
|
---|
| 1558 | ObjMgrW()->Show();
|
---|
| 1559 | break;
|
---|
| 1560 |
|
---|
| 1561 | case 10220 :
|
---|
[685] | 1562 | pfc_ppf->AcceptNewFile(true);
|
---|
[165] | 1563 | mFCMsg = 10225;
|
---|
[685] | 1564 | pfc_ppf->SetMsg(mFCMsg);
|
---|
[165] | 1565 | SetBlocked();
|
---|
[685] | 1566 | pfc_ppf->Show();
|
---|
[165] | 1567 | break;
|
---|
| 1568 |
|
---|
| 1569 | case 10225 :
|
---|
| 1570 | SetBusy();
|
---|
| 1571 | if (data) {
|
---|
| 1572 | if (mPpfout) {
|
---|
| 1573 | printf("PIStdImg/Info: Closing POutPersist-File %s \n", name_outppf.c_str());
|
---|
| 1574 | delete mPpfout;
|
---|
| 1575 | }
|
---|
[685] | 1576 | name_outppf = pfc_ppf->GetFileName();
|
---|
[165] | 1577 | mPpfout = NULL;
|
---|
| 1578 | printf("PIStdImg/Info: Opening POutPersist-File %s \n", name_outppf.c_str());
|
---|
| 1579 | mPpfout = new POutPersist(name_outppf);
|
---|
| 1580 | }
|
---|
| 1581 | mFCMsg = 0;
|
---|
| 1582 | SetReady();
|
---|
| 1583 | break;
|
---|
| 1584 |
|
---|
| 1585 | case 10230 :
|
---|
| 1586 | if (!mPpfout) break;
|
---|
| 1587 | printf("PIStdImg/Info: Closing POutPersist-File %s \n", name_outppf.c_str());
|
---|
| 1588 | delete mPpfout;
|
---|
| 1589 | name_outppf = "";
|
---|
| 1590 | mPpfout = NULL;
|
---|
| 1591 | break;
|
---|
| 1592 |
|
---|
[686] | 1593 | case 10270 :
|
---|
| 1594 | if (mCurWdg) {
|
---|
| 1595 | int oid = mCurWdg->UserFlag();
|
---|
| 1596 | DeleteBaseWidget(mCurWdg);
|
---|
| 1597 | mObjMgr->DelObj_Id(oid);
|
---|
| 1598 | }
|
---|
| 1599 | break;
|
---|
[165] | 1600 |
|
---|
| 1601 | default:
|
---|
| 1602 | cerr << "PIStdImgApp::MBProcess2() BUG?? Msg= " << msg << endl;
|
---|
| 1603 | break;
|
---|
| 1604 | }
|
---|
| 1605 |
|
---|
| 1606 | return;
|
---|
| 1607 | }
|
---|
| 1608 |
|
---|
| 1609 | /* --Methode-- */
|
---|
| 1610 | void PIStdImgApp::MBProcess3(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/)
|
---|
| 1611 | {
|
---|
| 1612 |
|
---|
| 1613 | switch (msg) {
|
---|
| 1614 | case 10301 :
|
---|
| 1615 | PIImgTools::ShowPIImgTools();
|
---|
| 1616 | break;
|
---|
| 1617 | case 10302 :
|
---|
| 1618 | PIDrwTools::ShowPIDrwTools();
|
---|
| 1619 | break;
|
---|
[1590] | 1620 | case 10303 :
|
---|
| 1621 | PIAxesTools::ShowPIAxesTools();
|
---|
| 1622 | break;
|
---|
[165] | 1623 |
|
---|
[1590] | 1624 | case 10304 :
|
---|
[1251] | 1625 | mCmd->ShowCxxExecWindow();
|
---|
| 1626 | break;
|
---|
| 1627 |
|
---|
[1590] | 1628 | case 10311 :
|
---|
| 1629 | case 10312 :
|
---|
[165] | 1630 | {
|
---|
| 1631 | PIImage* curpimg = NULL;
|
---|
| 1632 | if (!mCurWdg) return;
|
---|
| 1633 | if (mCurWdg->kind() != PIImage::ClassId) return;
|
---|
| 1634 | curpimg = (PIImage*)mCurWdg;
|
---|
| 1635 | if (curpimg == NULL) return;
|
---|
| 1636 | P2DArrayAdapter* img = curpimg->Image();
|
---|
| 1637 | if (img == NULL) return;
|
---|
| 1638 | int dx = curpimg->XSzPave();
|
---|
| 1639 | int dy = curpimg->YSzPave();
|
---|
| 1640 | int x0 = curpimg->XPave()-dx/2;
|
---|
| 1641 | int y0 = curpimg->YPave()-dy/2;
|
---|
| 1642 | if (x0 < 0) x0 = 0;
|
---|
| 1643 | if (y0 < 0) y0 = 0;
|
---|
| 1644 | int x1 = x0+dx;
|
---|
| 1645 | int y1 = y0+dy;
|
---|
| 1646 | if (x1 > img->XSize()) x1 = img->XSize();
|
---|
| 1647 | if (y1 > img->YSize()) y1 = img->YSize();
|
---|
| 1648 | dx = x1-x0; dy = y1-y0;
|
---|
| 1649 | ImageR4* pim = new ImageR4(dx, dy);
|
---|
| 1650 | int ii, jj;
|
---|
| 1651 | for(jj=0; jj<dy; jj++)
|
---|
| 1652 | for(ii=0; ii<dx; ii++) (*pim)(ii,jj) = (*img)(ii+x0, jj+y0);
|
---|
[338] | 1653 | if (msg == 10305) { // Calcul des coordonnees du sous-pave
|
---|
| 1654 | double xc1, yc1;
|
---|
| 1655 | img->Coord(x0, y0, xc1, yc1);
|
---|
| 1656 | pim->SetOrg((int)xc1, (int)yc1);
|
---|
| 1657 | }
|
---|
[165] | 1658 | string nom = mCurWdg->Nom() + "_pave";
|
---|
| 1659 | ObjMgr()->AddObj(pim, nom);
|
---|
| 1660 | ObjMgr()->DisplayObj(nom, "w");
|
---|
[293] | 1661 | break;
|
---|
[165] | 1662 | }
|
---|
| 1663 |
|
---|
[1590] | 1664 | case 10313 :
|
---|
[293] | 1665 | {
|
---|
| 1666 | PIImage* curpimg = NULL;
|
---|
| 1667 | if (!mCurWdg) return;
|
---|
| 1668 | if (mCurWdg->kind() != PIImage::ClassId) return;
|
---|
| 1669 | curpimg = (PIImage*)mCurWdg;
|
---|
| 1670 | if (curpimg == NULL) return;
|
---|
| 1671 | curpimg->ShowCuts(true);
|
---|
| 1672 | break;
|
---|
| 1673 | }
|
---|
| 1674 |
|
---|
[165] | 1675 | case 10320 :
|
---|
| 1676 | if (mStW) mStW->DispNext();
|
---|
| 1677 | break;
|
---|
| 1678 |
|
---|
| 1679 | case 10321 :
|
---|
| 1680 | case 10322 :
|
---|
| 1681 | case 10324 :
|
---|
| 1682 | // case 10328 :
|
---|
[191] | 1683 | if (mStW) mStW->StartAutoDisp((msg-10320)*500);
|
---|
[165] | 1684 | break;
|
---|
| 1685 |
|
---|
| 1686 | case 10329 :
|
---|
| 1687 | if (mStW) mStW->StopAutoDisp();
|
---|
| 1688 | break;
|
---|
| 1689 |
|
---|
| 1690 | case 103330 :
|
---|
| 1691 | if (mStW) {
|
---|
| 1692 | PIWdg* cw = mStW->CurrentWdg();
|
---|
| 1693 | if (cw) DeleteBaseWidget((PIBaseWdg*)cw);
|
---|
| 1694 | }
|
---|
| 1695 | break;
|
---|
| 1696 |
|
---|
| 1697 | default:
|
---|
| 1698 | cerr << "PIStdImgApp::MBProcess3() BUG?? Msg= " << msg << endl;
|
---|
| 1699 | break;
|
---|
| 1700 | }
|
---|
| 1701 | return;
|
---|
| 1702 | }
|
---|
| 1703 |
|
---|
| 1704 | /* --Methode-- */
|
---|
| 1705 | void PIStdImgApp::MBProcess4(PIMessage msg, PIMsgHandler* /*sender*/, void* /*data*/)
|
---|
| 1706 | {
|
---|
| 1707 |
|
---|
| 1708 | switch (msg) {
|
---|
| 1709 |
|
---|
| 1710 | case 10400 :
|
---|
| 1711 | CreateStackWin();
|
---|
| 1712 | break;
|
---|
| 1713 |
|
---|
| 1714 | case 10411 :
|
---|
| 1715 | CreateGraphWin(1,1);
|
---|
| 1716 | break;
|
---|
| 1717 | case 10421 :
|
---|
| 1718 | CreateGraphWin(1,2);
|
---|
| 1719 | break;
|
---|
| 1720 | case 10412 :
|
---|
| 1721 | CreateGraphWin(2,1);
|
---|
| 1722 | break;
|
---|
| 1723 | case 10422 :
|
---|
| 1724 | CreateGraphWin(2,2);
|
---|
| 1725 | break;
|
---|
| 1726 | case 10431 :
|
---|
| 1727 | CreateGraphWin(1,3);
|
---|
| 1728 | break;
|
---|
| 1729 | case 10433 :
|
---|
| 1730 | CreateGraphWin(3,3);
|
---|
| 1731 | break;
|
---|
[558] | 1732 | case 10441 :
|
---|
| 1733 | if (mCurWdg) {
|
---|
| 1734 | mLastWdg = mCurWdg;
|
---|
| 1735 | cout << " Using current widget as last-widget (display same) " << endl;
|
---|
| 1736 | }
|
---|
| 1737 | else cout << " No current widget - select widget with mouse " << endl;
|
---|
| 1738 | break;
|
---|
[686] | 1739 | case 10460 :
|
---|
| 1740 | DeleteWindow(mCurWin);
|
---|
| 1741 | break;
|
---|
[1971] | 1742 | case 10470 :
|
---|
| 1743 | StatZoomWindowSetVisible(m[3]->GetStateMsg(10470));
|
---|
| 1744 | break;
|
---|
[165] | 1745 | default:
|
---|
| 1746 | cerr << "PIStdImgApp::MBProcess4() BUG?? Msg= " << msg << endl;
|
---|
| 1747 | break;
|
---|
| 1748 | }
|
---|
| 1749 | return;
|
---|
| 1750 | }
|
---|
| 1751 |
|
---|
| 1752 |
|
---|
| 1753 | /* --Methode-- */
|
---|
| 1754 | void PIStdImgApp::MBProcess5(PIMessage msg, PIMsgHandler* /*sender*/, void* data)
|
---|
| 1755 | {
|
---|
| 1756 | char nomps[64],strg[512];
|
---|
| 1757 | PSFile *mps;
|
---|
| 1758 | int sxt, syt, syo, syo1, sx[4], sy[4];
|
---|
| 1759 |
|
---|
| 1760 | switch (msg)
|
---|
| 1761 | {
|
---|
| 1762 | case 10501 :
|
---|
[685] | 1763 | pfc_ps->AcceptNewFile(true);
|
---|
[165] | 1764 | mFCMsg = 10525;
|
---|
[685] | 1765 | pfc_ps->SetMsg(mFCMsg);
|
---|
[165] | 1766 | SetBlocked();
|
---|
[685] | 1767 | pfc_ps->Show();
|
---|
[165] | 1768 | break;
|
---|
| 1769 |
|
---|
| 1770 | case 10525 :
|
---|
| 1771 | SetBusy();
|
---|
| 1772 | if (data) {
|
---|
| 1773 | if (mpsfile) {
|
---|
| 1774 | printf("PIStdImg/Info: Closing PS-File %s \n", name_ps.c_str());
|
---|
| 1775 | delete mpsfile;
|
---|
| 1776 | }
|
---|
[685] | 1777 | name_ps = pfc_ps->GetFileName();
|
---|
[165] | 1778 | printf("PIStdImg/Info: Opening PS-File %s \n", name_ps.c_str());
|
---|
| 1779 | mpsfile = new PSFile(name_ps.c_str(), PI_Portrait, PI_A4, 2., 2.);
|
---|
| 1780 | }
|
---|
| 1781 | mFCMsg = 0;
|
---|
| 1782 | SetReady();
|
---|
| 1783 | break;
|
---|
| 1784 |
|
---|
| 1785 | case 10505 :
|
---|
| 1786 | if (!mpsfile) break;
|
---|
| 1787 | printf("PIStdImg/Info: Closing PS-File %s \n", name_ps.c_str());
|
---|
| 1788 | delete mpsfile;
|
---|
| 1789 | mpsfile = NULL;
|
---|
| 1790 | name_ps = "";
|
---|
| 1791 | break;
|
---|
| 1792 |
|
---|
| 1793 | case 10511 : // Window -> PS
|
---|
| 1794 | case 10512 : // Window -> EPS
|
---|
| 1795 | if (CurrentWindow() == NULL) break;
|
---|
| 1796 | if (msg == 10512)
|
---|
| 1797 | {
|
---|
| 1798 | num_eps++;
|
---|
| 1799 | sprintf(nomps,"pia%d.eps", num_eps);
|
---|
| 1800 | printf("PIStdImg/Info: Creating EPSFile %s (CurWin-> EPS) \n", nomps);
|
---|
| 1801 | mps = new PSFile(nomps);
|
---|
| 1802 | }
|
---|
| 1803 | else {
|
---|
| 1804 | if (mpsfile == NULL) {
|
---|
| 1805 | name_ps = "pia.ps";
|
---|
| 1806 | mpsfile = new PSFile(name_ps.c_str(), PI_Portrait, PI_A4, 0., 0.);
|
---|
| 1807 | printf("PIStdImg/Info: File PS %s opened \n", name_ps.c_str());
|
---|
| 1808 | }
|
---|
| 1809 | printf("PIStdImg/Info: CurWin-> PSFile %s\n", name_ps.c_str());
|
---|
| 1810 | mps = mpsfile;
|
---|
| 1811 | }
|
---|
| 1812 | CurrentWindow()->PSPrint(mps,0,0);
|
---|
| 1813 |
|
---|
| 1814 | if (msg == 10512) delete mps; // fichier eps
|
---|
| 1815 | break;
|
---|
| 1816 |
|
---|
| 1817 | case 10515 : // Image -> PS
|
---|
| 1818 | case 10516 : // Image -> EPS
|
---|
| 1819 | {
|
---|
| 1820 | PIImage* curpimg = NULL;
|
---|
| 1821 | if (!mCurWdg) return;
|
---|
| 1822 | if (mCurWdg->kind() != PIImage::ClassId) return;
|
---|
| 1823 | curpimg = (PIImage*)mCurWdg;
|
---|
| 1824 | if (curpimg == NULL) return;
|
---|
| 1825 | if (msg == 10516)
|
---|
| 1826 | {
|
---|
| 1827 | num_eps++;
|
---|
| 1828 | sprintf(nomps,"pia%d.eps", num_eps);
|
---|
| 1829 | printf("PIStdImg/Info: Creating EPSFile %s (CurImage-> EPS)\n", nomps);
|
---|
| 1830 | mps = new PSFile(nomps);
|
---|
| 1831 | }
|
---|
| 1832 | else {
|
---|
| 1833 | if (mpsfile == NULL) {
|
---|
| 1834 | name_ps = "pia.ps";
|
---|
| 1835 | mpsfile = new PSFile(name_ps.c_str(),PI_Portrait, PI_A4, 2., 2.);
|
---|
| 1836 | printf("PIStdImg/Info: File PS %s opened \n", name_ps.c_str());
|
---|
| 1837 | }
|
---|
| 1838 | printf("PIStdImg/Info: CurImage-> PSFile %s\n", name_ps.c_str());
|
---|
| 1839 | mps = mpsfile;
|
---|
| 1840 | }
|
---|
| 1841 |
|
---|
| 1842 | sx[0] = gimv->XSize();
|
---|
| 1843 | sy[0] = gimv->YSize();
|
---|
| 1844 | sx[1] = zoom->XSize();
|
---|
| 1845 | sy[1] = zoom->YSize();
|
---|
| 1846 | sx[2] = cmapv->XSize();
|
---|
| 1847 | sy[2] = cmapv->YSize();
|
---|
| 1848 | sx[3] = curpimg->XSize();
|
---|
| 1849 | sy[3] = curpimg->YSize();
|
---|
| 1850 | if (sy[1] > sy[0]) { syo1 = sy[1]+50; syo = sy[1]+sy[2]+60; }
|
---|
| 1851 | else { syo1 = sy[0]+50; syo = sy[0]+sy[2]+60; }
|
---|
| 1852 | syt = sy[3]+syo;
|
---|
| 1853 | sxt = sx[3];
|
---|
| 1854 | if (sxt < (sx[0]+sx[1]+20)) sxt = sx[0]+sx[1]+20;
|
---|
| 1855 | if (sxt < sx[2]) sxt = sx[2];
|
---|
| 1856 |
|
---|
| 1857 | // Pour ecrire le titre
|
---|
| 1858 | mps->NewPage((float)sxt, (float)syt, PI_Portrait);
|
---|
| 1859 | mps->NewBloc(0,0, (float)sxt, 30., (float)sxt, 30.);
|
---|
| 1860 | sprintf(strg,"Image: %s - Pave %d %d \n", curpimg->Nom().c_str(),
|
---|
| 1861 | curpimg->XPave(), curpimg->YPave());
|
---|
[384] | 1862 | mps->DrawString(10., 25., strg, PI_Black, PI_DefaultFont, PI_BoldFont, 20);
|
---|
[165] | 1863 | mps->EndBloc();
|
---|
| 1864 |
|
---|
| 1865 | // Les quatre fenetres glovimage, zoom, cmap, image
|
---|
| 1866 | gimv->PSPrint(mps, -gimv->XPos(), -gimv->YPos()+40);
|
---|
| 1867 | zoom->PSPrint(mps, -zoom->XPos()+sx[0]+20, -zoom->YPos()+40);
|
---|
| 1868 | cmapv->PSPrint(mps, -cmapv->XPos(), -cmapv->YPos()+syo1);
|
---|
| 1869 | curpimg->PSPrint(mps, -curpimg->XPos(), -curpimg->YPos()+syo);
|
---|
| 1870 |
|
---|
| 1871 | if (msg == 10516) delete mps; // fichier eps
|
---|
| 1872 | break;
|
---|
| 1873 | }
|
---|
| 1874 |
|
---|
| 1875 | default:
|
---|
| 1876 | cerr << "PIStdImgApp::MBProcess5() BUG?? Msg= " << msg << endl;
|
---|
| 1877 | break;
|
---|
| 1878 | }
|
---|
| 1879 |
|
---|
| 1880 | }
|
---|
| 1881 |
|
---|
| 1882 |
|
---|
| 1883 | /* --Methode-- */
|
---|
| 1884 | void PIStdImgApp::MBProcess6(PIMessage msg, PIMsgHandler* /*sender*/, void* data)
|
---|
| 1885 | {
|
---|
| 1886 | switch (msg) {
|
---|
| 1887 | case 10601:
|
---|
| 1888 | CloseAllWindows();
|
---|
| 1889 | break;
|
---|
| 1890 | case 10602:
|
---|
| 1891 | RedirectStdOutErr(*((bool*)data));
|
---|
| 1892 | break;
|
---|
| 1893 | case 10603:
|
---|
[374] | 1894 | case 10604:
|
---|
| 1895 | CatchSignals(m[5]->GetStateMsg(10603), m[5]->GetStateMsg(10604));
|
---|
[165] | 1896 | break;
|
---|
[449] | 1897 | case 10605:
|
---|
| 1898 | mObjMgr->SetVerbose(m[5]->GetStateMsg(10605));
|
---|
| 1899 | break;
|
---|
[1251] | 1900 | case 10606:
|
---|
| 1901 | mCmd->ShowCxxOptionWindow();
|
---|
| 1902 | break;
|
---|
[165] | 1903 | default:
|
---|
| 1904 | cerr << "PIStdImgApp::MBProcess6() BUG?? Msg= " << msg << endl;
|
---|
| 1905 | break;
|
---|
| 1906 | }
|
---|
| 1907 | return;
|
---|
| 1908 | }
|
---|
| 1909 |
|
---|
| 1910 |
|
---|
[1569] | 1911 |
|
---|
[686] | 1912 | // -------------------------------------------------
|
---|
| 1913 | // Fenetre info piapp (About piapp)
|
---|
| 1914 | // -------------------------------------------------
|
---|
| 1915 | static PIWindow* infow_win = NULL;
|
---|
| 1916 | static PIText* infow_txt = NULL;
|
---|
| 1917 | static PICMapView* infow_cmap = NULL;
|
---|
| 1918 | static PIButton* infow_but = NULL;
|
---|
| 1919 |
|
---|
| 1920 | /* Nouvelle-Fonction */
|
---|
| 1921 | static void createInfoWindow(PIStdImgApp* app)
|
---|
| 1922 | {
|
---|
| 1923 | if (infow_win) return;
|
---|
| 1924 |
|
---|
| 1925 | int bsx, bsy;
|
---|
| 1926 | PIApplicationPrefCompSize(bsx, bsy);
|
---|
| 1927 | int spx, spy;
|
---|
| 1928 | spx = bsx/6; spy = bsy/6;
|
---|
| 1929 |
|
---|
| 1930 | infow_win = new PIWindow((PIMsgHandler *)app, "About piapp",
|
---|
| 1931 | PIWK_dialog, bsx*5+3*spx, bsy*4+spy*3, 200, 200);
|
---|
| 1932 | infow_win->SetAutoDelChilds(true);
|
---|
| 1933 | infow_txt = new PIText(infow_win,"about_piapp_text", bsx*5+spx, bsy*3, spx, spy);
|
---|
| 1934 | infow_txt->SetMutiLineMode(true);
|
---|
| 1935 | infow_txt->SetTextEditable(false);
|
---|
| 1936 | infow_txt->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
|
---|
| 1937 | infow_cmap = new PICMapView(infow_win, "about_piapp_cmap", bsx*4, bsy*0.7, spx, 2*spy+bsy*3.15);
|
---|
| 1938 | infow_cmap->SetColMapId(CMAP_COLBR32, 1., -1., false);
|
---|
| 1939 | infow_cmap->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
|
---|
| 1940 | infow_but = new PIButton(infow_win,"OK", 10155, bsx, bsy, bsx*4+2*spx, 2*spy+bsy*3);
|
---|
| 1941 | infow_but->SetMsgParent((PIMsgHandler *)app);
|
---|
| 1942 | infow_but->SetBinding(PIBK_elastic,PIBK_elastic, PIBK_elastic,PIBK_elastic);
|
---|
| 1943 | char buff[128];
|
---|
| 1944 | #ifdef SANS_EVOLPLANCK
|
---|
| 1945 | sprintf(buff, "Version: piapp=%g PI=%g PEIDA=%g \n", (double)PIAPP_VERSIONNUMBER,
|
---|
| 1946 | (double)PI_VERSIONNUMBER, (float)PeidaVersion());
|
---|
| 1947 | #else
|
---|
[692] | 1948 | {
|
---|
[686] | 1949 | sprintf(buff, "Version: piapp=%g PI=%g SOPHYA=%g \n", (double)PIAPP_VERSIONNUMBER,
|
---|
[692] | 1950 | (double)PI_VERSIONNUMBER, glst_piai->Version());
|
---|
| 1951 | }
|
---|
[686] | 1952 | #endif
|
---|
| 1953 | string info = "piapp : Interactive analysis program\n";
|
---|
| 1954 | info += buff;
|
---|
[1971] | 1955 | info += "(C) LAL-IN2P3/CNRS 1996-2002\n";
|
---|
| 1956 | info += "(C) SPP-DAPNIA/CEA 1996-2002\n";
|
---|
[686] | 1957 | infow_txt->SetText(info);
|
---|
| 1958 | }
|
---|
| 1959 |
|
---|
| 1960 | /* Nouvelle-Fonction */
|
---|
| 1961 | static void showInfoWindow(PIStdImgApp* app)
|
---|
| 1962 | {
|
---|
[692] | 1963 | if (!infow_win) createInfoWindow(app);
|
---|
| 1964 | if (infow_win) infow_win->Show();
|
---|
[686] | 1965 | }
|
---|
| 1966 | /* Nouvelle-Fonction */
|
---|
| 1967 | static void hideInfoWindow(PIStdImgApp* app)
|
---|
| 1968 | {
|
---|
[692] | 1969 | if (infow_win) infow_win->Hide();
|
---|
[686] | 1970 | }
|
---|
| 1971 |
|
---|
| 1972 | /* Nouvelle-Fonction */
|
---|
| 1973 | static void deleteInfoWindow()
|
---|
| 1974 | {
|
---|
| 1975 | if (!infow_win) return;
|
---|
| 1976 | delete infow_win;
|
---|
| 1977 | infow_win = NULL;
|
---|
| 1978 | infow_txt = NULL;
|
---|
| 1979 | infow_cmap = NULL;
|
---|
| 1980 | infow_but = NULL;
|
---|
| 1981 | }
|
---|
| 1982 |
|
---|
[2106] | 1983 |
|
---|