23 #if !defined (octave_graphics_h)
24 #define octave_graphics_h 1
52 #if !defined (OCTAVE_DEFAULT_FONTNAME)
53 #define OCTAVE_DEFAULT_FONTNAME "*"
69 error (
"invalid axis scale");
75 error (
"invalid axis scale");
79 virtual double scale (
double d)
const
81 error (
"invalid axis scale");
87 error (
"invalid axis scale");
140 {
return log10 (d); }
143 {
return pow (10.0, d); }
149 void do_scale (
const double *src,
double *dest,
int n)
const
151 for (
int i = 0; i < n; i++)
152 dest[i] = log10 (src[i]);
180 {
return -log10 (-d); }
183 {
return -
pow (10.0, -d); }
189 void do_scale (
const double *src,
double *dest,
int n)
const
191 for (
int i = 0; i < n; i++)
192 dest[i] = -log10 (-src[i]);
250 else if (s ==
"neglog")
252 else if (s ==
"linear")
305 virtual bool is_radio (
void)
const {
return false; }
314 bool do_notify_toolkit =
true);
318 error (
"get: invalid property \"%s\"",
name.c_str ());
325 error (
"values_as_string: invalid property \"%s\"",
name.c_str ());
326 return std::string ();
331 error (
"values_as_cell: invalid property \"%s\"",
name.c_str ());
357 for (i = 0; i < l.
length (); i++)
359 if (v.internal_rep () == l(i).internal_rep ())
367 for (
int j = i; j < l.
length () - 1; j++)
381 for (
int i = l.
length () - 1; i >= 0 ; i--)
383 for (
int j = 0; j < lp.
length (); j++)
385 if (l(i).internal_rep () == lp(j).internal_rep ())
406 error (
"set: invalid property \"%s\"",
name.c_str ());
412 typedef std::map<listener_mode, octave_value_list>::iterator
414 typedef std::map<listener_mode, octave_value_list>::const_iterator
432 const std::string& val =
"")
465 error (
"set: invalid string property value for \"%s\"",
482 const std::string& val =
"",
const char& sep =
'|',
490 size_t new_pos = val.find_first_of (
separator, pos);
492 if (new_pos == std::string::npos)
498 str.
append (val.substr (pos, new_pos - pos));
505 const Cell& c,
const char& sep =
'|',
514 strings[i] = c(i).string_value ();
519 error (
"set: invalid order property value for \"%s\"",
573 while (pos != std::string::npos)
575 size_t new_pos = new_str.find_first_of (
separator, pos);
577 if (new_pos == std::string::npos)
579 strings.
append (new_str.substr (pos));
583 strings.
append (new_str.substr (pos, new_pos - pos));
591 if (strings[i] !=
str[i])
620 if (!replace && strings[i] !=
str[i])
647 if (strings[i] !=
str[i])
664 error (
"set: invalid string property value for \"%s\"",
683 const std::string& val =
"")
697 std::ostringstream buf;
699 value[i] = buf.str ();
716 value[i] = c(i).string_value ();
719 double d = c(i).double_value ();
723 std::ostringstream buf;
725 value[i] = buf.str ();
793 value[i] = c(i).string_value ();
796 double d = c(i).double_value ();
800 std::ostringstream buf;
802 value[i] = buf.str ();
823 std::ostringstream buf;
825 value[i] = buf.str ();
832 error (
"set: invalid string property value for \"%s\"",
876 error (
"invalid value = %s", val.c_str ());
887 size_t len = val.length ();
889 std::string first_match;
891 for (std::set<caseless_str>::const_iterator p =
possible_vals.begin ();
894 if (p->compare (val, len))
896 if (len == p->length ())
946 const std::string& v)
992 if (s.length () != match.length ())
994 "%s: allowing %s to match %s value %s",
995 "set", s.c_str (),
get_name ().c_str (),
1002 error (
"set: invalid value for radio property \"%s\" (value = %s)",
1006 error (
"set: invalid value for radio property \"%s\"",
1035 error (
"invalid color specification: %s", str.c_str ());
1058 {
return ! (*
this == c); }
1066 for (
int i = 0; i < 3; i++)
1070 error (
"invalid RGB color specification");
1113 const std::string& v)
1143 bool is (
const std::string& v)
const
1149 error (
"color has no rgb value");
1157 error (
"color has no radio value");
1226 error (
"set: invalid value for double property \"%s\"",
1247 const std::string& v)
1277 bool is (
const std::string& v)
const
1291 error (
"%s: property has no radio value");
1407 error (
"invalid value for array property \"%s\"",
1494 if (dv(0) > 1 && dv(1) == 1)
1698 *p = new_gh.
value ();
1703 error (
"children_list::renumber: child not found!");
1721 bool add_hidden =
true;
1727 if (visible_kids.
numel () == new_kids.
numel ())
1743 error (
"set: new children must be a permutation of existing children");
1748 error (
"set: expecting children to be array of graphics handles");
1753 Matrix tmp = new_kids_column;
1758 children_list.clear ();
1765 children_list.push_back (tmp.
xelem (i));
1774 children_list.clear ();
1776 children_list.push_front (val.
xelem (i));
1781 children_list.clear ();
1782 for (const_children_list_iterator p = val.begin (); p != val.end (); p++)
1783 children_list.push_front (*p);
1790 Matrix retval (children_list.size (), 1);
1793 for (const_children_list_iterator p = children_list.begin ();
1794 p != children_list.end (); p++)
1801 for (children_list_iterator p = children_list.begin ();
1802 p != children_list.end (); p++)
1806 children_list.erase (p);
1815 children_list.push_front (val);
1861 error (
"invalid value for callback property \"%s\"",
1899 {
return rep->
ok (); }
1932 bool do_notify_toolkit =
true)
1933 {
return rep->
set (val, do_run, do_notify_toolkit); }
2004 class pval_vector :
public std::vector <pval_pair>
2007 const_iterator
find (
const std::string pname)
const
2011 for (it = (*this).begin (); it != (*this).end (); it++)
2012 if (pname.compare ((*it).first) == 0)
2015 return (*this).end ();
2018 iterator
find (
const std::string pname)
2022 for (it = (*this).begin (); it != (*this).end (); it++)
2023 if (pname.compare ((*it).first) == 0)
2026 return (*this).end ();
2033 const_iterator it =
find (pname);
2035 if (it != (*this).end ())
2036 retval = (*it).second;
2043 iterator it =
find (pname);
2045 if (it == (*this).end ())
2048 return (*this).back ().second;
2051 return (*it).second;
2056 iterator it =
find (pname);
2057 if (it != (*this).end ())
2063 std::vector <pval_pair>::erase (it);
2095 plist_map_iterator
find (
const std::string& go_name)
2100 plist_map_const_iterator
find (
const std::string& go_name)
const
2135 const std::string&,
bool,
2136 const std::string& =
"")
const
2142 return Matrix (1, 2, 0.0);
2154 return Matrix (1, 2, 0.0);
2169 {
gripe_invalid (
"base_graphics_toolkit::initialize");
return false; }
2193 error (
"%s: invalid graphics toolkit", fname.c_str ());
2246 const std::string& file,
bool mono,
2247 const std::string& debug_file =
"")
const
2367 ::error (
"unable to create gh_manager!");
2390 typedef std::set<std::string>::const_iterator
2393 typedef std::map<std::string, graphics_toolkit>::iterator
2396 typedef std::map<std::string, graphics_toolkit>::const_iterator
2407 loaded_toolkits[tk.
get_name ()] = tk;
2412 loaded_toolkits.erase (name);
2419 if (p != loaded_toolkits.end ())
2427 Cell m (1 , available_toolkits.size ());
2431 p != available_toolkits.end (); p++)
2439 Cell m (1 , loaded_toolkits.size ());
2443 p != loaded_toolkits.end (); p++)
2451 while (! loaded_toolkits.empty ())
2455 std::string name = p->first;
2461 if (loaded_toolkits.find (name) != loaded_toolkits.end ())
2485 void mark_modified (
void);
2503 all_props[name] = p;
2522 virtual property get_property (
const caseless_str& pname);
2534 if (children.remove_child (h.
value ()))
2536 children.run_listeners ();
2543 children.adopt (h.
value ());
2544 children.run_listeners ();
2553 {
return Matrix (1, 4, 0.0); }
2555 virtual void update_boundingbox (
void);
2557 virtual void update_autopos (
const std::string& elem_type);
2571 return children.get_children ();
2576 return children.get_all ();
2581 return children.get_hidden ();
2593 virtual void update_axis_limits (
const std::string& axis_type)
const;
2595 virtual void update_axis_limits (
const std::string& axis_type,
2598 virtual void update_uicontextmenu (
void)
const;
2602 children.delete_children (
clear);
2607 children.renumber (old_gh, new_gh);
2636 std::set<std::string> dynamic_property_names (
void)
const;
2638 bool has_dynamic_property (
const std::string& pname);
2641 std::set<std::string> dynamic_properties;
2649 property get_property_dynamic (
const caseless_str& pname);
2651 BEGIN_BASE_PROPERTIES
2661 bool_property hittest , "on
"
2662 bool_property interruptible , "on
"
2663 handle_property parent fs , p
2664 bool_property selected , "off
"
2665 bool_property selectionhighlight , "on
"
2666 string_property tag s , ""
2667 string_property type frs , ty
2668 handle_property uicontextmenu u , graphics_handle ()
2669 any_property userdata , Matrix ()
2670 bool_property visible , "on
"
2671 // additional (Octave-specific) properties
2672 bool_property __modified__ s , "on
"
2673 graphics_handle __myhandle__ fhrs , mh
2677 struct cmp_caseless_str
2679 bool operator () (const caseless_str& a, const caseless_str& b) const
2682 std::transform (a1.begin (), a1.end (), a1.begin (), tolower);
2684 std::transform (b1.begin (), b1.end (), b1.begin (), tolower);
2690 std::map<caseless_str, property, cmp_caseless_str> all_props;
2693 void insert_static_property (const std::string& name, base_property& p)
2694 { insert_property (name, property (&p, true)); }
2696 virtual void init (void) { }
2699 class OCTINTERP_API base_graphics_object
2702 friend class graphics_object;
2704 base_graphics_object (void) : count (1), toolkit_flag (false) { }
2706 virtual ~base_graphics_object (void) { }
2708 virtual void mark_modified (void)
2710 if (valid_object ())
2711 get_properties ().mark_modified ();
2716 virtual void override_defaults (base_graphics_object& obj)
2718 if (valid_object ())
2719 get_properties ().override_defaults (obj);
2724 void build_user_defaults_map (property_list::pval_map_type &def,
2725 const std::string go_name) const;
2727 virtual void set_from_list (property_list& plist)
2729 if (valid_object ())
2730 get_properties ().set_from_list (*this, plist);
2735 virtual void set (const caseless_str& pname, const octave_value& pval)
2737 if (valid_object ())
2738 get_properties ().set (pname, pval);
2743 virtual void set_defaults (const std::string&)
2748 virtual octave_value get (bool all = false) const
2750 if (valid_object ())
2751 return get_properties ().get (all);
2755 return octave_value ();
2759 virtual octave_value get (const caseless_str& pname) const
2761 if (valid_object ())
2762 return get_properties ().get (pname);
2766 return octave_value ();
2770 virtual octave_value get_default (const caseless_str&) const;
2772 virtual octave_value get_factory_default (const caseless_str&) const;
2774 virtual octave_value get_defaults (void) const
2777 return octave_value ();
2780 virtual property_list get_defaults_list (void) const
2782 if (! valid_object ())
2784 return property_list ();
2787 virtual octave_value get_factory_defaults (void) const
2790 return octave_value ();
2793 virtual property_list get_factory_defaults_list (void) const
2796 return property_list ();
2799 virtual bool has_readonly_property (const caseless_str& pname) const
2801 return base_properties::has_readonly_property (pname);
2804 virtual std::string values_as_string (void);
2806 virtual std::string value_as_string (const std::string& prop);
2808 virtual octave_scalar_map values_as_struct (void);
2810 virtual graphics_handle get_parent (void) const
2812 if (valid_object ())
2813 return get_properties ().get_parent ();
2817 return graphics_handle ();
2821 graphics_handle get_handle (void) const
2823 if (valid_object ())
2824 return get_properties ().get___myhandle__ ();
2828 return graphics_handle ();
2832 virtual void remove_child (const graphics_handle& h)
2834 if (valid_object ())
2835 get_properties ().remove_child (h);
2840 virtual void adopt (const graphics_handle& h)
2842 if (valid_object ())
2843 get_properties ().adopt (h);
2848 virtual void reparent (const graphics_handle& np)
2850 if (valid_object ())
2851 get_properties ().reparent (np);
2856 virtual void defaults (void) const
2858 if (valid_object ())
2860 std::string msg = (type () + "::defaults
");
2861 gripe_not_implemented (msg.c_str ());
2864 error ("base_graphics_object::default: invalid graphics
object");
2867 virtual base_properties& get_properties (void)
2869 static base_properties properties;
2874 virtual const base_properties& get_properties (void) const
2876 static base_properties properties;
2881 virtual void update_axis_limits (const std::string& axis_type);
2883 virtual void update_axis_limits (const std::string& axis_type,
2884 const graphics_handle& h);
2886 virtual bool valid_object (void) const { return false; }
2888 bool valid_toolkit_object (void) const { return toolkit_flag; }
2890 virtual std::string type (void) const
2892 return (valid_object () ? get_properties ().graphics_object_name ()
2896 bool isa (const std::string& go_name) const
2898 return type () == go_name;
2901 virtual graphics_toolkit get_toolkit (void) const
2903 if (valid_object ())
2904 return get_properties ().get_toolkit ();
2908 return graphics_toolkit ();
2912 virtual void add_property_listener (const std::string& nm,
2913 const octave_value& v,
2914 listener_mode mode = POSTSET)
2916 if (valid_object ())
2917 get_properties ().add_listener (nm, v, mode);
2920 virtual void delete_property_listener (const std::string& nm,
2921 const octave_value& v,
2922 listener_mode mode = POSTSET)
2924 if (valid_object ())
2925 get_properties ().delete_listener (nm, v, mode);
2928 virtual void remove_all_listeners (void);
2930 virtual void reset_default_properties (void);
2933 virtual void initialize (const graphics_object& go)
2936 toolkit_flag = get_toolkit ().initialize (go);
2939 virtual void finalize (const graphics_object& go)
2943 get_toolkit ().finalize (go);
2944 toolkit_flag = false;
2948 virtual void update (const graphics_object& go, int id)
2951 get_toolkit ().update (go, id);
2955 // A reference count.
2956 octave_refcount<int> count;
2958 // A flag telling whether this object is a valid object
2959 // in the backend context.
2964 base_graphics_object (const base_graphics_object&) : count (0) { }
2966 base_graphics_object& operator = (const base_graphics_object&)
2972 class OCTINTERP_API graphics_object
2975 graphics_object (void) : rep (new base_graphics_object ()) { }
2977 graphics_object (base_graphics_object *new_rep)
2980 graphics_object (const graphics_object& obj) : rep (obj.rep)
2985 graphics_object& operator = (const graphics_object& obj)
2989 if (--rep->count == 0)
2999 ~graphics_object (void)
3001 if (--rep->count == 0)
3005 void mark_modified (void) { rep->mark_modified (); }
3007 void override_defaults (base_graphics_object& obj)
3009 rep->override_defaults (obj);
3012 void override_defaults (void)
3014 rep->override_defaults (*rep);
3017 void build_user_defaults_map (property_list::pval_map_type &def,
3018 const std::string go_name) const
3020 rep->build_user_defaults_map (def, go_name);
3023 void set_from_list (property_list& plist) { rep->set_from_list (plist); }
3025 void set (const caseless_str& name, const octave_value& val)
3027 rep->set (name, val);
3030 void set (const octave_value_list& args);
3032 void set (const Array<std::string>& names, const Cell& values,
3033 octave_idx_type row);
3035 void set (const octave_map& m);
3037 void set_value_or_default (const caseless_str& name,
3038 const octave_value& val);
3040 void set_defaults (const std::string& mode) { rep->set_defaults (mode); }
3042 octave_value get (bool all = false) const { return rep->get (all); }
3044 octave_value get (const caseless_str& name) const
3046 return name.compare ("default")
3048 : (name.compare ("factory
")
3049 ? get_factory_defaults () : rep->get (name));
3052 octave_value get (const std::string& name) const
3054 return get (caseless_str (name));
3057 octave_value get (const char *name) const
3059 return get (caseless_str (name));
3062 octave_value get_default (const caseless_str& name) const
3064 return rep->get_default (name);
3067 octave_value get_factory_default (const caseless_str& name) const
3069 return rep->get_factory_default (name);
3072 octave_value get_defaults (void) const { return rep->get_defaults (); }
3074 property_list get_defaults_list (void) const
3076 return rep->get_defaults_list ();
3079 octave_value get_factory_defaults (void) const
3081 return rep->get_factory_defaults ();
3084 property_list get_factory_defaults_list (void) const
3086 return rep->get_factory_defaults_list ();
3089 bool has_readonly_property (const caseless_str& pname) const
3091 return rep->has_readonly_property (pname);
3094 std::string values_as_string (void) { return rep->values_as_string (); }
3096 std::string value_as_string (const std::string& prop)
3098 return rep->value_as_string (prop);
3101 octave_map values_as_struct (void) { return rep->values_as_struct (); }
3103 graphics_handle get_parent (void) const { return rep->get_parent (); }
3105 graphics_handle get_handle (void) const { return rep->get_handle (); }
3107 graphics_object get_ancestor (const std::string& type) const;
3109 void remove_child (const graphics_handle& h) { rep->remove_child (h); }
3111 void adopt (const graphics_handle& h) { rep->adopt (h); }
3113 void reparent (const graphics_handle& h) { rep->reparent (h); }
3115 void defaults (void) const { rep->defaults (); }
3117 bool isa (const std::string& go_name) const { return rep->isa (go_name); }
3119 base_properties& get_properties (void) { return rep->get_properties (); }
3121 const base_properties& get_properties (void) const
3123 return rep->get_properties ();
3126 void update_axis_limits (const std::string& axis_type)
3128 rep->update_axis_limits (axis_type);
3131 void update_axis_limits (const std::string& axis_type,
3132 const graphics_handle& h)
3134 rep->update_axis_limits (axis_type, h);
3137 bool valid_object (void) const { return rep->valid_object (); }
3139 std::string type (void) const { return rep->type (); }
3141 operator bool (void) const { return rep->valid_object (); }
3143 // FIXME: these functions should be generated automatically by the
3144 // genprops.awk script.
3146 // EMIT_GRAPHICS_OBJECT_GET_FUNCTIONS
3148 octave_value get_alim (void) const
3149 { return get_properties ().get_alim (); }
3151 octave_value get_clim (void) const
3152 { return get_properties ().get_clim (); }
3154 octave_value get_xlim (void) const
3155 { return get_properties ().get_xlim (); }
3157 octave_value get_ylim (void) const
3158 { return get_properties ().get_ylim (); }
3160 octave_value get_zlim (void) const
3161 { return get_properties ().get_zlim (); }
3163 bool is_aliminclude (void) const
3164 { return get_properties ().is_aliminclude (); }
3166 bool is_climinclude (void) const
3167 { return get_properties ().is_climinclude (); }
3169 bool is_xliminclude (void) const
3170 { return get_properties ().is_xliminclude (); }
3172 bool is_yliminclude (void) const
3173 { return get_properties ().is_yliminclude (); }
3175 bool is_zliminclude (void) const
3176 { return get_properties ().is_zliminclude (); }
3178 bool is_handle_visible (void) const
3179 { return get_properties ().is_handle_visible (); }
3181 graphics_toolkit get_toolkit (void) const { return rep->get_toolkit (); }
3183 void add_property_listener (const std::string& nm, const octave_value& v,
3184 listener_mode mode = POSTSET)
3185 { rep->add_property_listener (nm, v, mode); }
3187 void delete_property_listener (const std::string& nm, const octave_value& v,
3188 listener_mode mode = POSTSET)
3189 { rep->delete_property_listener (nm, v, mode); }
3191 void initialize (void) { rep->initialize (*this); }
3193 void finalize (void) { rep->finalize (*this); }
3195 void update (int id) { rep->update (*this, id); }
3197 void reset_default_properties (void)
3198 { rep->reset_default_properties (); }
3201 base_graphics_object *rep;
3204 // ---------------------------------------------------------------------
3206 class OCTINTERP_API root_figure : public base_graphics_object
3209 class OCTINTERP_API properties : public base_properties
3212 void remove_child (const graphics_handle& h);
3214 Matrix get_boundingbox (bool internal = false,
3215 const Matrix& parent_pix_size = Matrix ()) const;
3217 // See the genprops.awk script for an explanation of the
3218 // properties declarations.
3220 // FIXME: Properties that still dont have callbacks are:
3221 // language, monitorpositions, pointerlocation, pointerwindow.
3222 // Note that these properties are not yet used by Octave, so setting
3223 // them will have no effect.
3225 // Programming note: Keep property list sorted if new ones are added.
3227 BEGIN_PROPERTIES (root_figure, root)
3228 handle_property callbackobject Sr , graphics_handle ()
3229 array_property commandwindowsize r , Matrix (1, 2, 0)
3230 handle_property currentfigure S , graphics_handle ()
3231 bool_property diary GS , "off
"
3232 string_property diaryfile GS , "diary
"
3233 bool_property echo GS , "off
"
3234 string_property errormessage Gr , ""
3235 string_property fixedwidthfontname , "Courier
"
3236 radio_property format GS , "+|bank|bit|hex|
long|longe|longeng|longg|native-bit|native-hex|none|rat|{
short}|shorte|shorteng|shortg
"
3237 radio_property formatspacing GS , "compact|{loose}
"
3238 string_property language , "ascii
"
3239 array_property monitorpositions , Matrix (1, 4, 0)
3240 array_property pointerlocation , Matrix (1, 2, 0)
3241 double_property pointerwindow r , 0.0
3242 double_property recursionlimit GS , 256.0
3243 double_property screendepth r , default_screendepth ()
3244 double_property screenpixelsperinch r , default_screenpixelsperinch ()
3245 array_property screensize r , default_screensize ()
3246 bool_property showhiddenhandles , "off
"
3247 radio_property units U , "inches|centimeters|normalized|points|{pixels}
"
3251 std::list<graphics_handle> cbo_stack;
3256 properties xproperties;
3261 : xproperties (0, graphics_handle ()), default_properties () { }
3263 ~root_figure (void) { }
3265 void mark_modified (void) { }
3267 void override_defaults (base_graphics_object& obj)
3269 // Now override with our defaults. If the default_properties
3270 // list includes the properties for all defaults (line,
3271 // surface, etc.) then we don't have to know the type of OBJ
3272 // here, we just call its set function and let it decide which
3273 // properties from the list to use.
3274 obj.set_from_list (default_properties);
3277 void set (const caseless_str& name, const octave_value& value)
3279 if (name.compare ("default", 7))
3280 // strip "default", pass rest to function that will
3281 // parse the remainder and add the element to the
3282 // default_properties map.
3283 default_properties.set (name.substr (7), value);
3285 xproperties.set (name, value);
3288 octave_value get (const caseless_str& name) const
3290 octave_value retval;
3292 if (name.compare ("default", 7))
3293 return get_default (name.substr (7));
3294 else if (name.compare ("factory
", 7))
3295 return get_factory_default (name.substr (7));
3297 retval = xproperties.get (name);
3302 octave_value get_default (const caseless_str& name) const
3304 octave_value retval = default_properties.lookup (name);
3306 if (retval.is_undefined ())
3308 // no default property found, use factory default
3309 retval = factory_properties.lookup (name);
3311 if (retval.is_undefined ())
3312 error ("get: invalid
default property '%s'", name.c_str ());
3318 octave_value get_factory_default (const caseless_str& name) const
3320 octave_value retval = factory_properties.lookup (name);
3322 if (retval.is_undefined ())
3323 error ("get: invalid factory
default property '%s'", name.c_str ());
3328 octave_value get_defaults (void) const
3330 return default_properties.as_struct ("default");
3333 property_list get_defaults_list (void) const
3335 return default_properties;
3338 octave_value get_factory_defaults (void) const
3340 return factory_properties.as_struct ("factory
");
3343 property_list get_factory_defaults_list (void) const
3345 return factory_properties;
3348 base_properties& get_properties (void) { return xproperties; }
3350 const base_properties& get_properties (void) const { return xproperties; }
3352 bool valid_object (void) const { return true; }
3354 void reset_default_properties (void);
3356 bool has_readonly_property (const caseless_str& pname) const
3358 bool retval = xproperties.has_readonly_property (pname);
3360 retval = base_properties::has_readonly_property (pname);
3365 property_list default_properties;
3367 static property_list factory_properties;
3369 static property_list::plist_map_type init_factory_properties (void);
3372 // ---------------------------------------------------------------------
3374 class OCTINTERP_API figure : public base_graphics_object
3377 class OCTINTERP_API properties : public base_properties
3380 void init_integerhandle (const octave_value& val)
3382 integerhandle = val;
3385 void remove_child (const graphics_handle& h);
3387 void set_visible (const octave_value& val);
3389 graphics_toolkit get_toolkit (void) const
3392 toolkit = gtk_manager::get_toolkit ();
3397 void set_toolkit (const graphics_toolkit& b);
3399 void set___graphics_toolkit__ (const octave_value& val)
3403 if (val.is_string ())
3405 std::string nm = val.string_value ();
3406 graphics_toolkit b = gtk_manager::find_toolkit (nm);
3407 if (b.get_name () != nm)
3409 error ("set___graphics_toolkit__: invalid graphics toolkit
");
3413 if (nm != get___graphics_toolkit__ ())
3421 error ("set___graphics_toolkit__ must be a
string");
3425 void adopt (const graphics_handle& h);
3427 void set_position (const octave_value& val,
3428 bool do_notify_toolkit = true);
3430 void set_outerposition (const octave_value& val,
3431 bool do_notify_toolkit = true);
3433 Matrix get_boundingbox (bool internal = false,
3434 const Matrix& parent_pix_size = Matrix ()) const;
3436 void set_boundingbox (const Matrix& bb, bool internal = false,
3437 bool do_notify_toolkit = true);
3439 Matrix map_from_boundingbox (double x, double y) const;
3441 Matrix map_to_boundingbox (double x, double y) const;
3443 void update_units (const caseless_str& old_units);
3445 void update_paperunits (const caseless_str& old_paperunits);
3447 std::string get_title (void) const;
3449 // See the genprops.awk script for an explanation of the
3450 // properties declarations.
3451 // Programming note: Keep property list sorted if new ones are added.
3453 BEGIN_PROPERTIES (figure)
3454 array_property alphamap , Matrix (64, 1, 1)
3455 callback_property buttondownfcn , Matrix ()
3456 callback_property closerequestfcn , "closereq
"
3457 color_property color , color_property (color_values (1, 1, 1), radio_values ("none
"))
3458 array_property colormap , jet_colormap ()
3459 handle_property currentaxes S , graphics_handle ()
3460 string_property currentcharacter r , ""
3461 handle_property currentobject r , graphics_handle ()
3462 array_property currentpoint r , Matrix (2, 1, 0)
3463 bool_property dockcontrols , "off
"
3464 bool_property doublebuffer , "on
"
3465 string_property filename , ""
3466 bool_property integerhandle S , "on
"
3467 bool_property inverthardcopy , "off
"
3468 callback_property keypressfcn , Matrix ()
3469 callback_property keyreleasefcn , Matrix ()
3470 radio_property menubar , "none|{
figure}
"
3471 double_property mincolormap , 64
3472 string_property name , ""
3473 radio_property nextplot , "new|{add}|replacechildren|
replace"
3474 bool_property numbertitle , "on
"
3475 array_property outerposition s , Matrix (1, 4, -1.0)
3476 radio_property paperorientation U , "{portrait}|landscape|rotated
"
3477 array_property paperposition m , default_figure_paperposition ()
3478 radio_property paperpositionmode au , "auto|{manual}
"
3479 array_property papersize U , default_figure_papersize ()
3480 radio_property papertype SU , "{usletter}|uslegal|a0|a1|
a2|a3|a4|a5|b0|b1|b2|b3|b4|b5|arch-a|arch-b|arch-c|arch-
d|arch-e|a|b|c|
d|e|tabloid|<custom>
"
3481 radio_property paperunits Su , "{inches}|centimeters|normalized|points
"
3482 radio_property pointer , "crosshair|fullcrosshair|{arrow}|ibeam|watch|topl|topr|botl|botr|
left|top|right|bottom|circle|
cross|fleur|custom|hand
"
3483 array_property pointershapecdata , Matrix (16, 16, 0)
3484 array_property pointershapehotspot , Matrix (1, 2, 0)
3485 array_property position s , default_figure_position ()
3486 radio_property renderer , "{painters}|zbuffer|opengl|none
"
3487 radio_property renderermode , "{
auto}|manual
"
3488 bool_property resize , "on
"
3489 callback_property resizefcn , Matrix ()
3490 radio_property selectiontype , "{normal}|open|alt|extend
"
3491 radio_property toolbar , "none|{
auto}|
figure"
3492 radio_property units Su , "inches|centimeters|normalized|points|{pixels}|characters
"
3493 callback_property windowbuttondownfcn , Matrix ()
3494 callback_property windowbuttonmotionfcn , Matrix ()
3495 callback_property windowbuttonupfcn , Matrix ()
3496 callback_property windowkeypressfcn , Matrix ()
3497 callback_property windowkeyreleasefcn , Matrix ()
3498 callback_property windowscrollwheelfcn , Matrix ()
3499 radio_property windowstyle , "{normal}|modal|docked
"
3500 string_property wvisual , ""
3501 radio_property wvisualmode , "{
auto}|manual
"
3502 string_property xdisplay , ""
3503 string_property xvisual , ""
3504 radio_property xvisualmode , "{
auto}|manual
"
3505 // Octave-specific properties
3506 radio_property __mouse_mode__ hS , "{none}|pan|rotate|select|
text|zoom
"
3507 any_property __pan_mode__ h , Matrix ()
3508 any_property __rotate_mode__ h , Matrix ()
3509 any_property __zoom_mode__ h , Matrix ()
3510 bool_property __enhanced__ h , "on
"
3511 string_property __graphics_toolkit__ hs , gtk_manager::default_toolkit ()
3512 any_property __guidata__ h , Matrix ()
3513 any_property __plot_stream__ h , Matrix ()
3519 alphamap.add_constraint (dim_vector (-1, 1));
3520 colormap.add_constraint (dim_vector (-1, 3));
3521 outerposition.add_constraint (dim_vector (1, 4));
3522 paperposition.add_constraint (dim_vector (1, 4));
3523 papersize.add_constraint (dim_vector (1, 2));
3524 pointershapecdata.add_constraint (dim_vector (16, 16));
3525 pointershapehotspot.add_constraint (dim_vector (1, 2));
3526 position.add_constraint (dim_vector (1, 4));
3530 Matrix get_auto_paperposition (void);
3532 void update_paperpositionmode (void)
3534 if (paperpositionmode.is ("auto"))
3535 paperposition.set (get_auto_paperposition ());
3538 mutable graphics_toolkit toolkit;
3542 properties xproperties;
3545 figure (const graphics_handle& mh, const graphics_handle& p)
3546 : base_graphics_object (), xproperties (mh, p), default_properties ()
3551 void override_defaults (base_graphics_object& obj)
3553 // Allow parent (root figure) to override first (properties knows how
3554 // to find the parent object).
3555 xproperties.override_defaults (obj);
3557 // Now override with our defaults. If the default_properties
3558 // list includes the properties for all defaults (line,
3559 // surface, etc.) then we don't have to know the type of OBJ
3560 // here, we just call its set function and let it decide which
3561 // properties from the list to use.
3562 obj.set_from_list (default_properties);
3565 void set (const caseless_str& name, const octave_value& value)
3567 if (name.compare ("default", 7))
3568 // strip "default", pass rest to function that will
3569 // parse the remainder and add the element to the
3570 // default_properties map.
3571 default_properties.set (name.substr (7), value);
3573 xproperties.set (name, value);
3576 octave_value get (const caseless_str& name) const
3578 octave_value retval;
3580 if (name.compare ("default", 7))
3581 retval = get_default (name.substr (7));
3583 retval = xproperties.get (name);
3588 octave_value get_default (const caseless_str& name) const;
3590 octave_value get_defaults (void) const
3592 return default_properties.as_struct ("default");
3595 property_list get_defaults_list (void) const
3597 return default_properties;
3600 base_properties& get_properties (void) { return xproperties; }
3602 const base_properties& get_properties (void) const { return xproperties; }
3604 bool valid_object (void) const { return true; }
3606 void reset_default_properties (void);
3608 bool has_readonly_property (const caseless_str& pname) const
3610 bool retval = xproperties.has_readonly_property (pname);
3612 retval = base_properties::has_readonly_property (pname);
3617 property_list default_properties;
3620 // ---------------------------------------------------------------------
3622 class OCTINTERP_API graphics_xform
3625 graphics_xform (void)
3626 : xform (xform_eye ()), xform_inv (xform_eye ()),
3627 sx ("linear
"), sy ("linear
"), sz ("linear
"), zlim (1, 2, 0.0)
3632 graphics_xform (const Matrix& xm, const Matrix& xim,
3633 const scaler& x, const scaler& y, const scaler& z,
3635 : xform (xm), xform_inv (xim), sx (x), sy (y), sz (z), zlim (zl) { }
3637 graphics_xform (const graphics_xform& g)
3638 : xform (g.xform), xform_inv (g.xform_inv), sx (g.sx),
3639 sy (g.sy), sz (g.sz), zlim (g.zlim) { }
3641 ~graphics_xform (void) { }
3643 graphics_xform& operator = (const graphics_xform& g)
3646 xform_inv = g.xform_inv;
3655 static ColumnVector xform_vector (double x, double y, double z);
3657 static Matrix xform_eye (void);
3659 ColumnVector transform (double x, double y, double z,
3660 bool use_scale = true) const;
3662 ColumnVector untransform (double x, double y, double z,
3663 bool use_scale = true) const;
3665 ColumnVector untransform (double x, double y, bool use_scale = true) const
3666 { return untransform (x, y, (zlim(0)+zlim(1))/2, use_scale); }
3668 Matrix xscale (const Matrix& m) const { return sx.scale (m); }
3669 Matrix yscale (const Matrix& m) const { return sy.scale (m); }
3670 Matrix zscale (const Matrix& m) const { return sz.scale (m); }
3672 Matrix scale (const Matrix& m) const
3674 bool has_z = (m.columns () > 2);
3676 if (sx.is_linear () && sy.is_linear ()
3677 && (! has_z || sz.is_linear ()))
3680 Matrix retval (m.dims ());
3684 for (int i = 0; i < r; i++)
3686 retval(i,0) = sx.scale (m(i,0));
3687 retval(i,1) = sy.scale (m(i,1));
3689 retval(i,2) = sz.scale (m(i,2));
3710 class OCTINTERP_API axes : public base_graphics_object
3713 class OCTINTERP_API properties : public base_properties
3716 void set_defaults (base_graphics_object& obj, const std::string& mode);
3718 void remove_child (const graphics_handle& h);
3720 const scaler& get_x_scaler (void) const { return sx; }
3721 const scaler& get_y_scaler (void) const { return sy; }
3722 const scaler& get_z_scaler (void) const { return sz; }
3724 Matrix get_boundingbox (bool internal = false,
3725 const Matrix& parent_pix_size = Matrix ()) const;
3726 Matrix get_extent (bool with_text = false,
3727 bool only_text_height=false) const;
3729 double get_fontsize_points (double box_pix_height = 0) const;
3731 void update_boundingbox (void)
3733 if (units_is ("normalized
"))
3736 base_properties::update_boundingbox ();
3740 void update_camera (void);
3741 void update_axes_layout (void);
3742 void update_aspectratios (void);
3743 void update_transform (void)
3745 update_aspectratios ();
3747 update_axes_layout ();
3750 void sync_positions (void);
3752 void update_autopos (const std::string& elem_type);
3753 void update_xlabel_position (void);
3754 void update_ylabel_position (void);
3755 void update_zlabel_position (void);
3756 void update_title_position (void);
3758 graphics_xform get_transform (void) const
3759 { return graphics_xform (x_render, x_render_inv, sx, sy, sz, x_zlim); }
3761 Matrix get_transform_matrix (void) const { return x_render; }
3762 Matrix get_inverse_transform_matrix (void) const { return x_render_inv; }
3763 Matrix get_opengl_matrix_1 (void) const { return x_gl_mat1; }
3764 Matrix get_opengl_matrix_2 (void) const { return x_gl_mat2; }
3765 Matrix get_transform_zlim (void) const { return x_zlim; }
3767 int get_xstate (void) const { return xstate; }
3768 int get_ystate (void) const { return ystate; }
3769 int get_zstate (void) const { return zstate; }
3770 double get_xPlane (void) const { return xPlane; }
3771 double get_xPlaneN (void) const { return xPlaneN; }
3772 double get_yPlane (void) const { return yPlane; }
3773 double get_yPlaneN (void) const { return yPlaneN; }
3774 double get_zPlane (void) const { return zPlane; }
3775 double get_zPlaneN (void) const { return zPlaneN; }
3776 double get_xpTick (void) const { return xpTick; }
3777 double get_xpTickN (void) const { return xpTickN; }
3778 double get_ypTick (void) const { return ypTick; }
3779 double get_ypTickN (void) const { return ypTickN; }
3780 double get_zpTick (void) const { return zpTick; }
3781 double get_zpTickN (void) const { return zpTickN; }
3782 double get_x_min (void) const { return std::min (xPlane, xPlaneN); }
3783 double get_x_max (void) const { return std::max (xPlane, xPlaneN); }
3784 double get_y_min (void) const { return std::min (yPlane, yPlaneN); }
3785 double get_y_max (void) const { return std::max (yPlane, yPlaneN); }
3786 double get_z_min (void) const { return std::min (zPlane, zPlaneN); }
3787 double get_z_max (void) const { return std::max (zPlane, zPlaneN); }
3788 double get_fx (void) const { return fx; }
3789 double get_fy (void) const { return fy; }
3790 double get_fz (void) const { return fz; }
3791 double get_xticklen (void) const { return xticklen; }
3792 double get_yticklen (void) const { return yticklen; }
3793 double get_zticklen (void) const { return zticklen; }
3794 double get_xtickoffset (void) const { return xtickoffset; }
3795 double get_ytickoffset (void) const { return ytickoffset; }
3796 double get_ztickoffset (void) const { return ztickoffset; }
3797 bool get_x2Dtop (void) const { return x2Dtop; }
3798 bool get_y2Dright (void) const { return y2Dright; }
3799 bool get_layer2Dtop (void) const { return layer2Dtop; }
3800 bool get_is2D (void) const { return is2D; }
3801 bool get_xySym (void) const { return xySym; }
3802 bool get_xyzSym (void) const { return xyzSym; }
3803 bool get_zSign (void) const { return zSign; }
3804 bool get_nearhoriz (void) const { return nearhoriz; }
3806 ColumnVector pixel2coord (double px, double py) const
3807 { return get_transform ().untransform (px, py, (x_zlim(0)+x_zlim(1))/2); }
3809 ColumnVector coord2pixel (double x, double y, double z) const
3810 { return get_transform ().transform (x, y, z); }
3812 void zoom_about_point (const std::string& mode, double x, double y,
3813 double factor, bool push_to_zoom_stack = true);
3814 void zoom (const std::string& mode, double factor,
3815 bool push_to_zoom_stack = true);
3816 void zoom (const std::string& mode, const Matrix& xl, const Matrix& yl,
3817 bool push_to_zoom_stack = true);
3819 void translate_view (const std::string& mode,
3820 double x0, double x1, double y0, double y1,
3821 bool push_to_zoom_stack = true);
3823 void pan (const std::string& mode, double factor,
3824 bool push_to_zoom_stack = true);
3826 void rotate3d (double x0, double x1, double y0, double y1,
3827 bool push_to_zoom_stack = true);
3829 void rotate_view (double delta_az, double delta_el,
3830 bool push_to_zoom_stack = true);
3833 void push_zoom_stack (void);
3834 void clear_zoom_stack (bool do_unzoom = true);
3836 void update_units (const caseless_str& old_units);
3838 void update_fontunits (const caseless_str& old_fontunits);
3842 Matrix x_render, x_render_inv;
3843 Matrix x_gl_mat1, x_gl_mat2;
3845 std::list<octave_value> zoom_stack;
3848 int xstate, ystate, zstate;
3849 double xPlane, xPlaneN, yPlane, yPlaneN, zPlane, zPlaneN;
3850 double xpTick, xpTickN, ypTick, ypTickN, zpTick, zpTickN;
3852 double xticklen, yticklen, zticklen;
3853 double xtickoffset, ytickoffset, ztickoffset;
3854 bool x2Dtop, y2Dright, layer2Dtop, is2D;
3855 bool xySym, xyzSym, zSign, nearhoriz;
3858 // FreeType renderer, used for calculation of text (tick labels) size
3859 ft_render text_renderer;
3862 void set_text_child (handle_property& h, const std::string& who,
3863 const octave_value& v);
3865 void delete_text_child (handle_property& h);
3867 // See the genprops.awk script for an explanation of the
3868 // properties declarations.
3869 // Programming note: Keep property list sorted if new ones are added.
3871 BEGIN_PROPERTIES (axes)
3872 radio_property activepositionproperty , "{outerposition}|position
"
3873 row_vector_property alim m , default_lim ()
3874 radio_property alimmode , "{
auto}|manual
"
3875 color_property ambientlightcolor , color_values (1, 1, 1)
3876 bool_property box , "on
"
3877 array_property cameraposition m , Matrix (1, 3, 0.0)
3878 radio_property camerapositionmode , "{
auto}|manual
"
3879 array_property cameratarget m , Matrix (1, 3, 0.0)
3880 radio_property cameratargetmode , "{
auto}|manual
"
3881 array_property cameraupvector m , Matrix (1, 3, 0.0)
3882 radio_property cameraupvectormode , "{
auto}|manual
"
3883 double_property cameraviewangle m , 10.0
3884 radio_property cameraviewanglemode , "{
auto}|manual
"
3885 row_vector_property clim m , default_lim ()
3886 radio_property climmode al , "{
auto}|manual
"
3887 color_property color , color_property (color_values (1, 1, 1), radio_values ("none
"))
3888 array_property colororder , default_colororder ()
3889 array_property currentpoint , Matrix (2, 3, 0.0)
3890 array_property dataaspectratio mu , Matrix (1, 3, 1.0)
3891 radio_property dataaspectratiomode u , "{
auto}|manual
"
3892 radio_property drawmode , "{normal}|fast
"
3893 radio_property fontangle u , "{normal}|italic|oblique
"
3894 string_property fontname u , OCTAVE_DEFAULT_FONTNAME
3895 double_property fontsize u , 10
3896 radio_property fontunits SU , "{points}|normalized|inches|centimeters|pixels
"
3897 radio_property fontweight u , "{normal}|light|demi|bold
"
3898 radio_property gridlinestyle , "-|--|{:}|-.|none
"
3899 // NOTE: interpreter is not a Matlab axis property, but it makes
3900 // more sense to have it so that axis ticklabels can use it.
3901 radio_property interpreter , "tex|{none}|latex
"
3902 radio_property layer u , "{bottom}|top
"
3903 // FIXME: should be kind of string array.
3904 any_property linestyleorder S , "-
"
3905 double_property linewidth , 0.5
3906 radio_property minorgridlinestyle , "-|--|{:}|-.|none
"
3907 double_property mousewheelzoom , 0.5
3908 radio_property nextplot , "add|replacechildren|{
replace}
"
3909 array_property outerposition u , default_axes_outerposition ()
3910 array_property plotboxaspectratio mu , Matrix (1, 3, 1.0)
3911 radio_property plotboxaspectratiomode u , "{
auto}|manual
"
3912 array_property position u , default_axes_position ()
3913 radio_property projection , "{orthographic}|perspective
"
3914 radio_property tickdir mu , "{in}|out
"
3915 radio_property tickdirmode u , "{
auto}|manual
"
3916 array_property ticklength u , default_axes_ticklength ()
3917 array_property tightinset r , Matrix (1, 4, 0.0)
3918 handle_property title SOf , gh_manager::make_graphics_handle ("text", __myhandle__, false, false, false)
3919 // FIXME: uicontextmenu should be moved here.
3920 radio_property units SU , "{normalized}|inches|centimeters|points|pixels|characters
"
3921 array_property view u , default_axes_view ()
3922 radio_property xaxislocation u , "{bottom}|top|zero
"
3923 color_property xcolor , color_values (0, 0, 0)
3924 radio_property xdir u , "{normal}|reverse
"
3925 bool_property xgrid , "off
"
3926 handle_property xlabel SOf , gh_manager::make_graphics_handle ("text", __myhandle__, false, false, false)
3927 row_vector_property xlim mu , default_lim ()
3928 radio_property xlimmode al , "{
auto}|manual
"
3929 bool_property xminorgrid , "off
"
3930 bool_property xminortick , "off
"
3931 radio_property xscale alu , "{linear}|log
"
3932 row_vector_property xtick mu , default_axes_tick ()
3933 // FIXME: should be kind of string array.
3934 any_property xticklabel S , ""
3935 radio_property xticklabelmode u , "{
auto}|manual
"
3936 radio_property xtickmode u , "{
auto}|manual
"
3937 radio_property yaxislocation u , "{
left}|right|zero
"
3938 color_property ycolor , color_values (0, 0, 0)
3939 radio_property ydir u , "{normal}|reverse
"
3940 bool_property ygrid , "off
"
3941 handle_property ylabel SOf , gh_manager::make_graphics_handle ("text", __myhandle__, false, false, false)
3942 row_vector_property ylim mu , default_lim ()
3943 radio_property ylimmode al , "{
auto}|manual
"
3944 bool_property yminorgrid , "off
"
3945 bool_property yminortick , "off
"
3946 radio_property yscale alu , "{linear}|log
"
3947 row_vector_property ytick mu , default_axes_tick ()
3948 any_property yticklabel S , ""
3949 radio_property yticklabelmode u , "{
auto}|manual
"
3950 radio_property ytickmode u , "{
auto}|manual
"
3951 color_property zcolor , color_values (0, 0, 0)
3952 radio_property zdir u , "{normal}|reverse
"
3953 bool_property zgrid , "off
"
3954 handle_property zlabel SOf , gh_manager::make_graphics_handle ("text", __myhandle__, false, false, false)
3955 row_vector_property zlim mu , default_lim ()
3956 radio_property zlimmode al , "{
auto}|manual
"
3957 bool_property zminorgrid , "off
"
3958 bool_property zminortick , "off
"
3959 radio_property zscale alu , "{linear}|log
"
3960 row_vector_property ztick mu , default_axes_tick ()
3961 any_property zticklabel S , ""
3962 radio_property zticklabelmode u , "{
auto}|manual
"
3963 radio_property ztickmode u , "{
auto}|manual
"
3964 // Octave-specific properties
3965 bool_property __hold_all__ h , "off
"
3966 // hidden properties for alignment of subplots
3967 radio_property autopos_tag h , "{none}|subplot
"
3968 // hidden properties for inset
3969 array_property looseinset hu , Matrix (1, 4, 0.0)
3970 // hidden properties for transformation computation
3971 array_property x_viewtransform h , Matrix (4, 4, 0.0)
3972 array_property x_projectiontransform h , Matrix (4, 4, 0.0)
3973 array_property x_viewporttransform h , Matrix (4, 4, 0.0)
3974 array_property x_normrendertransform h , Matrix (4, 4, 0.0)
3975 array_property x_rendertransform h , Matrix (4, 4, 0.0)
3976 // hidden properties for minor ticks
3977 row_vector_property xmtick h , Matrix ()
3978 row_vector_property ymtick h , Matrix ()
3979 row_vector_property zmtick h , Matrix ()
3980 // hidden property for text rendering
3981 double_property fontsize_points hgr , 0
3990 get_scale (const std::string& scale, const Matrix& lims)
3992 std::string retval = scale;
3994 if (scale == "log
" && lims.numel () > 1 && lims(0) < 0 && lims(1) < 0)
4000 void update_xscale (void)
4002 sx = get_scale (get_xscale (), xlim.get ().matrix_value ());
4005 void update_yscale (void)
4007 sy = get_scale (get_yscale (), ylim.get ().matrix_value ());
4010 void update_zscale (void)
4012 sz = get_scale (get_zscale (), zlim.get ().matrix_value ());
4015 void update_view (void) { sync_positions (); }
4016 void update_dataaspectratio (void) { sync_positions (); }
4017 void update_dataaspectratiomode (void) { sync_positions (); }
4018 void update_plotboxaspectratio (void) { sync_positions (); }
4019 void update_plotboxaspectratiomode (void) { sync_positions (); }
4021 void update_layer (void) { update_axes_layout (); }
4022 void update_yaxislocation (void)
4025 update_axes_layout ();
4026 update_ylabel_position ();
4028 void update_xaxislocation (void)
4031 update_axes_layout ();
4032 update_xlabel_position ();
4035 void update_xdir (void) { update_camera (); update_axes_layout (); }
4036 void update_ydir (void) { update_camera (); update_axes_layout (); }
4037 void update_zdir (void) { update_camera (); update_axes_layout (); }
4039 void update_ticklength (void);
4040 void update_tickdir (void) { update_ticklength (); }
4041 void update_tickdirmode (void) { update_ticklength (); }
4043 void update_xtick (void)
4045 if (xticklabelmode.is ("auto"))
4046 calc_ticklabels (xtick, xticklabel, xscale.is ("log
"));
4049 void update_ytick (void)
4051 if (yticklabelmode.is ("auto"))
4052 calc_ticklabels (ytick, yticklabel, yscale.is ("log
"));
4055 void update_ztick (void)
4057 if (zticklabelmode.is ("auto"))
4058 calc_ticklabels (ztick, zticklabel, zscale.is ("log
"));
4062 void update_xtickmode (void)
4064 if (xtickmode.is ("auto"))
4066 calc_ticks_and_lims (xlim, xtick, xmtick, xlimmode.is ("auto"),
4071 void update_ytickmode (void)
4073 if (ytickmode.is ("auto"))
4075 calc_ticks_and_lims (ylim, ytick, ymtick, ylimmode.is ("auto"),
4080 void update_ztickmode (void)
4082 if (ztickmode.is ("auto"))
4084 calc_ticks_and_lims (zlim, ztick, zmtick, zlimmode.is ("auto"),
4090 void update_xticklabelmode (void)
4092 if (xticklabelmode.is ("auto"))
4093 calc_ticklabels (xtick, xticklabel, xscale.is ("log
"));
4095 void update_yticklabelmode (void)
4097 if (yticklabelmode.is ("auto"))
4098 calc_ticklabels (ytick, yticklabel, yscale.is ("log
"));
4100 void update_zticklabelmode (void)
4102 if (zticklabelmode.is ("auto"))
4103 calc_ticklabels (ztick, zticklabel, zscale.is ("log
"));
4106 void update_font (void);
4107 void update_fontname (void)
4112 void update_fontsize (void)
4117 void update_fontangle (void)
4122 void update_fontweight (void)
4128 void update_outerposition (void)
4130 set_activepositionproperty ("outerposition
");
4131 caseless_str old_units = get_units ();
4132 set_units ("normalized
");
4133 Matrix outerbox = outerposition.get ().matrix_value ();
4134 Matrix innerbox = position.get ().matrix_value ();
4135 Matrix linset = looseinset.get ().matrix_value ();
4136 Matrix tinset = tightinset.get ().matrix_value ();
4137 outerbox(2) = outerbox(2) + outerbox(0);
4138 outerbox(3) = outerbox(3) + outerbox(1);
4139 innerbox(0) = outerbox(0) + std::max (linset(0), tinset(0));
4140 innerbox(1) = outerbox(1) + std::max (linset(1), tinset(1));
4141 innerbox(2) = outerbox(2) - std::max (linset(2), tinset(2));
4142 innerbox(3) = outerbox(3) - std::max (linset(3), tinset(3));
4143 innerbox(2) = innerbox(2) - innerbox(0);
4144 innerbox(3) = innerbox(3) - innerbox(1);
4145 position = innerbox;
4146 set_units (old_units);
4147 update_transform ();
4150 void update_position (void)
4152 set_activepositionproperty ("position
");
4153 caseless_str old_units = get_units ();
4154 set_units ("normalized
");
4155 Matrix outerbox = outerposition.get ().matrix_value ();
4156 Matrix innerbox = position.get ().matrix_value ();
4157 Matrix linset = looseinset.get ().matrix_value ();
4158 Matrix tinset = tightinset.get ().matrix_value ();
4159 innerbox(2) = innerbox(2) + innerbox(0);
4160 innerbox(3) = innerbox(3) + innerbox(1);
4161 outerbox(0) = innerbox(0) - std::max (linset(0), tinset(0));
4162 outerbox(1) = innerbox(1) - std::max (linset(1), tinset(1));
4163 outerbox(2) = innerbox(2) + std::max (linset(2), tinset(2));
4164 outerbox(3) = innerbox(3) + std::max (linset(3), tinset(3));
4165 outerbox(2) = outerbox(2) - outerbox(0);
4166 outerbox(3) = outerbox(3) - outerbox(1);
4167 outerposition = outerbox;
4168 set_units (old_units);
4169 update_transform ();
4172 void update_looseinset (void)
4174 caseless_str old_units = get_units ();
4175 set_units ("normalized
");
4176 Matrix innerbox = position.get ().matrix_value ();
4177 innerbox(2) = innerbox(2) + innerbox(0);
4178 innerbox(3) = innerbox(3) + innerbox(1);
4179 Matrix outerbox = outerposition.get ().matrix_value ();
4180 outerbox(2) = outerbox(2) + outerbox(0);
4181 outerbox(3) = outerbox(3) + outerbox(1);
4182 Matrix linset = looseinset.get ().matrix_value ();
4183 Matrix tinset = tightinset.get ().matrix_value ();
4184 if (activepositionproperty.is ("position
"))
4186 outerbox(0) = innerbox(0) - std::max (linset(0), tinset(0));
4187 outerbox(1) = innerbox(1) - std::max (linset(1), tinset(1));
4188 outerbox(2) = innerbox(2) + std::max (linset(2), tinset(2));
4189 outerbox(3) = innerbox(3) + std::max (linset(3), tinset(3));
4190 outerbox(2) = outerbox(2) - outerbox(0);
4191 outerbox(3) = outerbox(3) - outerbox(1);
4192 outerposition = outerbox;
4196 innerbox(0) = outerbox(0) + std::max (linset(0), tinset(0));
4197 innerbox(1) = outerbox(1) + std::max (linset(1), tinset(1));
4198 innerbox(2) = outerbox(2) - std::max (linset(2), tinset(2));
4199 innerbox(3) = outerbox(3) - std::max (linset(3), tinset(3));
4200 innerbox(2) = innerbox(2) - innerbox(0);
4201 innerbox(3) = innerbox(3) - innerbox(1);
4202 position = innerbox;
4204 set_units (old_units);
4205 update_transform ();
4208 double calc_tick_sep (double minval, double maxval);
4209 void calc_ticks_and_lims (array_property& lims, array_property& ticks,
4210 array_property& mticks,
4211 bool limmode_is_auto, bool is_logscale);
4212 void calc_ticklabels (const array_property& ticks, any_property& labels,
4214 Matrix get_ticklabel_extents (const Matrix& ticks,
4215 const string_vector& ticklabels,
4216 const Matrix& limits);
4218 void fix_limits (array_property& lims)
4220 if (lims.get ().is_empty ())
4223 Matrix l = lims.get ().matrix_value ();
4230 else if (l(0) == l(1))
4238 Matrix calc_tightbox (const Matrix& init_pos);
4241 Matrix get_axis_limits (double xmin, double xmax,
4242 double min_pos, double max_neg,
4247 if (xtickmode.is ("auto"))
4248 calc_ticks_and_lims (xlim, xtick, xmtick, xlimmode.is ("auto"),
4250 if (xticklabelmode.is ("auto"))
4251 calc_ticklabels (xtick, xticklabel, xscale.is ("log
"));
4257 update_axes_layout ();
4260 void update_ylim (void)
4262 if (ytickmode.is ("auto"))
4263 calc_ticks_and_lims (ylim, ytick, ymtick, ylimmode.is ("auto"),
4265 if (yticklabelmode.is ("auto"))
4266 calc_ticklabels (ytick, yticklabel, yscale.is ("log
"));
4272 update_axes_layout ();
4275 void update_zlim (void)
4277 if (ztickmode.is ("auto"))
4278 calc_ticks_and_lims (zlim, ztick, zmtick, zlimmode.is ("auto"),
4280 if (zticklabelmode.is ("auto"))
4281 calc_ticklabels (ztick, zticklabel, zscale.is ("log
"));
4287 update_axes_layout ();
4293 properties xproperties;
4296 axes (const graphics_handle& mh, const graphics_handle& p)
4297 : base_graphics_object (), xproperties (mh, p), default_properties ()
4299 xproperties.update_transform ();
4304 void override_defaults (base_graphics_object& obj)
4306 // Allow parent (figure) to override first (properties knows how
4307 // to find the parent object).
4308 xproperties.override_defaults (obj);
4310 // Now override with our defaults. If the default_properties
4311 // list includes the properties for all defaults (line,
4312 // surface, etc.) then we don't have to know the type of OBJ
4313 // here, we just call its set function and let it decide which
4314 // properties from the list to use.
4315 obj.set_from_list (default_properties);
4318 void set (const caseless_str& name, const octave_value& value)
4320 if (name.compare ("default", 7))
4321 // strip "default", pass rest to function that will
4322 // parse the remainder and add the element to the
4323 // default_properties map.
4324 default_properties.set (name.substr (7), value);
4326 xproperties.set (name, value);
4329 void set_defaults (const std::string& mode)
4331 xproperties.set_defaults (*this, mode);
4334 octave_value get (const caseless_str& name) const
4336 octave_value retval;
4338 // FIXME: finish this.
4339 if (name.compare ("default", 7))
4340 retval = get_default (name.substr (7));
4342 retval = xproperties.get (name);
4347 octave_value get_default (const caseless_str& name) const;
4349 octave_value get_defaults (void) const
4351 return default_properties.as_struct ("default");
4354 property_list get_defaults_list (void) const
4356 return default_properties;
4359 base_properties& get_properties (void) { return xproperties; }
4361 const base_properties& get_properties (void) const { return xproperties; }
4363 void update_axis_limits (const std::string& axis_type);
4365 void update_axis_limits (const std::string& axis_type,
4366 const graphics_handle& h);
4368 bool valid_object (void) const { return true; }
4370 void reset_default_properties (void);
4372 bool has_readonly_property (const caseless_str& pname) const
4374 bool retval = xproperties.has_readonly_property (pname);
4376 retval = base_properties::has_readonly_property (pname);
4381 void initialize (const graphics_object& go);
4384 property_list default_properties;
4387 // ---------------------------------------------------------------------
4389 class OCTINTERP_API line : public base_graphics_object
4392 class OCTINTERP_API properties : public base_properties
4395 // See the genprops.awk script for an explanation of the
4396 // properties declarations.
4397 // Programming note: Keep property list sorted if new ones are added.
4399 BEGIN_PROPERTIES (line)
4400 color_property color , color_values (0, 0, 0)
4401 string_property displayname , ""
4402 radio_property erasemode , "{normal}|none|xor|background
"
4403 // FIXME: interpreter is not a property of Matlab line objects.
4404 // Octave uses this for legend() with the string displayname.
4405 radio_property interpreter , "{tex}|none|latex
"
4406 radio_property linestyle , "{-}|--|:|-.|none
"
4407 double_property linewidth , 0.5
4408 radio_property marker , "{none}|+|o|*|.|
x|s|square|
d|diamond|^|v|>|<|p|pentagram|h|hexagram
"
4409 color_property markeredgecolor , color_property (radio_values ("{
auto}|none
"), color_values (0, 0, 0))
4410 color_property markerfacecolor , color_property (radio_values ("auto|{none}
"), color_values (0, 0, 0))
4411 double_property markersize , 6
4412 row_vector_property xdata u , default_data ()
4413 string_property xdatasource , ""
4414 row_vector_property ydata u , default_data ()
4415 string_property ydatasource , ""
4416 row_vector_property zdata u , Matrix ()
4417 string_property zdatasource , ""
4419 // hidden properties for limit computation
4420 row_vector_property xlim hlr , Matrix ()
4421 row_vector_property ylim hlr , Matrix ()
4422 row_vector_property zlim hlr , Matrix ()
4423 bool_property xliminclude hl , "on
"
4424 bool_property yliminclude hl , "on
"
4425 bool_property zliminclude hl , "off
"
4429 Matrix compute_xlim (void) const;
4430 Matrix compute_ylim (void) const;
4432 void update_xdata (void) { set_xlim (compute_xlim ()); }
4434 void update_ydata (void) { set_ylim (compute_ylim ()); }
4436 void update_zdata (void)
4438 set_zlim (zdata.get_limits ());
4439 set_zliminclude (get_zdata ().numel () > 0);
4444 properties xproperties;
4447 line (const graphics_handle& mh, const graphics_handle& p)
4448 : base_graphics_object (), xproperties (mh, p)
4453 base_properties& get_properties (void) { return xproperties; }
4455 const base_properties& get_properties (void) const { return xproperties; }
4457 bool valid_object (void) const { return true; }
4459 bool has_readonly_property (const caseless_str& pname) const
4461 bool retval = xproperties.has_readonly_property (pname);
4463 retval = base_properties::has_readonly_property (pname);
4468 // ---------------------------------------------------------------------
4470 class OCTINTERP_API text : public base_graphics_object
4473 class OCTINTERP_API properties : public base_properties
4476 double get_fontsize_points (double box_pix_height = 0) const;
4478 void set_position (const octave_value& val)
4482 octave_value new_val (val);
4484 if (new_val.numel () == 2)
4486 dim_vector dv (1, 3);
4488 new_val = new_val.resize (dv, true);
4491 if (position.set (new_val, false))
4493 set_positionmode ("manual
");
4495 position.run_listeners (POSTSET);
4499 set_positionmode ("manual
");
4503 // See the genprops.awk script for an explanation of the
4504 // properties declarations.
4506 BEGIN_PROPERTIES (text)
4507 color_property backgroundcolor , color_property (radio_values ("{none}
"), color_values (1, 1, 1))
4508 color_property color u , color_values (0, 0, 0)
4509 string_property displayname , ""
4510 color_property edgecolor , color_property (radio_values ("{none}
"), color_values (0, 0, 0))
4511 bool_property editing , "off
"
4512 radio_property erasemode , "{normal}|none|xor|background
"
4513 array_property extent rG , Matrix (1, 4, 0.0)
4514 radio_property fontangle u , "{normal}|italic|oblique
"
4515 string_property fontname u , OCTAVE_DEFAULT_FONTNAME
4516 double_property fontsize u , 10
4517 radio_property fontunits SU , "inches|centimeters|normalized|{points}|pixels
"
4518 radio_property fontweight u , "light|{normal}|demi|bold
"
4519 radio_property horizontalalignment mu , "{
left}|center|right
"
4520 radio_property interpreter u , "{tex}|none|latex
"
4521 radio_property linestyle , "{-}|--|:|-.|none
"
4522 double_property linewidth , 0.5
4523 double_property margin , 2
4524 array_property position smu , Matrix (1, 3, 0.0)
4525 double_property rotation mu , 0
4526 text_label_property string u , ""
4527 radio_property units u , "{data}|pixels|normalized|inches|centimeters|points
"
4528 radio_property verticalalignment mu , "top|cap|{middle}|baseline|bottom
"
4530 // hidden properties for limit computation
4531 row_vector_property xlim hlr , Matrix ()
4532 row_vector_property ylim hlr , Matrix ()
4533 row_vector_property zlim hlr , Matrix ()
4534 bool_property xliminclude hl , "off
"
4535 bool_property yliminclude hl , "off
"
4536 bool_property zliminclude hl , "off
"
4537 // hidden properties for auto-positioning
4538 radio_property positionmode hu , "{
auto}|manual
"
4539 radio_property rotationmode hu , "{
auto}|manual
"
4540 radio_property horizontalalignmentmode hu , "{
auto}|manual
"
4541 radio_property verticalalignmentmode hu , "{
auto}|manual
"
4542 radio_property autopos_tag h , "{none}|xlabel|ylabel|zlabel|title
"
4543 // hidden property for text rendering
4544 double_property fontsize_points hgr , 0
4547 Matrix get_data_position (void) const;
4548 Matrix get_extent_matrix (void) const;
4549 const uint8NDArray& get_pixels (void) const { return pixels; }
4551 // FreeType renderer, used for calculation of text size
4558 position.add_constraint (dim_vector (1, 3));
4559 cached_units = get_units ();
4564 void update_position (void)
4566 Matrix pos = get_data_position ();
4569 lim = Matrix (1, 3, pos(0));
4570 lim(2) = (lim(2) <= 0 ? octave_Inf : lim(2));
4573 lim = Matrix (1, 3, pos(1));
4574 lim(2) = (lim(2) <= 0 ? octave_Inf : lim(2));
4577 if (pos.numel () == 3)
4579 lim = Matrix (1, 3, pos(2));
4580 lim(2) = (lim(2) <= 0 ? octave_Inf : lim(2));
4581 set_zliminclude ("on
");
4585 set_zliminclude ("off
");
4588 void update_text_extent (void);
4590 void request_autopos (void);
4591 void update_positionmode (void) { request_autopos (); }
4592 void update_rotationmode (void) { request_autopos (); }
4593 void update_horizontalalignmentmode (void) { request_autopos (); }
4594 void update_verticalalignmentmode (void) { request_autopos (); }
4596 void update_font (void);
4597 void update_string (void) { request_autopos (); update_text_extent (); }
4598 void update_rotation (void) { update_text_extent (); }
4599 void update_color (void) { update_font (); update_text_extent (); }
4600 void update_fontname (void) { update_font (); update_text_extent (); }
4601 void update_fontsize (void) { update_font (); update_text_extent (); }
4602 void update_fontangle (void) { update_font (); update_text_extent (); }
4603 void update_fontweight (void) { update_font (); update_text_extent (); }
4604 void update_interpreter (void) { update_text_extent (); }
4605 void update_horizontalalignment (void) { update_text_extent (); }
4606 void update_verticalalignment (void) { update_text_extent (); }
4608 void update_units (void);
4609 void update_fontunits (const caseless_str& old_fontunits);
4612 std::string cached_units;
4613 uint8NDArray pixels;
4617 properties xproperties;
4620 text (const graphics_handle& mh, const graphics_handle& p)
4621 : base_graphics_object (), xproperties (mh, p)
4623 xproperties.set_clipping ("off
");
4628 base_properties& get_properties (void) { return xproperties; }
4630 const base_properties& get_properties (void) const { return xproperties; }
4632 bool valid_object (void) const { return true; }
4634 bool has_readonly_property (const caseless_str& pname) const
4636 bool retval = xproperties.has_readonly_property (pname);
4638 retval = base_properties::has_readonly_property (pname);
4643 // ---------------------------------------------------------------------
4645 class OCTINTERP_API image : public base_graphics_object
4648 class OCTINTERP_API properties : public base_properties
4651 bool is_aliminclude (void) const
4652 { return (aliminclude.is_on () && alphadatamapping.is ("scaled
")); }
4653 std::string get_aliminclude (void) const
4654 { return aliminclude.current_value (); }
4656 bool is_climinclude (void) const
4657 { return (climinclude.is_on () && cdatamapping.is ("scaled
")); }
4658 std::string get_climinclude (void) const
4659 { return climinclude.current_value (); }
4661 octave_value get_color_data (void) const;
4663 void initialize_data (void) { update_cdata (); }
4665 // See the genprops.awk script for an explanation of the
4666 // properties declarations.
4667 // Programming note: Keep property list sorted if new ones are added.
4669 BEGIN_PROPERTIES (image)
4670 array_property alphadata u , Matrix (1, 1, 1.0)
4671 radio_property alphadatamapping al , "{none}|direct|scaled
"
4672 array_property cdata u , default_image_cdata ()
4673 radio_property cdatamapping al , "scaled|{direct}
"
4674 string_property displayname , ""
4675 radio_property erasemode , "{normal}|none|xor|background
"
4676 row_vector_property xdata mu , Matrix ()
4677 row_vector_property ydata mu , Matrix ()
4678 // hidden properties for limit computation
4679 row_vector_property alim hlr , Matrix ()
4680 row_vector_property clim hlr , Matrix ()
4681 row_vector_property xlim hlr , Matrix ()
4682 row_vector_property ylim hlr , Matrix ()
4683 bool_property aliminclude hlg , "on
"
4684 bool_property climinclude hlg , "on
"
4685 bool_property xliminclude hl , "on
"
4686 bool_property yliminclude hl , "on
"
4687 radio_property xdatamode ha , "{
auto}|manual
"
4688 radio_property ydatamode ha , "{
auto}|manual
"
4694 xdata.add_constraint (2);
4695 ydata.add_constraint (2);
4696 cdata.add_constraint ("double");
4697 cdata.add_constraint ("single
");
4698 cdata.add_constraint ("logical
");
4699 cdata.add_constraint ("uint8
");
4700 cdata.add_constraint ("uint16
");
4701 cdata.add_constraint ("int16
");
4702 cdata.add_constraint ("real");
4703 cdata.add_constraint (dim_vector (-1, -1));
4704 cdata.add_constraint (dim_vector (-1, -1, 3));
4705 alphadata.add_constraint (dim_vector (-1, -1));
4706 alphadata.add_constraint ("double");
4707 alphadata.add_constraint ("uint8
");
4711 void update_alphadata (void)
4713 if (alphadatamapping_is ("scaled
"))
4714 set_alim (alphadata.get_limits ());
4716 alim = alphadata.get_limits ();
4719 void update_cdata (void)
4721 if (cdatamapping_is ("scaled
"))
4722 set_clim (cdata.get_limits ());
4724 clim = cdata.get_limits ();
4726 if (xdatamode.is ("auto"))
4729 if (ydatamode.is ("auto"))
4733 void update_xdata (void)
4735 if (xdata.get ().is_empty ())
4736 set_xdatamode ("auto");
4738 if (xdatamode.is ("auto"))
4740 set_xdata (get_auto_xdata ());
4741 set_xdatamode ("auto");
4744 Matrix limits = xdata.get_limits ();
4745 float dp = pixel_xsize ();
4747 limits(0) = limits(0) - dp;
4748 limits(1) = limits(1) + dp;
4752 void update_ydata (void)
4754 if (ydata.get ().is_empty ())
4755 set_ydatamode ("auto");
4757 if (ydatamode.is ("auto"))
4759 set_ydata (get_auto_ydata ());
4760 set_ydatamode ("auto");
4763 Matrix limits = ydata.get_limits ();
4764 float dp = pixel_ysize ();
4766 limits(0) = limits(0) - dp;
4767 limits(1) = limits(1) + dp;
4771 Matrix get_auto_xdata (void)
4773 dim_vector dv = get_cdata ().dims ();
4777 data = Matrix (1, 2, 1);
4783 Matrix get_auto_ydata (void)
4785 dim_vector dv = get_cdata ().dims ();
4789 data = Matrix (1, 2, 1);
4795 float pixel_size (octave_idx_type dim, const Matrix limits)
4797 octave_idx_type l = dim - 1;
4800 if (l > 0 && limits(0) != limits(1))
4801 dp = (limits(1) - limits(0))/(2*l);
4804 if (limits(1) == limits(2))
4807 dp = (limits(1) - limits(0))/2;
4813 float pixel_xsize (void)
4815 return pixel_size ((get_cdata ().dims ())(1), xdata.get_limits ());
4818 float pixel_ysize (void)
4820 return pixel_size ((get_cdata ().dims ())(0), ydata.get_limits ());
4825 properties xproperties;
4828 image (const graphics_handle& mh, const graphics_handle& p)
4829 : base_graphics_object (), xproperties (mh, p)
4831 xproperties.initialize_data ();
4836 base_properties& get_properties (void) { return xproperties; }
4838 const base_properties& get_properties (void) const { return xproperties; }
4840 bool valid_object (void) const { return true; }
4842 bool has_readonly_property (const caseless_str& pname) const
4844 bool retval = xproperties.has_readonly_property (pname);
4846 retval = base_properties::has_readonly_property (pname);
4851 // ---------------------------------------------------------------------
4853 class OCTINTERP_API patch : public base_graphics_object
4856 class OCTINTERP_API properties : public base_properties
4859 octave_value get_color_data (void) const;
4861 // Matlab allows incoherent data to be stored into patch properties.
4862 // The patch should then be ignored by the renderer.
4863 bool has_bad_data (std::string &msg) const
4866 return ! msg.empty ();
4869 bool is_aliminclude (void) const
4870 { return (aliminclude.is_on () && alphadatamapping.is ("scaled
")); }
4871 std::string get_aliminclude (void) const
4872 { return aliminclude.current_value (); }
4874 bool is_climinclude (void) const
4875 { return (climinclude.is_on () && cdatamapping.is ("scaled
")); }
4876 std::string get_climinclude (void) const
4877 { return climinclude.current_value (); }
4879 // See the genprops.awk script for an explanation of the
4880 // properties declarations.
4881 // Programming note: Keep property list sorted if new ones are added.
4883 BEGIN_PROPERTIES (patch)
4884 radio_property alphadatamapping l , "none|{scaled}|direct
"
4885 double_property ambientstrength , 0.3
4886 radio_property backfacelighting , "unlit|lit|{reverselit}
"
4887 array_property cdata u , Matrix ()
4888 radio_property cdatamapping l , "{scaled}|direct
"
4889 double_property diffusestrength , 0.6
4890 string_property displayname , ""
4891 double_radio_property edgealpha , double_radio_property (1.0, radio_values ("flat|interp
"))
4892 color_property edgecolor , color_property (color_values (0, 0, 0), radio_values ("none|flat|interp
"))
4893 radio_property edgelighting , "{none}|flat|gouraud|phong
"
4894 radio_property erasemode , "{normal}|background|xor|none
"
4895 double_radio_property facealpha , double_radio_property (1.0, radio_values ("flat|interp
"))
4896 color_property facecolor , color_property (color_values (0, 0, 0), radio_values ("none|flat|interp
"))
4897 radio_property facelighting , "{none}|flat|gouraud|phong
"
4898 array_property faces u , default_patch_faces ()
4899 array_property facevertexalphadata , Matrix ()
4900 array_property facevertexcdata u , Matrix ()
4901 // FIXME: interpreter is not a property of a Matlab patch.
4902 // Octave uses this for legend() with the string displayname.
4903 radio_property interpreter , "{tex}|none|latex
"
4904 radio_property linestyle , "{-}|--|:|-.|none
"
4905 double_property linewidth , 0.5
4906 radio_property marker , "{none}|+|o|*|.|
x|s|square|
d|diamond|^|v|>|<|p|pentagram|h|hexagram
"
4907 color_property markeredgecolor , color_property (radio_values ("none|{
auto}|flat
"), color_values (0, 0, 0))
4908 color_property markerfacecolor , color_property (radio_values ("{none}|
auto|flat
"), color_values (0, 0, 0))
4909 double_property markersize , 6
4910 radio_property normalmode , "{
auto}|manual
"
4911 double_property specularcolorreflectance , 1.0
4912 double_property specularexponent , 10.0
4913 double_property specularstrength , 0.9
4914 array_property vertexnormals , Matrix ()
4915 array_property vertices u , default_patch_vertices ()
4916 array_property xdata u , default_patch_xdata ()
4917 array_property ydata u , default_patch_ydata ()
4918 array_property zdata u , Matrix ()
4920 // hidden properties for limit computation
4921 row_vector_property alim hlr , Matrix ()
4922 row_vector_property clim hlr , Matrix ()
4923 row_vector_property xlim hlr , Matrix ()
4924 row_vector_property ylim hlr , Matrix ()
4925 row_vector_property zlim hlr , Matrix ()
4926 bool_property aliminclude hlg , "on
"
4927 bool_property climinclude hlg , "on
"
4928 bool_property xliminclude hl , "on
"
4929 bool_property yliminclude hl , "on
"
4930 bool_property zliminclude hl , "on
"
4936 xdata.add_constraint (dim_vector (-1, -1));
4937 ydata.add_constraint (dim_vector (-1, -1));
4938 zdata.add_constraint (dim_vector (-1, -1));
4939 faces.add_constraint (dim_vector (-1, -1));
4940 vertices.add_constraint (dim_vector (-1, 2));
4941 vertices.add_constraint (dim_vector (-1, 3));
4942 cdata.add_constraint (dim_vector (-1, -1));
4943 cdata.add_constraint (dim_vector (-1, -1, 3));
4944 facevertexcdata.add_constraint (dim_vector (-1, 1));
4945 facevertexcdata.add_constraint (dim_vector (-1, 3));
4946 facevertexalphadata.add_constraint (dim_vector (-1, 1));
4947 vertexnormals.add_constraint (dim_vector (-1, -1));
4951 std::string bad_data_msg;
4953 void update_faces (void) { update_data ();}
4955 void update_vertices (void) { update_data ();}
4957 void update_facevertexcdata (void) { update_data ();}
4959 void update_fvc (void);
4961 void update_xdata (void)
4963 if (get_xdata ().is_empty ())
4965 // For compatibility with matlab behavior,
4966 // if x/ydata are set empty, silently empty other *data and
4967 // faces properties while vertices remain unchanged.
4968 set_ydata (Matrix ());
4969 set_zdata (Matrix ());
4970 set_cdata (Matrix ());
4971 set_faces (Matrix ());
4976 set_xlim (xdata.get_limits ());
4979 void update_ydata (void)
4981 if (get_ydata ().is_empty ())
4983 set_xdata (Matrix ());
4984 set_zdata (Matrix ());
4985 set_cdata (Matrix ());
4986 set_faces (Matrix ());
4991 set_ylim (ydata.get_limits ());
4994 void update_zdata (void)
4997 set_zlim (zdata.get_limits ());
5000 void update_cdata (void)
5004 if (cdatamapping_is ("scaled
"))
5005 set_clim (cdata.get_limits ());
5007 clim = cdata.get_limits ();
5011 void update_data (void);
5015 properties xproperties;
5018 patch (const graphics_handle& mh, const graphics_handle& p)
5019 : base_graphics_object (), xproperties (mh, p)
5024 base_properties& get_properties (void) { return xproperties; }
5026 const base_properties& get_properties (void) const { return xproperties; }
5028 bool valid_object (void) const { return true; }
5030 bool has_readonly_property (const caseless_str& pname) const
5032 bool retval = xproperties.has_readonly_property (pname);
5034 retval = base_properties::has_readonly_property (pname);
5039 // ---------------------------------------------------------------------
5041 class OCTINTERP_API surface : public base_graphics_object
5044 class OCTINTERP_API properties : public base_properties
5047 octave_value get_color_data (void) const;
5049 bool is_aliminclude (void) const
5050 { return (aliminclude.is_on () && alphadatamapping.is ("scaled
")); }
5051 std::string get_aliminclude (void) const
5052 { return aliminclude.current_value (); }
5054 bool is_climinclude (void) const
5055 { return (climinclude.is_on () && cdatamapping.is ("scaled
")); }
5056 std::string get_climinclude (void) const
5057 { return climinclude.current_value (); }
5059 // See the genprops.awk script for an explanation of the
5060 // properties declarations.
5061 // Programming note: Keep property list sorted if new ones are added.
5063 BEGIN_PROPERTIES (surface)
5064 array_property alphadata u , Matrix (1, 1, 1.0)
5065 radio_property alphadatamapping l , "none|direct|{scaled}
"
5066 double_property ambientstrength , 0.3
5067 radio_property backfacelighting , "unlit|lit|{reverselit}
"
5068 array_property cdata u , default_surface_cdata ()
5069 radio_property cdatamapping al , "{scaled}|direct
"
5070 string_property cdatasource , ""
5071 double_property diffusestrength , 0.6
5072 string_property displayname , ""
5073 double_radio_property edgealpha , double_radio_property (1.0, radio_values ("flat|interp
"))
5074 color_property edgecolor , color_property (color_values (0, 0, 0), radio_values ("none|flat|interp
"))
5075 radio_property edgelighting , "{none}|flat|gouraud|phong
"
5076 radio_property erasemode , "{normal}|none|xor|background
"
5077 double_radio_property facealpha , double_radio_property (1.0, radio_values ("flat|interp|texturemap
"))
5078 color_property facecolor , color_property (radio_values ("none|{flat}|interp|texturemap
"), color_values (0, 0, 0))
5079 radio_property facelighting , "{none}|flat|gouraud|phong
"
5080 // FIXME: interpreter is not a Matlab surface property
5081 // Octave uses this for legend() with the string displayname.
5082 radio_property interpreter , "{tex}|none|latex
"
5083 radio_property linestyle , "{-}|--|:|-.|none
"
5084 double_property linewidth , 0.5
5085 radio_property marker , "{none}|+|o|*|.|
x|s|square|
d|diamond|^|v|>|<|p|pentagram|h|hexagram
"
5086 color_property markeredgecolor , color_property (radio_values ("none|{
auto}|flat
"), color_values (0, 0, 0))
5087 color_property markerfacecolor , color_property (radio_values ("{none}|
auto|flat
"), color_values (0, 0, 0))
5088 double_property markersize , 6
5089 radio_property meshstyle , "{both}|row|column
"
5090 radio_property normalmode u , "{
auto}|manual
"
5091 double_property specularcolorreflectance , 1
5092 double_property specularexponent , 10
5093 double_property specularstrength , 0.9
5094 array_property vertexnormals u , Matrix ()
5095 array_property xdata u , default_surface_xdata ()
5096 string_property xdatasource , ""
5097 array_property ydata u , default_surface_ydata ()
5098 string_property ydatasource , ""
5099 array_property zdata u , default_surface_zdata ()
5100 string_property zdatasource , ""
5102 // hidden properties for limit computation
5103 row_vector_property alim hlr , Matrix ()
5104 row_vector_property clim hlr , Matrix ()
5105 row_vector_property xlim hlr , Matrix ()
5106 row_vector_property ylim hlr , Matrix ()
5107 row_vector_property zlim hlr , Matrix ()
5108 bool_property aliminclude hlg , "on
"
5109 bool_property climinclude hlg , "on
"
5110 bool_property xliminclude hl , "on
"
5111 bool_property yliminclude hl , "on
"
5112 bool_property zliminclude hl , "on
"
5118 xdata.add_constraint (dim_vector (-1, -1));
5119 ydata.add_constraint (dim_vector (-1, -1));
5120 zdata.add_constraint (dim_vector (-1, -1));
5121 cdata.add_constraint ("double");
5122 cdata.add_constraint ("single
");
5123 cdata.add_constraint (dim_vector (-1, -1));
5124 cdata.add_constraint (dim_vector (-1, -1, 3));
5125 alphadata.add_constraint ("double");
5126 alphadata.add_constraint ("uint8
");
5127 alphadata.add_constraint (dim_vector (-1, -1));
5128 vertexnormals.add_constraint (dim_vector (-1, -1, 3));
5129 vertexnormals.add_constraint (dim_vector (0, 0));
5133 void update_alphadata (void)
5135 if (alphadatamapping_is ("scaled
"))
5136 set_alim (alphadata.get_limits ());
5138 alim = alphadata.get_limits ();
5141 void update_cdata (void)
5143 if (cdatamapping_is ("scaled
"))
5144 set_clim (cdata.get_limits ());
5146 clim = cdata.get_limits ();
5149 void update_xdata (void)
5152 set_xlim (xdata.get_limits ());
5155 void update_ydata (void)
5158 set_ylim (ydata.get_limits ());
5161 void update_zdata (void)
5164 set_zlim (zdata.get_limits ());
5167 void update_normals (void);
5169 void update_normalmode (void)
5170 { update_normals (); }
5172 void update_vertexnormals (void)
5173 { set_normalmode ("manual
"); }
5177 properties xproperties;
5180 surface (const graphics_handle& mh, const graphics_handle& p)
5181 : base_graphics_object (), xproperties (mh, p)
5186 base_properties& get_properties (void) { return xproperties; }
5188 const base_properties& get_properties (void) const { return xproperties; }
5190 bool valid_object (void) const { return true; }
5192 bool has_readonly_property (const caseless_str& pname) const
5194 bool retval = xproperties.has_readonly_property (pname);
5196 retval = base_properties::has_readonly_property (pname);
5201 // ---------------------------------------------------------------------
5203 class OCTINTERP_API hggroup : public base_graphics_object
5206 class OCTINTERP_API properties : public base_properties
5209 void remove_child (const graphics_handle& h)
5211 base_properties::remove_child (h);
5215 void adopt (const graphics_handle& h)
5218 base_properties::adopt (h);
5222 // See the genprops.awk script for an explanation of the
5223 // properties declarations.
5224 // Programming note: Keep property list sorted if new ones are added.
5226 BEGIN_PROPERTIES (hggroup)
5227 string_property displayname , ""
5228 radio_property erasemode , "{normal}|none|xor|background
"
5230 // hidden properties for limit computation
5231 row_vector_property alim hr , Matrix ()
5232 row_vector_property clim hr , Matrix ()
5233 row_vector_property xlim hr , Matrix ()
5234 row_vector_property ylim hr , Matrix ()
5235 row_vector_property zlim hr , Matrix ()
5236 bool_property aliminclude h , "on
"
5237 bool_property climinclude h , "on
"
5238 bool_property xliminclude h , "on
"
5239 bool_property yliminclude h , "on
"
5240 bool_property zliminclude h , "on
"
5244 void update_limits (void) const;
5246 void update_limits (const graphics_handle& h) const;
5255 properties xproperties;
5258 hggroup (const graphics_handle& mh, const graphics_handle& p)
5259 : base_graphics_object (), xproperties (mh, p)
5264 base_properties& get_properties (void) { return xproperties; }
5266 const base_properties& get_properties (void) const { return xproperties; }
5268 bool valid_object (void) const { return true; }
5270 void update_axis_limits (const std::string& axis_type);
5272 void update_axis_limits (const std::string& axis_type,
5273 const graphics_handle& h);
5275 bool has_readonly_property (const caseless_str& pname) const
5277 bool retval = xproperties.has_readonly_property (pname);
5279 retval = base_properties::has_readonly_property (pname);
5285 // ---------------------------------------------------------------------
5287 class OCTINTERP_API uimenu : public base_graphics_object
5290 class OCTINTERP_API properties : public base_properties
5293 void remove_child (const graphics_handle& h)
5295 base_properties::remove_child (h);
5298 void adopt (const graphics_handle& h)
5300 base_properties::adopt (h);
5303 // See the genprops.awk script for an explanation of the
5304 // properties declarations.
5305 // Programming note: Keep property list sorted if new ones are added.
5307 BEGIN_PROPERTIES (uimenu)
5308 any_property __object__ , Matrix ()
5309 string_property accelerator , ""
5310 callback_property callback , Matrix ()
5311 bool_property checked , "off
"
5312 bool_property enable , "on
"
5313 color_property foregroundcolor , color_values (0, 0, 0)
5314 string_property label , ""
5315 double_property position , 0
5316 bool_property separator , "off
"
5317 // Octave-specific properties
5318 string_property fltk_label h , ""
5327 properties xproperties;
5330 uimenu (const graphics_handle& mh, const graphics_handle& p)
5331 : base_graphics_object (), xproperties (mh, p)
5336 base_properties& get_properties (void) { return xproperties; }
5338 const base_properties& get_properties (void) const { return xproperties; }
5340 bool valid_object (void) const { return true; }
5342 bool has_readonly_property (const caseless_str& pname) const
5344 bool retval = xproperties.has_readonly_property (pname);
5346 retval = base_properties::has_readonly_property (pname);
5352 // ---------------------------------------------------------------------
5354 class OCTINTERP_API uicontextmenu : public base_graphics_object
5357 class OCTINTERP_API properties : public base_properties
5361 void add_dependent_obj (graphics_handle gh)
5362 { dependent_obj_list.push_back (gh); }
5364 // FIXME: the list may contain duplicates.
5365 // Should we return only unique elements?
5366 const std::list<graphics_handle> get_dependent_obj_list (void)
5367 { return dependent_obj_list; }
5369 // See the genprops.awk script for an explanation of the
5370 // properties declarations.
5371 // Programming note: Keep property list sorted if new ones are added.
5373 BEGIN_PROPERTIES (uicontextmenu)
5374 any_property __object__ , Matrix ()
5375 callback_property callback , Matrix ()
5376 array_property position , Matrix (1, 2, 0.0)
5382 position.add_constraint (dim_vector (1, 2));
5383 position.add_constraint (dim_vector (2, 1));
5384 visible.set (octave_value (false));
5388 // List of objects that might depend on this uicontextmenu object
5389 std::list<graphics_handle> dependent_obj_list;
5393 properties xproperties;
5396 uicontextmenu (const graphics_handle& mh, const graphics_handle& p)
5397 : base_graphics_object (), xproperties (mh, p)
5400 ~uicontextmenu (void);
5402 base_properties& get_properties (void) { return xproperties; }
5404 const base_properties& get_properties (void) const { return xproperties; }
5406 bool valid_object (void) const { return true; }
5408 bool has_readonly_property (const caseless_str& pname) const
5410 bool retval = xproperties.has_readonly_property (pname);
5412 retval = base_properties::has_readonly_property (pname);
5418 // ---------------------------------------------------------------------
5420 class OCTINTERP_API uicontrol : public base_graphics_object
5423 class OCTINTERP_API properties : public base_properties
5426 Matrix get_boundingbox (bool internal = false,
5427 const Matrix& parent_pix_size = Matrix ()) const;
5429 double get_fontsize_points (double box_pix_height = 0) const;
5431 // See the genprops.awk script for an explanation of the
5432 // properties declarations.
5433 // Programming note: Keep property list sorted if new ones are added.
5435 BEGIN_PROPERTIES (uicontrol)
5436 any_property __object__ , Matrix ()
5437 color_property backgroundcolor , color_values (1, 1, 1)
5438 callback_property callback , Matrix ()
5439 array_property cdata , Matrix ()
5440 bool_property clipping , "on
"
5441 radio_property enable , "{on}|inactive|off
"
5442 array_property extent rG , Matrix (1, 4, 0.0)
5443 radio_property fontangle u , "{normal}|italic|oblique
"
5444 string_property fontname u , OCTAVE_DEFAULT_FONTNAME
5445 double_property fontsize u , 10
5446 radio_property fontunits S , "inches|centimeters|normalized|{points}|pixels
"
5447 radio_property fontweight u , "light|{normal}|demi|bold
"
5448 color_property foregroundcolor , color_values (0, 0, 0)
5449 radio_property horizontalalignment , "left|{center}|right
"
5450 callback_property keypressfcn , Matrix ()
5451 double_property listboxtop , 1
5452 double_property max , 1
5453 double_property min , 0
5454 array_property position , default_control_position ()
5455 array_property sliderstep , default_control_sliderstep ()
5456 string_array_property string u , ""
5457 radio_property style S , "{pushbutton}|togglebutton|radiobutton|checkbox|edit|
text|slider|frame|listbox|popupmenu
"
5458 string_property tooltipstring , ""
5459 radio_property units u , "normalized|inches|centimeters|points|{pixels}|characters
"
5460 row_vector_property value , Matrix (1, 1, 1.0)
5461 radio_property verticalalignment , "top|{middle}|bottom
"
5465 std::string cached_units;
5470 cdata.add_constraint ("double");
5471 cdata.add_constraint ("single
");
5472 cdata.add_constraint (dim_vector (-1, -1, 3));
5473 position.add_constraint (dim_vector (1, 4));
5474 sliderstep.add_constraint (dim_vector (1, 2));
5475 cached_units = get_units ();
5478 void update_text_extent (void);
5480 void update_string (void) { update_text_extent (); }
5481 void update_fontname (void) { update_text_extent (); }
5482 void update_fontsize (void) { update_text_extent (); }
5483 void update_fontangle (void) { update_text_extent (); }
5484 void update_fontweight (void) { update_text_extent (); }
5485 void update_fontunits (const caseless_str& old_units);
5487 void update_units (void);
5492 properties xproperties;
5495 uicontrol (const graphics_handle& mh, const graphics_handle& p)
5496 : base_graphics_object (), xproperties (mh, p)
5499 ~uicontrol (void) { }
5501 base_properties& get_properties (void) { return xproperties; }
5503 const base_properties& get_properties (void) const { return xproperties; }
5505 bool valid_object (void) const { return true; }
5507 bool has_readonly_property (const caseless_str& pname) const
5509 bool retval = xproperties.has_readonly_property (pname);
5511 retval = base_properties::has_readonly_property (pname);
5516 // ---------------------------------------------------------------------
5518 class OCTINTERP_API uipanel : public base_graphics_object
5521 class OCTINTERP_API properties : public base_properties
5524 Matrix get_boundingbox (bool internal = false,
5525 const Matrix& parent_pix_size = Matrix ()) const;
5527 double get_fontsize_points (double box_pix_height = 0) const;
5529 // See the genprops.awk script for an explanation of the
5530 // properties declarations.
5531 // Programming note: Keep property list sorted if new ones are added.
5533 BEGIN_PROPERTIES (uipanel)
5534 any_property __object__ , Matrix ()
5535 color_property backgroundcolor , color_values (1, 1, 1)
5536 radio_property bordertype , "none|{etchedin}|etchedout|beveledin|beveledout|
line"
5537 double_property borderwidth , 1
5538 radio_property fontangle , "{normal}|italic|oblique
"
5539 string_property fontname , OCTAVE_DEFAULT_FONTNAME
5540 double_property fontsize , 10
5541 radio_property fontunits S , "inches|centimeters|normalized|{points}|pixels
"
5542 radio_property fontweight , "light|{normal}|demi|bold
"
5543 color_property foregroundcolor , color_values (0, 0, 0)
5544 color_property highlightcolor , color_values (1, 1, 1)
5545 array_property position , default_panel_position ()
5546 callback_property resizefcn , Matrix ()
5547 color_property shadowcolor , color_values (0, 0, 0)
5548 string_property title , ""
5549 radio_property titleposition , "{lefttop}|centertop|righttop|leftbottom|centerbottom|rightbottom
"
5550 radio_property units S , "{normalized}|inches|centimeters|points|pixels|characters
"
5556 position.add_constraint (dim_vector (1, 4));
5559 void update_units (const caseless_str& old_units);
5560 void update_fontunits (const caseless_str& old_units);
5565 properties xproperties;
5568 uipanel (const graphics_handle& mh, const graphics_handle& p)
5569 : base_graphics_object (), xproperties (mh, p)
5574 base_properties& get_properties (void) { return xproperties; }
5576 const base_properties& get_properties (void) const { return xproperties; }
5578 bool valid_object (void) const { return true; }
5580 bool has_readonly_property (const caseless_str& pname) const
5582 bool retval = xproperties.has_readonly_property (pname);
5584 retval = base_properties::has_readonly_property (pname);
5589 // ---------------------------------------------------------------------
5591 class OCTINTERP_API uitoolbar : public base_graphics_object
5594 class OCTINTERP_API properties : public base_properties
5597 // See the genprops.awk script for an explanation of the
5598 // properties declarations.
5599 // Programming note: Keep property list sorted if new ones are added.
5601 BEGIN_PROPERTIES (uitoolbar)
5602 any_property __object__ , Matrix ()
5611 properties xproperties;
5614 uitoolbar (const graphics_handle& mh, const graphics_handle& p)
5615 : base_graphics_object (), xproperties (mh, p), default_properties ()
5618 ~uitoolbar (void) { }
5620 void override_defaults (base_graphics_object& obj)
5622 // Allow parent (figure) to override first (properties knows how
5623 // to find the parent object).
5624 xproperties.override_defaults (obj);
5626 // Now override with our defaults. If the default_properties
5627 // list includes the properties for all defaults (line,
5628 // surface, etc.) then we don't have to know the type of OBJ
5629 // here, we just call its set function and let it decide which
5630 // properties from the list to use.
5631 obj.set_from_list (default_properties);
5634 void set (const caseless_str& name, const octave_value& value)
5636 if (name.compare ("default", 7))
5637 // strip "default", pass rest to function that will
5638 // parse the remainder and add the element to the
5639 // default_properties map.
5640 default_properties.set (name.substr (7), value);
5642 xproperties.set (name, value);
5645 octave_value get (const caseless_str& name) const
5647 octave_value retval;
5649 if (name.compare ("default", 7))
5650 retval = get_default (name.substr (7));
5652 retval = xproperties.get (name);
5657 octave_value get_default (const caseless_str& name) const;
5659 octave_value get_defaults (void) const
5661 return default_properties.as_struct ("default");
5664 property_list get_defaults_list (void) const
5666 return default_properties;
5669 base_properties& get_properties (void) { return xproperties; }
5671 const base_properties& get_properties (void) const { return xproperties; }
5673 bool valid_object (void) const { return true; }
5675 void reset_default_properties (void);
5677 bool has_readonly_property (const caseless_str& pname) const
5679 bool retval = xproperties.has_readonly_property (pname);
5681 retval = base_properties::has_readonly_property (pname);
5686 property_list default_properties;
5689 // ---------------------------------------------------------------------
5691 class OCTINTERP_API uipushtool : public base_graphics_object
5694 class OCTINTERP_API properties : public base_properties
5697 // See the genprops.awk script for an explanation of the
5698 // properties declarations.
5699 // Programming note: Keep property list sorted if new ones are added.
5701 BEGIN_PROPERTIES (uipushtool)
5702 any_property __object__ , Matrix ()
5703 array_property cdata , Matrix ()
5704 callback_property clickedcallback , Matrix ()
5705 bool_property enable , "on
"
5706 bool_property separator , "off
"
5707 string_property tooltipstring , ""
5713 cdata.add_constraint ("double");
5714 cdata.add_constraint ("single
");
5715 cdata.add_constraint (dim_vector (-1, -1, 3));
5720 properties xproperties;
5723 uipushtool (const graphics_handle& mh, const graphics_handle& p)
5724 : base_graphics_object (), xproperties (mh, p)
5727 ~uipushtool (void) { }
5729 base_properties& get_properties (void) { return xproperties; }
5731 const base_properties& get_properties (void) const { return xproperties; }
5733 bool valid_object (void) const { return true; }
5735 bool has_readonly_property (const caseless_str& pname) const
5737 bool retval = xproperties.has_readonly_property (pname);
5739 retval = base_properties::has_readonly_property (pname);
5745 // ---------------------------------------------------------------------
5747 class OCTINTERP_API uitoggletool : public base_graphics_object
5750 class OCTINTERP_API properties : public base_properties
5753 // See the genprops.awk script for an explanation of the
5754 // properties declarations.
5755 // Programming note: Keep property list sorted if new ones are added.
5757 BEGIN_PROPERTIES (uitoggletool)
5758 any_property __object__ , Matrix ()
5759 array_property cdata , Matrix ()
5760 callback_property clickedcallback , Matrix ()
5761 bool_property enable , "on
"
5762 callback_property offcallback , Matrix ()
5763 callback_property oncallback , Matrix ()
5764 bool_property separator , "off
"
5765 bool_property state , "off
"
5766 string_property tooltipstring , ""
5772 cdata.add_constraint ("double");
5773 cdata.add_constraint ("single
");
5774 cdata.add_constraint (dim_vector (-1, -1, 3));
5779 properties xproperties;
5782 uitoggletool (const graphics_handle& mh, const graphics_handle& p)
5783 : base_graphics_object (), xproperties (mh, p)
5786 ~uitoggletool (void) { }
5788 base_properties& get_properties (void) { return xproperties; }
5790 const base_properties& get_properties (void) const { return xproperties; }
5792 bool valid_object (void) const { return true; }
5794 bool has_readonly_property (const caseless_str& pname) const
5796 bool retval = xproperties.has_readonly_property (pname);
5798 retval = base_properties::has_readonly_property (pname);
5804 // ---------------------------------------------------------------------
5807 get_property_from_handle (double handle, const std::string& property,
5808 const std::string& func);
5810 set_property_in_handle (double handle, const std::string& property,
5811 const octave_value& arg, const std::string& func);
5813 // ---------------------------------------------------------------------
5815 class graphics_event;
5821 friend class graphics_event;
5823 base_graphics_event (void) : count (1) { }
5825 virtual ~base_graphics_event (void) { }
5827 virtual void execute (void) = 0;
5830 octave_refcount<int> count;
5837 typedef void (*event_fcn) (void*);
5839 graphics_event (void) : rep (0) { }
5841 graphics_event (const graphics_event& e) : rep (e.rep)
5846 ~graphics_event (void)
5848 if (rep && --rep->count == 0)
5852 graphics_event& operator = (const graphics_event& e)
5856 if (rep && --rep->count == 0)
5868 { if (rep) rep->execute (); }
5870 bool ok (void) const
5871 { return (rep != 0); }
5873 static graphics_event
5874 create_callback_event (const graphics_handle& h,
5875 const std::string& name,
5876 const octave_value& data = Matrix ());
5878 static graphics_event
5879 create_callback_event (const graphics_handle& h,
5880 const octave_value& cb,
5881 const octave_value& data = Matrix ());
5883 static graphics_event
5884 create_function_event (event_fcn fcn, void *data = 0);
5886 static graphics_event
5887 create_set_event (const graphics_handle& h, const std::string& name,
5888 const octave_value& value,
5889 bool notify_toolkit = true);
5891 base_graphics_event *rep;
5894 class OCTINTERP_API gh_manager
5902 static void create_instance (void);
5904 static bool instance_ok (void)
5921 static void cleanup_instance (void) { delete instance; instance = 0; }
5923 static graphics_handle get_handle (bool integer_figure_handle)
5925 return instance_ok ()
5926 ? instance->do_get_handle (integer_figure_handle)
5927 : graphics_handle ();
5930 static void free (const graphics_handle& h)
5933 instance->do_free (h);
5936 static void renumber_figure (const graphics_handle& old_gh,
5937 const graphics_handle& new_gh)
5940 instance->do_renumber_figure (old_gh, new_gh);
5943 static graphics_handle lookup (double val)
5945 return instance_ok () ? instance->do_lookup (val) : graphics_handle ();
5948 static graphics_handle lookup (const octave_value& val)
5950 return val.is_real_scalar ()
5951 ? lookup (val.double_value ()) : graphics_handle ();
5954 static graphics_object get_object (double val)
5956 return get_object (lookup (val));
5959 static graphics_object get_object (const graphics_handle& h)
5961 return instance_ok () ? instance->do_get_object (h) : graphics_object ();
5964 static graphics_handle
5965 make_graphics_handle (const std::string& go_name,
5966 const graphics_handle& parent,
5967 bool integer_figure_handle = false,
5968 bool do_createfcn = true,
5969 bool do_notify_toolkit = true)
5971 return instance_ok ()
5972 ? instance->do_make_graphics_handle (go_name, parent,
5973 integer_figure_handle,
5974 do_createfcn, do_notify_toolkit)
5975 : graphics_handle ();
5978 static graphics_handle make_figure_handle (double val,
5979 bool do_notify_toolkit = true)
5981 return instance_ok ()
5982 ? instance->do_make_figure_handle (val, do_notify_toolkit)
5983 : graphics_handle ();
5986 static void push_figure (const graphics_handle& h)
5989 instance->do_push_figure (h);
5992 static void pop_figure (const graphics_handle& h)
5995 instance->do_pop_figure (h);
5998 static graphics_handle current_figure (void)
6000 return instance_ok ()
6001 ? instance->do_current_figure () : graphics_handle ();
6004 static Matrix handle_list (bool show_hidden = false)
6006 return instance_ok ()
6007 ? instance->do_handle_list (show_hidden) : Matrix ();
6010 static void lock (void)
6013 instance->do_lock ();
6016 static bool try_lock (void)
6019 return instance->do_try_lock ();
6024 static void unlock (void)
6027 instance->do_unlock ();
6030 static Matrix figure_handle_list (bool show_hidden = false)
6032 return instance_ok ()
6033 ? instance->do_figure_handle_list (show_hidden) : Matrix ();
6036 static void execute_listener (const graphics_handle& h,
6037 const octave_value& l)
6040 instance->do_execute_listener (h, l);
6043 static void execute_callback (const graphics_handle& h,
6044 const std::string& name,
6045 const octave_value& data = Matrix ())
6051 gh_manager::auto_lock lock;
6053 graphics_object go = get_object (h);
6055 if (go.valid_object ())
6060 execute_callback (h, cb, data);
6063 static void execute_callback (const graphics_handle& h,
6064 const octave_value& cb,
6065 const octave_value& data = Matrix ())
6068 instance->do_execute_callback (h, cb, data);
6071 static void post_callback (const graphics_handle& h,
6072 const std::string& name,
6073 const octave_value& data = Matrix ())
6076 instance->do_post_callback (h, name, data);
6079 static void post_function (graphics_event::event_fcn fcn, void* data = 0)
6082 instance->do_post_function (fcn, data);
6085 static void post_set (const graphics_handle& h, const std::string& name,
6086 const octave_value& value, bool notify_toolkit = true)
6089 instance->do_post_set (h, name, value, notify_toolkit);
6092 static int process_events (void)
6094 return (instance_ok () ? instance->do_process_events () : 0);
6097 static int flush_events (void)
6099 return (instance_ok () ? instance->do_process_events (true) : 0);
6102 static void enable_event_processing (bool enable = true)
6105 instance->do_enable_event_processing (enable);
6108 static bool is_handle_visible (const graphics_handle& h)
6110 bool retval = false;
6112 graphics_object go = get_object (h);
6114 if (go.valid_object ())
6115 retval = go.is_handle_visible ();
6120 static void close_all_figures (void)
6123 instance->do_close_all_figures ();
6127 class auto_lock : public octave_autolock
6130 auto_lock (bool wait = true)
6131 : octave_autolock (instance_ok ()
6132 ? instance->graphics_lock
6140 auto_lock (const auto_lock&);
6141 auto_lock& operator = (const auto_lock&);
6146 static gh_manager *instance;
6148 typedef std::map<graphics_handle, graphics_object>::iterator iterator;
6149 typedef std::map<graphics_handle, graphics_object>::const_iterator
6152 typedef std::set<graphics_handle>::iterator free_list_iterator;
6153 typedef std::set<graphics_handle>::const_iterator const_free_list_iterator;
6155 typedef std::list<graphics_handle>::iterator figure_list_iterator;
6156 typedef std::list<graphics_handle>::const_iterator const_figure_list_iterator;
6158 // A map of handles to graphics objects.
6159 std::map<graphics_handle, graphics_object> handle_map;
6161 // The available graphics handles.
6162 std::set<graphics_handle> handle_free_list;
6164 // The next handle available if handle_free_list is empty.
6167 // The allocated figure handles. Top of the stack is most recently
6169 std::list<graphics_handle> figure_list;
6171 // The lock for accessing the graphics sytsem.
6172 octave_mutex graphics_lock;
6174 // The list of events queued by graphics toolkits.
6175 std::list<graphics_event> event_queue;
6177 // The stack of callback objects.
6178 std::list<graphics_object> callback_objects;
6180 // A flag telling whether event processing must be constantly on.
6181 int event_processing;
6183 graphics_handle do_get_handle (bool integer_figure_handle);
6185 void do_free (const graphics_handle& h);
6187 void do_renumber_figure (const graphics_handle& old_gh,
6188 const graphics_handle& new_gh);
6190 graphics_handle do_lookup (double val)
6192 iterator p = (xisnan (val) ? handle_map.end () : handle_map.find (val));
6194 return (p != handle_map.end ()) ? p->first : graphics_handle ();
6197 graphics_object do_get_object (const graphics_handle& h)
6199 iterator p = (h.ok () ? handle_map.find (h) : handle_map.end ());
6201 return (p != handle_map.end ()) ? p->second : graphics_object ();
6204 graphics_handle do_make_graphics_handle (const std::string& go_name,
6205 const graphics_handle& p,
6206 bool integer_figure_handle,
6208 bool do_notify_toolkit);
6210 graphics_handle do_make_figure_handle (double val, bool do_notify_toolkit);
6212 Matrix do_handle_list (bool show_hidden)
6214 Matrix retval (1, handle_map.size ());
6216 octave_idx_type i = 0;
6217 for (const_iterator p = handle_map.begin (); p != handle_map.end (); p++)
6219 graphics_handle h = p->first;
6221 if (show_hidden || is_handle_visible (h))
6222 retval(i++) = h.value ();
6225 retval.resize (1, i);
6230 Matrix do_figure_handle_list (bool show_hidden)
6232 Matrix retval (1, figure_list.size ());
6234 octave_idx_type i = 0;
6235 for (const_figure_list_iterator p = figure_list.begin ();
6236 p != figure_list.end ();
6239 graphics_handle h = *p;
6241 if (show_hidden || is_handle_visible (h))
6242 retval(i++) = h.value ();
6245 retval.resize (1, i);
6250 void do_push_figure (const graphics_handle& h);
6252 void do_pop_figure (const graphics_handle& h);
6254 graphics_handle do_current_figure (void) const
6256 graphics_handle retval;
6258 for (const_figure_list_iterator p = figure_list.begin ();
6259 p != figure_list.end ();
6262 graphics_handle h = *p;
6264 if (is_handle_visible (h))
6271 void do_lock (void) { graphics_lock.lock (); }
6273 bool do_try_lock (void) { return graphics_lock.try_lock (); }
6275 void do_unlock (void) { graphics_lock.unlock (); }
6277 void do_execute_listener (const graphics_handle& h, const octave_value& l);
6279 void do_execute_callback (const graphics_handle& h, const octave_value& cb,
6280 const octave_value& data);
6282 void do_post_callback (const graphics_handle& h, const std::string& name,
6283 const octave_value& data);
6285 void do_post_function (graphics_event::event_fcn fcn, void* fcn_data);
6287 void do_post_set (const graphics_handle& h, const std::string& name,
6288 const octave_value& value, bool notify_toolkit = true);
6290 int do_process_events (bool force = false);
6292 void do_close_all_figures (void);
6294 static void restore_gcbo (void)
6297 instance->do_restore_gcbo ();
6300 void do_restore_gcbo (void);
6302 void do_post_event (const graphics_event& e);
6304 void do_enable_event_processing (bool enable = true);
6307 void get_children_limits (double& min_val, double& max_val,
6308 double& min_pos, double& max_neg,
6309 const Matrix& kids, char limit_type);
6311 OCTINTERP_API int calc_dimensions (const graphics_object& gh);
6313 // This function is NOT equivalent to the scripting language function gcf.
6314 OCTINTERP_API graphics_handle gcf (void);
6316 // This function is NOT equivalent to the scripting language function gca.
6317 OCTINTERP_API graphics_handle gca (void);
6319 OCTINTERP_API void close_all_figures (void);
void validate(void) const
enum double_radio_property::current_enum current_type
void do_register_toolkit(const std::string &name)
bool do_set(const octave_value &newval)
virtual base_property * clone(void) const
const std::string & current_value(void) const
bool is_radio(void) const
void warning_with_id(const char *id, const char *fmt,...)
void do_unload_toolkit(const std::string &name)
Matrix scale(const Matrix &m) const
static void clear(octave_shlib &oct_file)
std::string do_default_toolkit(void)
static void unload_all_toolkits(void)
plist_map_iterator find(const std::string &go_name)
Matrix get_children(void) const
color_property(const std::string &nm, const graphics_handle &h, const color_values &c=color_values(), const radio_values &v=radio_values())
void add_constraint(const std::string &type)
void delete_listener(const octave_value &v=octave_value(), listener_mode mode=POSTSET)
virtual void reparent(const graphics_handle &np)
row_vector_property(const std::string &nm, const graphics_handle &h, const octave_value &m)
radio_values & operator=(const radio_values &a)
base_property * clone(void) const
std::string values_as_string(void) const
std::string string_value(void) const
text_label_property(const std::string &s, const graphics_handle &h, const NDArray &nda)
bool is_real_type(void) const
std::string values_as_string(void) const
void set_name(const std::string &name)
OCTINTERP_API bool validate(const octave_value &v)
virtual bool do_set(const octave_value &)
NDArray scale(const NDArray &m) const
octave_idx_type nelem(void) const
color_property(const std::string &nm, const graphics_handle &h, const radio_values &v)
OCTINTERP_API bool is_equal(const octave_value &v) const
enum color_property::current_enum current_type
virtual bool is_climinclude(void) const
Cell values_as_cell(void) const
property(base_property *bp, bool persist=false)
double double_value(void) const
double_radio_property(const std::string &nm, const graphics_handle &h, const std::string &v)
color_property & operator=(const octave_value &val)
base_property * clone(void) const
octave_value reshape(const dim_vector &dv) const
octave_idx_type rows(void) const
static graphics_toolkit get_toolkit(void)
bool_property(const bool_property &p)
static void register_toolkit(const std::string &name)
void erase(const std::string pname)
bool do_set(const octave_value &val)
octave_value full_value(void) const
static Cell available_toolkits_list(void)
base_property * clone(void) const
color_property(const radio_values &v, const color_values &c)
radio_property & operator=(const octave_value &val)
void insert_property(const std::string &name, property p)
virtual bool is_radio(void) const
virtual std::string values_as_string(void) const
octave_value & operator[](const std::string pname)
std::string string_value(void) const
virtual void init_integerhandle(const octave_value &)
virtual bool is_aliminclude(void) const
std::set< caseless_str > possible_vals
std::set< std::string >::const_iterator const_available_toolkits_iterator
octave_idx_type numel(void) const
Number of elements in the array.
Matrix do_get_all_children(void) const
std::map< listener_mode, octave_value_list >::iterator listener_map_iterator
handle_property(const handle_property &p)
octave_idx_type length(void) const
base_property * clone(void) const
OCTINTERP_API bool do_set(const octave_value &v)
bool is_radio(void) const
double max_neg(void) const
base_property(const base_property &p)
virtual ~base_property(void)
bool is_scalar_type(void) const
std::string default_value(void) const
bool is_defined(void) const
bool operator==(const color_values &c) const
color_values & operator=(const color_values &c)
void set_hidden(bool flag)
Cell cell_value(void) const
std::set< std::string > type_constraints
bool operator!=(const color_values &c) const
void set_parent(const graphics_handle &h)
const_iterator find(const std::string pname) const
void reparent(const graphics_handle &new_parent)
octave_value lookup(const std::string pname) const
virtual octave_value get_xlim(void) const
OCTINTERP_API void run_listeners(listener_mode mode=POSTSET)
Cell values_as_cell(void) const
virtual octave_value get_alim(void) const
array_property(const std::string &nm, const graphics_handle &h, const octave_value &m)
virtual graphics_toolkit get_toolkit(void) const
const std::string & current_value(void) const
virtual std::string graphics_object_name(void) const
double scale(double d) const
pval_map_type::const_iterator pval_map_const_iterator
void error(const char *fmt,...)
radio_property(const std::string &nm, const graphics_handle &h, const radio_values &v=radio_values())
void do_scale(const double *src, double *dest, int n) const
bool_property & operator=(const octave_value &val)
void set(const caseless_str &name, const octave_value &val)
std::list< dim_vector > size_constraints
virtual Matrix get_boundingbox(bool=false, const Matrix &=Matrix()) const
pval_map_type::iterator pval_map_iterator
base_property * clone(void) const
OCTINTERP_API bool str2rgb(const std::string &str)
property(const property &p)
bool contains(const std::string &val, std::string &match)
base_scaler * clone(void) const
base_property(const std::string &s, const graphics_handle &h)
radio_property(const std::string &nm, const graphics_handle &h, const std::string &v)
static void load_toolkit(const graphics_toolkit &tk)
Cell do_available_toolkits_list(void) const
string_array_property(const std::string &s, const graphics_handle &h, const std::string &val="", const char &sep= '|', const desired_enum &typ=string_t)
void add_listener(const octave_value &v, listener_mode mode=POSTSET)
base_property * clone(void) const
Cell values_as_cell(void) const
children_property(const std::string &nm, const graphics_handle &h, const Matrix &val)
bool do_set(const octave_value &v)
virtual void set_from_list(property_list &plist)
double_radio_property & operator=(const octave_value &val)
virtual void delete_children(bool clear=false)
color_values(const color_values &c)
virtual Matrix scale(const Matrix &m) const
pval_vector pval_map_type
static std::string default_toolkit(void)
std::string string_value(void) const
NDArray scale(const NDArray &m) const
bool is(const caseless_str &v) const
std::string get_name(void) const
children_property & operator=(const octave_value &val)
std::string row_as_string(octave_idx_type, bool strip_ws=false) const
desired_enum desired_type
virtual property_list get_factory_defaults_list(void) const
graphics_handle current_val
static void unregister_toolkit(const std::string &name)
virtual graphics_handle get_parent(void) const
virtual void set(const caseless_str &pname, const octave_value &pval)
void renumber_child(graphics_handle old_gh, graphics_handle new_gh)
void set_hidden(bool flag)
octave_idx_type rows(void) const
F77_RET_T const double const double double * d
color_values(const std::string &str)
void delete_listener(const octave_value &v=octave_value(), listener_mode mode=POSTSET)
bool validate(const std::string &val, std::string &match)
string_vector all_strings(bool pad=false) const
OCTINTERP_API bool do_set(const octave_value &newval)
text_label_property(const std::string &s, const graphics_handle &h, const Cell &c)
string_array_property(const string_array_property &p)
base_property * clone(void) const
bool do_set(const octave_value &v)
double_radio_property(const double_radio_property &p)
bool_property(const std::string &nm, const graphics_handle &h, bool val)
color_property(const std::string &nm, const graphics_handle &h, const color_property &v)
string_array_property & operator=(const octave_value &val)
bool do_set(const octave_value &v)
const octave_base_value & a2
any_property(const any_property &p)
virtual void adopt(const graphics_handle &h)
Cell cell_value(void) const
virtual octave_value get(bool all=false) const
callback_property & operator=(const octave_value &val)
base_property * clone(void) const
text_label_property & operator=(const octave_value &val)
void do_scale(const double *src, double *dest, int n) const
virtual ~base_scaler(void)
const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
base_property * clone(void) const
void do_adopt_child(double val)
Matrix get_hidden(void) const
std::string values_as_string(void) const
Matrix get_limits(void) const
virtual base_scaler * clone() const
Array< std::string > cellstr_value(void) const
double unscale(double d) const
bool is_radio(void) const
any_property & operator=(const octave_value &val)
text_label_property(const text_label_property &p)
virtual octave_value get_defaults(void) const
bool_property(const std::string &nm, const graphics_handle &h, const char *val)
virtual octave_value get_clim(void) const
scaler & operator=(const scaler &s)
const std::string & current_value(void) const
double unscale(double d) const
string_array_property(const std::string &s, const graphics_handle &h, const Cell &c, const char &sep= '|', const desired_enum &typ=string_t)
bool is_hidden(void) const
virtual octave_value get_factory_defaults(void) const
static void replace(QString &text, const QRegExp &re, const QString &after)
std::list< double >::iterator children_list_iterator
color_values(double r=0, double g=0, double b=1)
void delete_children(bool clear=false)
property & operator=(const octave_value &val)
graphics_handle get_parent(void) const
virtual octave_value get_zlim(void) const
Matrix get_children(void) const
bool is_sparse_type(void) const
Array< T > sort(int dim=0, sortmode mode=ASCENDING) const
Cell cell_value(void) const
graphics_toolkit do_get_toolkit(void) const
color_property(const std::string &nm, const graphics_handle &h, const std::string &v)
string_vector string_vector_value(void) const
double min_pos(void) const
std::string string_value(bool force=false) const
plist_map_iterator end(void)
std::map< listener_mode, octave_value_list > listener_map
virtual Cell values_as_cell(void) const
base_scaler * clone(void) const
virtual ~base_properties(void)
virtual void adopt(const graphics_handle &h)
void resize(octave_idx_type n, const std::string &rfv=std::string())
Matrix scale(const Matrix &m) const
bool set(const octave_value &val, bool do_run=true, bool do_notify_toolkit=true)
octave_refcount< int > count
bool is_double(void) const
bool do_set(const octave_value &v)
void do_delete_children(bool clear)
plist_map_const_iterator begin(void) const
void renumber(graphics_handle old_gh, graphics_handle new_gh)
property_list(const plist_map_type &m=plist_map_type())
bool is_string(void) const
virtual octave_value get(void) const
iterator find(const std::string pname)
const T * data(void) const
void set___modified__(const octave_value &val)
double min_val(void) const
void add_constraint(const dim_vector &dims)
string_vector & append(const std::string &s)
callback_property(const std::string &nm, const graphics_handle &h, const octave_value &m)
Matrix do_get_children(bool return_hidden) const
Cell values_as_cell(void) const
virtual double unscale(double d) const
octave_int< T > pow(const octave_int< T > &a, const octave_int< T > &b)
bool do_set(const octave_value &val)
std::list< double > children_list
handle_property(const std::string &nm, const graphics_handle &h, const graphics_handle &val=graphics_handle())
bool is_cellstr(void) const
#define panic_impossible()
void do_init_children(const Matrix &val)
virtual void remove_child(const graphics_handle &h)
virtual base_properties & get_properties(void)
std::map< std::string, graphics_toolkit >::const_iterator const_loaded_toolkits_iterator
static void unload_toolkit(const std::string &name)
virtual void remove_child(const graphics_handle &h)
base_property * clone(void) const
bool is_cellstr(void) const
void set_parent(const graphics_handle &h)
bool is_radio(void) const
BEGIN_BASE_PROPERTIES bool_property off radio_property queue cancel callback_property buttondownfcn
bool is_hidden(void) const
void renumber_parent(graphics_handle new_gh)
void do_unregister_toolkit(const std::string &name)
octave_value lookup(const caseless_str &name) const
ColumnVector cross(const ColumnVector &v1, const ColumnVector &v2)
virtual bool is_yliminclude(void) const
double unscale(double d) const
void do_load_toolkit(const graphics_toolkit &tk)
dim_vector dims(void) const
callback_property(const callback_property &p)
Matrix matrix_value(bool frc_str_conv=false) const
double max_val(void) const
Cell do_loaded_toolkits_list(void) const
plist_map_const_iterator end(void) const
row_vector_property(const row_vector_property &p)
OCTINTERP_API void execute(const octave_value &data=octave_value()) const
double_property(const double_property &p)
any_property(const std::string &nm, const graphics_handle &h, const octave_value &m=Matrix())
charMatrix char_matrix_value(bool frc_str_conv=false) const
std::list< double >::const_iterator const_children_list_iterator
std::set< std::string > available_toolkits
std::map< std::string, graphics_toolkit >::iterator loaded_toolkits_iterator
T & xelem(octave_idx_type n)
string_property(const string_property &p)
virtual double scale(double d) const
virtual void set_defaults(const std::string &)
static graphics_toolkit find_toolkit(const std::string &name)
string_property(const std::string &s, const graphics_handle &h, const std::string &val="")
virtual bool is_xliminclude(void) const
array_property & operator=(const octave_value &val)
graphics_handle get_parent(void) const
base_property * clone(void) const
OCTINTERP_API bool validate(const octave_value &v)
bool is(const std::string &v) const
octave_idx_type length(void) const
Number of elements in the array.
std::map< listener_mode, octave_value_list >::const_iterator listener_map_const_iterator
bool is_bool_scalar(void) const
bool is_empty(void) const
void run_listeners(listener_mode mode=POSTSET)
Matrix scale(const Matrix &m) const
NDArray array_value(bool frc_str_conv=false) const
Matrix stack(const Matrix &a) const
string_vector string_vector_value(void) const
double scale(double d) const
bool do_set(const octave_value &val)
void add_listener(const octave_value &v, listener_mode mode=POSTSET)
virtual property_list get_defaults_list(void) const
static void cleanup_instance(void)
std::set< std::string >::iterator available_toolkits_iterator
std::string values_as_string(void) const
base_property * clone(void) const
double_radio_property(const std::string &nm, const graphics_handle &h, const double_radio_property &v)
octave_handle graphics_handle
void add_constraint(const dim_vector &dims)
string_property & operator=(const octave_value &val)
radio_values(const radio_values &a)
bool bool_value(bool warn=false) const
std::map< std::string, pval_map_type > plist_map_type
virtual NDArray scale(const NDArray &m) const
bool remove_child(double val)
double_property & operator=(const octave_value &val)
NDArray scale(const NDArray &m) const
static OCTINTERP_API property create(const std::string &name, const graphics_handle &parent, const caseless_str &type, const octave_value_list &args)
OCTINTERP_API bool set(const octave_value &v, bool do_run=true, bool do_notify_toolkit=true)
static bool instance_ok(void)
static OCTINTERP_API void create_instance(void)
plist_map_iterator begin(void)
double scale(double d) const
handle_property & operator=(const octave_value &val)
virtual octave_value get_ylim(void) const
virtual bool is_linear(void) const
NDArray scale(const NDArray &m) const
double_radio_property(double d, const radio_values &v)
virtual void mark_modified(void)
Matrix get_all_children(void) const
double double_value(void) const
bool compare(const std::string &s, size_t limit=std::string::npos) const
bool is_modified(void) const
Matrix get_hidden_children(void) const
void set_name(const std::string &s)
bool is_defined(void) const
bool is_linear(void) const
bool is(const std::string &v) const
radio_property(const radio_property &p)
void resize(octave_idx_type n, const octave_value &rfv=octave_value())
radio_property(const std::string &nm, const graphics_handle &h, const radio_values &v, const std::string &def)
array_property(const array_property &p)
void add_constraint(const std::string &type)
virtual bool is_zliminclude(void) const
graphics_toolkit do_find_toolkit(const std::string &name) const
base_property * clone(void) const
static bool match(const std::string &filename_arg, const std::string &path_elt_arg)
color_property(const color_values &c, const radio_values &v)
virtual void override_defaults(base_graphics_object &obj)
Matrix scale(const Matrix &m) const
property clone(void) const
charMatrix char_value(void) const
void add_constraint(octave_idx_type len)
std::map< std::string, graphics_toolkit > loaded_toolkits
static Cell loaded_toolkits_list(void)
void set_modified(const octave_value &val)
OCTINTERP_API radio_values(const std::string &opt_string=std::string())
static OCTINTERP_API gtk_manager * instance
base_property & operator=(const octave_value &val)
MArray< T > reshape(const dim_vector &new_dims) const
octave_scalar_map as_struct(const std::string &prefix_arg) const
bool do_set(const octave_value &val)
ColumnVector real(const ComplexColumnVector &a)
double double_value(bool frc_str_conv=false) const
octave_idx_type cols(void) const
graphics_handle get_handle(void) const
base_scaler * clone(void) const
std::string get_name(void) const
OCTINTERP_API bool validate(const octave_value &v) const
virtual bool has_property(const caseless_str &) const
row_vector_property & operator=(const octave_value &val)
bool do_remove_child(double child)
octave_value as_octave_value(void) const
plist_map_const_iterator find(const std::string &go_name) const
text_label_property(const std::string &s, const graphics_handle &h, const std::string &val="")
void set_tag(const octave_value &val)
scaler(const std::string &s)
bool do_set(const octave_value &v)
bool do_set(const octave_value &val)
children_property(const children_property &p)
double unscale(double d) const
static bool is_handle_visible(const graphics_handle &h)
Matrix get_all(void) const
plist_map_type::const_iterator plist_map_const_iterator
bool is_linear(void) const
void do_unload_all_toolkits(void)
double scale(double d) const
graphics_handle handle_value(void) const
double_property(const std::string &nm, const graphics_handle &h, double d=0)
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
color_property(const color_property &p)
F77_RET_T const double * x
void do_init_children(const std::list< double > &val)
OCTINTERP_API bool do_set(const octave_value &v)
OCTINTERP_API void get_data_limits(void)
base_property * clone(void) const
std::pair< std::string, octave_value > pval_pair
plist_map_type::iterator plist_map_iterator