Mercurial > octave-antonio
comparison libinterp/corefcn/graphics.in.h @ 19861:19755f4fc851
maint: Cleanup C++ code to follow Octave coding conventions.
Try to wrap long lines to < 80 characters.
Use GNU style and don't indent first brace of function definition.
"case" statement is aligned flush left with brace of switch stmt.
Remove trailing '\' line continuation from the end of #define macros.
Use 2 spaces for indent.
* files-dock-widget.cc, history-dock-widget.cc, main-window.cc, octave-cmd.cc,
octave-dock-widget.cc, octave-gui.cc, resource-manager.cc, settings-dialog.cc,
shortcut-manager.cc, welcome-wizard.cc, workspace-view.cc, cellfun.cc, data.cc,
debug.cc, debug.h, dirfns.cc, error.h, file-io.cc, gl-render.cc, gl-render.h,
gl2ps-renderer.h, graphics.cc, graphics.in.h, help.cc, input.cc, load-path.cc,
load-path.h, lookup.cc, lu.cc, oct-stream.cc, octave-default-image.h,
ordschur.cc, pr-output.cc, qz.cc, strfns.cc, symtab.cc, symtab.h, sysdep.cc,
variables.cc, zfstream.h, __fltk_uigetfile__.cc, __init_fltk__.cc,
__magick_read__.cc, __osmesa_print__.cc, audiodevinfo.cc, ov-classdef.cc,
ov-classdef.h, ov-fcn.h, ov-float.cc, ov-flt-complex.cc, ov-java.cc,
ov-range.cc, ov-re-mat.cc, ov-usr-fcn.h, ov.cc, op-int.h, options-usage.h,
pt-eval.cc, Array-C.cc, Array-fC.cc, Array.cc, Array.h, PermMatrix.cc,
Sparse.cc, chMatrix.h, dSparse.cc, dim-vector.h, bsxfun-decl.h, bsxfun-defs.cc,
oct-norm.cc, Sparse-op-defs.h, oct-inttypes.cc, oct-inttypes.h, main.in.cc,
mkoctfile.in.cc: Cleanup C++ code to follow Octave coding conventions.
author | Rik <rik@octave.org> |
---|---|
date | Wed, 25 Feb 2015 11:55:49 -0800 |
parents | 426525fb3b9f |
children | f134ee404041 |
comparison
equal
deleted
inserted
replaced
19860:e8ccfc5d892b | 19861:19755f4fc851 |
---|---|
1728 Matrix t2 = new_kids_column.sort (); | 1728 Matrix t2 = new_kids_column.sort (); |
1729 Matrix t3 = get_hidden ().sort (); | 1729 Matrix t3 = get_hidden ().sort (); |
1730 | 1730 |
1731 if (t1 != t2) | 1731 if (t1 != t2) |
1732 is_ok = false; | 1732 is_ok = false; |
1733 | 1733 |
1734 if (t1 == t3) | 1734 if (t1 == t3) |
1735 add_hidden = false; | 1735 add_hidden = false; |
1736 } | 1736 } |
1737 else | 1737 else |
1738 is_ok = false; | 1738 is_ok = false; |
1999 | 1999 |
2000 typedef std::pair <std::string, octave_value> pval_pair; | 2000 typedef std::pair <std::string, octave_value> pval_pair; |
2001 | 2001 |
2002 class pval_vector : public std::vector <pval_pair> | 2002 class pval_vector : public std::vector <pval_pair> |
2003 { | 2003 { |
2004 public: | 2004 public: |
2005 const_iterator find (const std::string pname) const | 2005 const_iterator find (const std::string pname) const |
2006 { | 2006 { |
2007 const_iterator it; | 2007 const_iterator it; |
2008 | 2008 |
2009 for (it = (*this).begin (); it != (*this).end (); it++) | 2009 for (it = (*this).begin (); it != (*this).end (); it++) |
2029 octave_value retval; | 2029 octave_value retval; |
2030 | 2030 |
2031 const_iterator it = find (pname); | 2031 const_iterator it = find (pname); |
2032 | 2032 |
2033 if (it != (*this).end ()) | 2033 if (it != (*this).end ()) |
2034 retval = (*it).second; | 2034 retval = (*it).second; |
2035 | 2035 |
2036 return retval; | 2036 return retval; |
2037 } | 2037 } |
2038 | 2038 |
2039 octave_value& operator [] (const std::string pname) | 2039 octave_value& operator [] (const std::string pname) |
2714 if (valid_object ()) | 2714 if (valid_object ()) |
2715 get_properties ().override_defaults (obj); | 2715 get_properties ().override_defaults (obj); |
2716 else | 2716 else |
2717 error ("base_graphics_object::override_defaults: invalid graphics object"); | 2717 error ("base_graphics_object::override_defaults: invalid graphics object"); |
2718 } | 2718 } |
2719 | 2719 |
2720 void build_user_defaults_map (property_list::pval_map_type &def, | 2720 void build_user_defaults_map (property_list::pval_map_type &def, |
2721 const std::string go_name) const; | 2721 const std::string go_name) const; |
2722 | 2722 |
2723 virtual void set_from_list (property_list& plist) | 2723 virtual void set_from_list (property_list& plist) |
2724 { | 2724 { |
2770 virtual octave_value get_defaults (void) const | 2770 virtual octave_value get_defaults (void) const |
2771 { | 2771 { |
2772 error ("base_graphics_object::get_defaults: invalid graphics object"); | 2772 error ("base_graphics_object::get_defaults: invalid graphics object"); |
2773 return octave_value (); | 2773 return octave_value (); |
2774 } | 2774 } |
2775 | 2775 |
2776 virtual property_list get_defaults_list (void) const | 2776 virtual property_list get_defaults_list (void) const |
2777 { | 2777 { |
2778 if (! valid_object ()) | 2778 if (! valid_object ()) |
2779 error ("base_graphics_object::get_defaults_list: invalid graphics object"); | 2779 error ("base_graphics_object::get_defaults_list: invalid graphics object"); |
2780 return property_list (); | 2780 return property_list (); |
4092 if (zticklabelmode.is ("auto")) | 4092 if (zticklabelmode.is ("auto")) |
4093 calc_ticklabels (ztick, zticklabel, zscale.is ("log")); | 4093 calc_ticklabels (ztick, zticklabel, zscale.is ("log")); |
4094 } | 4094 } |
4095 | 4095 |
4096 void update_font (void); | 4096 void update_font (void); |
4097 void update_fontname (void) | 4097 void update_fontname (void) |
4098 { | 4098 { |
4099 update_font (); | 4099 update_font (); |
4100 sync_positions (); | 4100 sync_positions (); |
4101 } | 4101 } |
4102 void update_fontsize (void) | 4102 void update_fontsize (void) |
4103 { | 4103 { |
4104 update_font (); | 4104 update_font (); |
4105 sync_positions (); | 4105 sync_positions (); |
4106 } | 4106 } |
4107 void update_fontangle (void) | 4107 void update_fontangle (void) |
4108 { | 4108 { |
4109 update_font (); | 4109 update_font (); |
4110 sync_positions (); | 4110 sync_positions (); |
4111 } | 4111 } |
4112 void update_fontweight (void) | 4112 void update_fontweight (void) |
4113 { | 4113 { |
4114 update_font (); | 4114 update_font (); |
4115 sync_positions (); | 4115 sync_positions (); |
4116 } | 4116 } |
4117 | 4117 |
4118 void update_outerposition (void) | 4118 void update_outerposition (void) |
4119 { | 4119 { |
4682 radio_property ydatamode ha , "{auto}|manual" | 4682 radio_property ydatamode ha , "{auto}|manual" |
4683 END_PROPERTIES | 4683 END_PROPERTIES |
4684 | 4684 |
4685 protected: | 4685 protected: |
4686 void init (void) | 4686 void init (void) |
4687 { | 4687 { |
4688 xdata.add_constraint (2); | 4688 xdata.add_constraint (2); |
4689 ydata.add_constraint (2); | 4689 ydata.add_constraint (2); |
4690 cdata.add_constraint ("double"); | 4690 cdata.add_constraint ("double"); |
4691 cdata.add_constraint ("single"); | 4691 cdata.add_constraint ("single"); |
4692 cdata.add_constraint ("logical"); | 4692 cdata.add_constraint ("logical"); |
4693 cdata.add_constraint ("uint8"); | 4693 cdata.add_constraint ("uint8"); |
4694 cdata.add_constraint ("uint16"); | 4694 cdata.add_constraint ("uint16"); |
4695 cdata.add_constraint ("int16"); | 4695 cdata.add_constraint ("int16"); |
4696 cdata.add_constraint ("real"); | 4696 cdata.add_constraint ("real"); |
4697 cdata.add_constraint (dim_vector (-1, -1)); | 4697 cdata.add_constraint (dim_vector (-1, -1)); |
4698 cdata.add_constraint (dim_vector (-1, -1, 3)); | 4698 cdata.add_constraint (dim_vector (-1, -1, 3)); |
4699 alphadata.add_constraint (dim_vector (-1, -1)); | 4699 alphadata.add_constraint (dim_vector (-1, -1)); |
4700 alphadata.add_constraint ("double"); | 4700 alphadata.add_constraint ("double"); |
4701 alphadata.add_constraint ("uint8"); | 4701 alphadata.add_constraint ("uint8"); |
4702 } | 4702 } |
4703 | 4703 |
4704 private: | 4704 private: |
4705 void update_alphadata (void) | 4705 void update_alphadata (void) |
4706 { | 4706 { |
4707 if (alphadatamapping_is ("scaled")) | 4707 if (alphadatamapping_is ("scaled")) |
4854 octave_value get_color_data (void) const; | 4854 octave_value get_color_data (void) const; |
4855 | 4855 |
4856 // Matlab allows incoherent data to be stored into patch properties. | 4856 // Matlab allows incoherent data to be stored into patch properties. |
4857 // The patch should then be ignored by the renderer. | 4857 // The patch should then be ignored by the renderer. |
4858 bool has_bad_data (std::string &msg) const | 4858 bool has_bad_data (std::string &msg) const |
4859 { | 4859 { |
4860 msg = bad_data_msg; | 4860 msg = bad_data_msg; |
4861 return ! msg.empty (); | 4861 return ! msg.empty (); |
4862 } | 4862 } |
4863 | 4863 |
4864 bool is_aliminclude (void) const | 4864 bool is_aliminclude (void) const |
4865 { return (aliminclude.is_on () && alphadatamapping.is ("scaled")); } | 4865 { return (aliminclude.is_on () && alphadatamapping.is ("scaled")); } |
4866 std::string get_aliminclude (void) const | 4866 std::string get_aliminclude (void) const |
4867 { return aliminclude.current_value (); } | 4867 { return aliminclude.current_value (); } |
5544 radio_property units S , "{normalized}|inches|centimeters|points|pixels|characters" | 5544 radio_property units S , "{normalized}|inches|centimeters|points|pixels|characters" |
5545 END_PROPERTIES | 5545 END_PROPERTIES |
5546 | 5546 |
5547 protected: | 5547 protected: |
5548 void init (void) | 5548 void init (void) |
5549 { | 5549 { |
5550 position.add_constraint (dim_vector (1, 4)); | 5550 position.add_constraint (dim_vector (1, 4)); |
5551 } | 5551 } |
5552 | 5552 |
5553 void update_units (const caseless_str& old_units); | 5553 void update_units (const caseless_str& old_units); |
5554 void update_fontunits (const caseless_str& old_units); | 5554 void update_fontunits (const caseless_str& old_units); |
5555 | 5555 |
5556 }; | 5556 }; |