Changeset 2165 in Sophya
- Timestamp:
- Aug 7, 2002, 5:00:49 PM (23 years ago)
- Location:
- trunk/SophyaPI/PIext
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIext/basexecut.cc
r2158 r2165 128 128 129 129 130 else if ( kw == "settitle") {131 if (tokens.size() < 1) { cout << "Usage: settitle TopTitle [BotTitle] [fontatt]" << endl; return(0); }130 else if ((kw == "settitle") || (kw == "addtitle")) { 131 if (tokens.size() < 1) { cout << "Usage: settitle/addtitle TopTitle [BotTitle] [fontatt]" << endl; return(0); } 132 132 if(tokens.size()<2) tokens.push_back(""); 133 mImgApp->SetTitle(tokens[0], tokens[1]); 133 string gropt; 134 if(tokens.size()>2) gropt = tokens[2]; 135 mImgApp->SetTitle(tokens[0], tokens[1], gropt); 136 } 137 138 else if ((kw == "setaxelabels") || (kw == "addaxelabels")) { 139 if (tokens.size() < 2) { cout << "Usage: setaxelabels/addaxelabels xLabel yLabel [fontatt]" << endl; return(0); } 140 string gropt; 141 if(tokens.size()>2) gropt = tokens[2]; 142 mImgApp->SetAxeLabels(tokens[0], tokens[1], gropt); 134 143 } 135 144 … … 879 888 usage += "\n Usage: settitle TopTitle [BottomTitle] [fontAtt]"; 880 889 usage += "\n Related commands: addtext graphicatt"; 890 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 891 892 kw = "addtitle"; 893 usage = "Set the title string (top title / bottom title) \n"; 894 usage += " alias for settitle "; 895 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 896 897 kw = "setaxelabels"; 898 usage = "Set the X and Y axis labels for the current 2D graphic object \n"; 899 usage += "\n Usage: setaxelabels xLabel yLabel [ColorFntAtt]"; 900 usage += "\n Related commands: settitle addtext graphicatt"; 901 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 902 903 kw = "addaxelabels"; 904 usage = "Set the X and Y axis labels for the current 2D graphic object"; 905 usage += " alias for setaxelabels "; 881 906 mpiac->RegisterCommand(kw, usage, this, "Graphics"); 882 907 -
trunk/SophyaPI/PIext/pintup3d.cc
r2092 r2165 148 148 (xmin+xmax)/2.+D , (ymin+ymax)/2.-2.5*D , zmin+(zmax-zmin)*0.85, 0.25, 0.25); 149 149 150 /* 150 151 x3Min = xmin; // - PERC_GARDE*(xmax-xmin); 151 152 x3Max = xmax; // + PERC_GARDE*(xmax-xmin); … … 154 155 z3Min = zmin; // - PERC_GARDE*(zmax-zmin); 155 156 z3Max = zmax; // + PERC_GARDE*(zmax-zmin); 157 */ 158 159 Set3DBox(xmin, xmax, ymin, ymax, zmin, zmax); 156 160 157 161 // printf("PINTuple3D::UpdateLimits() : %g .. %g %g .. %g %g .. %g (%g) \n", xmin,xmax,ymin,ymax,zmin,zmax,D); -
trunk/SophyaPI/PIext/pistdimgapp.cc
r2158 r2165 777 777 void PIStdImgApp::AddText(string const & txt, double xp, double yp, string const& sop) 778 778 { 779 PI ElDrawer *eld=CurrentElDrawer();779 PIDrawer *eld=CurrentElDrawer(); 780 780 if (eld == NULL) return; 781 PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld); 782 PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld); 783 if ((eld2 == NULL) && (eld3 == NULL)) return; 784 PIElDrwMgr* elmgr; 785 if (eld2) elmgr = &(eld2->ElDrwMgr()); 786 else if (eld3) elmgr = &(eld3->ElDrwMgr()); 787 if (elmgr == NULL) return; 781 788 782 789 vector<string> opts; 783 790 ParseDisplayOption(sop, opts); 784 791 PIGraphicAtt gratt(opts); 785 el d->ElAddText(xp,yp,txt.c_str(), gratt.GetColor());792 elmgr->ElAddText(xp,yp,txt.c_str(), gratt); 786 793 eld->Refresh(); 787 794 } … … 790 797 void PIStdImgApp::AddLine(double xp1, double yp1, double xp2, double yp2, string const& sop) 791 798 { 792 PI ElDrawer *eld=CurrentElDrawer();799 PIDrawer *eld=CurrentElDrawer(); 793 800 if (eld == NULL) return; 801 PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld); 802 PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld); 803 if ((eld2 == NULL) && (eld3 == NULL)) return; 804 PIElDrwMgr* elmgr = NULL; 805 if (eld2) elmgr = &(eld2->ElDrwMgr()); 806 else if (eld3) elmgr = &(eld3->ElDrwMgr()); 807 if (elmgr == NULL) return; 794 808 795 809 vector<string> opts; 796 810 ParseDisplayOption(sop, opts); 797 811 PIGraphicAtt gratt(opts); 798 el d->ElAddLine(xp1, yp1, xp2, yp2, gratt.GetColor());812 elmgr->ElAddLine(xp1, yp1, xp2, yp2, gratt); 799 813 eld->Refresh(); 800 814 } … … 804 818 string const& sop, bool fgfill) 805 819 { 806 PI ElDrawer *eld=CurrentElDrawer();820 PIDrawer *eld=CurrentElDrawer(); 807 821 if (eld == NULL) return; 822 PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld); 823 PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld); 824 if ((eld2 == NULL) && (eld3 == NULL)) return; 825 PIElDrwMgr* elmgr = NULL; 826 if (eld2) elmgr = &(eld2->ElDrwMgr()); 827 else if (eld3) elmgr = &(eld3->ElDrwMgr()); 808 828 809 829 double xp,yp; … … 826 846 PIGraphicAtt gratt(opts); 827 847 828 if (fgfill) el d->ElAddFRect(xp, yp, dx, dy, gratt.GetColor());829 else el d->ElAddRect(xp, yp, dx, dy, gratt.GetColor());848 if (fgfill) elmgr->ElAddFRect(xp, yp, dx, dy, gratt); 849 else elmgr->ElAddRect(xp, yp, dx, dy, gratt); 830 850 eld->Refresh(); 831 851 } … … 834 854 void PIStdImgApp::AddCircle(double xc, double yc, double r, string const& sop, bool fgfill) 835 855 { 836 PI ElDrawer *eld=CurrentElDrawer();856 PIDrawer *eld=CurrentElDrawer(); 837 857 if (eld == NULL) return; 858 PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld); 859 PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld); 860 if ((eld2 == NULL) && (eld3 == NULL)) return; 861 PIElDrwMgr* elmgr = NULL; 862 if (eld2) elmgr = &(eld2->ElDrwMgr()); 863 else if (eld3) elmgr = &(eld3->ElDrwMgr()); 838 864 839 865 vector<string> opts; … … 841 867 PIGraphicAtt gratt(opts); 842 868 843 if (fgfill) el d->ElAddFCirc(xc, yc, r, gratt.GetColor());844 else el d->ElAddCirc(xc, yc, r, gratt.GetColor());869 if (fgfill) elmgr->ElAddFCirc(xc, yc, r, gratt); 870 else elmgr->ElAddCirc(xc, yc, r, gratt); 845 871 eld->Refresh(); 846 872 } 847 873 848 874 /* --Methode-- */ 849 void PIStdImgApp::SetTitle(string const & titletop, string const & titlebottom )850 { 851 PI ElDrawer *eld=CurrentElDrawer();875 void PIStdImgApp::SetTitle(string const & titletop, string const & titlebottom, string const& sop) 876 { 877 PIDrawer *eld=CurrentElDrawer(); 852 878 if (eld == NULL) return; 853 854 eld->SetTitles(titletop, titlebottom); 879 PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld); 880 PIElDrawer3D* eld3 = dynamic_cast<PIElDrawer3D *>(eld); 881 if ((eld2 == NULL) && (eld3 == NULL)) return; 882 883 vector<string> opts; 884 ParseDisplayOption(sop, opts); 885 PIGraphicAtt gratt(opts); 886 887 if (eld2) { 888 eld2->SetTitles(titletop, titlebottom, gratt); 889 eld2->ShowTitles(true); 890 } 891 else if (eld3) { 892 eld3->SetTitles(titletop, titlebottom, gratt); 893 eld3->ShowTitles(true); 894 } 855 895 eld->Refresh(); 856 896 } 857 858 /* --Methode-- */ 859 PIElDrawer* PIStdImgApp::CurrentElDrawer() 860 { 861 PIElDrawer *eld=NULL; 897 /* --Methode-- */ 898 void PIStdImgApp::SetAxeLabels(string const & xLabel, string const & yLabel, string const& sop) 899 { 900 PIDrawer *eld=CurrentElDrawer(); 901 if (eld == NULL) return; 902 PIElDrawer* eld2 = dynamic_cast<PIElDrawer *>(eld); 903 if (eld2 == NULL) return; 904 905 vector<string> opts; 906 ParseDisplayOption(sop, opts); 907 PIGraphicAtt gratt(opts); 908 909 eld2->SetAxesLabels(xLabel, yLabel, gratt); 910 eld2->ShowAxesLabels(true); 911 912 eld->Refresh(); 913 } 914 915 /* --Methode-- */ 916 PIDrawer* PIStdImgApp::CurrentElDrawer() 917 { 918 PIDrawer *eld=NULL; 862 919 if (!mLastWdg) return(eld); 863 920 PIScDrawWdg* sdw=NULL; -
trunk/SophyaPI/PIext/pistdimgapp.h
r2141 r2165 69 69 70 70 // Fonction Ajout de titre de trace 71 void SetTitle(string const & titleup, string const & titledown); 71 void SetTitle(string const & titleup, string const & titledown, string const& opt); 72 // Fonction d'Ajout label d'axe X,Y 73 void SetAxeLabels(string const & xLabel, string const & yLabel, string const& opt); 72 74 73 75 // Acces au BaseDrawer (PIElDrawer) du PIBaseWdg courant 74 PI ElDrawer* CurrentElDrawer();76 PIDrawer* CurrentElDrawer(); 75 77 76 78 void CreateGraphWin(int nx=1, int ny=1, int sx=0, int sy = 0);
Note:
See TracChangeset
for help on using the changeset viewer.