Changeset 3355 in Sophya
- Timestamp:
- Oct 23, 2007, 12:02:12 AM (18 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/graphexecut.cc
r3296 r3355 463 463 usage = "Define the display rectangle for drawers added as insets \n"; 464 464 usage += " over existing graphic objects - limits expressed as fraction \n"; 465 usage += " graphic object size (0. .. 1.) Xmax at right, YMax top .";465 usage += " graphic object size (0. .. 1.) Xmax at right, YMax top \n "; 466 466 usage += " Usage: setinsetlimits xmin xmax ymin ymax"; 467 467 usage += "\n Related commands: graphicatt /inset"; … … 859 859 usage += "o Most objects can be also be displayed overlayed \n"; 860 860 usage += " on the last displayed widget (gr_att= same) \n"; 861 usage += "o The overlay can be on a selected rectangle of the \n"; 862 usage += " last displayed widget (gr_att= inset) - See setinsetlimits\n"; 861 usage += " or by specifying a widget name samew=Widgetname \n"; 862 usage += "o The widget/window name can be specified (gr_att wname=Name) \n"; 863 usage += "o The overlay can be on a selected rectangle of the last \n"; 864 usage += " displayed widget (gr_att: inset or inset=fxmin,fxmax,fymin,fymax) \n"; 863 865 usage += "\n Related commands: newwin zone stacknext graphicatt setinsetlimits"; 864 866 piac->RegisterHelp(kw, usage, grp); -
trunk/SophyaPI/PIext/nobjmgr.cc
r3269 r3355 1638 1638 1639 1639 /* --Methode-- */ 1640 int NamedObjMgr::NameToOId(string & nom) 1641 { 1642 ZSync zs(*myMutex); zs.NOp(); 1643 return NameToOId_P(nom); 1644 } 1645 1646 /* --Methode-- */ 1647 int NamedObjMgr::NameToOId_P(string & nom) 1648 { 1649 string n1,r1; 1650 ParseObjectName(nom, r1, n1); 1651 nom = '/' + r1 + '/' + n1; 1652 NObjList::iterator it = myObjs->find(nom); 1653 if (it == myObjs->end()) return(-1); 1654 else return((*it).second.oid); 1655 } 1656 1657 1658 /* --Methode-- */ 1640 1659 void NamedObjMgr::AddWRsId(string & nom, int wrsid) 1641 1660 { -
trunk/SophyaPI/PIext/nobjmgr.h
r3269 r3355 100 100 virtual void SetTmpDir(string const& tmpdir); 101 101 102 // Pour convertir un nom d'objet en identificateur d'objet (OId) 103 virtual int NameToOId(string & nom); 104 102 105 // Ajoute un identificateur d'objet widget/drawer/fenetre pour l'objet nom 103 106 // Ces identificateurs servent lors de la destruction de l'objet nom … … 125 128 virtual void SaveObj_P(string & nom, POutPersist& s, bool keeppath=false); 126 129 130 virtual int NameToOId_P(string & nom); 127 131 virtual void AddWRsId_P(string & nom, int wrsid); 128 132 virtual void UpdateObjMgrWindow_P(int did); -
trunk/SophyaPI/PIext/pistdimgapp.cc
r3024 r3355 761 761 } 762 762 763 // <ZThread> global PIApplication event loop synchronisation 764 SyncPIS zs(getMutex(), fglock, 2); 765 763 766 // On decode les options graphiques 764 767 vector<string> opts; 765 DispWinEnum dwopt = ParseDisplayOption(sop, opts); 768 string wname = name; 769 DispWinEnum dwopt = ParseDisplayOption(sop, opts, wname); 766 770 767 771 // Pas de same ou inset pour DispImage 768 772 if ((dwopt == Disp_Same) || (dwopt == Disp_Inset) ) dwopt = Disp_Next; 769 770 // <ZThread> global PIApplication event loop synchronisation771 SyncPIS zs(getMutex(), fglock, 2);772 773 773 774 // Choix de la taille de fenetre … … 778 779 if (sy > 400+mFgScSz*100) sy = 400+mFgScSz*100; 779 780 px = py = 0; 780 win = GetWindow(dwopt, sx, sy, px, py, flag, (char *) name.c_str());781 win = GetWindow(dwopt, sx, sy, px, py, flag, (char *)wname.c_str()); 781 782 if (fgimagnav) { // Creation de naviguateur d'image 782 piin = new PIImageNavigator(win, (char *) name.c_str(), sx, sy, px,py);783 piin = new PIImageNavigator(win, (char *)wname.c_str(), sx, sy, px,py); 783 784 piin->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 784 785 piin->Show(); … … 789 790 } 790 791 else { // Creation de widget PIImage normal 791 pii = new PIImage(win, (char *) name.c_str(), sx, sy, px,py);792 pii = new PIImage(win, (char *)wname.c_str(), sx, sy, px,py); 792 793 pii->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 793 794 pii->SetZoomWin(zoom, false); … … 845 846 } 846 847 848 // <ZThread> global PIApplication event loop synchronisation 849 SyncPIS zs(getMutex(), fglock, 2); 850 847 851 // On decode les options graphiques 848 852 vector<string> opts; 849 DispWinEnum dwopt = ParseDisplayOption(sop, opts); 853 string wname = name; 854 DispWinEnum dwopt = ParseDisplayOption(sop, opts, wname); 850 855 if ( (!mLastWdg) && ( (dwopt == Disp_Same) || (dwopt == Disp_Inset) ) ) dwopt = Disp_Next; 851 852 // <ZThread> global PIApplication event loop synchronisation853 SyncPIS zs(getMutex(), fglock, 2);854 856 855 857 // Trace en superpoistion … … 898 900 sx = 200+mFgScSz*100; 899 901 sy = 200+mFgScSz*100; 900 win = GetWindow(dwopt, sx, sy, px, py, flag, (char *) name.c_str());901 902 scw = new PIScDrawWdg(win, (char *) name.c_str(), sx, sy, px, py);902 win = GetWindow(dwopt, sx, sy, px, py, flag, (char *)wname.c_str()); 903 904 scw = new PIScDrawWdg(win, (char *)wname.c_str(), sx, sy, px, py); 903 905 scw->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 904 906 scw->SetUserData(NULL, oid); … … 923 925 // Titre du plot 924 926 if (mAddTitle) { 925 if (title.length() <= 0) title = name; string t2="";927 if (title.length() <= 0) title = wname; string t2=""; 926 928 scw->SetTitles(title, t2); 927 929 } … … 948 950 } 949 951 952 // <ZThread> global PIApplication event loop synchronisation 953 SyncPIS zs(getMutex(), fglock, 2); 954 950 955 // On decode les options graphiques 951 956 vector<string> opts; 952 DispWinEnum dwopt = ParseDisplayOption(sop, opts); 957 string wname = name; 958 DispWinEnum dwopt = ParseDisplayOption(sop, opts, wname); 953 959 954 960 if ( (!mLastWdg) && ( (dwopt == Disp_Same) || (dwopt == Disp_Inset) ) ) dwopt = Disp_Next; 955 956 // <ZThread> global PIApplication event loop synchronisation957 SyncPIS zs(getMutex(), fglock, 2);958 961 959 962 // Trace en superpoistion … … 1002 1005 sx = 200+mFgScSz*100; 1003 1006 sy = 200+mFgScSz*100; 1004 win = GetWindow(dwopt, sx, sy, px, py, flag, (char *) name.c_str());1005 PIDraw3DWdg* wd3 = new PIDraw3DWdg(win, (char *) name.c_str(), sx, sy, px, py);1007 win = GetWindow(dwopt, sx, sy, px, py, flag, (char *)wname.c_str()); 1008 PIDraw3DWdg* wd3 = new PIDraw3DWdg(win, (char *)wname.c_str(), sx, sy, px, py); 1006 1009 wd3->SetBinding(PIBK_elastic, PIBK_elastic, PIBK_elastic, PIBK_elastic); 1007 1010 wd3->SetUserData(NULL, oid); … … 1026 1029 // Titre du plot 1027 1030 if (mAddTitle) { 1028 if (title.length() <= 0) title = name; string t2="";1031 if (title.length() <= 0) title = wname; string t2=""; 1029 1032 wd3->SetTitles(title, t2); 1030 1033 } … … 1493 1496 { 1494 1497 if (mStW) mStW->DispNext(); 1498 } 1499 1500 /* --Methode-- */ 1501 void PIStdImgApp::SelectLastWidget(string & nom) 1502 { 1503 1504 if ( (mLastWdg != NULL) && (mLastWdg->Nom() == nom) ) return; 1505 if ( (mCurWdg != NULL) && (mCurWdg->Nom() == nom) ) { 1506 mLastWdg = mCurWdg; 1507 return; 1508 } 1509 1510 PIWdg* bw = NULL; 1511 long wsid = -1; 1512 BWMList::iterator it; 1513 for(it = mBWList.begin(); it != mBWList.end(); it++) { 1514 if ( ((*it).second->Nom() == nom) && ((*it).first > wsid)) { 1515 bw = (*it).second; wsid = (*it).first; 1516 } 1517 } 1518 if (bw != NULL) { 1519 if (bw->kind() == PIImageNavigator::ClassId) 1520 mLastWdg = dynamic_cast<PIImageNavigator *>(bw)->ImageWdg(); 1521 else mLastWdg = dynamic_cast<PIBaseWdg *>(bw); 1522 } 1523 return; 1524 } 1525 1526 /* --Methode-- */ 1527 void PIStdImgApp::SelectLastWidgetByObjName(string & nom) 1528 { 1529 int oid = ObjMgr()->NameToOId(nom); 1530 if (oid < 0) return; 1531 1532 if ( (mLastWdg != NULL) && (mLastWdg->UserFlag() == oid) ) return; 1533 if ( (mCurWdg != NULL) && (mCurWdg->UserFlag() == oid) ) { 1534 mLastWdg = mCurWdg; 1535 return; 1536 } 1537 1538 PIWdg* bw = NULL; 1539 long wsid = -1; 1540 BWMList::iterator it; 1541 for(it = mBWList.begin(); it != mBWList.end(); it++) { 1542 if ( ((*it).second->UserFlag() == oid) && ((*it).first > wsid)) { 1543 bw = (*it).second; wsid = (*it).first; 1544 } 1545 } 1546 if (bw != NULL) { 1547 if (bw->kind() == PIImageNavigator::ClassId) 1548 mLastWdg = dynamic_cast<PIImageNavigator *>(bw)->ImageWdg(); 1549 else mLastWdg = dynamic_cast<PIBaseWdg *>(bw); 1550 } 1551 return; 1495 1552 } 1496 1553 … … 1749 1806 1750 1807 /* --Methode-- */ 1751 DispWinEnum PIStdImgApp::ParseDisplayOption(string const & sop, vector<string>& opts )1808 DispWinEnum PIStdImgApp::ParseDisplayOption(string const & sop, vector<string>& opts, string& wname) 1752 1809 { 1753 1810 DispWinEnum rc = Disp_Next; … … 1774 1831 else if (token == "same") rc = Disp_Same; 1775 1832 else if (token == "inset") rc = Disp_Inset; 1776 else if (token == "stack") rc = Disp_Stack; 1777 else if (token == "next") rc = Disp_Next; 1833 else if (token == "stack") rc = Disp_Stack; 1834 else if (token == "next") rc = Disp_Next; 1835 else if (token.substr(0,6)=="samew=") { 1836 string snom=token.substr(6); 1837 SelectLastWidget(snom); 1838 rc = Disp_Same; 1839 } 1840 else if (token.substr(0,6)=="inset=") { 1841 double fx1,fx2,fy1,fy2; 1842 fx1=fy1=0.4; fx2=fy2=0.6; 1843 sscanf(token.substr(6).c_str(),"%lg,%lg,%lg,%lg",&fx1,&fx2,&fy1,&fy2); 1844 SetInsetLimits(fx1, fx2, fy1, fy2); 1845 rc = Disp_Inset; 1846 } 1847 else if (token.substr(0,6)=="wname=") { // specification de nom de widget 1848 wname=token.substr(6); 1849 } 1778 1850 // Option a etre decode par les drawers, etc ... 1779 1851 else opts.push_back(token); -
trunk/SophyaPI/PIext/pistdimgapp.h
r2944 r3355 114 114 void StackWinNext(); 115 115 116 // Pour specifier le widget pour le trace en superpose, en specifiant un nom de widget 117 void SelectLastWidget(string & nom); 118 // Pour specifier le widget pour le trace en superpose, en specifiant un nom d'objet 119 void SelectLastWidgetByObjName(string & nom); 120 116 121 void DeleteWindow(PIWindow* w); 117 122 void DeleteWidget(PIWdg* w, bool dw=true, bool dwin=true); … … 156 161 void SetDefaultGraphicAttributes(string const & opt); 157 162 void SetDefaultAxesAttributes(string const & opt); 158 DispWinEnum ParseDisplayOption(string const & opt, vector<string>& opts); 163 DispWinEnum ParseDisplayOption(string const & opt, vector<string>& opts, string& wname); 164 inline DispWinEnum ParseDisplayOption(string const & opt, vector<string>& opts) 165 { 166 string wname; 167 return ParseDisplayOption(opt, opts, wname); 168 } 159 169 160 170 // Gestion fichiers PS
Note:
See TracChangeset
for help on using the changeset viewer.