Changeset 2651 in Sophya
- Timestamp:
- Feb 18, 2005, 3:09:47 PM (21 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/basexecut.cc
r2645 r2651 714 714 715 715 // >>>>>>>>>>> Affichage des objets 716 else if ( (kw == "disp") || (kw == "surf") || (kw == "imag") ) {717 if (tokens.size() < 1) { cout << "Usage: disp/surf/imag nameobj [opt]" << endl; return(0); }716 else if ( (kw == "disp") || (kw == "surf") || (kw == "imag") || (kw == "imagnav") ) { 717 if (tokens.size() < 1) { cout << "Usage: disp/surf/imag/imagnav nameobj [opt]" << endl; return(0); } 718 718 string opt = "next"; 719 719 if (tokens.size() > 1) opt = tokens[1]; 720 720 if (kw == "disp") mObjMgr->DisplayObj(tokens[0], opt); 721 721 else if (kw == "surf") mObjMgr->DisplaySurf3D(tokens[0], opt); 722 else if (kw == "imag") mObjMgr->DisplayImage(tokens[0], opt); 722 else if (kw == "imag") mObjMgr->DisplayImage(tokens[0], opt, false); 723 else if (kw == "imagnav") mObjMgr->DisplayImage(tokens[0], opt, true); 723 724 } 724 725 … … 1638 1639 kw = "imag"; 1639 1640 usage = "Displays an object as an image \n Usage: imag nameobj [graphic_attributes]"; 1640 usage += "\n Related commands: disp surf nt2d nt3d vecplot"; 1641 usage += "\n Related commands: disp imagnav surf nt2d nt3d vecplot"; 1642 mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); 1643 kw = "imagnav"; 1644 usage = "Displays an object as an image with the ImageNavigator viewer \n"; 1645 usage += "Usage: imagnav nameobj [graphic_attributes]"; 1646 usage += "\n Related commands: disp imag surf nt2d nt3d vecplot"; 1641 1647 mpiac->RegisterCommand(kw, usage, this, "Obj. Display"); 1642 1648 kw = "surf"; -
trunk/SophyaPI/PIext/nobjmgr.cc
r2645 r2651 1311 1311 else wrsid = myImgApp->DispScDrawer( dr, n1, dopt, "", 0, fglock); 1312 1312 } 1313 else if (arr) wrsid = myImgApp->DispImage(arr, n1, dopt, 0, fglock);1313 else if (arr) wrsid = myImgApp->DispImage(arr, n1, dopt, false, 0, fglock); 1314 1314 1315 1315 AddWRsId(nom, wrsid); … … 1318 1318 1319 1319 /* --Methode-- */ 1320 void NamedObjMgr::DisplayImage(string& nom, string dopt )1320 void NamedObjMgr::DisplayImage(string& nom, string dopt, bool fgimagnav) 1321 1321 { 1322 1322 ZSync(*myMutex); … … 1349 1349 1350 1350 int wrsid = 0; 1351 wrsid = myImgApp->DispImage(arr, n1, dopt, 0, fglock);1351 wrsid = myImgApp->DispImage(arr, n1, dopt, fgimagnav, 0, fglock); 1352 1352 1353 1353 AddWRsId(nom, wrsid); -
trunk/SophyaPI/PIext/nobjmgr.h
r2645 r2651 83 83 // Affichage des objets 84 84 virtual void DisplayObj(string & nom, string dopt=""); 85 virtual void DisplayImage(string & nom, string dopt="" );85 virtual void DisplayImage(string & nom, string dopt="", bool fgimagnav=false); 86 86 virtual void DisplaySurf3D(string & nom, string dopt=""); 87 87 virtual void DisplayNT(string & nom, string& nmx, string& nmy, string& nmz, -
trunk/SophyaPI/PIext/piaversion.h
r2613 r2651 2 2 #define PIAPPVERSION_H_SEEN 3 3 4 #define PIAPP_VERSIONNUMBER 3.97 4 #define PIAPP_VERSIONNUMBER 3.972 5 5 6 6 #endif -
trunk/SophyaPI/PIext/pistdimgapp.cc
r2638 r2651 661 661 PIApplication::SetBusy(); 662 662 // Attention : Appel XSync specifique X11 - en attendant multi-thread 663 XSync(PIXDisplay(), False); 663 // XSync(PIXDisplay(), False); RZDEL 664 664 } 665 665 … … 671 671 PIApplication::SetBlocked(); 672 672 // Attention : Appel XSync specifique X11 - en attendant multi-thread 673 XSync(PIXDisplay(), False); 673 // XSync(PIXDisplay(), False); RZDEL 674 674 } 675 675 … … 701 701 /* --Methode-- */ 702 702 int PIStdImgApp::DispImage(P2DArrayAdapter* nouv, string const & name, string const& sop, 703 int oid, bool fglock) 704 { 705 PIImage* pii; 703 bool fgimagnav, int oid, bool fglock) 704 { 705 PIImage* pii=NULL; 706 PIImageNavigator* piin=NULL; 706 707 PIWindow* win; 707 708 int sx, sy, px, py, flag; … … 738 739 px = py = 0; 739 740 win = GetWindow(dwopt, sx, sy, px, py, flag, (char *)name.c_str()); 740 pii = new PIImage(win, (char *)name.c_str(), sx, sy, px,py); 741 pii->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 742 pii->SetZoomWin(zoom, false); 743 pii->SetGloVWin(gimv, false); 744 pii->SetCMapWin(cmapv, false); 745 pii->ShowCursor(true); 746 pii->SetUserData(NULL, oid); 747 741 if (fgimagnav) { // Creation de naviguateur d'image 742 piin = new PIImageNavigator(win, (char *)name.c_str(), sx, sy, px,py); 743 piin->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 744 piin->ImageWdg()->ShowCursor(true); 745 pii = piin->ImageWdg(); 746 pii->SetUserData(NULL, oid); 747 // XSync(PIXDisplay(), False); 748 // cout << " DBG-ImagNav-BBB-BBB Apres XSync() " << endl; 749 750 } 751 else { // Creation de widget PIImage normal 752 pii = new PIImage(win, (char *)name.c_str(), sx, sy, px,py); 753 pii->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 754 pii->SetZoomWin(zoom, false); 755 pii->SetGloVWin(gimv, false); 756 pii->SetCMapWin(cmapv, false); 757 pii->ShowCursor(true); 758 pii->SetUserData(NULL, oid); 759 } 748 760 749 761 // On recalcule la taille de la fenetre si Disp_Win … … 776 788 mBWList[mBWId] = pii; 777 789 // pii->Refresh(); 778 pii->Apply();779 cmapv->Refresh(); 790 pii->Apply(true); 791 // cmapv->Refresh(); Pas besoin ? , Reza Fev 2005 780 792 return(mBWId); 781 793 } … … 1380 1392 PIWdg* nw = mGrW->NextChildPosSize(px, py, sx, sy); 1381 1393 // cerr << "**DBG** PIStdImgApp::GetWindow() DispNext : nw = " << (long)nw << endl; 1382 if (nw) Delete BaseWidget((PIBaseWdg*)nw, false, false);1394 if (nw) DeleteWidget(nw, false, false); 1383 1395 flag = mGrIdx; 1384 1396 mGrIdx = (mGrIdx+1)%(nx*ny); … … 1430 1442 for(k=0; k<mGrW->NbChilds(); k++) { 1431 1443 if ((cwd = mGrW->GetChild(k)) == NULL) continue; 1432 Delete BaseWidget((PIBaseWdg*)cwd, false, false);1444 DeleteWidget(cwd, false, false); 1433 1445 } 1434 1446 mGrW->SetZone(nzx, nzy); … … 1461 1473 for(k=0; k<w->NbChilds(); k++) { 1462 1474 if ((cwd = w->GetChild(k)) == NULL) continue; 1463 Delete BaseWidget((PIBaseWdg*)cwd,false,false);1475 DeleteWidget(cwd,false,false); 1464 1476 } 1465 1477 delete w; … … 1468 1480 1469 1481 /* --Methode-- */ 1470 void PIStdImgApp::Delete BaseWidget(PIBaseWdg* w, bool dw, bool dwin)1482 void PIStdImgApp::DeleteWidget(PIWdg* w, bool dw, bool dwin) 1471 1483 { 1472 1484 if (w == NULL) return; … … 1474 1486 for(it = mBWList.begin(); it != mBWList.end(); it++) 1475 1487 if ((*it).second == w) { mBWList.erase(it); break; } 1476 int k; 1477 PIDrawer* drw; 1478 for(k=0; k<w->NbDrawers(); k++) { 1479 if ((drw = w->GetDrawer(k)) == NULL) continue; 1480 DrwMList::iterator itt; 1481 for(itt = mDrwList.begin(); itt != mDrwList.end(); itt++) 1482 if ((*itt).second == drw) { mDrwList.erase(itt); break; } 1483 } 1484 1485 if (w == mCurWdg) { 1488 PIBaseWdg* bw = dynamic_cast<PIBaseWdg *>(w); 1489 if (bw != NULL) { 1490 PIDrawer* drw; 1491 int k; 1492 for(k=0; k<bw->NbDrawers(); k++) { 1493 if ((drw = bw->GetDrawer(k)) == NULL) continue; 1494 DrwMList::iterator itt; 1495 for(itt = mDrwList.begin(); itt != mDrwList.end(); itt++) 1496 if ((*itt).second == drw) { mDrwList.erase(itt); break; } 1497 } 1498 } 1499 1500 // Reza Fev 2005 - On met systematiquement mCurWdg et mLastWdg a NULL 1501 // Il peuvent en effet etre un des fils du widget qui est supprime 1502 // if (w == mCurWdg) { 1503 if (true) { // Reza Fev 2005 - mCurWdg = NULL systematique 1486 1504 mCurWdg = NULL; 1487 1505 if (mFgCWImg) { … … 1492 1510 } 1493 1511 1494 if (w == mLastWdg) mLastWdg = NULL; 1512 // if (w == mLastWdg) mLastWdg = NULL; 1513 mLastWdg = NULL; // Reza Fev 2005 - mLastWdg = NULL systematique 1495 1514 1496 1515 PIWdg* pw=NULL; 1497 if (dwin) pw = (PIWdg*)(w->Parent()); 1498 //DBG printf("DeleteBaseWidget(%lx)-DBG kind = %d - %d %d \n", (long)w, w->kind(), (int)dw, (int)dwin); 1499 if (dw) delete w; 1500 if (pw && (pw->kind() == PIWindow::ClassId )) { 1501 PIWindow* pww = (PIWindow*) pw; 1502 if ((pww != (PIWindow*)mGrW) && (pww != (PIWindow*)mStW) && (pww->NbChilds()==0)) 1516 pw = (PIWdg*)(w->Parent()); 1517 //DBG printf("DeleteWidget(%lx)-DBG kind = %d - %d %d \n", (long)w, w->kind(), (int)dw, (int)dwin); 1518 if (dw) { 1519 if (pw && (pw->kind() == PIImageNavigator::ClassId) ) { 1520 delete pw; 1521 pw = NULL; 1522 } 1523 else delete w; 1524 } 1525 if (dwin && pw && (pw->kind() == PIWindow::ClassId )) { 1526 PIWindow* pww = dynamic_cast<PIWindow *>(pw); 1527 if (pww && (pww != (PIWindow*)mGrW) && (pww != (PIWindow*)mStW) && (pww->NbChilds()==0)) 1503 1528 DeleteWindow((PIWindow*)pw); 1504 1529 } … … 1516 1541 it = mBWList.find(k); 1517 1542 if (it == mBWList.end()) return; 1518 PI BaseWdg* wd = (*it).second;1543 PIWdg* wd = (*it).second; 1519 1544 //DBG cerr << "-DBG- PIStdImgApp::DelWRsId Deleting BaseWidget " << (long)(wd) << endl ; 1520 Delete BaseWidget(wd, true, true);1545 DeleteWidget(wd, true, true); 1521 1546 } 1522 1547 else { // C'est un drawer … … 1867 1892 if (mCurWdg) { 1868 1893 int oid = mCurWdg->UserFlag(); 1869 Delete BaseWidget(mCurWdg);1894 DeleteWidget(mCurWdg); 1870 1895 mObjMgr->DelObj_Id(oid); 1871 1896 } … … 1964 1989 if (mStW) { 1965 1990 PIWdg* cw = mStW->CurrentWdg(); 1966 if (cw) Delete BaseWidget((PIBaseWdg*)cw);1991 if (cw) DeleteWidget(cw); 1967 1992 } 1968 1993 break; -
trunk/SophyaPI/PIext/pistdimgapp.h
r2638 r2651 41 41 42 42 typedef map<long, PIWindow*, less<long> > WindMList; 43 typedef map<long, PI BaseWdg*, less<long> > BWMList;43 typedef map<long, PIWdg*, less<long> > BWMList; 44 44 typedef map<long, PIDrawer*, less<long> > DrwMList; 45 45 … … 66 66 // Methodes d'Affichage generique 67 67 int DispImage(P2DArrayAdapter* nouv, string const & name, string const & opt, 68 int oid=0, bool fglock=true);68 bool fgimagnav=false, int oid=0, bool fglock=true); 69 69 int DispScDrawer(PIDrawer* scd, string const & name, string const & opt, 70 70 string title="", int oid=0, bool fglock=true); … … 114 114 115 115 void DeleteWindow(PIWindow* w); 116 void Delete BaseWidget(PIBaseWdg* w, bool dw=true, bool dwin=true);116 void DeleteWidget(PIWdg* w, bool dw=true, bool dwin=true); 117 117 void DelWRsId(int k); 118 118 bool CheckWRsId(int k);
Note:
See TracChangeset
for help on using the changeset viewer.