Changeset 2263 in Sophya for trunk/SophyaPI/PIext/pistdimgapp.cc
- Timestamp:
- Nov 14, 2002, 8:12:02 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/pistdimgapp.cc
r2259 r2263 19 19 20 20 #include "pistdimgapp.h" 21 #include "servnobjm.h" 21 22 // #include "pihisto2d.h" 22 23 #include "psfile.h" … … 95 96 m[0]->AppendItem("Open-Fits", 10120); 96 97 m[0]->AppendItem("Open-PPF", 10130); 98 #ifndef SANS_EVOLPLANCK 99 m[0]->AppendItem("Open-ASCII", 10140); 100 #endif 97 101 // m[0]->AppendItem("Options", 10101); 98 102 m[0]->AppendItem("Help", 10100); … … 251 255 pfc_fits = new PIFileChooser(this,"FITS-FileChooser", 10125); 252 256 pfc_ppf = new PIFileChooser(this,"PPF-FileChooser", 10135); 257 pfc_ascii = new PIFileChooser(this,"ASCII-FileChooser", 10145); 253 258 pfc_ps = new PIFileChooser(this,"PS-FileChooser", 10525); 254 259 … … 345 350 delete pfc_fits; 346 351 delete pfc_ppf; 352 delete pfc_ascii; 347 353 delete pfc_ps; 348 354 … … 796 802 797 803 /* --Methode-- */ 798 void PIStdImgApp::AddText(string const & txt, double xp, double yp, string const& sop )804 void PIStdImgApp::AddText(string const & txt, double xp, double yp, string const& sop, bool fgcn) 799 805 { 800 806 PIDrawer *eld=CurrentElDrawer(); … … 813 819 unsigned long tpd = 0; 814 820 gratt.DecodeTextPosDirAtt(opts, tpd, false); 815 elmgr->ElAddText(xp,yp,txt.c_str(), gratt, tpd );821 elmgr->ElAddText(xp,yp,txt.c_str(), gratt, tpd, fgcn); 816 822 eld->Refresh(); 817 823 } 818 824 819 825 /* --Methode-- */ 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-- */ 820 852 void PIStdImgApp::AddLine(double xp1, double yp1, double xp2, double yp2, 821 string const& sop, bool fgarrow )853 string const& sop, bool fgarrow, bool fgcn) 822 854 { 823 855 PIDrawer *eld=CurrentElDrawer(); … … 835 867 PIGraphicAtt gratt(opts); 836 868 if (fgarrow) 837 elmgr->ElAddArrow(xp1, yp1, xp2, yp2, gratt );838 else elmgr->ElAddLine(xp1, yp1, xp2, yp2, gratt );869 elmgr->ElAddArrow(xp1, yp1, xp2, yp2, gratt, fgcn); 870 else elmgr->ElAddLine(xp1, yp1, xp2, yp2, gratt, fgcn); 839 871 eld->Refresh(); 840 872 } … … 842 874 /* --Methode-- */ 843 875 void PIStdImgApp::AddRectangle(double xp1, double yp1, double xp2, double yp2, 844 string const& sop, bool fgfill )876 string const& sop, bool fgfill, bool fgcn) 845 877 { 846 878 PIDrawer *eld=CurrentElDrawer(); … … 872 904 PIGraphicAtt gratt(opts); 873 905 874 if (fgfill) elmgr->ElAddFRect(xp, yp, dx, dy, gratt );875 else elmgr->ElAddRect(xp, yp, dx, dy, gratt );906 if (fgfill) elmgr->ElAddFRect(xp, yp, dx, dy, gratt, fgcn); 907 else elmgr->ElAddRect(xp, yp, dx, dy, gratt, fgcn); 876 908 eld->Refresh(); 877 909 } 878 910 879 911 /* --Methode-- */ 880 void PIStdImgApp::AddCircle(double xc, double yc, double r, string const& sop, bool fgfill) 912 void PIStdImgApp::AddCircle(double xc, double yc, double r, string const& sop, 913 bool fgfill, bool fgcn) 881 914 { 882 915 PIDrawer *eld=CurrentElDrawer(); … … 895 928 elmgr->ElAddMarker(xc, yc, gratt); 896 929 else { 897 if (fgfill) elmgr->ElAddFCirc(xc, yc, r, gratt );898 else elmgr->ElAddCirc(xc, yc, r, gratt );930 if (fgfill) elmgr->ElAddFCirc(xc, yc, r, gratt, fgcn); 931 else elmgr->ElAddCirc(xc, yc, r, gratt, fgcn); 899 932 } 900 933 eld->Refresh(); … … 903 936 /* --Methode-- */ 904 937 void PIStdImgApp::AddArc(double x1, double y1, double x2, double y2, 905 double x3, double y3, string const& sop, bool fgfill )938 double x3, double y3, string const& sop, bool fgfill, bool fgcn) 906 939 { 907 940 PIDrawer *eld=CurrentElDrawer(); … … 919 952 PIGraphicAtt gratt(opts); 920 953 if (fgfill) 921 elmgr->ElAddFArc(x1, y1, x2, y2, x3, y3, gratt );922 else elmgr->ElAddArc(x1, y1, x2, y2, x3, y3, gratt );954 elmgr->ElAddFArc(x1, y1, x2, y2, x3, y3, gratt, fgcn); 955 else elmgr->ElAddArc(x1, y1, x2, y2, x3, y3, gratt, fgcn); 923 956 eld->Refresh(); 924 957 } 958 959 /* --Methode-- */ 960 void PIStdImgApp::AddPoly(vector<double>& xpol, vector<double>& ypol, 961 string const& sop, bool fgfill, bool fgcn) 962 { 963 PIDrawer *eld=CurrentElDrawer(); 964 if (eld == NULL) return; 965 PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld); 966 PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld); 967 if ((eld2 == NULL) && (eld3 == NULL)) return; 968 PIElDrwMgr* elmgr = NULL; 969 if (eld2) elmgr = &(eld2->ElDrwMgr()); 970 else if (eld3) elmgr = &(eld3->ElDrwMgr()); 971 if (elmgr == NULL) return; 972 973 vector<string> opts; 974 ParseDisplayOption(sop, opts); 975 PIGraphicAtt gratt(opts); 976 if (fgfill) 977 elmgr->ElAddFPoly(xpol, ypol, gratt, fgcn); 978 else elmgr->ElAddPoly(xpol, ypol, gratt, fgcn); 979 eld->Refresh(); 980 981 } 982 925 983 926 984 /* --Methode-- */ … … 1426 1484 break; 1427 1485 1486 #ifndef SANS_EVOLPLANCK 1487 case 10140 : 1488 pfc_ascii->AcceptNewFile(false); 1489 mFCMsg = 10145; 1490 pfc_ascii->SetMsg(mFCMsg); 1491 SetBlocked(); 1492 pfc_ascii->Show(); 1493 break; 1494 1495 case 10145 : 1496 SetBusy(); 1497 if (data) { 1498 string afname = pfc_ascii->GetFileName(); 1499 string nomobj = ObjMgr()->GetServiceObj()->FileName2Name(afname); 1500 string cmd = "mtxfrascii "; 1501 cmd += nomobj; cmd += " "; cmd += afname; 1502 try { 1503 mCmd->Interpret(cmd); 1504 } 1505 catch ( PThrowable & exc ) { 1506 cerr << "\n PIStdImgApp::Process()/ Cmd->Interpret() Exception :" 1507 << (string)typeid(exc).name() << " Msg= " 1508 << exc.Msg() << endl; 1509 cout << endl; 1510 } 1511 catch ( ... ) { 1512 cerr << "\n PIStdImgApp::Process()/ Cmd->Interpret() Catched Exception ... " << endl; 1513 cout << endl; 1514 } 1515 1516 } 1517 mFCMsg = 0; 1518 SetReady(); 1519 break; 1520 #endif 1521 1428 1522 case 10105: 1429 1523 Stop();
Note:
See TracChangeset
for help on using the changeset viewer.