Mercurial > hg > octave-max
changeset 7176:6525eb2fba0f
[project @ 2007-11-14 20:42:06 by jwe]
author | jwe |
---|---|
date | Wed, 14 Nov 2007 20:42:07 +0000 |
parents | 5ff4da7bd2e7 |
children | 57d2546ad8d5 |
files | liboctave/ChangeLog liboctave/lo-specfun.cc src/ChangeLog src/graphics.cc src/graphics.h.in |
diffstat | 5 files changed, 91 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +2007-11-14 John W. Eaton <jwe@octave.org> + + * lo-specfun.cc (zbesi): When alpha is negative, don't limit + correction to half-integer values. From Eric Chassande-Mottin + <echassandemottin@gmail.com>. + 2007-11-07 Michael Goffioul <michael.goffioul@gmail.com> * dMatrix.cc, CMatrix.cc: Help MSVC compiler to resolve
--- a/liboctave/lo-specfun.cc +++ b/liboctave/lo-specfun.cc @@ -411,9 +411,8 @@ if (ierr == 0 || ierr == 3) { - if (! is_integer_value (alpha - 0.5)) - tmp += (2.0 / M_PI) * sin (M_PI * alpha) - * zbesk (z, alpha, kode, ierr); + tmp += (2.0 / M_PI) * sin (M_PI * alpha) + * zbesk (z, alpha, kode, ierr); retval = bessel_return_value (tmp, ierr); }
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2007-11-14 John W. Eaton <jwe@octave.org> + + * graphics.h.in (base_properties::tag): New property. + (base_properties::get_tag, base_properties::set_tag): New functions. + (root_figure::set, root_figure::get, figure::set, figure::get, + axes::set, axes::get, line::set, line::get, text::set, text::get, + patch::set, patch::get, surface::set, surface::get): Handle tag. + 2007-11-14 Joseph P. Skudlarek <Jskud@Jskud.com> * DLD-FUNCTIONS/regexp.cc: Undo previous change.
--- a/src/graphics.cc +++ b/src/graphics.cc @@ -705,6 +705,17 @@ } void +base_properties::set_tag (const octave_value& val) +{ + std::string tmp = val.string_value (); + + if (! error_state) + tag = tmp; + else + error ("set: expecting tag to be a character string"); +} + +void base_properties::set_parent (const octave_value& val) { double tmp = val.double_value (); @@ -776,7 +787,9 @@ root_figure::properties::set (const property_name& name, const octave_value& val) { - if (name.compare ("currentfigure")) + if (name.compare ("tag")) + set_tag (val); + else if (name.compare ("currentfigure")) set_currentfigure (val); else if (name.compare ("children")) children = maybe_set_children (children, val); @@ -790,6 +803,7 @@ { Octave_map m; + m.assign ("tag", tag); m.assign ("type", type); m.assign ("currentfigure", currentfigure.as_octave_value ()); m.assign ("children", children); @@ -803,7 +817,9 @@ { octave_value retval; - if (name.compare ("type")) + if (name.compare ("tag")) + retval = type; + else if (name.compare ("tag")) retval = type; else if (name.compare ("currentfigure")) retval = currentfigure.as_octave_value (); @@ -867,7 +883,9 @@ { bool modified = true; - if (name.compare ("children")) + if (name.compare ("tag")) + set_tag (val); + else if (name.compare ("children")) children = maybe_set_children (children, val); else if (name.compare ("__modified__")) { @@ -903,6 +921,7 @@ { Octave_map m; + m.assign ("tag", tag); m.assign ("type", type); m.assign ("parent", parent.as_octave_value ()); m.assign ("children", children); @@ -923,7 +942,9 @@ { octave_value retval; - if (name.compare ("type")) + if (name.compare ("tag")) + retval = tag; + else if (name.compare ("type")) retval = type; else if (name.compare ("parent")) retval = parent.as_octave_value (); @@ -1175,7 +1196,9 @@ { bool modified = true; - if (name.compare ("parent")) + if (name.compare ("tag")) + set_tag (val); + else if (name.compare ("parent")) set_parent (val); else if (name.compare ("children")) children = maybe_set_children (children, val); @@ -1418,6 +1441,7 @@ { Octave_map m; + m.assign ("tag", tag); m.assign ("type", type); m.assign ("parent", parent.as_octave_value ()); m.assign ("children", children); @@ -1481,7 +1505,9 @@ { octave_value retval; - if (name.compare ("type")) + if (name.compare ("tag")) + retval = tag; + else if (name.compare ("type")) retval = type; else if (name.compare ("parent")) retval = parent.value (); @@ -1755,7 +1781,9 @@ { bool modified = true; - if (name.compare ("parent")) + if (name.compare ("tag")) + set_tag (val); + else if (name.compare ("parent")) set_parent (val); else if (name.compare ("children")) children = maybe_set_children (children, val); @@ -1809,6 +1837,7 @@ { Octave_map m; + m.assign ("tag", tag); m.assign ("type", type); m.assign ("parent", parent.as_octave_value ()); m.assign ("children", children); @@ -1837,7 +1866,9 @@ { octave_value retval; - if (name.compare ("type")) + if (name.compare ("tag")) + retval = tag; + else if (name.compare ("type")) retval = type; else if (name.compare ("parent")) retval = parent.as_octave_value (); @@ -1929,7 +1960,9 @@ { bool modified = true; - if (name.compare ("parent")) + if (name.compare ("tag")) + set_tag (val); + else if (name.compare ("parent")) set_parent (val); else if (name.compare ("children")) children = maybe_set_children (children, val); @@ -1973,6 +2006,7 @@ { Octave_map m; + m.assign ("tag", tag); m.assign ("type", type); m.assign ("parent", parent.as_octave_value ()); m.assign ("children", children); @@ -1996,7 +2030,9 @@ { octave_value retval; - if (name.compare ("type")) + if (name.compare ("tag")) + retval = tag; + else if (name.compare ("type")) retval = type; else if (name.compare ("parent")) retval = parent.as_octave_value (); @@ -2069,7 +2105,9 @@ { bool modified = true; - if (name.compare ("parent")) + if (name.compare ("tag")) + set_tag (val); + else if (name.compare ("parent")) set_parent (val); else if (name.compare ("children")) children = maybe_set_children (children, val); @@ -2099,6 +2137,7 @@ { Octave_map m; + m.assign ("tag", tag); m.assign ("type", type); m.assign ("parent", parent.as_octave_value ()); m.assign ("children", children); @@ -2115,7 +2154,9 @@ { octave_value retval; - if (name.compare ("type")) + if (name.compare ("tag")) + retval = tag; + else if (name.compare ("type")) retval = type; else if (name.compare ("parent")) retval = parent.as_octave_value (); @@ -2178,7 +2219,9 @@ { bool modified = true; - if (name.compare ("parent")) + if (name.compare ("tag")) + set_tag (val); + else if (name.compare ("parent")) set_parent (val); else if (name.compare ("children")) children = maybe_set_children (children, val); @@ -2234,6 +2277,7 @@ { Octave_map m; + m.assign ("tag", tag); m.assign ("type", type); m.assign ("parent", parent.as_octave_value ()); m.assign ("children", children); @@ -2263,7 +2307,9 @@ { octave_value retval; - if (name.compare ("type")) + if (name.compare ("tag")) + retval = tag; + else if (name.compare ("type")) retval = type; else if (name.compare ("parent")) retval = parent.as_octave_value (); @@ -2363,7 +2409,9 @@ { bool modified = true; - if (name.compare ("parent")) + if (name.compare ("tag")) + set_tag (val); + else if (name.compare ("parent")) set_parent (val); else if (name.compare ("children")) children = maybe_set_children (children, val); @@ -2415,6 +2463,7 @@ { Octave_map m; + m.assign ("tag", tag); m.assign ("type", type); m.assign ("parent", parent.as_octave_value ()); m.assign ("children", children); @@ -2442,7 +2491,9 @@ { octave_value retval; - if (name.compare ("type")) + if (name.compare ("tag")) + retval = tag; + else if (name.compare ("type")) retval = type; else if (name.compare ("parent")) retval = parent.as_octave_value ();
--- a/src/graphics.h.in +++ b/src/graphics.h.in @@ -649,11 +649,11 @@ class base_properties { public: - base_properties (const std::string& t = "unknown", + base_properties (const std::string& ty = "unknown", const graphics_handle& mh = graphics_handle (), const graphics_handle& p = graphics_handle ()) - : type (t), __modified__ (true), __myhandle__ (mh), parent (p), - children () { } + : tag (), type (ty), __modified__ (true), __myhandle__ (mh), + parent (p), children () { } virtual ~base_properties (void) { } @@ -670,6 +670,8 @@ virtual void set (const property_name&, const octave_value&) { } + std::string get_tag (void) const { return tag; } + graphics_handle get_parent (void) const { return parent; } void remove_child (const graphics_handle& h); @@ -681,6 +683,8 @@ children(n) = h.value (); } + void set_tag (const octave_value& val); + void set_parent (const octave_value& val); void reparent (const graphics_handle& new_parent) { parent = new_parent; } @@ -688,6 +692,7 @@ virtual void delete_children (void); protected: + std::string tag; std::string type; bool __modified__; graphics_handle __myhandle__;