comparison libinterp/corefcn/graphics.in.h @ 19631:db92e7e28e1f

strip trailing whitespace from most source files * NEWS, doc/interpreter/contributors.in, doc/interpreter/func.txi, doc/interpreter/genpropdoc.m, doc/interpreter/octave_logo.eps, doc/interpreter/plot.txi, doc/interpreter/stmt.txi, examples/data/Makefile.am, libinterp/corefcn/data.cc, libinterp/corefcn/debug.cc, libinterp/corefcn/error.cc, libinterp/corefcn/file-io.cc, libinterp/corefcn/gl-render.cc, libinterp/corefcn/graphics.cc, libinterp/corefcn/graphics.in.h, libinterp/corefcn/load-path.cc, libinterp/corefcn/pr-output.cc, libinterp/corefcn/pt-jit.cc, libinterp/corefcn/strfind.cc, libinterp/corefcn/toplev.cc, libinterp/corefcn/toplev.h, libinterp/corefcn/urlwrite.cc, libinterp/corefcn/variables.cc, libinterp/octave-value/ov-classdef.cc, libinterp/octave-value/ov-classdef.h, libinterp/octave.cc, libinterp/parse-tree/lex.h, libinterp/parse-tree/oct-parse.in.yy, libinterp/parse-tree/pt-classdef.h, liboctave/system/file-ops.cc, liboctave/system/oct-env.cc, m4/acinclude.m4, scripts/deprecated/finite.m, scripts/deprecated/fmod.m, scripts/deprecated/fnmatch.m, scripts/deprecated/luinc.m, scripts/deprecated/octave_tmp_file_name.m, scripts/deprecated/syl.m, scripts/deprecated/usage.m, scripts/general/inputParser.m, scripts/general/interp1.m, scripts/general/interp2.m, scripts/general/interp3.m, scripts/general/isequal.m, scripts/general/private/__isequal__.m, scripts/geometry/voronoi.m, scripts/image/image.m, scripts/image/imshow.m, scripts/image/ind2rgb.m, scripts/linear-algebra/bandwidth.m, scripts/linear-algebra/isbanded.m, scripts/miscellaneous/bzip2.m, scripts/miscellaneous/cast.m, scripts/miscellaneous/copyfile.m, scripts/miscellaneous/delete.m, scripts/miscellaneous/fullfile.m, scripts/miscellaneous/getappdata.m, scripts/miscellaneous/gunzip.m, scripts/miscellaneous/isappdata.m, scripts/miscellaneous/ls.m, scripts/miscellaneous/mex.m, scripts/miscellaneous/movefile.m, scripts/miscellaneous/orderfields.m, scripts/miscellaneous/recycle.m, scripts/miscellaneous/rmappdata.m, scripts/miscellaneous/setfield.m, scripts/miscellaneous/symvar.m, scripts/miscellaneous/tar.m, scripts/miscellaneous/tmpnam.m, scripts/miscellaneous/unpack.m, scripts/miscellaneous/ver.m, scripts/miscellaneous/what.m, scripts/miscellaneous/xor.m, scripts/miscellaneous/zip.m, scripts/optimization/fminbnd.m, scripts/optimization/sqp.m, scripts/path/private/getsavepath.m, scripts/path/savepath.m, scripts/pkg/pkg.m, scripts/pkg/private/installed_packages.m, scripts/plot/draw/plotyy.m, scripts/plot/draw/polar.m, scripts/plot/draw/private/__quiver__.m, scripts/plot/draw/private/__scatter__.m, scripts/plot/draw/private/__stem__.m, scripts/plot/draw/surface.m, scripts/plot/draw/surfnorm.m, scripts/plot/util/copyobj.m, scripts/plot/util/hgload.m, scripts/plot/util/hgsave.m, scripts/plot/util/isprop.m, scripts/plot/util/linkprop.m, scripts/plot/util/private/__go_draw_axes__.m, scripts/set/setdiff.m, scripts/set/union.m, scripts/signal/periodogram.m, scripts/sparse/eigs.m, scripts/sparse/ilu.m, scripts/sparse/qmr.m, scripts/sparse/sprand.m, scripts/sparse/sprandn.m, scripts/specfun/beta.m, scripts/specfun/ellipke.m, scripts/specfun/isprime.m, scripts/statistics/base/lscov.m, scripts/testfun/__run_test_suite__.m, scripts/testfun/test.m: Strip trailing whitespace.
author John W. Eaton <jwe@octave.org>
date Tue, 20 Jan 2015 10:29:54 -0500
parents 0e1f5a750d00
children 5b4fd7ebcfc6
comparison
equal deleted inserted replaced
19630:0e1f5a750d00 19631:db92e7e28e1f
1995 { 1995 {
1996 public: 1996 public:
1997 const_iterator find (const std::string pname) const 1997 const_iterator find (const std::string pname) const
1998 { 1998 {
1999 const_iterator it; 1999 const_iterator it;
2000 2000
2001 for (it = (*this).begin (); it != (*this).end (); it++) 2001 for (it = (*this).begin (); it != (*this).end (); it++)
2002 if (pname.compare ((*it).first) == 0) 2002 if (pname.compare ((*it).first) == 0)
2003 return it; 2003 return it;
2004 2004
2005 return (*this).end (); 2005 return (*this).end ();
2006 } 2006 }
2007 2007
2008 iterator find (const std::string pname) 2008 iterator find (const std::string pname)
2009 { 2009 {
2010 iterator it; 2010 iterator it;
2011 2011
2012 for (it = (*this).begin (); it != (*this).end (); it++) 2012 for (it = (*this).begin (); it != (*this).end (); it++)
2013 if (pname.compare ((*it).first) == 0) 2013 if (pname.compare ((*it).first) == 0)
2014 return it; 2014 return it;
2015 2015
2016 return (*this).end (); 2016 return (*this).end ();
2017 } 2017 }
2018 2018
2019 octave_value lookup (const std::string pname) const 2019 octave_value lookup (const std::string pname) const
2020 { 2020 {
2021 octave_value retval; 2021 octave_value retval;
2022 2022
2023 const_iterator it = find (pname); 2023 const_iterator it = find (pname);
2026 retval = (*it).second; 2026 retval = (*it).second;
2027 2027
2028 return retval; 2028 return retval;
2029 } 2029 }
2030 2030
2031 octave_value& operator [] (const std::string pname) 2031 octave_value& operator [] (const std::string pname)
2032 { 2032 {
2033 iterator it = find (pname); 2033 iterator it = find (pname);
2034 2034
2035 if (it == (*this).end ()) 2035 if (it == (*this).end ())
2036 { 2036 {
2037 push_back (pval_pair (pname, octave_value ())); 2037 push_back (pval_pair (pname, octave_value ()));
2038 return (*this).back ().second; 2038 return (*this).back ().second;
2039 } 2039 }
2040 2040
2041 return (*it).second; 2041 return (*it).second;
2042 } 2042 }
2043 2043
2044 void erase (const std::string pname) 2044 void erase (const std::string pname)
2045 { 2045 {
2046 iterator it = find (pname); 2046 iterator it = find (pname);
2047 if (it != (*this).end ()) 2047 if (it != (*this).end ())
2048 erase (it); 2048 erase (it);
2049 } 2049 }
2050 2050
2051 void erase (iterator it) 2051 void erase (iterator it)
2052 { 2052 {
2053 std::vector <pval_pair>::erase (it); 2053 std::vector <pval_pair>::erase (it);
2054 } 2054 }
2055 2055
3049 return rep->has_readonly_property (pname); 3049 return rep->has_readonly_property (pname);
3050 } 3050 }
3051 3051
3052 std::string values_as_string (void) { return rep->values_as_string (); } 3052 std::string values_as_string (void) { return rep->values_as_string (); }
3053 3053
3054 std::string value_as_string (const std::string& prop) 3054 std::string value_as_string (const std::string& prop)
3055 { 3055 {
3056 return rep->value_as_string (prop); 3056 return rep->value_as_string (prop);
3057 } 3057 }
3058 3058
3059 octave_map values_as_struct (void) { return rep->values_as_struct (); } 3059 octave_map values_as_struct (void) { return rep->values_as_struct (); }
3060 3060
3061 graphics_handle get_parent (void) const { return rep->get_parent (); } 3061 graphics_handle get_parent (void) const { return rep->get_parent (); }
3303 const base_properties& get_properties (void) const { return xproperties; } 3303 const base_properties& get_properties (void) const { return xproperties; }
3304 3304
3305 bool valid_object (void) const { return true; } 3305 bool valid_object (void) const { return true; }
3306 3306
3307 void reset_default_properties (void); 3307 void reset_default_properties (void);
3308 3308
3309 bool has_readonly_property (const caseless_str& pname) const 3309 bool has_readonly_property (const caseless_str& pname) const
3310 { 3310 {
3311 bool retval = xproperties.has_readonly_property (pname); 3311 bool retval = xproperties.has_readonly_property (pname);
3312 if (! retval) 3312 if (! retval)
3313 retval = base_properties::has_readonly_property (pname); 3313 retval = base_properties::has_readonly_property (pname);
3470 pointershapecdata.add_constraint (dim_vector (16, 16)); 3470 pointershapecdata.add_constraint (dim_vector (16, 16));
3471 pointershapehotspot.add_constraint (dim_vector (1, 2)); 3471 pointershapehotspot.add_constraint (dim_vector (1, 2));
3472 position.add_constraint (dim_vector (1, 4)); 3472 position.add_constraint (dim_vector (1, 4));
3473 } 3473 }
3474 3474
3475 private: 3475 private:
3476 Matrix get_auto_paperposition (void); 3476 Matrix get_auto_paperposition (void);
3477 3477
3478 void update_paperpositionmode (void) 3478 void update_paperpositionmode (void)
3479 { 3479 {
3480 if (paperpositionmode.is ("auto")) 3480 if (paperpositionmode.is ("auto"))
3545 const base_properties& get_properties (void) const { return xproperties; } 3545 const base_properties& get_properties (void) const { return xproperties; }
3546 3546
3547 bool valid_object (void) const { return true; } 3547 bool valid_object (void) const { return true; }
3548 3548
3549 void reset_default_properties (void); 3549 void reset_default_properties (void);
3550 3550
3551 bool has_readonly_property (const caseless_str& pname) const 3551 bool has_readonly_property (const caseless_str& pname) const
3552 { 3552 {
3553 bool retval = xproperties.has_readonly_property (pname); 3553 bool retval = xproperties.has_readonly_property (pname);
3554 if (! retval) 3554 if (! retval)
3555 retval = base_properties::has_readonly_property (pname); 3555 retval = base_properties::has_readonly_property (pname);
4646 else 4646 else
4647 clim = cdata.get_limits (); 4647 clim = cdata.get_limits ();
4648 4648
4649 if (xdatamode.is ("auto")) 4649 if (xdatamode.is ("auto"))
4650 update_xdata (); 4650 update_xdata ();
4651 4651
4652 if (ydatamode.is ("auto")) 4652 if (ydatamode.is ("auto"))
4653 update_ydata (); 4653 update_ydata ();
4654 } 4654 }
4655 4655
4656 void update_xdata (void) 4656 void update_xdata (void)
4657 { 4657 {
4658 if (xdata.get ().is_empty ()) 4658 if (xdata.get ().is_empty ())
4659 set_xdatamode ("auto"); 4659 set_xdatamode ("auto");
4660 4660
4661 if (xdatamode.is ("auto")) 4661 if (xdatamode.is ("auto"))
4662 { 4662 {
4663 set_xdata (get_auto_xdata ()); 4663 set_xdata (get_auto_xdata ());
4664 set_xdatamode ("auto"); 4664 set_xdatamode ("auto");
4665 } 4665 }
4666 4666
4667 Matrix limits = xdata.get_limits (); 4667 Matrix limits = xdata.get_limits ();
4668 float dp = pixel_xsize (); 4668 float dp = pixel_xsize ();
4669 4669
4670 limits(0) = limits(0) - dp; 4670 limits(0) = limits(0) - dp;
4671 limits(1) = limits(1) + dp; 4671 limits(1) = limits(1) + dp;
4674 4674
4675 void update_ydata (void) 4675 void update_ydata (void)
4676 { 4676 {
4677 if (ydata.get ().is_empty ()) 4677 if (ydata.get ().is_empty ())
4678 set_ydatamode ("auto"); 4678 set_ydatamode ("auto");
4679 4679
4680 if (ydatamode.is ("auto")) 4680 if (ydatamode.is ("auto"))
4681 { 4681 {
4682 set_ydata (get_auto_ydata ()); 4682 set_ydata (get_auto_ydata ());
4683 set_ydatamode ("auto"); 4683 set_ydatamode ("auto");
4684 } 4684 }
4685 4685
4686 Matrix limits = ydata.get_limits (); 4686 Matrix limits = ydata.get_limits ();
4687 float dp = pixel_ysize (); 4687 float dp = pixel_ysize ();
4688 4688
4689 limits(0) = limits(0) - dp; 4689 limits(0) = limits(0) - dp;
4690 limits(1) = limits(1) + dp; 4690 limits(1) = limits(1) + dp;
4781 { 4781 {
4782 public: 4782 public:
4783 octave_value get_color_data (void) const; 4783 octave_value get_color_data (void) const;
4784 4784
4785 // Matlab allows incoherent data to be stored into patch properties. 4785 // Matlab allows incoherent data to be stored into patch properties.
4786 // The patch should then be ignored by the renderer. 4786 // The patch should then be ignored by the renderer.
4787 bool has_bad_data (std::string &msg) const 4787 bool has_bad_data (std::string &msg) const
4788 { 4788 {
4789 msg = bad_data_msg; 4789 msg = bad_data_msg;
4790 return ! msg.empty (); 4790 return ! msg.empty ();
4791 } 4791 }
4792 4792
4793 bool is_aliminclude (void) const 4793 bool is_aliminclude (void) const
4880 4880
4881 void update_facevertexcdata (void) { update_data ();} 4881 void update_facevertexcdata (void) { update_data ();}
4882 4882
4883 void update_fvc (void); 4883 void update_fvc (void);
4884 4884
4885 void update_xdata (void) 4885 void update_xdata (void)
4886 { 4886 {
4887 if (get_xdata ().is_empty ()) 4887 if (get_xdata ().is_empty ())
4888 { 4888 {
4889 // For compatibility with matlab behavior, 4889 // For compatibility with matlab behavior,
4890 // if x/ydata are set empty, silently empty other *data and 4890 // if x/ydata are set empty, silently empty other *data and
4891 // faces properties while vertices remain unchanged. 4891 // faces properties while vertices remain unchanged.
4892 set_ydata (Matrix ()); 4892 set_ydata (Matrix ());
4893 set_zdata (Matrix ()); 4893 set_zdata (Matrix ());
4894 set_cdata (Matrix ()); 4894 set_cdata (Matrix ());
4895 set_faces (Matrix ()); 4895 set_faces (Matrix ());
4896 } 4896 }
4898 update_fvc (); 4898 update_fvc ();
4899 4899
4900 set_xlim (xdata.get_limits ()); 4900 set_xlim (xdata.get_limits ());
4901 } 4901 }
4902 4902
4903 void update_ydata (void) 4903 void update_ydata (void)
4904 { 4904 {
4905 if (get_ydata ().is_empty ()) 4905 if (get_ydata ().is_empty ())
4906 { 4906 {
4907 set_xdata (Matrix ()); 4907 set_xdata (Matrix ());
4908 set_zdata (Matrix ()); 4908 set_zdata (Matrix ());
4909 set_cdata (Matrix ()); 4909 set_cdata (Matrix ());
4913 update_fvc (); 4913 update_fvc ();
4914 4914
4915 set_ylim (ydata.get_limits ()); 4915 set_ylim (ydata.get_limits ());
4916 } 4916 }
4917 4917
4918 void update_zdata (void) 4918 void update_zdata (void)
4919 { 4919 {
4920 update_fvc (); 4920 update_fvc ();
4921 set_zlim (zdata.get_limits ()); 4921 set_zlim (zdata.get_limits ());
4922 } 4922 }
4923 4923
4924 void update_cdata (void) 4924 void update_cdata (void)