Changeset 3342 in Sophya
- Timestamp:
- Oct 8, 2007, 9:46:38 AM (18 years ago)
- Location:
- trunk/SophyaPI/PIGcont
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaPI/PIGcont/pigncont.cc
r2615 r3342 430 430 //-- 431 431 GNUPlotContour::~GNUPlotContour(){ 432 cout << " destructeur de GNUPlotContour "<<endl;432 //cout << " destructeur de GNUPlotContour "<<endl; 433 433 434 434 struct iso_curve *iso_cur; … … 516 516 517 517 if(_contours) { 518 cout << " GNUPlotContour::CalcContour(): destruction des contours "<<_contours<<endl;518 //cout << " GNUPlotContour::CalcContour(): destruction des contours "<<_contours<<endl; 519 519 struct gnuplot_contours *cntcur = _contours; 520 520 /****** 521 521 struct gnuplot_contours *cntold; 522 522 while(cntcur) { 523 cout << " GNUPlotContour::CalcContour(): destruction des contours "<< cntcur<<endl;523 //cout << " GNUPlotContour::CalcContour(): destruction des contours "<< cntcur<<endl; 524 524 cntold = cntcur; 525 525 cntcur = cntold->next; … … 804 804 805 805 /* --Methode-- */ 806 bool PIContourDrawer::IsLabelOn(){ 806 bool PIContourDrawer::IsLabelOn() const 807 { 807 808 return (mLabelOn); 808 809 } 809 810 810 bool PIContourDrawer::IsLineOn(){ 811 bool PIContourDrawer::IsLineOn() const 812 { 811 813 return (mLineOn); 812 814 } 813 815 814 bool PIContourDrawer::IsMarkOn(){ 816 bool PIContourDrawer::IsMarkOn() const 817 { 815 818 return (mMarkOn); 816 819 } 817 820 818 void PIContourDrawer::SetLabelOn(bool state){ 821 void PIContourDrawer::SetLabelOn(bool state) 822 { 819 823 mLabelOn = state; 820 824 } … … 843 847 844 848 845 cout << " PIDrawer::DecodeOptionString : ndec = "<< ndec <<endl;849 // cout << " PIDrawer::DecodeOptionString : ndec = "<< ndec <<endl; 846 850 // On appelle d'abord le decodage de la classe PIDrawer de laquelle 847 851 // on herite. (Pas obligatoire) on decode donc ici les attributs de 848 852 // couleur, fontes ... 849 853 int ndec1 = PIDrawer::DecodeOptionString(opt, rmdecopt); 850 cout << " PIDrawer::DecodeOptionString apres PIDrawer::DecodeOptionString : ndec = "851 << ndec1 <<"<>" << ndec <<endl;854 //cout << " PIDrawer::DecodeOptionString apres PIDrawer::DecodeOptionString : ndec = " 855 // << ndec1 <<"<>" << ndec <<endl; 852 856 if( ndec - ndec1 < 1 ) return(ndec1); // si tout a ete decode 853 857 … … 862 866 // options avec = 863 867 string deb = sopt.substr(0,sopt.find_first_of("=")); 864 cout << " option avec = : "<<deb<<" "<<sopt<<endl;868 // cout << " option avec = : "<<deb<<" "<<sopt<<endl; 865 869 if( (deb =="ncont") || (deb =="nc") ){ // # de contours 866 870 string fin = sopt.substr(sopt.find_first_of("=")+1 , string::npos); 867 cout <<" fin "<<fin<<endl;871 // cout <<" fin "<<fin<<endl; 868 872 int nlev = atoi(fin.c_str()); 869 873 this->SetNLevel(nlev); … … 887 891 } 888 892 int nlev = ztmp.size(); 889 cout << " PICOntourDrawer::DecodeOptionString "<<nlev<<" niveaux decodes "<<endl;893 // cout << " PICOntourDrawer::DecodeOptionString "<<nlev<<" niveaux decodes "<<endl; 890 894 this->SetCntLevelKind(LEVELS_DISCRETE); 891 895 this->SetNLevel(nlev); … … 929 933 if( sopt == "labon" ) 930 934 this->SetLabelOn(); 935 else if ( sopt == "laboff" ) 936 this->SetLabelOn(false); 937 else if ( sopt == "autolevels" ) 938 this->SetCntLevelKind(LEVELS_AUTO); 939 else if (sopt == "linear" ){ 940 this->SetCntKind(CONTOUR_KIND_BSPLINE); 941 recalc = 1; 942 } 931 943 else if (sopt == "bspline" ){ 932 944 this->SetCntKind(CONTOUR_KIND_BSPLINE); 933 945 recalc = 1; 934 }else if ( sopt == "3spl" ){946 }else if ((sopt == "3spl" )||(sopt == "cubicspl")) { 935 947 this->SetCntKind(CONTOUR_KIND_CUBIC_SPL); 936 948 recalc = 1; … … 963 975 } 964 976 965 966 977 // Methode ajoute en Oct 2007 - Reza 978 int PIContourDrawer::OptionToString(vector<string> & opt) const 979 { 980 PIDrawer::OptionToString(opt); 981 982 if (GetCntKind()==CONTOUR_KIND_LINEAR) opt.push_back("linear"); 983 else if (GetCntKind()==CONTOUR_KIND_BSPLINE) opt.push_back("bspline"); 984 else if (GetCntKind()==CONTOUR_KIND_CUBIC_SPL) opt.push_back("cubicspl"); 985 986 if (IsLabelOn()) opt.push_back("labon"); 987 else opt.push_back("laboff"); 988 989 return 1; 990 } 991 992 void PIContourDrawer::GetOptionsHelpInfo(string& info) 993 { 994 info += " ---- PIContourDrawer options help info : \n" ; 995 info += " autolevels : automatic selection of levels and number of contours \n"; 996 info += " ncont=nLevel (or nc=NLevel) : sets the number of contour\n"; 997 info += " lev=v1,v2,v3... (or niv=v1,v2,v3...) set the number and levels of contours\n"; 998 info += " lstep=nLev,start,step : define incremental levels \n"; 999 info += " labon/laboff : display of contour level values on/off \n"; 1000 info += " linear/bspline/cubicspl=3spl : select contour kind \n"; 1001 // On recupere ensuite la chaine info de la classe de base 1002 PIDrawer::GetOptionsHelpInfo(info); 1003 return; 1004 } 1005 1006 1007 1008 -
trunk/SophyaPI/PIGcont/pigncont.h
r2250 r3342 33 33 int NContours(){return _npolys;}; 34 34 void SetCntLevelKind(t_contour_levels_kind kind){Contour_Levels_kind = kind;}; 35 t_contour_levels_kind GetCntLevelKind() {return Contour_Levels_kind ;};35 t_contour_levels_kind GetCntLevelKind() const {return Contour_Levels_kind ;}; 36 36 void SetCntKind(t_contour_kind kind){Contour_kind = kind;}; 37 t_contour_kind GetCntKind() {return Contour_kind ;};37 t_contour_kind GetCntKind() const {return Contour_kind ;}; 38 38 39 39 … … 75 75 virtual void Draw(PIGraphicUC* g, double xmin, double ymin, double xmax, double ymax); 76 76 virtual void UpdateLimits(); 77 virtual bool IsLineOn() ;78 virtual bool IsMarkOn() ;79 virtual bool IsLabelOn() ;77 virtual bool IsLineOn() const; 78 virtual bool IsMarkOn() const; 79 virtual bool IsLabelOn() const; 80 80 virtual void SetLineOn(bool b=true); 81 81 virtual void SetMarkOn(bool b=true); … … 92 92 virtual void DeactivateControlWindow(PIBaseWdgGen* wdg); 93 93 // Methode permettant de decoder des options a partir de chaines 94 int DecodeOptionString(vector<string> & opt, bool rmdecopt=true); 94 virtual int DecodeOptionString(vector<string> & opt, bool rmdecopt=true); 95 virtual int OptionToString(vector<string> & opt) const; 96 // Texte d'aide des options disponibles 97 virtual void GetOptionsHelpInfo(string& info); 95 98 96 99
Note:
See TracChangeset
for help on using the changeset viewer.