23 #if defined (HAVE_CONFIG_H)
66 OCTAVE_NORETURN
static
70 error (
"set: invalid value for %s property", pname.c_str ());
79 const std::set<std::string>& pnames,
82 size_t len = pname.length ();
83 std::set<std::string> matches;
86 for (
const auto& propnm : pnames)
88 if (pname.
compare (propnm, len))
90 if (len == propnm.length ())
93 matches.insert (propnm);
97 size_t num_matches = matches.size ();
100 error (
"%s: unknown %s property %s",
101 who.c_str (), what.c_str (), pname.c_str ());
102 else if (num_matches > 1)
106 std::ostringstream os;
112 error (
"%s: ambiguous %s property name %s; possible matches:\n\n%s",
113 who.c_str (), what.c_str (), pname.c_str (), match_list.c_str ());
115 else if (num_matches == 1)
121 "%s: allowing %s to match %s property %s",
122 who.c_str (), pname.c_str (), what.c_str (),
123 possible_match.c_str ());
125 return possible_match;
140 const double cmapv[] =
142 2.67004010000000e-01, 2.72651720952381e-01, 2.77106307619048e-01,
143 2.80356151428571e-01, 2.82390045238095e-01, 2.83204606666667e-01,
144 2.82809341428571e-01, 2.81230763333333e-01, 2.78516153333333e-01,
145 2.74735528571429e-01, 2.69981791904762e-01, 2.64368580952381e-01,
146 2.58026184285714e-01, 2.51098684761905e-01, 2.43732853333333e-01,
147 2.36073294285714e-01, 2.28263191428571e-01, 2.20424955714286e-01,
148 2.12666598571429e-01, 2.05079113809524e-01, 1.97721880952381e-01,
149 1.90631350000000e-01, 1.83819438571429e-01, 1.77272360952381e-01,
150 1.70957518571429e-01, 1.64832915714286e-01, 1.58845368095238e-01,
151 1.52951235714286e-01, 1.47131626666667e-01, 1.41402210952381e-01,
152 1.35832975714286e-01, 1.30582113809524e-01, 1.25898377619048e-01,
153 1.22163105714286e-01, 1.19872409523810e-01, 1.19626570000000e-01,
154 1.22045948571429e-01, 1.27667691904762e-01, 1.36834947142857e-01,
155 1.49643331428571e-01, 1.65967274285714e-01, 1.85538397142857e-01,
156 2.08030450000000e-01, 2.33127309523809e-01, 2.60531475238095e-01,
157 2.90000730000000e-01, 3.21329971428571e-01, 3.54355250000000e-01,
158 3.88930322857143e-01, 4.24933143333333e-01, 4.62246770476190e-01,
159 5.00753620000000e-01, 5.40336957142857e-01, 5.80861172380952e-01,
160 6.22170772857143e-01, 6.64087320476191e-01, 7.06403823333333e-01,
161 7.48885251428571e-01, 7.91273132857143e-01, 8.33302102380952e-01,
162 8.74717527142857e-01, 9.15296319047619e-01, 9.54839555238095e-01,
163 9.93247890000000e-01, 4.87433000000000e-03, 2.58456800000000e-02,
164 5.09139004761905e-02, 7.42014957142857e-02, 9.59536042857143e-02,
165 1.16893314761905e-01, 1.37350195714286e-01, 1.57479940000000e-01,
166 1.77347967619048e-01, 1.96969168571429e-01, 2.16330337619048e-01,
167 2.35404660952381e-01, 2.54161735714286e-01, 2.72573219047619e-01,
168 2.90619516666667e-01, 3.08291041428571e-01, 3.25586450952381e-01,
169 3.42517215238095e-01, 3.59102207142857e-01, 3.75366067142857e-01,
170 3.91340913333333e-01, 4.07061480000000e-01, 4.22563764285714e-01,
171 4.37885543809524e-01, 4.53062984285714e-01, 4.68129543809524e-01,
172 4.83117059523810e-01, 4.98052961428571e-01, 5.12959473333333e-01,
173 5.27854311428571e-01, 5.42750087142857e-01, 5.57652481904762e-01,
174 5.72563073333333e-01, 5.87476284285714e-01, 6.02382410952381e-01,
175 6.17265840000000e-01, 6.32106955714286e-01, 6.46881817142857e-01,
176 6.61562926190476e-01, 6.76119717142857e-01, 6.90518987142857e-01,
177 7.04725181904762e-01, 7.18700950000000e-01, 7.32406441904762e-01,
178 7.45802021904762e-01, 7.58846480000000e-01, 7.71497934761905e-01,
179 7.83714033809524e-01, 7.95453081428571e-01, 8.06673890000000e-01,
180 8.17337565714286e-01, 8.27409135714286e-01, 8.36858167619048e-01,
181 8.45663399523809e-01, 8.53815582857143e-01, 8.61321019047619e-01,
182 8.68206316666667e-01, 8.74522215714286e-01, 8.80346158571429e-01,
183 8.85780083333333e-01, 8.90945338571429e-01, 8.95973498571429e-01,
184 9.01005800000000e-01, 9.06156570000000e-01, 3.29415190000000e-01,
185 3.53367293333333e-01, 3.76236064761905e-01, 3.97901482857143e-01,
186 4.18250757142857e-01, 4.37178920000000e-01, 4.54595888571429e-01,
187 4.70433883333333e-01, 4.84653865714286e-01, 4.97250492857143e-01,
188 5.08254501428571e-01, 5.17731949047619e-01, 5.25780221428571e-01,
189 5.32522206190476e-01, 5.38097133333333e-01, 5.42651800000000e-01,
190 5.46335411904762e-01, 5.49287148571429e-01, 5.51635008571429e-01,
191 5.53493173333333e-01, 5.54953478571429e-01, 5.56089070000000e-01,
192 5.56952166666667e-01, 5.57576145714286e-01, 5.57974025714286e-01,
193 5.58142745238095e-01, 5.58058673809524e-01, 5.57684744285714e-01,
194 5.56973310000000e-01, 5.55864478571429e-01, 5.54288677142857e-01,
195 5.52175699047619e-01, 5.49445382857143e-01, 5.46023368571429e-01,
196 5.41830633809524e-01, 5.36795616666667e-01, 5.30847985714286e-01,
197 5.23924198571429e-01, 5.15966779523810e-01, 5.06924262857143e-01,
198 4.96751861428571e-01, 4.85412122857143e-01, 4.72873300000000e-01,
199 4.59105875238095e-01, 4.44095883333333e-01, 4.27825852857143e-01,
200 4.10292713809524e-01, 3.91487632857143e-01, 3.71420688571429e-01,
201 3.50098750000000e-01, 3.27544678571429e-01, 3.03798967142857e-01,
202 2.78916748571429e-01, 2.53000856190476e-01, 2.26223670000000e-01,
203 1.98879439523810e-01, 1.71494930000000e-01, 1.45037631428572e-01,
204 1.21291048571429e-01, 1.03326155238095e-01, 9.53507900000000e-02,
205 1.00469958095238e-01, 1.17876387142857e-01, 1.43936200000000e-01
211 std::copy (cmapv, cmapv + (64*3), cmap.
fortran_vec ());
311 for (
int col = 0; col < 64; col++)
326 for (
int col = 0; col < 3; col++)
339 for (
int col = 0; col < 3; col++)
561 if (from_units.
compare (to_units))
567 double points_size = 0;
570 if (from_units.
compare (
"points"))
571 points_size = font_size;
576 if (from_units.
compare (
"pixels"))
577 points_size = font_size * 72.0 / res;
578 else if (from_units.
compare (
"inches"))
579 points_size = font_size * 72.0;
580 else if (from_units.
compare (
"centimeters"))
581 points_size = font_size * 72.0 / 2.54;
582 else if (from_units.
compare (
"normalized"))
583 points_size = font_size * parent_height * 72.0 / res;
586 double new_font_size = 0;
588 if (to_units.
compare (
"points"))
589 new_font_size = points_size;
595 if (to_units.
compare (
"pixels"))
596 new_font_size = points_size * res / 72.0;
597 else if (to_units.
compare (
"inches"))
598 new_font_size = points_size / 72.0;
599 else if (to_units.
compare (
"centimeters"))
600 new_font_size = points_size * 2.54 / 72.0;
601 else if (to_units.
compare (
"normalized"))
605 if (parent_height > 0)
606 new_font_size = points_size * res / (parent_height * 72.0);
610 return new_font_size;
619 bool is_rectangle = (pos.
numel () == 4);
620 bool is_2d = (pos.
numel () == 2);
622 if (from_units.
compare (
"pixels"))
624 else if (from_units.
compare (
"normalized"))
626 retval(0) = pos(0) * parent_dim(0) + 1;
627 retval(1) = pos(1) * parent_dim(1) + 1;
630 retval(2) = pos(2) * parent_dim(0);
631 retval(3) = pos(3) * parent_dim(1);
636 else if (from_units.
compare (
"characters"))
645 f = 12.0 * res / 74.951;
667 if (from_units.
compare (
"points"))
669 else if (from_units.
compare (
"inches"))
671 else if (from_units.
compare (
"centimeters"))
676 retval(0) = pos(0) * f + 1;
677 retval(1) = pos(1) * f + 1;
688 if (! to_units.
compare (
"pixels"))
690 if (to_units.
compare (
"normalized"))
696 retval(2) /= parent_dim(0);
697 retval(3) /= parent_dim(1);
702 else if (to_units.
compare (
"characters"))
709 f = 12.0 * res / 74.951;
731 if (to_units.
compare (
"points"))
733 else if (to_units.
compare (
"inches"))
735 else if (to_units.
compare (
"centimeters"))
752 else if (! is_rectangle && ! is_2d)
768 if (ax.valid_object ())
773 bool is_rectangle = (pos.
numel () == 4);
775 ax_size = ax_bbox.
extract_n (0, 2, 1, 2);
777 if (from_units.
compare (
"data"))
787 retval(0) = v1(0) - ax_bbox(0) + 1;
788 retval(1) = ax_bbox(1) + ax_bbox(3) - v1(1) + 1;
798 retval(0) = v(0) - ax_bbox(0) + 1;
799 retval(1) = ax_bbox(1) + ax_bbox(3) - v(1) + 1;
806 if (! to_units.
compare (
"pixels"))
814 retval(0) + ax_bbox(0) - 1,
815 ax_bbox(1) + ax_bbox(3) -
retval(1) + 1);
831 retval(0) + ax_bbox(0) - 1,
832 ax_bbox(1) + ax_bbox(3) -
retval(1) + 1);
856 sz.
extract_n (0, 2, 1, 2)).extract_n (0, 2, 1, 2);
885 av[i+lda] = cmapv[idx+nc];
886 av[i+2*lda] = cmapv[idx+2*nc];
890 template <
typename T>
898 clim_0, clim_1, cmapv, cv[
i], lda, nc, i, av);
903 bool is_scaled,
int cdim)
908 if (
dv.
ndims () == cdim &&
dv(cdim-1) == 3)
917 if (fig.valid_object ())
945 const double *cmapv = cmap.
data ();
947 double clim_0 = clim(0);
948 double clim_1 = clim(1);
958 #define CONVERT_CDATA_1(ARRAY_T, VAL_FN, IS_REAL) \
961 ARRAY_T tmp = cdata. VAL_FN ## array_value (); \
963 convert_cdata_1 (is_scaled, IS_REAL, clim_0, clim_1, cmapv, \
964 tmp.data (), lda, nc, av); \
981 warning (
"unsupported type for cdata (= %s). "
982 "Valid types are uint8, uint16, double, single, and bool.",
987 #undef CONVERT_CDATA_1
992 template <
typename T>
995 double& eminp,
double& emaxp)
997 const T *data = m.
data ();
1013 if (e > 0 && e < eminp)
1016 if (e < 0 && e > emaxp)
1026 int len = name.length ();
1039 pfx = name.substr (0, 5);
1045 pfx = name.substr (0, 6);
1051 pfx = name.substr (0, 7);
1058 pfx = name.substr (0, 9);
1065 pfx = name.substr (0, 10);
1067 if (pfx.
compare (
"uipushtool"))
1071 pfx = name.substr (0, 12);
1073 if (pfx.
compare (
"uitoggletool"))
1077 pfx = name.substr (0, 13);
1079 if (pfx.
compare (
"uicontextmenu") ||
1080 pfx.
compare (
"uibuttongroup"))
1093 rest = name.substr (offset);
1110 else if (type.
compare (
"axes"))
1112 else if (type.
compare (
"line"))
1114 else if (type.
compare (
"text"))
1116 else if (type.
compare (
"image"))
1118 else if (type.
compare (
"light"))
1120 else if (type.
compare (
"patch"))
1122 else if (type.
compare (
"surface"))
1124 else if (type.
compare (
"hggroup"))
1126 else if (type.
compare (
"uimenu"))
1128 else if (type.
compare (
"uicontrol"))
1130 else if (type.
compare (
"uipanel"))
1132 else if (type.
compare (
"uibuttongroup"))
1134 else if (type.
compare (
"uicontextmenu"))
1136 else if (type.
compare (
"uitoolbar"))
1138 else if (type.
compare (
"uipushtool"))
1140 else if (type.
compare (
"uitoggletool"))
1153 if (
id >= 0 && do_notify_toolkit)
1180 : default_val (), possible_vals ()
1183 size_t len = opt_string.length ();
1184 bool done = len == 0;
1188 size_t end = opt_string.find (
'|', beg);
1190 if (end == std::string::npos)
1201 t = t.substr (1, t.length () - 2);
1217 for (std::set<caseless_str>::const_iterator it =
possible_vals.begin ();
1220 if (retval.empty ())
1223 retval =
"{" + *it +
"}";
1230 retval +=
" | {" + *it +
"}";
1232 retval +=
" | " + *it;
1236 if (! retval.empty ())
1237 retval =
"[ " + retval +
" ]";
1247 for (std::set<caseless_str>::const_iterator it =
possible_vals.begin ();
1258 double tmp_rgb[3] = {0, 0, 0};
1261 unsigned int len = str.length ();
1263 std::transform (str.begin (), str.end (), str.begin (), tolower);
1265 if (str.compare (0, len,
"blue", 0, len) == 0)
1267 else if (str.compare (0, len,
"black", 0, len) == 0
1268 || str.compare (0, len,
"k", 0, len) == 0)
1269 tmp_rgb[0] = tmp_rgb[1] = tmp_rgb[2] = 0;
1270 else if (str.compare (0, len,
"red", 0, len) == 0)
1272 else if (str.compare (0, len,
"green", 0, len) == 0)
1274 else if (str.compare (0, len,
"yellow", 0, len) == 0)
1275 tmp_rgb[0] = tmp_rgb[1] = 1;
1276 else if (str.compare (0, len,
"magenta", 0, len) == 0)
1277 tmp_rgb[0] = tmp_rgb[2] = 1;
1278 else if (str.compare (0, len,
"cyan", 0, len) == 0)
1279 tmp_rgb[1] = tmp_rgb[2] = 1;
1280 else if (str.compare (0, len,
"white", 0, len) == 0
1281 || str.compare (0, len,
"w", 0, len) == 0)
1282 tmp_rgb[0] = tmp_rgb[1] = tmp_rgb[2] = 1;
1288 for (
int i = 0;
i < 3;
i++)
1303 error (
"invalid value for color property \"%s\"",
1312 if (s.length () != match.length ())
1314 "%s: allowing %s to match %s value %s",
1315 "set", s.c_str (),
get_name ().c_str (),
1335 catch (octave::execution_exception&
e)
1337 error (e,
"invalid value for color property \"%s\" (value = %s)",
1346 if (m.
numel () != 3)
1347 error (
"invalid value for color property \"%s\"",
1360 error (
"invalid value for color property \"%s\"",
1375 error (
"invalid value for double_radio property \"%s\"",
1380 if (s.length () != match.length ())
1382 "%s: allowing %s to match %s value %s",
1383 "set", s.c_str (),
get_name ().c_str (),
1402 error (
"invalid value for double_radio property \"%s\"",
1434 int vlen = vdims.
ndims ();
1445 if (itdims.
ndims () == vlen)
1449 for (
int i = 0; xok &&
i < vlen;
i++)
1453 if (itdims(
i) != vdims(
i))
1474 #define CHECK_ARRAY_EQUAL(T, F, A) \
1476 if (data.numel () == 1) \
1477 return data.F ## scalar_value () == \
1478 v.F ## scalar_value (); \
1484 const A m1 = data.F ## array_value (); \
1485 const T* d1 = m1.data (); \
1486 const A m2 = v.F ## array_value (); \
1487 const T* d2 = m2.data (); \
1491 for (int i = 0; flag && i < data.numel (); i++) \
1492 if (d1[i] != d2[i]) \
1571 if (!
get ().is_empty ())
1580 double dv = v.
xdouble_value (
"set: invalid graphics handle for property \"%s\"",
1586 error (
"set: invalid graphics handle (= %g) for property \"%s\"",
1617 if (! return_hidden)
1620 else if (return_hidden)
1647 children_list.clear ();
1694 executing_callback =
true;
1717 else if (type.
compare (
"any"))
1724 else if (type.
compare (
"radio"))
1727 error (
"addproperty: missing possible values for radio property");
1729 std::string sv =
args(0).xstring_value (
"addproperty: argument for radio property must be a string");
1736 else if (type.
compare (
"double"))
1738 double dv = (args.
length () > 0 ?
args(0).double_value () : 0.0);
1742 else if (type.
compare (
"handle"))
1744 double hv = args.
length () > 0 ?
args(0).double_value ()
1751 else if (type.
compare (
"boolean"))
1758 else if (type.
compare (
"data"))
1769 else if (type.
compare (
"color"))
1779 if (args.
length () > 0 && !
args(0).is_empty ())
1789 error (
"addproperty: unsupported type for dynamic property (= %s)",
1794 std::map<caseless_str, graphics_object>::const_iterator it =
1795 dprop_obj_map.find (go_name);
1797 if (it == dprop_obj_map.end ())
1806 dprop_obj_map[go_name] = go;
1813 error (
"addproperty: invalid object type (= %s)",
1839 for (
int k = 0;
k < children.
numel ();
k++)
1857 for (
int k = 0;
k < children.
numel ();
k++)
1889 if (modestr ==
"zoom in")
1891 val = modestr =
"zoom";
1894 else if (modestr ==
"zoom out")
1896 val = modestr =
"zoom";
1900 if (__mouse_mode__.set (val,
true))
1905 pm.
setfield (
"Enable", mode ==
"pan" ?
"on" :
"off");
1906 set___pan_mode__ (pm);
1909 rm.
setfield (
"Enable", mode ==
"rotate" ?
"on" :
"off");
1910 set___rotate_mode__ (rm);
1913 zm.
setfield (
"Enable", mode ==
"zoom" ?
"on" :
"off");
1914 zm.
setfield (
"Direction", direction);
1915 set___zoom_mode__ (zm);
1919 else if (modestr ==
"zoom")
1925 if (direction != curr_direction)
1927 zm.
setfield (
"Direction", direction);
1928 set___zoom_mode__ (zm);
1943 size_t len = name.length ();
1954 pfx = name.substr (0, 5);
1960 pfx = name.substr (0, 6);
1966 pfx = name.substr (0, 7);
1973 pfx = name.substr (0, 9);
1980 pfx = name.substr (0, 10);
1982 if (pfx.
compare (
"uipushtool"))
1986 pfx = name.substr (0, 12);
1988 if (pfx.
compare (
"uitoogletool"))
1992 pfx = name.substr (0, 13);
1994 if (pfx.
compare (
"uicontextmenu")
1995 || pfx.
compare (
"uibuttongroup"))
2011 std::transform (pfx.begin (), pfx.end (), pfx.begin (), tolower);
2015 bool has_property =
false;
2018 else if (pfx ==
"figure")
2020 else if (pfx ==
"line")
2022 else if (pfx ==
"text")
2024 else if (pfx ==
"image")
2026 else if (pfx ==
"patch")
2028 else if (pfx ==
"surface")
2030 else if (pfx ==
"hggroup")
2032 else if (pfx ==
"uimenu")
2034 else if (pfx ==
"uicontrol")
2036 else if (pfx ==
"uibuttongroup")
2038 else if (pfx ==
"uipanel")
2040 else if (pfx ==
"uicontextmenu")
2042 else if (pfx ==
"uitoolbar")
2044 else if (pfx ==
"uipushtool")
2048 error (
"invalid %s property '%s'", pfx.c_str (), pname.c_str ());
2050 bool remove =
false;
2055 remove = (sval ==
"remove");
2064 if (p != pval_map.end ())
2073 error (
"invalid default property specification");
2083 size_t len = name.length ();
2094 pfx = name.substr (0, 5);
2100 pfx = name.substr (0, 6);
2106 pfx = name.substr (0, 7);
2113 pfx = name.substr (0, 9);
2120 pfx = name.substr (0, 10);
2122 if (pfx.
compare (
"uipushtool"))
2126 pfx = name.substr (0, 12);
2128 if (pfx.
compare (
"uitoggletool"))
2132 pfx = name.substr (0, 13);
2134 if (pfx.
compare (
"uicontextmenu")
2135 || pfx.
compare (
"uibuttongroup"))
2149 std::transform (pfx.begin (), pfx.end (), pfx.begin (), tolower);
2161 if (q != pval_map.end ())
2181 for (
const auto& prop_val_p : pval_map)
2182 m.
assign (prefix + prop_val_p.first, prop_val_p.second);
2196 error (
"graphics_object::set: Nothing to set");
2200 if (
args(
i).is_map () )
2205 else if (
i < nargin - 1)
2209 set_value_or_default (pname, val);
2213 error (
"set: invalid number of arguments");
2236 error (
"set: number of names must match number of value columns (%d != %d)",
2246 set_value_or_default (pname, val);
2308 set_value_or_default (pname, val);
2405 if (sval ==
"default")
2409 rep->set (pname, default_val);
2411 else if (sval ==
"factory")
2415 rep->set (pname, default_val);
2420 if (sval ==
"\\default")
2421 rep->set (pname,
"default");
2422 else if (sval ==
"\\factory")
2423 rep->set (pname,
"factory");
2425 rep->set (pname, val);
2429 rep->set (pname, val);
2453 static double maxrand = RAND_MAX + 2.0;
2455 return (rand () + 1.0) / maxrand;
2463 if (integer_figure_handle)
2472 while (handle_map.find (retval) != handle_map.end ())
2483 if (p != handle_free_list.end ())
2486 handle_free_list.erase (p);
2504 if (h.
value () == 0)
2505 error (
"graphics_handle::free: can't delete root figure");
2509 if (p == handle_map.end ())
2510 error (
"graphics_handle::free: invalid object %g", h.
value ());
2523 p->second.finalize ();
2534 handle_map.erase (p);
2537 handle_free_list.insert
2548 if (p == handle_map.end ())
2549 error (
"graphics_handle::free: invalid object %g", old_gh.
value ());
2553 handle_map.erase (p);
2555 handle_map[new_gh] = go;
2557 if (old_gh.
value () < 0)
2561 for (
auto& hfig : figure_list)
2578 go.
set (pname, val);
2595 return go.
get (pname);
2605 double hv = ov.
xdouble_value (
"%s: %s must be a graphics handle",
2606 who.c_str (), pname.c_str ());
2611 error (
"%s: invalid graphics handle (= %g) for %s",
2612 who.c_str (), hv, pname.c_str ());
2623 go.
set (
"parent", new_parent.
value ());
2694 delete_executing =
true;
2730 Matrix hlist = do_figure_handle_list (
true);
2742 hlist = do_figure_handle_list (
true);
2754 hlist = do_figure_handle_list (
true);
2756 if (hlist.
numel () != 0)
2757 warning (
"gh_manager::do_close_all_figures: some graphics elements failed to close.");
2761 callback_objects.clear ();
2768 parent_go.
adopt (h);
2812 return go && go.
isa (
"figure");
2869 p != pval.end ();
p++)
2871 factory_pval[
p->first] =
p->second;
2876 it != factory_pval.end (); it++)
2882 && pname.find (
"__") != 0 && pname.find (
"current") != 0
2883 && pname !=
"uicontextmenu" && pname !=
"parent")
2886 if (pname.find (
"mode") == (pname.length () - 4))
2887 pval[
pname] = it->second;
2889 go.
set (pname, it->second);
2895 it != pval.end (); it++)
2896 go.
set (it->first, it->second);
2909 if (plist != defaults.
end ())
2913 for (
const auto& prop_val_p : pval_map)
2919 bgo.
set (pname, prop_val_p.second);
2921 catch (octave::execution_exception&
e)
2923 error (e,
"error setting default property %s", pname.c_str ());
2948 std::map<caseless_str, property, cmp_caseless_str>::const_iterator it =
2949 all_props.find (pname);
2951 if (it == all_props.end ())
2952 error (
"get: unknown property \"%s\"", pname.c_str ());
2954 return it->second.get ();
2962 for (std::map<caseless_str, property, cmp_caseless_str>::const_iterator
2963 it = all_props.begin (); it != all_props.end (); ++it)
2964 if (all || ! it->second.is_hidden ())
2965 m.
assign (it->second.get_name (), it->second.get ());
2970 std::set<std::string>
2973 return dynamic_properties;
2979 const std::set<std::string>& dynprops = dynamic_property_names ();
2981 if (dynprops.find (pname) != dynprops.end ())
2984 return all_props.find (pname) != all_props.end ();
2991 std::map<caseless_str, property, cmp_caseless_str>::iterator it =
2992 all_props.find (pname);
2994 if (it == all_props.end ())
2995 error (
"set: unknown property \"%s\"", pname.c_str ());
2997 it->second.set (val);
2999 dynamic_properties.insert (pname);
3007 std::map<caseless_str, property, cmp_caseless_str>::const_iterator it =
3008 all_props.find (pname);
3010 if (it == all_props.end ())
3011 error (
"get_property: unknown property \"%s\"", pname.c_str ());
3019 double hp = val.
xdouble_value (
"set: parent must be a graphics handle");
3023 if (hp == __myhandle__)
3024 error (
"set: can not set object parent to be object itself");
3028 if (! new_parent.
ok ())
3029 error (
"set: invalid graphics handle (= %g) for parent", hp);
3043 if (new_parent_go.
get_parent () == __myhandle__)
3051 ::adopt (parent.handle_value (), __myhandle__);
3070 __modified__ =
"on";
3112 if (go && go.
isa (
"uicontextmenu"))
3123 return (handlevisibility.is (
"on")
3124 || (executing_callback && ! handlevisibility.is (
"off")));
3141 Matrix kids = get_children ();
3143 for (
int i = 0;
i < kids.
numel ();
i++)
3166 property p = get_property (pname);
3169 p.add_listener (val, mode);
3177 property p = get_property (pname);
3180 p.delete_listener (val, mode);
3189 error (
"base_graphics_object::update_axis_limits: invalid graphics object");
3202 error (
"base_graphics_object::update_axis_limits: invalid graphics object");
3236 p.delete_listener ();
3238 catch (
const octave::execution_exception&)
3249 const auto it = local_defaults.
find (go_name);
3251 if (it != local_defaults.
end ())
3254 for (
const auto& prop_val_p : pval)
3257 if (def.
find (pname) == def.end ())
3258 def[pname] = prop_val_p.second;
3275 .
find (type ())->second;
3284 if (old_dep_prop == 1)
3286 else if (old_dep_prop == 2)
3298 error (
"base_graphics_object::values_as_string: invalid graphics object");
3309 if (
p.ok () && !
p.is_hidden ())
3311 retval +=
"\n\t" +
std::string (pa->first) +
": ";
3313 retval +=
p.values_as_string ();
3318 if (! retval.empty ())
3330 error (
"base_graphics_object::value_as_string: invalid graphics object");
3338 if (
p.ok () && !
p.is_hidden ())
3341 retval +=
p.values_as_string ();
3345 if (! retval.empty ())
3357 error (
"base_graphics_object::values_as_struct: invalid graphics object");
3363 pa != m.
end (); pa++)
3365 if (pa->first !=
"children"
3370 if (
p.ok () && !
p.is_hidden ())
3373 retval.
assign (
p.get_name (),
p.values_as_cell ());
3430 if (! cbo_stack.empty ())
3432 val = cbo_stack.front ();
3434 cbo_stack.pop_front ();
3437 callbackobject =
val;
3441 if (get_callbackobject ().ok ())
3442 cbo_stack.push_front (get_callbackobject ());
3444 callbackobject =
val;
3457 currentfigure =
val;
3469 if (integerhandle.set (val,
true))
3471 bool int_fig_handle = integerhandle.is_on ();
3487 Matrix kids = get_children ();
3498 if (__myhandle__ == cf)
3499 xset (0,
"currentfigure", __myhandle__.value ());
3501 this_go.
update (integerhandle.get_id ());
3516 double dpi = get_screenpixelsperinch ();
3518 if (xunits ==
"inches")
3525 else if (xunits ==
"centimeters")
3529 scrn_sz(2) *= 2.54 / dpi;
3530 scrn_sz(3) *= 2.54 / dpi;
3532 else if (xunits ==
"normalized")
3534 scrn_sz =
Matrix (1, 4, 1.0);
3538 else if (xunits ==
"points")
3542 scrn_sz(2) *= 72 / dpi;
3543 scrn_sz(3) *= 72 / dpi;
3546 set_screensize (scrn_sz);
3555 pos(2) = screen_size(0);
3556 pos(3) = screen_size(1);
3626 if (h == currentaxes.handle_value ())
3630 Matrix kids = get_children ();
3638 if (go.
isa (
"axes"))
3640 new_currentaxes = kid;
3645 currentaxes = new_currentaxes;
3654 if (! get_currentaxes ().ok ())
3658 if (go.
type () ==
"axes")
3687 xset (0,
"currentfigure", __myhandle__.value ());
3697 get_position ().matrix_value () :
3698 get_outerposition ().matrix_value ());
3704 pos(1) = screen_size(1) - pos(1) - pos(3);
3711 bool do_notify_toolkit)
3716 pos(1) = screen_size(1) - pos(1) - pos(3);
3722 set_position (pos, do_notify_toolkit);
3724 set_outerposition (pos, do_notify_toolkit);
3730 Matrix bb = get_boundingbox (
true);
3736 pos(1) = bb(3) - pos(1);
3747 Matrix bb = get_boundingbox (
true);
3756 pos(1) = bb(3) - pos(1);
3763 bool do_notify_toolkit)
3766 bool modified =
false;
3768 old_bb = get_boundingbox (
true);
3769 modified = position.set (v,
false, do_notify_toolkit);
3770 new_bb = get_boundingbox (
true);
3772 if (old_bb != new_bb)
3774 if (old_bb(2) != new_bb(2) || old_bb(3) != new_bb(3))
3776 execute_resizefcn ();
3777 update_boundingbox ();
3783 position.run_listeners (
POSTSET);
3787 if (paperpositionmode.is (
"auto"))
3788 paperposition.set (get_auto_paperposition ());
3793 bool do_notify_toolkit)
3795 if (outerposition.set (v,
true, do_notify_toolkit))
3806 error (
"set: can't set paperunits to normalized when papertype is custom");
3809 if (paperunits.set (val,
true))
3811 update_paperunits (old_paperunits);
3823 error (
"set: can't set paperunits to normalized when papertype is custom");
3825 if (papertype.set (val,
true))
3827 update_papertype ();
3837 if (! punits.
compare (
"normalized"))
3842 if (punits.
compare (
"inches"))
3845 mm2units = 1 / 25.4;
3847 else if (punits.
compare (
"centimeters"))
3850 mm2units = 1 / 10.0;
3855 mm2units = 72.0 / 25.4;
3858 if (ptype.
compare (
"usletter"))
3860 retval(0) = 8.5 * in2units;
3861 retval(1) = 11.0 * in2units;
3863 else if (ptype.
compare (
"uslegal"))
3865 retval(0) = 8.5 * in2units;
3866 retval(1) = 14.0 * in2units;
3868 else if (ptype.
compare (
"tabloid"))
3870 retval(0) = 11.0 * in2units;
3871 retval(1) = 17.0 * in2units;
3873 else if (ptype.
compare (
"a0"))
3875 retval(0) = 841.0 * mm2units;
3876 retval(1) = 1189.0 * mm2units;
3878 else if (ptype.
compare (
"a1"))
3880 retval(0) = 594.0 * mm2units;
3881 retval(1) = 841.0 * mm2units;
3883 else if (ptype.
compare (
"a2"))
3885 retval(0) = 420.0 * mm2units;
3886 retval(1) = 594.0 * mm2units;
3888 else if (ptype.
compare (
"a3"))
3890 retval(0) = 297.0 * mm2units;
3891 retval(1) = 420.0 * mm2units;
3893 else if (ptype.
compare (
"a4"))
3895 retval(0) = 210.0 * mm2units;
3896 retval(1) = 297.0 * mm2units;
3898 else if (ptype.
compare (
"a5"))
3900 retval(0) = 148.0 * mm2units;
3901 retval(1) = 210.0 * mm2units;
3903 else if (ptype.
compare (
"b0"))
3905 retval(0) = 1029.0 * mm2units;
3906 retval(1) = 1456.0 * mm2units;
3908 else if (ptype.
compare (
"b1"))
3910 retval(0) = 728.0 * mm2units;
3911 retval(1) = 1028.0 * mm2units;
3913 else if (ptype.
compare (
"b2"))
3915 retval(0) = 514.0 * mm2units;
3916 retval(1) = 728.0 * mm2units;
3918 else if (ptype.
compare (
"b3"))
3920 retval(0) = 364.0 * mm2units;
3921 retval(1) = 514.0 * mm2units;
3923 else if (ptype.
compare (
"b4"))
3925 retval(0) = 257.0 * mm2units;
3926 retval(1) = 364.0 * mm2units;
3928 else if (ptype.
compare (
"b5"))
3930 retval(0) = 182.0 * mm2units;
3931 retval(1) = 257.0 * mm2units;
3933 else if (ptype.
compare (
"arch-a"))
3935 retval(0) = 9.0 * in2units;
3936 retval(1) = 12.0 * in2units;
3938 else if (ptype.
compare (
"arch-b"))
3940 retval(0) = 12.0 * in2units;
3941 retval(1) = 18.0 * in2units;
3943 else if (ptype.
compare (
"arch-c"))
3945 retval(0) = 18.0 * in2units;
3946 retval(1) = 24.0 * in2units;
3948 else if (ptype.
compare (
"arch-d"))
3950 retval(0) = 24.0 * in2units;
3951 retval(1) = 36.0 * in2units;
3953 else if (ptype.
compare (
"arch-e"))
3955 retval(0) = 36.0 * in2units;
3956 retval(1) = 48.0 * in2units;
3960 retval(0) = 8.5 * in2units;
3961 retval(1) = 11.0 * in2units;
3965 retval(0) = 11.0 * in2units;
3966 retval(1) = 17.0 * in2units;
3970 retval(0) = 17.0 * in2units;
3971 retval(1) = 22.0 * in2units;
3975 retval(0) = 22.0 * in2units;
3976 retval(1) = 34.0 * in2units;
3980 retval(0) = 34.0 * in2units;
3981 retval(1) = 43.0 * in2units;
3991 Matrix pos = get_position ().matrix_value ();
3998 if (funits ==
"normalized" || punits ==
"normalized")
4003 if (punits ==
"normalized")
4012 sz = get_papersize ().matrix_value ();
4014 pos(0) =
sz(0)/2 - pos(2)/2;
4015 pos(1) =
sz(1)/2 - pos(3)/2;
4106 Matrix pos = get_paperposition ().matrix_value ();
4107 Matrix sz = get_papersize ().matrix_value ();
4118 if (ptype.
compare (
"<custom>"))
4120 if (old_paperunits.
compare (
"centimeters"))
4125 else if (old_paperunits.
compare (
"points"))
4131 if (punits.
compare (
"centimeters"))
4136 else if (punits.
compare (
"points"))
4145 if (porient ==
"landscape")
4162 if (typ !=
"<custom>")
4165 if (get_paperorientation () ==
"landscape")
4172 if (paperpositionmode.is (
"auto"))
4173 paperposition.set (get_auto_paperposition ());
4179 Matrix sz = get_papersize ().matrix_value ();
4188 paperorientation.set (
"portrait");
4192 if (punits ==
"centimeters")
4197 else if (punits ==
"points")
4202 if (punits ==
"normalized")
4204 if (get_papertype () ==
"<custom>")
4205 error (
"set: can't set the papertype to <custom> when the paperunits is normalized");
4213 const double mm2in = 1.0 / 25.4;
4214 const double tol = 0.01;
4290 papertype.set (ptype);
4292 if (punits ==
"centimeters")
4297 else if (punits ==
"points")
4302 if (get_paperorientation () ==
"landscape")
4308 if (paperpositionmode.is (
"auto"))
4309 paperposition.set (get_auto_paperposition ());
4348 Matrix sz = get_papersize ().matrix_value ();
4349 if ((
sz(0) >
sz(1) && porient ==
"portrait")
4350 || (
sz(0) <
sz(1) && porient ==
"landscape"))
4358 if (paperpositionmode.is (
"auto"))
4359 paperposition.set (get_auto_paperposition ());
4394 if (units.set (val,
true))
4396 update_units (old_units);
4404 position.set (
convert_position (get_position ().matrix_value (), old_units,
4429 if (is_numbertitle ())
4431 std::ostringstream os;
4434 os <<
"Figure " << __myhandle__.value ();
4436 os <<
": " << get_name ();
4467 plist.
erase (
"units");
4468 plist.
erase (
"position");
4469 plist.
erase (
"outerposition");
4470 plist.
erase (
"paperunits");
4471 plist.
erase (
"paperposition");
4472 plist.
erase (
"windowstyle");
4483 outerposition.add_constraint (
dim_vector (1, 4));
4484 tightinset.add_constraint (
dim_vector (1, 4));
4485 looseinset.add_constraint (
dim_vector (1, 4));
4486 colororder.add_constraint (
dim_vector (-1, 3));
4487 dataaspectratio.add_constraint (
dim_vector (1, 3));
4488 plotboxaspectratio.add_constraint (
dim_vector (1, 3));
4491 alim.add_constraint (2);
4492 clim.add_constraint (2);
4493 xlim.add_constraint (2);
4494 ylim.add_constraint (2);
4495 zlim.add_constraint (2);
4499 ticklength.add_constraint (
dim_vector (1, 2));
4504 cameraposition.add_constraint (
dim_vector (1, 3));
4505 cameratarget.add_constraint (
dim_vector (1, 3));
4508 cameraupvector = upv;
4509 cameraupvector.add_constraint (
dim_vector (1, 3));
4510 currentpoint.add_constraint (
dim_vector (2, 3));
4514 x_zlim.resize (1, 2);
4520 calc_ticklabels (xtick, xticklabel, xscale.is (
"log"));
4521 calc_ticklabels (ytick, yticklabel, yscale.is (
"log"));
4522 calc_ticklabels (ztick, zticklabel, zscale.is (
"log"));
4524 xset (xlabel.handle_value (),
"handlevisibility",
"off");
4525 xset (ylabel.handle_value (),
"handlevisibility",
"off");
4526 xset (zlabel.handle_value (),
"handlevisibility",
"off");
4527 xset (title.handle_value (),
"handlevisibility",
"off");
4529 xset (xlabel.handle_value (),
"horizontalalignment",
"center");
4530 xset (xlabel.handle_value (),
"horizontalalignmentmode",
"auto");
4531 xset (ylabel.handle_value (),
"horizontalalignment",
"center");
4532 xset (ylabel.handle_value (),
"horizontalalignmentmode",
"auto");
4533 xset (zlabel.handle_value (),
"horizontalalignment",
"right");
4534 xset (zlabel.handle_value (),
"horizontalalignmentmode",
"auto");
4535 xset (title.handle_value (),
"horizontalalignment",
"center");
4536 xset (title.handle_value (),
"horizontalalignmentmode",
"auto");
4538 xset (xlabel.handle_value (),
"verticalalignment",
"top");
4539 xset (xlabel.handle_value (),
"verticalalignmentmode",
"auto");
4540 xset (ylabel.handle_value (),
"verticalalignment",
"bottom");
4541 xset (ylabel.handle_value (),
"verticalalignmentmode",
"auto");
4542 xset (title.handle_value (),
"verticalalignment",
"bottom");
4543 xset (title.handle_value (),
"verticalalignmentmode",
"auto");
4545 xset (ylabel.handle_value (),
"rotation", 90.0);
4546 xset (ylabel.handle_value (),
"rotationmode",
"auto");
4548 xset (zlabel.handle_value (),
"visible",
"off");
4550 xset (xlabel.handle_value (),
"clipping",
"off");
4551 xset (ylabel.handle_value (),
"clipping",
"off");
4552 xset (zlabel.handle_value (),
"clipping",
"off");
4553 xset (title.handle_value (),
"clipping",
"off");
4555 xset (xlabel.handle_value (),
"autopos_tag",
"xlabel");
4556 xset (ylabel.handle_value (),
"autopos_tag",
"ylabel");
4557 xset (zlabel.handle_value (),
"autopos_tag",
"zlabel");
4558 xset (title.handle_value (),
"autopos_tag",
"title");
4560 adopt (xlabel.handle_value ());
4561 adopt (ylabel.handle_value ());
4562 adopt (zlabel.handle_value ());
4563 adopt (title.handle_value ());
4566 tlooseinset(2) = 1-tlooseinset(0)-tlooseinset(2);
4567 tlooseinset(3) = 1-tlooseinset(1)-tlooseinset(3);
4568 looseinset = tlooseinset;
4577 Matrix ext = get_extent (
true,
true);
4578 ext(1) = parent_bb(3) - ext(1) - ext(3);
4583 if (ext(0) < pos(0))
4585 pos(2) += pos(0)-ext(0);
4588 if (ext(0)+ext(2) > pos(0)+pos(2))
4589 pos(2) = ext(0)+ext(2)-pos(0);
4591 if (ext(1) < pos(1))
4593 pos(3) += pos(1)-ext(1);
4596 if (ext(1)+ext(3) > pos(1)+pos(3))
4597 pos(3) = ext(1)+ext(3)-pos(1);
4606 if (activepositionproperty.is (
"position"))
4609 update_outerposition ();
4611 set_units (
"normalized");
4612 Matrix pos = position.get ().matrix_value ();
4613 Matrix outpos = outerposition.get ().matrix_value ();
4614 Matrix tightpos = calc_tightbox (pos);
4615 Matrix tinset (1, 4, 1.0);
4616 tinset(0) = pos(0)-tightpos(0);
4617 tinset(1) = pos(1)-tightpos(1);
4618 tinset(2) = tightpos(0)+tightpos(2)-pos(0)-pos(2);
4619 tinset(3) = tightpos(1)+tightpos(3)-pos(1)-pos(3);
4620 tightinset = tinset;
4621 set_units (old_units);
4622 update_transform ();
4623 if (activepositionproperty.is (
"position"))
4626 update_outerposition ();
4715 if (go.
isa (
"text"))
4716 val = ::
reparent (v,
"set", who, __myhandle__,
false);
4721 error (
"set: expecting text graphics object or character string for %s property, found %s",
4722 who.c_str (), cname.c_str ());
4725 xset (val,
"handlevisibility",
"off");
4733 adopt (hp.handle_value ());
4739 set_text_child (xlabel,
"xlabel", v);
4740 xset (xlabel.handle_value (),
"positionmode",
"auto");
4741 xset (xlabel.handle_value (),
"rotationmode",
"auto");
4742 xset (xlabel.handle_value (),
"horizontalalignmentmode",
"auto");
4743 xset (xlabel.handle_value (),
"verticalalignmentmode",
"auto");
4744 xset (xlabel.handle_value (),
"clipping",
"off");
4745 xset (xlabel.handle_value (),
"color", get_xcolor ());
4746 xset (xlabel.handle_value (),
"autopos_tag",
"xlabel");
4747 update_xlabel_position ();
4753 set_text_child (ylabel,
"ylabel", v);
4754 xset (ylabel.handle_value (),
"positionmode",
"auto");
4755 xset (ylabel.handle_value (),
"rotationmode",
"auto");
4756 xset (ylabel.handle_value (),
"horizontalalignmentmode",
"auto");
4757 xset (ylabel.handle_value (),
"verticalalignmentmode",
"auto");
4758 xset (ylabel.handle_value (),
"clipping",
"off");
4759 xset (ylabel.handle_value (),
"color", get_ycolor ());
4760 xset (ylabel.handle_value (),
"autopos_tag",
"ylabel");
4761 update_ylabel_position ();
4767 set_text_child (zlabel,
"zlabel", v);
4768 xset (zlabel.handle_value (),
"positionmode",
"auto");
4769 xset (zlabel.handle_value (),
"rotationmode",
"auto");
4770 xset (zlabel.handle_value (),
"horizontalalignmentmode",
"auto");
4771 xset (zlabel.handle_value (),
"verticalalignmentmode",
"auto");
4772 xset (zlabel.handle_value (),
"clipping",
"off");
4773 xset (zlabel.handle_value (),
"color", get_zcolor ());
4774 xset (zlabel.handle_value (),
"autopos_tag",
"zlabel");
4775 update_zlabel_position ();
4781 set_text_child (title,
"title", v);
4782 xset (title.handle_value (),
"positionmode",
"auto");
4783 xset (title.handle_value (),
"horizontalalignment",
"center");
4784 xset (title.handle_value (),
"horizontalalignmentmode",
"auto");
4785 xset (title.handle_value (),
"verticalalignment",
"bottom");
4786 xset (title.handle_value (),
"verticalalignmentmode",
"auto");
4787 xset (title.handle_value (),
"clipping",
"off");
4788 xset (title.handle_value (),
"autopos_tag",
"title");
4789 update_title_position ();
4812 ambientlightcolor =
Matrix (1, 3, 1.0);
4818 camerapositionmode =
"auto";
4819 cameratargetmode =
"auto";
4820 cameraupvectormode =
"auto";
4821 cameraviewanglemode =
"auto";
4827 clippingstyle =
"3dbox";
4831 colororderindex = 1.0;
4834 dataaspectratiomode =
"auto";
4836 drawmode =
"normal";
4838 fontangle =
"normal";
4841 fontunits =
"points";
4842 fontsmoothing =
"on";
4843 fontweight =
"normal";
4846 gridalphamode =
"auto";
4848 gridcolormode =
"auto";
4849 gridlinestyle =
"-";
4851 labelfontsizemultiplier = 1.1;
4855 linestyleorder =
"-";
4856 linestyleorderindex = 1.0;
4860 minorgridalpha = 0.25;
4861 minorgridalphamode =
"auto";
4863 minorgridcolormode =
"auto";
4864 minorgridlinestyle =
":";
4866 nextplot =
"replace";
4869 plotboxaspectratiomode =
"auto";
4870 projection =
"orthographic";
4872 sortmethod =
"depth";
4875 tickdirmode =
"auto";
4876 ticklabelinterpreter =
"tex";
4879 tightinset =
Matrix (1, 4, 0.0);
4881 titlefontsizemultiplier = 1.1;
4882 titlefontweight =
"bold";
4884 Matrix tview (1, 2, 0.0);
4888 xaxislocation =
"bottom";
4891 xcolormode =
"auto";
4899 xticklabelmode =
"auto";
4900 xticklabelrotation = 0.0;
4903 yaxislocation =
"left";
4906 ycolormode =
"auto";
4914 yticklabelmode =
"auto";
4915 yticklabelrotation = 0.0;
4919 zcolormode =
"auto";
4927 zticklabelmode =
"auto";
4928 zticklabelrotation = 0.0;
4938 if (mode !=
"replace" && mode !=
"reset")
4942 activepositionproperty =
"outerposition";
4945 if (mode !=
"reset")
4947 delete_children (
true);
4949 xlabel.invalidate ();
4950 ylabel.invalidate ();
4951 zlabel.invalidate ();
4952 title.invalidate ();
4955 false,
false,
false);
4957 false,
false,
false);
4959 false,
false,
false);
4961 false,
false,
false);
4963 adopt (xlabel.handle_value ());
4964 adopt (ylabel.handle_value ());
4965 adopt (zlabel.handle_value ());
4966 adopt (title.handle_value ());
4968 update_xlabel_position ();
4969 update_ylabel_position ();
4970 update_zlabel_position ();
4971 update_title_position ();
4985 xset (xlabel.handle_value (),
"handlevisibility",
"off");
4986 xset (ylabel.handle_value (),
"handlevisibility",
"off");
4987 xset (zlabel.handle_value (),
"handlevisibility",
"off");
4988 xset (title.handle_value (),
"handlevisibility",
"off");
4990 xset (xlabel.handle_value (),
"horizontalalignment",
"center");
4991 xset (xlabel.handle_value (),
"horizontalalignmentmode",
"auto");
4992 xset (ylabel.handle_value (),
"horizontalalignment",
"center");
4993 xset (ylabel.handle_value (),
"horizontalalignmentmode",
"auto");
4994 xset (zlabel.handle_value (),
"horizontalalignment",
"right");
4995 xset (zlabel.handle_value (),
"horizontalalignmentmode",
"auto");
4996 xset (title.handle_value (),
"horizontalalignment",
"center");
4997 xset (title.handle_value (),
"horizontalalignmentmode",
"auto");
4999 xset (xlabel.handle_value (),
"verticalalignment",
"top");
5000 xset (xlabel.handle_value (),
"verticalalignmentmode",
"auto");
5001 xset (ylabel.handle_value (),
"verticalalignment",
"bottom");
5002 xset (ylabel.handle_value (),
"verticalalignmentmode",
"auto");
5003 xset (title.handle_value (),
"verticalalignment",
"bottom");
5004 xset (title.handle_value (),
"verticalalignmentmode",
"auto");
5006 xset (ylabel.handle_value (),
"rotation", 90.0);
5007 xset (ylabel.handle_value (),
"rotationmode",
"auto");
5009 xset (zlabel.handle_value (),
"visible",
"off");
5011 xset (xlabel.handle_value (),
"clipping",
"off");
5012 xset (ylabel.handle_value (),
"clipping",
"off");
5013 xset (zlabel.handle_value (),
"clipping",
"off");
5014 xset (title.handle_value (),
"clipping",
"off");
5016 xset (xlabel.handle_value (),
"autopos_tag",
"xlabel");
5017 xset (ylabel.handle_value (),
"autopos_tag",
"ylabel");
5018 xset (zlabel.handle_value (),
"autopos_tag",
"zlabel");
5019 xset (title.handle_value (),
"autopos_tag",
"title");
5021 update_transform ();
5046 if (! is_beingdeleted ())
5060 if (xlabel.handle_value ().ok () && h == xlabel.handle_value ())
5062 delete_text_child (xlabel);
5063 update_xlabel_position ();
5065 else if (ylabel.handle_value ().ok () && h == ylabel.handle_value ())
5067 delete_text_child (ylabel);
5068 update_ylabel_position ();
5070 else if (zlabel.handle_value ().ok () && h == zlabel.handle_value ())
5072 delete_text_child (zlabel);
5073 update_zlabel_position ();
5075 else if (title.handle_value ().ok () && h == title.handle_value ())
5077 delete_text_child (title);
5078 update_title_position ();
5089 for (
int i = 0;
i < 4;
i++)
5186 double fact = 1.0 / sqrt (v(0)*v(0)+v(1)*v(1)+v(2)*v(2));
5187 scale (v, fact, fact, fact);
5193 return (v1(0)*
v2(0)+v1(1)*
v2(1)+v1(2)*
v2(2));
5199 return sqrt (
dot (v, v));
5207 r(0) = v1(1)*
v2(2) - v1(2)*
v2(1);
5208 r(1) = v1(2)*
v2(0) - v1(0)*
v2(2);
5209 r(2) = v1(0)*
v2(1) - v1(1)*
v2(0);
5217 static double data[32] =
5254 double xd = (xdir_is (
"normal") ? 1 : -1);
5255 double yd = (ydir_is (
"normal") ? 1 : -1);
5256 double zd = (zdir_is (
"normal") ? 1 : -1);
5258 Matrix xlimits = sx.scale (get_xlim ().matrix_value ());
5259 Matrix ylimits = sy.scale (get_ylim ().matrix_value ());
5260 Matrix zlimits =
sz.scale (get_zlim ().matrix_value ());
5262 double xo = xlimits(xd > 0 ? 0 : 1);
5263 double yo = ylimits(yd > 0 ? 0 : 1);
5264 double zo = zlimits(zd > 0 ? 0 : 1);
5266 Matrix pb = get_plotboxaspectratio ().matrix_value ();
5268 bool autocam = (camerapositionmode_is (
"auto")
5269 && cameratargetmode_is (
"auto")
5270 && cameraupvectormode_is (
"auto")
5271 && cameraviewanglemode_is (
"auto"));
5272 bool dowarp = (autocam && dataaspectratiomode_is (
"auto")
5273 && plotboxaspectratiomode_is (
"auto"));
5279 if (cameratargetmode_is (
"auto"))
5281 c_center(0) = (xlimits(0) + xlimits(1)) / 2;
5282 c_center(1) = (ylimits(0) + ylimits(1)) / 2;
5283 c_center(2) = (zlimits(0) + zlimits(1)) / 2;
5288 c_center =
cam2xform (get_cameratarget ().matrix_value ());
5290 if (camerapositionmode_is (
"auto"))
5292 Matrix tview = get_view ().matrix_value ();
5293 double az = tview(0);
5294 double el = tview(1);
5295 double d = 5 * sqrt (pb(0)*pb(0) + pb(1)*pb(1) + pb(2)*pb(2));
5297 if (el == 90 || el == -90)
5303 c_eye(0) = d * cos (el) * sin (az);
5304 c_eye(1) = -d* cos (el) * cos (az);
5305 c_eye(2) = d * sin (el);
5307 c_eye(0) = c_eye(0)*(xlimits(1)-xlimits(0))/(xd*pb(0))+c_center(0);
5308 c_eye(1) = c_eye(1)*(ylimits(1)-ylimits(0))/(yd*pb(1))+c_center(1);
5309 c_eye(2) = c_eye(2)*(zlimits(1)-zlimits(0))/(zd*pb(2))+c_center(2);
5314 c_eye =
cam2xform (get_cameraposition ().matrix_value ());
5316 if (cameraupvectormode_is (
"auto"))
5318 Matrix tview = get_view ().matrix_value ();
5319 double az = tview(0);
5320 double el = tview(1);
5322 if (el == 90 || el == -90)
5325 * sin (az*M_PI/180.0)*(xlimits(1)-xlimits(0))/pb(0);
5327 * cos (az*M_PI/180.0)*(ylimits(1)-ylimits(0))/pb(1);
5335 c_upv =
cam2xform (get_cameraupvector ().matrix_value ());
5346 scale (x_pre, pb(0), pb(1), pb(2));
5348 scale (x_pre, xd/(xlimits(1)-xlimits(0)), yd/(ylimits(1)-ylimits(0)),
5349 zd/(zlimits(1)-zlimits(0)));
5352 xform (c_eye, x_pre);
5353 xform (c_center, x_pre);
5354 scale (c_upv, pb(0)/(xlimits(1)-xlimits(0)), pb(1)/(ylimits(1)-ylimits(0)),
5355 pb(2)/(zlimits(1)-zlimits(0)));
5356 translate (c_center, -c_eye(0), -c_eye(1), -c_eye(2));
5364 double fa = 1 / sqrt (1 -
f(2)*
f(2));
5365 scale (UP, fa, fa, fa);
5371 scale (x_view, 1, 1, -1);
5373 l(0,0) =
s(0); l(0,1) =
s(1); l(0,2) =
s(2);
5374 l(1,0) =
u(0); l(1,1) =
u(1); l(1,2) =
u(2);
5375 l(2,0) = -
f(0); l(2,1) = -
f(1); l(2,2) = -
f(2);
5376 x_view = x_view * l;
5377 translate (x_view, -c_eye(0), -c_eye(1), -c_eye(2));
5378 scale (x_view, pb(0), pb(1), pb(2));
5384 double xM = cmax(0) - cmin(0);
5385 double yM = cmax(1) - cmin(1);
5387 Matrix bb = get_boundingbox (
true);
5391 if (cameraviewanglemode_is (
"auto"))
5398 if (
false && dowarp)
5399 af = 1.0 / (xM > yM ? xM : yM);
5402 if ((bb(2)/bb(3)) > (xM/yM))
5407 v_angle = 2 * (180.0 / M_PI) *
atan (1 / (2 * af *
norm (
F)));
5409 cameraviewangle = v_angle;
5412 v_angle = get_cameraviewangle ();
5414 double pf = 1 / (2 * tan ((v_angle / 2) * M_PI / 180.0) *
norm (
F));
5415 scale (x_projection, pf, pf, 1);
5421 translate (x_viewport, bb(0)+bb(2)/2, bb(1)+bb(3)/2, 0);
5422 scale (x_viewport, bb(2)/xM, -bb(3)/yM, 1);
5429 if ((bb(2)/bb(3)) > (xM/yM))
5435 pix = (bb(2) < bb(3) ? bb(2) : bb(3));
5436 translate (x_viewport, bb(0)+bb(2)/2, bb(1)+bb(3)/2, 0);
5437 scale (x_viewport, pix, -pix, 1);
5440 x_normrender = x_viewport * x_projection * x_view;
5446 x_zlim(0) = cmin(2);
5447 x_zlim(1) = cmax(2);
5449 x_render = x_normrender;
5450 scale (x_render, xd/(xlimits(1)-xlimits(0)), yd/(ylimits(1)-ylimits(0)),
5451 zd/(zlimits(1)-zlimits(0)));
5454 x_viewtransform = x_view;
5455 x_projectiontransform = x_projection;
5456 x_viewporttransform = x_viewport;
5457 x_normrendertransform = x_normrender;
5458 x_rendertransform = x_render;
5460 x_render_inv = x_render.
inverse ();
5465 scale (x_gl_mat1, xd/(xlimits(1)-xlimits(0)), yd/(ylimits(1)-ylimits(0)),
5466 zd/(zlimits(1)-zlimits(0)));
5468 x_gl_mat2 = x_viewport * x_projection;
5476 if (updating_axes_layout)
5481 double xd = (xdir_is (
"normal") ? 1 : -1);
5482 double yd = (ydir_is (
"normal") ? 1 : -1);
5483 double zd = (zdir_is (
"normal") ? 1 : -1);
5485 const Matrix xlims = xform.
xscale (get_xlim ().matrix_value ());
5486 const Matrix ylims = xform.
yscale (get_ylim ().matrix_value ());
5487 const Matrix zlims = xform.
zscale (get_zlim ().matrix_value ());
5489 double x_min, x_max, y_min, y_max, z_min, z_max;
5490 x_min = xlims(0), x_max = xlims(1);
5491 y_min = ylims(0), y_max = ylims(1);
5492 z_min = zlims(0), z_max = zlims(1);
5498 p1 = xform.
transform (x_min, (y_min+y_max)/2, (z_min+z_max)/2,
false);
5499 p2 = xform.
transform (x_max, (y_min+y_max)/2, (z_min+z_max)/2,
false);
5502 dir(2) = (p2(2) - p1(2));
5503 if (dir(0) == 0 && dir(1) == 0)
5505 else if (dir(2) == 0)
5509 else if (dir(1) == 0)
5516 xPlane = (dir(0) > 0 ? x_max : x_min);
5518 xPlane = (dir(1) < 0 ? x_max : x_min);
5521 xPlane = (dir(2) < 0 ? x_min : x_max);
5523 xPlaneN = (xPlane == x_min ? x_max : x_min);
5524 fx = (x_max - x_min) / sqrt (dir(0)*dir(0) + dir(1)*dir(1));
5526 p1 = xform.
transform ((x_min + x_max)/2, y_min, (z_min + z_max)/2,
false);
5527 p2 = xform.
transform ((x_min + x_max)/2, y_max, (z_min + z_max)/2,
false);
5530 dir(2) = (p2(2) - p1(2));
5531 if (dir(0) == 0 && dir(1) == 0)
5533 else if (dir(2) == 0)
5537 else if (dir(1) == 0)
5544 yPlane = (dir(0) > 0 ? y_max : y_min);
5546 yPlane = (dir(1) < 0 ? y_max : y_min);
5549 yPlane = (dir(2) < 0 ? y_min : y_max);
5551 yPlaneN = (yPlane == y_min ? y_max : y_min);
5552 fy = (y_max - y_min) / sqrt (dir(0)*dir(0) + dir(1)*dir(1));
5554 p1 = xform.
transform ((x_min + x_max)/2, (y_min + y_max)/2, z_min,
false);
5555 p2 = xform.
transform ((x_min + x_max)/2, (y_min + y_max)/2, z_max,
false);
5558 dir(2) = (p2(2) - p1(2));
5559 if (dir(0) == 0 && dir(1) == 0)
5561 else if (dir(2) == 0)
5565 else if (dir(1) == 0)
5572 zPlane = (dir(0) > 0 ? z_min : z_max);
5574 zPlane = (dir(1) < 0 ? z_min : z_max);
5577 zPlane = (dir(2) < 0 ? z_min : z_max);
5579 zPlaneN = (zPlane == z_min ? z_max : z_min);
5580 fz = (z_max - z_min) / sqrt (dir(0)*dir(0) + dir(1)*dir(1));
5584 updating_axes_layout =
true;
5586 xySym = (xd*yd*(xPlane-xPlaneN)*(yPlane-yPlaneN) > 0);
5587 zSign = (zd*(zPlane-zPlaneN) <= 0);
5588 xyzSym = zSign ? xySym : ! xySym;
5589 xpTick = (zSign ? xPlaneN : xPlane);
5590 ypTick = (zSign ? yPlaneN : yPlane);
5591 zpTick = (zSign ? zPlane : zPlaneN);
5592 xpTickN = (zSign ? xPlane : xPlaneN);
5593 ypTickN = (zSign ? yPlane : yPlaneN);
5594 zpTickN = (zSign ? zPlaneN : zPlane);
5602 if (xaxislocation_is (
"top"))
5609 if (yaxislocation_is (
"right"))
5616 if (layer_is (
"top"))
5625 Matrix viewmat = get_view ().matrix_value ();
5626 nearhoriz =
std::abs (viewmat(1)) <= 5;
5627 is2D = viewmat(1) == 90;
5629 update_ticklength ();
5639 if (tickdirmode_is (
"auto"))
5640 tickdir.set (mode2d ?
"in" :
"out",
true);
5642 double ticksign = (tickdir_is (
"in") ? -1 : 1);
5644 Matrix bbox = get_boundingbox (
true);
5645 Matrix ticklen = get_ticklength ().matrix_value ();
5646 ticklen(0) *=
std::max (bbox(2), bbox(3));
5647 ticklen(1) *=
std::max (bbox(2), bbox(3));
5649 xticklen = ticksign * (mode2d ? ticklen(0) : ticklen(1));
5650 yticklen = ticksign * (mode2d ? ticklen(0) : ticklen(1));
5651 zticklen = ticksign * (mode2d ? ticklen(0) : ticklen(1));
5653 xtickoffset = (mode2d ?
std::max (0., xticklen) :
std::abs (xticklen)) + 5;
5654 ytickoffset = (mode2d ?
std::max (0., yticklen) :
std::abs (yticklen)) + 5;
5655 ztickoffset = (mode2d ?
std::max (0., zticklen) :
std::abs (zticklen)) + 5;
5657 update_xlabel_position ();
5658 update_ylabel_position ();
5659 update_zlabel_position ();
5660 update_title_position ();
5691 if (to_units !=
"data")
5697 retval(0) = v(0) - bbox(0) + 1;
5698 retval(1) = bbox(1) + bbox(3) - v(1) + 1;
5715 if (updating_xlabel_position)
5730 updating_xlabel_position =
true;
5737 (xstate >
AXE_DEPTH_DIR ?
"center" : (xyzSym ?
"left" :
"right"));
5757 ext = get_ticklabel_extents (get_xtick ().matrix_value (),
5758 get_xticklabel ().string_vector_value (),
5759 get_xlim ().matrix_value ());
5761 double wmax = ext(0);
5762 double hmax = ext(1);
5778 p(0) += (xyzSym ? wmax : -wmax);
5788 p(1) += (x2Dtop ? -hmax : hmax);
5797 get_extent (
false));
5816 if (updating_ylabel_position)
5831 updating_ylabel_position =
true;
5838 (ystate >
AXE_DEPTH_DIR ?
"center" : (! xyzSym ?
"left" :
"right"));
5846 (ystate ==
AXE_VERT_DIR && ! y2Dright ?
"bottom" :
"top");
5867 ext = get_ticklabel_extents (get_ytick ().matrix_value (),
5868 get_yticklabel ().string_vector_value (),
5869 get_ylim ().matrix_value ());
5871 double wmax = ext(0)+4;
5872 double hmax = ext(1);
5888 p(0) += (! xyzSym ? wmax : -wmax);
5893 p(0) += (y2Dright ? wmax : -wmax);
5907 get_extent (
false));
5926 if (updating_zlabel_position)
5937 bool camAuto = cameraupvectormode_is (
"auto");
5942 updating_zlabel_position =
true;
5958 ?
"bottom" : ((zSign || camAuto) ?
"bottom" :
"top"));
5970 ext = get_ticklabel_extents (get_ztick ().matrix_value (),
5971 get_zticklabel ().string_vector_value (),
5972 get_zlim ().matrix_value ());
5974 double wmax = ext(0);
5975 double hmax = ext(1);
5982 (zpTickN + zpTick)/2);
5991 (zpTickN + zpTick)/2);
6031 get_extent (
false));
6050 if (updating_title_position)
6063 updating_title_position =
true;
6070 Matrix bbox = get_extent (
false);
6075 (x_zlim(0) + x_zlim(1))/2);
6080 ext = get_ticklabel_extents (get_xtick ().matrix_value (),
6081 get_xticklabel ().string_vector_value (),
6082 get_xlim ().matrix_value ());
6098 if (elem_type ==
"xlabel")
6099 update_xlabel_position ();
6100 else if (elem_type ==
"ylabel")
6101 update_ylabel_position ();
6102 else if (elem_type ==
"zlabel")
6103 update_zlabel_position ();
6104 else if (elem_type ==
"title")
6105 update_title_position ();
6106 else if (elem_type ==
"sync")
6112 double xlength,
double ylength,
double zlength)
6114 double xval = xlength / scalefactors(0);
6115 double yval = ylength / scalefactors(1);
6116 double zval = zlength / scalefactors(2);
6120 aspectratios(0) = xval / minval;
6121 aspectratios(1) = yval / minval;
6122 aspectratios(2) = zval / minval;
6127 double pbfactor,
double dafactor,
char limit_type,
bool tight)
6152 if (updating_aspectratios.find (get___myhandle__ ().
value ())
6153 != updating_aspectratios.end ())
6156 Matrix xlimits = get_xlim ().matrix_value ();
6157 Matrix ylimits = get_ylim ().matrix_value ();
6158 Matrix zlimits = get_zlim ().matrix_value ();
6160 double dx = (xlimits(1) - xlimits(0));
6161 double dy = (ylimits(1) - ylimits(0));
6162 double dz = (zlimits(1) - zlimits(0));
6164 Matrix da = get_dataaspectratio ().matrix_value ();
6165 Matrix pba = get_plotboxaspectratio ().matrix_value ();
6167 if (dataaspectratiomode_is (
"auto"))
6169 if (plotboxaspectratiomode_is (
"auto"))
6171 pba =
Matrix (1, 3, 1.0);
6172 plotboxaspectratio.set (pba,
false);
6176 dataaspectratio.set (da,
false);
6178 else if (plotboxaspectratiomode_is (
"auto"))
6181 plotboxaspectratio.set (pba,
false);
6186 bool modified_limits =
false;
6189 if (xlimmode_is (
"auto") && ylimmode_is (
"auto") && zlimmode_is (
"auto"))
6191 modified_limits =
true;
6192 kids = get_children ();
6197 else if (xlimmode_is (
"auto") && ylimmode_is (
"auto"))
6199 modified_limits =
true;
6202 else if (ylimmode_is (
"auto") && zlimmode_is (
"auto"))
6204 modified_limits =
true;
6207 else if (zlimmode_is (
"auto") && xlimmode_is (
"auto"))
6209 modified_limits =
true;
6213 if (modified_limits)
6218 updating_aspectratios.insert (get___myhandle__ ().
value ());
6220 dx = pba(0) * da(0);
6221 dy = pba(1) * da(1);
6222 dz = pba(2) * da(2);
6226 if (xlimmode_is (
"auto"))
6229 xlimits(0) = 0.5 * (xlimits(0) + xlimits(1) - dx);
6230 xlimits(1) = xlimits(0) + dx;
6232 set_xlimmode (
"auto");
6235 if (ylimmode_is (
"auto"))
6238 ylimits(0) = 0.5 * (ylimits(0) + ylimits(1) - dy);
6239 ylimits(1) = ylimits(0) + dy;
6241 set_ylimmode (
"auto");
6244 if (zlimmode_is (
"auto"))
6247 zlimits(0) = 0.5 * (zlimits(0) + zlimits(1) - dz);
6248 zlimits(1) = zlimits(0) + dz;
6250 set_zlimmode (
"auto");
6256 plotboxaspectratio.set (pba,
false);
6271 txt_renderer.set_font (
get (
"fontname").string_value (),
6272 get (
"fontweight").string_value (),
6273 get (
"fontangle").string_value (),
6274 get (
"fontsize_points").double_value ());
6281 const Matrix& parent_pix_size)
const
6283 Matrix pos =
internal ? get_position ().matrix_value ()
6284 : get_outerposition ().matrix_value ();
6285 Matrix parent_size (parent_pix_size);
6302 pos(1) = parent_size(1) - pos(1) - pos(3);
6315 for (
int i = 0;
i <= 1;
i++)
6316 for (
int j = 0; j <= 1; j++)
6317 for (
int k = 0;
k <= 1;
k++)
6320 j ? yPlaneN : yPlane,
6321 k ? zPlaneN : zPlane,
false);
6330 for (
int i = 0;
i < 4;
i++)
6334 htext = get_title ();
6336 htext = get_xlabel ();
6338 htext = get_ylabel ();
6340 htext = get_zlabel ();
6347 text_pos = xform.
transform (text_pos(0), text_pos(1), text_pos(2));
6350 ext(0) =
std::min (ext(0), text_pos(0));
6351 ext(1) =
std::min (ext(1), text_pos(1));
6352 ext(2) =
std::max (ext(2), text_pos(0));
6353 ext(3) =
std::max (ext(3), text_pos(1));
6359 bool ignore_horizontal =
false;
6360 bool ignore_vertical =
false;
6361 if (only_text_height)
6364 if (text_rotation == 0. || text_rotation == 180.)
6365 ignore_horizontal =
true;
6366 else if (text_rotation == 90. || text_rotation == 270.)
6367 ignore_vertical =
true;
6370 if (! ignore_horizontal)
6372 ext(0) =
std::min (ext(0), text_pos(0)+text_ext(0));
6374 text_pos(0)+text_ext(0)+text_ext(2));
6377 if (! ignore_vertical)
6380 text_pos(1)-text_ext(1)-text_ext(3));
6381 ext(3) =
std::max (ext(3), text_pos(1)-text_ext(1));
6387 ext(2) = ext(2) - ext(0);
6388 ext(3) = ext(3) - ext(1);
6410 std::ostringstream oss;
6422 std::istringstream iss (valstr);
6426 while (std::getline (iss, tmpstr,
'|'))
6430 if (*valstr.rbegin () ==
'|')
6449 set_xticklabelmode (
"manual");
6450 xticklabel.run_listeners (
POSTSET);
6454 set_xticklabelmode (
"manual");
6464 set_yticklabelmode (
"manual");
6465 yticklabel.run_listeners (
POSTSET);
6469 set_yticklabelmode (
"manual");
6479 set_zticklabelmode (
"manual");
6480 zticklabel.run_listeners (
POSTSET);
6484 set_zticklabelmode (
"manual");
6508 std::istringstream iss (valstr);
6512 while (std::getline (iss, tmpstr,
'|'))
6516 if (*valstr.rbegin () ==
'|')
6541 if (units.set (val,
true))
6543 update_units (old_units);
6556 old_units, new_units,
6560 old_units, new_units,
6564 old_units, new_units,
6568 old_units, new_units,
6578 if (fontunits.set (val,
true))
6580 update_fontunits (old_fontunits);
6589 double parent_height = get_boundingbox (
true).elem (3);
6590 double fontsz = get_fontsize ();
6600 double fontsz = get_fontsize ();
6601 double parent_height = box_pix_height;
6603 if (fontunits_is (
"normalized") && parent_height <= 0)
6604 parent_height = get_boundingbox (
true).elem (3);
6636 bool use_scale)
const
6642 v(0) = sx.unscale (v(0));
6643 v(1) = sy.unscale (v(1));
6644 v(2) =
sz.unscale (v(2));
6691 double& min_pos,
double& max_neg,
6698 if (m.
numel () == 4)
6756 magform ((hi - lo) / ticint, a, b);
6758 static const double sqrt_2 = sqrt (2.0);
6759 static const double sqrt_10 = sqrt (10.0);
6760 static const double sqrt_50 = sqrt (50.0);
6764 else if (a < sqrt_10)
6766 else if (a < sqrt_50)
6779 double min_pos,
double max_neg,
6784 double min_val =
xmin;
6785 double max_val =
xmax;
6807 if (min_val <= 0 && max_val > 0)
6809 warning (
"axis: omitting non-positive data in log plot");
6814 < sqrt (std::numeric_limits<double>::epsilon ()))
6843 if (min_val == 0 && max_val == 0)
6849 else if (
std::abs (min_val - max_val)
6850 < sqrt (std::numeric_limits<double>::epsilon ()))
6852 min_val -= 0.1 *
std::abs (min_val);
6853 max_val += 0.1 *
std::abs (max_val);
6856 double tick_sep = calc_tick_sep (min_val, max_val);
6857 double min_tick =
std::floor (min_val / tick_sep);
6858 double max_tick =
std::ceil (max_val / tick_sep);
6860 min_val =
std::min (min_val, tick_sep * min_tick);
6861 max_val =
std::max (max_val, tick_sep * max_tick);
6877 bool limmode_is_auto,
bool is_logscale)
6886 bool is_negative = lo < 0 && hi < 0;
6897 hi = std::log10 (-lo);
6898 lo = std::log10 (-tmp);
6902 hi = std::log10 (hi);
6903 lo = std::log10 (lo);
6917 tick_sep = calc_tick_sep (lo, hi);
6922 if (limmode_is_auto)
6926 tmp_lims(0) =
std::min (tick_sep * i1, lo);
6927 tmp_lims(1) =
std::max (tick_sep * i2, hi);
6931 tmp_lims(0) =
std::pow (10., tmp_lims(0));
6932 tmp_lims(1) =
std::pow (10., tmp_lims(1));
6933 if (tmp_lims(0) <= 0)
6937 double tmp = tmp_lims(0);
6938 tmp_lims(0) = -tmp_lims(1);
6947 if (i1*tick_sep < lo)
6949 if (i2*tick_sep > hi && i2 > i1)
6953 Matrix tmp_ticks (1, i2-i1+1);
6956 tmp_ticks(
i) = tick_sep * (
i+i1);
6960 if (is_logscale && is_negative)
6962 Matrix rev_ticks (1, i2-i1+1);
6963 rev_ticks = -tmp_ticks;
6965 tmp_ticks(
i) = rev_ticks(i2-i1-
i);
6970 int n = is_logscale ? 8 : 4;
6971 Matrix tmp_mticks (1, n * (tmp_ticks.
numel () - 1));
6973 for (
int i = 0;
i < tmp_ticks.
numel ()-1;
i++)
6975 double d = (tmp_ticks(
i+1) - tmp_ticks(
i)) / (n + 1);
6976 for (
int j = 0; j < n; j++)
6978 tmp_mticks(n*
i+j) = tmp_ticks(
i) + d * (j+1);
6981 mticks = tmp_mticks;
7003 std::ostringstream os;
7009 double exp_max = 0.0;
7010 double exp_min = 0.0;
7012 for (
int i = 0;
i < values.
numel ();
i++)
7014 double exp = std::log10 (
values(
i));
7019 for (
int i = 0;
i < values.
numel ();
i++)
7029 10*std::numeric_limits<double>::epsilon())
7030 os << significand <<
"x";
7031 else if (significand < 0)
7039 exponent = -exponent;
7041 if (exponent < 10. && (exp_max > 9 || exp_min < -9))
7043 os << exponent <<
"}";
7049 for (
int i = 0;
i < values.
numel ();
i++)
7069 for (
int i = 0;
i < n;
i++)
7071 double val = ticks(
i);
7072 if (limits(0) <= val && val <= limits(1))
7075 label.erase (0, label.find_first_not_of (
" "));
7076 label = label.substr (0, label.find_last_not_of (
" ")+1);
7078 if (txt_renderer.ok ())
7080 ext = txt_renderer.get_extent (label, 0.0,
7081 get_ticklabelinterpreter ());
7089 double fsize =
get (
"fontsize").double_value ();
7090 int len = label.length ();
7092 wmax =
std::max (wmax, 0.5*fsize*len);
7105 double& min_pos,
double& max_neg,
7106 const Matrix& kids,
char limit_type)
7194 != updating_axis_limits.end ())
7204 char update_type = 0;
7209 #define FIX_LIMITS \
7210 if (limits.numel () == 4) \
7213 if (octave::math::finite (val)) \
7216 if (octave::math::finite (val)) \
7219 if (octave::math::finite (val)) \
7222 if (octave::math::finite (val)) \
7227 limits.resize (4, 1); \
7228 limits(0) = min_val; \
7229 limits(1) = max_val; \
7230 limits(2) = min_pos; \
7231 limits(3) = max_neg; \
7234 if (axis_type ==
"xdata" || axis_type ==
"xscale"
7235 || axis_type ==
"xlimmode" || axis_type ==
"xliminclude"
7236 || axis_type ==
"xlim")
7245 limits =
xproperties.get_axis_limits (min_val, max_val,
7252 else if (axis_type ==
"ydata" || axis_type ==
"yscale"
7253 || axis_type ==
"ylimmode" || axis_type ==
"yliminclude"
7254 || axis_type ==
"ylim")
7263 limits =
xproperties.get_axis_limits (min_val, max_val,
7270 else if (axis_type ==
"zdata" || axis_type ==
"zscale"
7271 || axis_type ==
"zlimmode" || axis_type ==
"zliminclude"
7272 || axis_type ==
"zlim")
7281 limits =
xproperties.get_axis_limits (min_val, max_val,
7288 else if (axis_type ==
"cdata" || axis_type ==
"climmode"
7289 || axis_type ==
"cdatamapping" || axis_type ==
"climinclude"
7290 || axis_type ==
"clim")
7299 if (min_val > max_val)
7301 min_val = min_pos = 0;
7304 else if (min_val == max_val)
7306 max_val = min_val + 1;
7312 limits(0) = min_val;
7313 limits(1) = max_val;
7319 else if (axis_type ==
"alphadata" || axis_type ==
"alimmode"
7320 || axis_type ==
"alphadatamapping" || axis_type ==
"aliminclude"
7321 || axis_type ==
"alim")
7330 if (min_val > max_val)
7332 min_val = min_pos = 0;
7335 else if (min_val == max_val)
7336 max_val = min_val + 1;
7340 limits(0) = min_val;
7341 limits(1) = max_val;
7355 switch (update_type)
7396 != updating_axis_limits.end ())
7398 != updating_aspectratios.end ()))
7408 char update_type = 0;
7412 if (axis_type ==
"xdata" || axis_type ==
"xscale"
7413 || axis_type ==
"xlimmode" || axis_type ==
"xliminclude"
7414 || axis_type ==
"xlim")
7420 limits =
xproperties.get_axis_limits (min_val, max_val,
7427 else if (axis_type ==
"ydata" || axis_type ==
"yscale"
7428 || axis_type ==
"ylimmode" || axis_type ==
"yliminclude"
7429 || axis_type ==
"ylim")
7435 limits =
xproperties.get_axis_limits (min_val, max_val,
7442 else if (axis_type ==
"zdata" || axis_type ==
"zscale"
7443 || axis_type ==
"zlimmode" || axis_type ==
"zliminclude"
7444 || axis_type ==
"zlim")
7450 limits =
xproperties.get_axis_limits (min_val, max_val,
7457 else if (axis_type ==
"cdata" || axis_type ==
"climmode"
7458 || axis_type ==
"cdatamapping" || axis_type ==
"climinclude"
7459 || axis_type ==
"clim")
7465 if (min_val > max_val)
7467 min_val = min_pos = 0;
7470 else if (min_val == max_val)
7472 max_val = min_val + 1;
7478 limits(0) = min_val;
7479 limits(1) = max_val;
7485 else if (axis_type ==
"alphadata" || axis_type ==
"alimmode"
7486 || axis_type ==
"alphadatamapping" || axis_type ==
"aliminclude"
7487 || axis_type ==
"alim")
7493 if (min_val > max_val)
7495 min_val = min_pos = 0;
7498 else if (min_val == max_val)
7499 max_val = min_val + 1;
7503 limits(0) = min_val;
7504 limits(1) = max_val;
7516 switch (update_type)
7569 double lo = lims(0);
7570 double hi = lims(1);
7572 bool is_negative = lo < 0 && hi < 0;
7579 hi = std::log10 (-lo);
7580 lo = std::log10 (-tmp);
7581 val = std::log10 (-val);
7585 hi = std::log10 (hi);
7586 lo = std::log10 (lo);
7587 val = std::log10 (val);
7592 lo = val + (lo -
val) / factor;
7593 hi = val + (hi -
val) / factor;
7618 double x,
double y,
double factor,
7619 bool push_to_zoom_stack)
7622 Matrix xlims = get_xlim ().matrix_value ();
7623 Matrix ylims = get_ylim ().matrix_value ();
7626 Matrix kids = get_children ();
7639 xlims =
do_zoom (x, factor, xlims, xscale_is (
"log"));
7640 ylims =
do_zoom (y, factor, ylims, yscale_is (
"log"));
7642 zoom (mode, xlims, ylims, push_to_zoom_stack);
7647 bool push_to_zoom_stack)
7650 Matrix xlims = get_xlim ().matrix_value ();
7651 Matrix ylims = get_ylim ().matrix_value ();
7653 double x = (xlims(0) + xlims(1)) / 2;
7654 double y = (ylims(0) + ylims(1)) / 2;
7656 zoom_about_point (mode, x, y, factor, push_to_zoom_stack);
7662 if (zoom_stack.empty ())
7664 zoom_stack.push_front (xlimmode.get ());
7665 zoom_stack.push_front (xlim.get ());
7666 zoom_stack.push_front (ylimmode.get ());
7667 zoom_stack.push_front (ylim.get ());
7668 zoom_stack.push_front (zlimmode.get ());
7669 zoom_stack.push_front (zlim.get ());
7670 zoom_stack.push_front (view.get ());
7677 bool push_to_zoom_stack)
7679 if (push_to_zoom_stack)
7682 if (mode ==
"horizontal" || mode ==
"both")
7685 xlimmode =
"manual";
7688 if (mode ==
"vertical" || mode ==
"both")
7691 ylimmode =
"manual";
7694 update_transform ();
7696 if (mode ==
"horizontal" || mode ==
"both")
7699 if (mode ==
"vertical" || mode ==
"both")
7708 double lo = lims(0);
7709 double hi = lims(1);
7711 bool is_negative = lo < 0 && hi < 0;
7720 hi = std::log10 (-lo);
7721 lo = std::log10 (-tmp);
7727 hi = std::log10 (hi);
7728 lo = std::log10 (lo);
7731 delta = std::log10 (x0) - std::log10 (x1);
7765 double x0,
double x1,
double y0,
double y1,
7766 bool push_to_zoom_stack)
7769 Matrix xlims = get_xlim ().matrix_value ();
7770 Matrix ylims = get_ylim ().matrix_value ();
7773 Matrix kids = get_children ();
7786 xlims =
do_translate (x0, x1, xlims, xscale_is (
"log"));
7787 ylims =
do_translate (y0, y1, ylims, yscale_is (
"log"));
7789 zoom (mode, xlims, ylims, push_to_zoom_stack);
7794 bool push_to_zoom_stack)
7797 Matrix xlims = get_xlim ().matrix_value ();
7798 Matrix ylims = get_ylim ().matrix_value ();
7800 double x0 = (xlims(0) + xlims(1)) / 2;
7801 double y0 = (ylims(0) + ylims(1)) / 2;
7803 double x1 = x0 + (xlims(1) - xlims(0)) * factor;
7804 double y1 = y0 + (ylims(1) - ylims(0)) * factor;
7806 translate_view (mode, x0, x1, y0, y1, push_to_zoom_stack);
7811 bool push_to_zoom_stack)
7813 if (push_to_zoom_stack)
7816 Matrix bb = get_boundingbox (
true);
7817 Matrix new_view = get_view ().matrix_value ();
7820 new_view(0) += ((x0 - x1) * (180.0 / bb(2)));
7821 new_view(1) += ((y1 - y0) * (180.0 / bb(3)));
7824 new_view(1) =
std::min (new_view(1), 90.0);
7825 new_view(1) =
std::max (new_view(1), -90.0);
7826 if (new_view(0) > 180.0)
7827 new_view(0) -= 360.0;
7828 else if (new_view(0) < -180.0)
7829 new_view(0) += 360.0;
7832 double snapmargin = 1.0;
7833 for (
int a = -90;
a <= 90;
a += 90)
7835 if ((
a - snapmargin) < new_view(1) && new_view(1) < (
a + snapmargin))
7842 for (
int a = -180;
a <= 180;
a += 180)
7843 if ((
a - snapmargin) < new_view(0) && new_view(0) < (
a + snapmargin))
7853 set_view (new_view);
7858 bool push_to_zoom_stack)
7860 if (push_to_zoom_stack)
7863 Matrix v = get_view ().matrix_value ();
7872 v(0) = fmod (v(0) - delta_az + 720,360);
7876 update_transform ();
7882 if (zoom_stack.size () >= 7)
7884 view = zoom_stack.front ();
7885 zoom_stack.pop_front ();
7887 zlim = zoom_stack.front ();
7888 zoom_stack.pop_front ();
7890 zlimmode = zoom_stack.front ();
7891 zoom_stack.pop_front ();
7893 ylim = zoom_stack.front ();
7894 zoom_stack.pop_front ();
7896 ylimmode = zoom_stack.front ();
7897 zoom_stack.pop_front ();
7899 xlim = zoom_stack.front ();
7900 zoom_stack.pop_front ();
7902 xlimmode = zoom_stack.front ();
7903 zoom_stack.pop_front ();
7905 update_transform ();
7918 size_t items_to_leave_on_stack = do_unzoom ? 7 : 0;
7920 while (zoom_stack.size () > items_to_leave_on_stack)
7921 zoom_stack.pop_front ();
7957 m(0) = xdata.min_val ();
7958 m(1) = xdata.max_val ();
7959 m(2) = xdata.min_pos ();
7960 m(3) = xdata.max_neg ();
7970 m(0) = ydata.min_val ();
7971 m(1) = ydata.max_val ();
7972 m(2) = ydata.min_pos ();
7973 m(3) = ydata.max_neg ();
7983 Matrix pos = get_position ().matrix_value ();
7985 if (! units_is (
"data"))
7995 return extent.get ().matrix_value ();
8003 Matrix m = extent.get ().matrix_value ();
8004 Matrix pos = get_position ().matrix_value ();
8018 if (fontunits.set (val,
true))
8020 update_fontunits (old_fontunits);
8029 double parent_height = 0;
8030 double fontsz = get_fontsize ();
8032 if (new_units ==
"normalized")
8048 txt_renderer.set_font (
get (
"fontname").string_value (),
8049 get (
"fontweight").string_value (),
8050 get (
"fontangle").string_value (),
8051 get (
"fontsize_points").double_value ());
8053 txt_renderer.set_color (get_color_rgb ());
8062 if (horizontalalignment_is (
"center"))
8064 else if (horizontalalignment_is (
"right"))
8067 if (verticalalignment_is (
"middle"))
8069 else if (verticalalignment_is (
"top"))
8071 else if (verticalalignment_is (
"baseline"))
8073 else if (verticalalignment_is (
"cap"))
8084 txt_renderer.text_to_pixels (sv.
join (
"\n"), pixels, bbox,
8085 halign, valign, get_rotation (),
8086 get_interpreter ());
8093 if (autopos_tag_is (
"xlabel") || autopos_tag_is (
"ylabel")
8094 || autopos_tag_is (
"zlabel") || autopos_tag_is (
"title"))
8095 update_autopos (
"sync");
8101 if (autopos_tag_is (
"xlabel") || autopos_tag_is (
"ylabel")
8102 || autopos_tag_is (
"zlabel") || autopos_tag_is (
"title"))
8103 update_autopos (get_autopos_tag ());
8109 if (! units_is (
"data"))
8111 set_xliminclude (
"off");
8112 set_yliminclude (
"off");
8113 set_zliminclude (
"off");
8116 Matrix pos = get_position ().matrix_value ();
8123 bool autopos = positionmode_is (
"auto");
8128 set_positionmode (
"auto");
8130 if (units_is (
"data"))
8132 set_xliminclude (
"on");
8133 set_yliminclude (
"on");
8135 set_zliminclude (
"off");
8138 cached_units = get_units ();
8144 double fontsz = get_fontsize ();
8145 double parent_height = box_pix_height;
8147 if (fontunits_is (
"normalized") && parent_height <= 0)
8163 return convert_cdata (*
this, get_cdata (), cdatamapping_is (
"scaled"), 3);
8175 return convert_cdata (*
this, fvc, cdatamapping_is (
"scaled"), 2);
8183 if (updating_patch_data)
8186 Matrix xd = get_xdata ().matrix_value ();
8187 Matrix yd = get_ydata ().matrix_value ();
8188 Matrix zd = get_zdata ().matrix_value ();
8189 NDArray cd = get_cdata ().array_value ();
8195 bad_data_msg =
"x/y/zdata must have the same dimensions";
8204 if (nr == 1 && nc > 1)
8230 vert(kk,0) = xd(ii,jj);
8231 vert(kk,1) = yd(ii,jj);
8233 vert(kk,2) = zd(ii,jj);
8235 idx(jj,ii) =
static_cast<double> (kk+1);
8243 if (cd.
ndims () == 3)
8256 updating_patch_data =
true;
8259 vertices.set (vert);
8260 facevertexcdata.set (fvc);
8266 if (updating_patch_data)
8270 Matrix vert = get_vertices ().matrix_value ();
8271 NDArray fvc = get_facevertexcdata ().array_value ();
8278 if (static_cast<double> (nvert) < idx.
row_max ().
max ())
8280 bad_data_msg =
"some vertices in \"faces\" property are undefined";
8289 double valid_vert = idx(0,jj);
8290 bool turn_valid =
false;
8295 idx(ii,jj) = valid_vert;
8299 valid_vert = idx(ii,jj);
8307 bool pervertex =
false;
8309 if (fvc.
rows () == nfaces || fvc.
rows () == 1)
8332 bool has_zd =
false;
8344 xd(ii,jj) = vert(row,0);
8345 yd(ii,jj) = vert(row,1);
8348 zd(ii,jj) = vert(row,2);
8351 for (
int kk = 0; kk < fvc.
columns (); kk++)
8352 cd(ii,jj,kk) = fvc(row,kk);
8358 updating_patch_data =
true;
8371 return convert_cdata (*
this, get_cdata (), cdatamapping_is (
"scaled"), 3);
8376 double x2,
double y2,
double z2,
8377 double&
x,
double&
y,
double& z)
8379 x += (y1 * z2 - z1 * y2);
8380 y += (z1 * x2 - x1 * z2);
8381 z += (x1 * y2 - y1 * x2);
8387 if (vertexnormalsmode_is (
"auto"))
8389 Matrix x = get_xdata ().matrix_value ();
8390 Matrix y = get_ydata ().matrix_value ();
8391 Matrix z = get_zdata ().matrix_value ();
8407 bool x_mat = (x.
rows () == q);
8410 int i1, i2, i3, j1, j2, j3;
8414 for (
int i = 0;
i <
p;
i++)
8423 for (
int j = 0; j < q; j++)
8432 double& nx = n(j,
i, 0);
8433 double& ny = n(j,
i, 1);
8434 double& nz = n(j,
i, 2);
8436 if ((j > 0) && (
i > 0))
8439 (
x(j1,
i-1)-
x(j2,
i),
y(j-1,i1)-
y(j,i2), z(j-1,
i-1)-z(j,
i),
8440 x(j2,
i-1)-
x(j1,
i),
y(j,i1)-
y(j-1,i2), z(j,
i-1)-z(j-1,
i),
8443 if ((j > 0) && (
i < (p -1)))
8446 (
x(j1,
i+1)-
x(j2,
i),
y(j-1,i3)-
y(j,i2), z(j-1,
i+1)-z(j,
i),
8447 x(j1,
i)-
x(j2,
i+1),
y(j-1,i2)-
y(j,i3), z(j-1,
i)-z(j,
i+1),
8450 if ((j < (q - 1)) && (
i > 0))
8453 (
x(j2,
i-1)-
x(j3,
i),
y(j,i1)-
y(j+1,i2), z(j,
i-1)-z(j+1,
i),
8454 x(j3,
i-1)-
x(j2,
i),
y(j+1,i1)-
y(j,i2), z(j+1,
i-1)-z(j,
i),
8457 if ((j < (q - 1)) && (
i < (p -1)))
8460 (
x(j3,
i)-
x(j2,
i+1),
y(j+1,i2)-
y(j,i3), z(j+1,
i)-z(j,
i+1),
8461 x(j3,
i+1)-
x(j2,
i),
y(j+1,i3)-
y(j,i2), z(j+1,
i+1)-z(j,
i),
8513 if (updating_hggroup_limits)
8526 char update_type = 0;
8528 if (axis_type ==
"xlim" || axis_type ==
"xliminclude")
8533 else if (axis_type ==
"ylim" || axis_type ==
"yliminclude")
8538 else if (axis_type ==
"zlim" || axis_type ==
"zliminclude")
8543 else if (axis_type ==
"clim" || axis_type ==
"climinclude")
8548 else if (axis_type ==
"alim" || axis_type ==
"aliminclude")
8554 if (limits.
numel () == 4)
8572 limits(0) = min_val;
8573 limits(1) = max_val;
8574 limits(2) = min_pos;
8575 limits(3) = max_neg;
8583 updating_hggroup_limits =
true;
8585 if (limits(0) != min_val || limits(1) != max_val
8586 || limits(2) != min_pos || limits(3) != max_neg)
8588 limits(0) = min_val;
8589 limits(1) = max_val;
8590 limits(2) = min_pos;
8591 limits(3) = max_neg;
8593 switch (update_type)
8626 if (updating_hggroup_limits)
8636 char update_type = 0;
8638 if (axis_type ==
"xlim" || axis_type ==
"xliminclude")
8644 else if (axis_type ==
"ylim" || axis_type ==
"yliminclude")
8650 else if (axis_type ==
"zlim" || axis_type ==
"zliminclude")
8656 else if (axis_type ==
"clim" || axis_type ==
"climinclude")
8662 else if (axis_type ==
"alim" || axis_type ==
"aliminclude")
8672 updating_hggroup_limits =
true;
8674 Matrix limits (1, 4, 0.0);
8676 limits(0) = min_val;
8677 limits(1) = max_val;
8678 limits(2) = min_pos;
8679 limits(3) = max_neg;
8681 switch (update_type)
8714 std::list<graphics_handle> lst =
xproperties.get_dependent_obj_list ();
8715 std::list<graphics_handle>::const_iterator it;
8717 for (it = lst.begin (); it != lst.end (); it++)
8759 Matrix m = extent.get ().matrix_value ();
8780 txt_renderer.
set_font (get_fontname (), get_fontweight (),
8781 get_fontangle (), get_fontsize ());
8791 ext(0) = ext(1) = 1;
8801 Matrix pos = get_position ().matrix_value ();
8810 cached_units = get_units ();
8816 if (! get___object__ ().is_empty ())
8817 error (
"set: cannot change the style of a uicontrol object after creation.");
8822 if (style_is (
"listbox") || style_is (
"popupmenu"))
8825 if(v.
numel () == 1 && v (0) == 0)
8832 const Matrix& parent_pix_size)
const
8834 Matrix pos = get_position ().matrix_value ();
8835 Matrix parent_size (parent_pix_size);
8852 pos(1) = parent_size(1) - pos(1) - pos(3);
8862 if (fontunits.set (val,
true))
8864 update_fontunits (old_fontunits);
8873 double parent_height = get_boundingbox (
false).elem (3);
8874 double fontsz = get_fontsize ();
8884 double fontsz = get_fontsize ();
8885 double parent_height = box_pix_height;
8887 if (fontunits_is (
"normalized") && parent_height <= 0)
8888 parent_height = get_boundingbox (
false).elem (3);
8897 const Matrix& parent_pix_size)
const
8899 Matrix pos = get_position ().matrix_value ();
8900 Matrix parent_size (parent_pix_size);
8914 pos(1) = parent_size(1) - pos(1) - pos(3);
8918 double outer_height = pos(3);
8920 pos(0) = pos(1) = 0;
8922 if (! bordertype_is (
"none"))
8924 double bw = get_borderwidth ();
8927 if (bordertype_is (
"etchedin") || bordertype_is (
"etchedout"))
8932 pos(2) -= 2 * mul * bw;
8933 pos(3) -= 2 * mul * bw;
8936 if (! get_title ().
empty ())
8938 double fontsz = get_fontsize ();
8940 if (! fontunits_is (
"pixels"))
8944 if (fontunits_is (
"points"))
8945 fontsz *= (res / 72.0);
8946 else if (fontunits_is (
"inches"))
8948 else if (fontunits_is (
"centimeters"))
8949 fontsz *= (res / 2.54);
8950 else if (fontunits_is (
"normalized"))
8951 fontsz *= outer_height;
8954 if (titleposition_is (
"lefttop") || titleposition_is (
"centertop")
8955 || titleposition_is (
"righttop"))
8956 pos(1) += (fontsz / 2);
8957 pos(3) -= (fontsz / 2);
8969 if (units.set (val,
true))
8971 update_units (old_units);
8979 Matrix pos = get_position ().matrix_value ();
8994 if (fontunits.set (val,
true))
8996 update_fontunits (old_fontunits);
9005 double parent_height = get_boundingbox (
false).elem (3);
9006 double fontsz = get_fontsize ();
9016 double fontsz = get_fontsize ();
9017 double parent_height = box_pix_height;
9019 if (fontunits_is (
"normalized") && parent_height <= 0)
9020 parent_height = get_boundingbox (
false).elem (3);
9029 selectedobject = current_selectedobject;
9032 if (current_selectedobject.
ok ())
9048 && go.
isa (
"uicontrol"))
9053 if (style.
compare (
"radiobutton") || style.
compare (
"togglebutton"))
9055 selectedobject =
val;
9068 const Matrix& parent_pix_size)
const
9070 Matrix pos = get_position ().matrix_value ();
9071 Matrix parent_size (parent_pix_size);
9085 pos(1) = parent_size(1) - pos(1) - pos(3);
9089 double outer_height = pos(3);
9091 pos(0) = pos(1) = 0;
9093 if (! bordertype_is (
"none"))
9095 double bw = get_borderwidth ();
9098 if (bordertype_is (
"etchedin") || bordertype_is (
"etchedout"))
9103 pos(2) -= 2 * mul * bw;
9104 pos(3) -= 2 * mul * bw;
9107 if (! get_title ().
empty ())
9109 double fontsz = get_fontsize ();
9111 if (! fontunits_is (
"pixels"))
9115 if (fontunits_is (
"points"))
9116 fontsz *= (res / 72.0);
9117 else if (fontunits_is (
"inches"))
9119 else if (fontunits_is (
"centimeters"))
9120 fontsz *= (res / 2.54);
9121 else if (fontunits_is (
"normalized"))
9122 fontsz *= outer_height;
9125 if (titleposition_is (
"lefttop") || titleposition_is (
"centertop")
9126 || titleposition_is (
"righttop"))
9127 pos(1) += (fontsz / 2);
9128 pos(3) -= (fontsz / 2);
9140 if (units.set (val,
true))
9142 update_units (old_units);
9150 Matrix pos = get_position ().matrix_value ();
9165 if (fontunits.set (val,
true))
9167 update_fontunits (old_fontunits);
9176 double parent_height = get_boundingbox (
false).elem (3);
9177 double fontsz = get_fontsize ();
9187 double fontsz = get_fontsize ();
9188 double parent_height = box_pix_height;
9190 if (fontunits_is (
"normalized") && parent_height <= 0)
9191 parent_height = get_boundingbox (
false).elem (3);
9245 : handle_map (), handle_free_list (),
9246 next_handle (-1.0 - (rand () + 1.0) / (RAND_MAX + 2.0)),
9248 callback_objects (), event_processing (0)
9268 bool integer_figure_handle,
9270 bool do_notify_toolkit)
9279 error (
"gh_manager::do_make_graphics_handle: invalid object type '%s'",
9288 go.override_defaults ();
9290 if (go_name ==
"axes")
9318 if (do_notify_toolkit)
9335 if (do_notify_toolkit)
9371 callback (), callback_data (data) { }
9376 callback (cb), callback_data (data) { }
9380 if (callback.is_defined ())
9408 function (function_data);
9434 property_value (value), notify_toolkit (do_notify_toolkit) { }
9447 p.set (property_value,
true, notify_toolkit);
9502 bool notify_toolkit)
9588 catch (octave::execution_exception&)
9590 std::cerr <<
"execution error in graphics callback function"
9593 ovl (
"execution error in graphics callback function"));
9600 || cb.
cell_value ()(0).is_function_handle ()))
9604 fcn =
c(0).function_value ();
9606 for (
int i = 1;
i < c.
numel () ;
i++)
9612 error (
"trying to execute non-executable object (class = %s)",
9621 catch (octave::execution_exception&)
9623 std::cerr <<
"execution error in graphics callback function"
9626 ovl (
"execution error in graphics callback function"));
9640 if (go_name.length () > 1
9641 && go_name[0] ==
'u' && go_name[1] ==
'i')
9682 if (busy_action ==
"queue")
9689 if (cname.
compare (
"deletefcn")
9690 || cname.
compare (
"createfcn")
9691 || (go.
isa (
"figure")
9692 && (cname.
compare (
"closerequestfcn")
9693 || cname.
compare (
"resizefcn"))))
9725 bool events_executed =
false;
9759 events_executed =
true;
9771 if (events_executed)
9845 if (
args.length () != 1)
9891 if (
args.length () != 1)
9912 if (
args.length () != 1)
10133 error (
"set: invalid handle (= %g)",
hcv(n));
10135 if (nargin == 3 &&
args(1).is_cellstr () &&
args(2).is_cell ())
10137 if (
args(2).cell_value ().rows () == 1)
10138 go.
set (
args(1).cellstr_value (),
args(2).cell_value (), 0);
10139 else if (hcv.
numel () ==
args(2).cell_value ().rows ())
10140 go.
set (
args(1).cellstr_value (),
args(2).cell_value (), n);
10142 error (
"set: number of graphics handles must match number of value rows (%d != %d)",
10143 hcv.
numel (),
args(2).cell_value ().rows ());
10145 else if (nargin == 2 &&
args(1).is_map ())
10146 go.
set (
args(1).map_value ());
10147 else if (nargin == 2 &&
args(1).is_string ())
10158 <<
" is read-only" << std::endl;
10171 error (
"set: unknown property");
10173 else if (nargin == 1)
10187 request_drawnow =
true;
10190 request_drawnow =
true;
10193 if (request_drawnow)
10207 error (
"get: invalid handle (= %g)", val);
10228 int nargin =
args.length ();
10230 if (nargin < 1 || nargin > 2)
10233 if (
args(0).is_empty ())
10236 ColumnVector hcv =
args(0).xvector_value (
"get: H must be a graphics handle");
10240 if (nargin == 1 && hcv_len > 1)
10249 error (
"get: vector of handles must all have the same type");
10255 bool use_cell_format =
false;
10257 if (nargin > 1 &&
args(1).is_cellstr ())
10263 use_cell_format =
true;
10272 error (
"get: invalid handle (= %g)",
hcv(n));
10287 property =
args(1).xstring_value (
"get: second argument must be property name or cell array of property names");
10296 error (
"get: invalid handle (= %g)",
hcv(n));
10299 vals(n) = go.
get ();
10301 vals(n) = go.
get (property);
10305 if (use_cell_format)
10313 else if (vals_len == 1)
10315 else if (vals_len > 1 && nargin == 1)
10320 tmp[n] = vals(n).scalar_map_value ();
10347 if (
args.length () != 1)
10350 ColumnVector hcv =
args(0).xvector_value (
"get: H must be a graphics handle");
10363 error (
"get: invalid handle (= %g)",
hcv(n));
10365 vals(n) = go.
get (
true);
10372 else if (vals_len == 1)
10373 return ovl (vals(0));
10379 make_graphics_object (
const std::string& go_name,
10380 bool integer_figure_handle,
10391 for (
int i = 0;
i < xargs.
length ();
i++)
10393 if (xargs(
i).is_string () &&
p.compare (xargs(
i).string_value ()))
10395 if (
i >= (xargs.
length () - 1))
10396 error (
"__go_%s__: missing value for parent property",
10399 val = xargs(
i+1).double_value ();
10407 val =
args(0).xdouble_value (
"__go_%s__: invalid parent", go_name.c_str ());
10411 if (! parent.
ok ())
10412 error (
"__go_%s__: invalid parent", go_name.c_str ());
10419 integer_figure_handle,
10422 catch (octave::execution_exception&
e)
10424 error (e,
"__go%s__: unable to create graphics handle",
10434 retval = h.
value ();
10441 DEFUN (__go_figure__, args, ,
10449 if (args.
length () == 0)
10452 double val =
args(0).xdouble_value (
"__go_figure__: figure number must be a double value");
10462 retval = h.
value ();
10466 bool int_fig_handle =
true;
10476 for (
int i = 0;
i < xargs.
length ();
i++)
10478 if (xargs(
i).is_string ()
10479 &&
pname.compare (xargs(
i).string_value ()))
10481 if (
i < (xargs.
length () - 1))
10486 int_fig_handle = on.compare (pval);
10498 if (! int_fig_handle)
10511 error (
"__go_figure__: failed to create figure handle");
10521 retval = h.
value ();
10527 #define GO_BODY(TYPE) \
10528 gh_manager::auto_lock guard; \
10530 if (args.length () == 0) \
10533 return octave_value (make_graphics_object (#TYPE, false, args)); \
10540 if (go.
isa (
"surface"))
10542 else if ((go.
isa (
"line") || go.
isa (
"patch"))
10569 DEFUN (__calc_dimensions__, args, ,
10579 if (args.
length () != 1)
10582 double h =
args(0).xdouble_value (
"__calc_dimensions__: first argument must be a graphics handle");
10587 DEFUN (__go_axes__, args, ,
10596 DEFUN (__go_line__, args, ,
10605 DEFUN (__go_text__, args, ,
10614 DEFUN (__go_image__, args, ,
10623 DEFUN (__go_surface__, args, ,
10632 DEFUN (__go_patch__, args, ,
10641 DEFUN (__go_light__, args, ,
10650 DEFUN (__go_hggroup__, args, ,
10659 DEFUN (__go_uimenu__, args, ,
10668 DEFUN (__go_uicontrol__, args, ,
10677 DEFUN (__go_uibuttongroup__, args, ,
10686 DEFUN (__go_uipanel__, args, ,
10695 DEFUN (__go_uicontextmenu__, args, ,
10704 DEFUN (__go_uitoolbar__, args, ,
10713 DEFUN (__go_uipushtool__, args, ,
10722 DEFUN (__go_uitoggletool__, args, ,
10731 DEFUN (__go_delete__, args, ,
10739 if (args.
length () != 1)
10744 const NDArray vals =
args(0).xarray_value (
"delete: invalid graphics object");
10753 error (
"delete: invalid graphics object (= %g)", vals(
i));
10761 DEFUN (__go_axes_init__, args, ,
10769 int nargin = args.
length ();
10771 if (nargin < 1 || nargin > 2)
10776 mode =
args(1).string_value ();
10780 double val =
args(0).xdouble_value (
"__go_axes_init__: invalid graphics object");
10785 error (
"__go_axes_init__: invalid graphics object (= %g)", val);
10793 error (
"__go_axes_init__: axis deleted during initialization (= %g)", val);
10798 DEFUN (__go_handles__, args, ,
10806 bool show_hidden =
false;
10809 show_hidden =
args(0).bool_value ();
10814 DEFUN (__go_figure_handles__, args, ,
10822 bool show_hidden =
false;
10825 show_hidden =
args(0).bool_value ();
10830 DEFUN (__go_execute_callback__, args, ,
10837 int nargin = args.
length ();
10839 if (nargin < 2 || nargin > 3)
10842 const NDArray vals =
args(0).xarray_value (
"__go_execute_callback__: invalid graphics object");
10844 std::string name =
args(1).xstring_value (
"__go_execute_callback__: invalid callback name");
10848 double val = vals(
i);
10853 error (
"__go_execute_callback__: invalid graphics object (= %g)", val);
10864 DEFUN (__image_pixel_size__, args, ,
10870 if (args.
length () != 1)
10873 double h =
args(0).xdouble_value (
"__image_pixel_size__: argument is not a handle");
10876 if (! go || ! go.
isa (
"image"))
10877 error (
"__image_pixel_size__: object is not an image");
10905 error (
"no graphics toolkits are available!");
10914 error (
"default graphics toolkit '%s' is not available!",
10919 feval (
"graphics_toolkit", args);
10924 error (
"failed to load %s graphics toolkit",
dtk.c_str ());
10926 retval = pl->second;
10929 retval = pl->second;
10937 if (
dtk.empty () || name ==
"qt"
10964 if (tk_name ==
"qt"
10965 || (tk_name ==
"fltk"
10974 DEFUN (available_graphics_toolkits, , ,
10986 DEFUN (register_graphics_toolkit, args, ,
10995 if (args.
length () != 1)
10998 std::string name =
args(0).xstring_value (
"register_graphics_toolkit: TOOLKIT must be a string");
11005 DEFUN (loaded_graphics_toolkits, , ,
11017 DEFUN (drawnow, args, ,
11034 static int drawnow_executing = 0;
11045 if (++drawnow_executing <= 1 && ! delete_executing)
11053 for (
int i = 0;
i < hlist.
numel ();
i++)
11057 if (h.
ok () && h != 0)
11079 bool do_events =
true;
11081 if (args.
length () == 1)
11088 error (
"drawnow: invalid argument, 'expose' is only valid option");
11104 term =
args(0).xstring_value (
"drawnow: TERM must be a string");
11106 file =
args(1).xstring_value (
"drawnow: FILE must be a string");
11109 error (
"drawnow: empty output ''");
11110 else if (file.length () == 1 && file[0] ==
'|')
11111 error (
"drawnow: empty pipe '|'");
11112 else if (file[0] !=
'|')
11116 if (pos != std::string::npos)
11122 if (! fs || ! fs.
is_dir ())
11123 error (
"drawnow: nonexistent directory '%s'",
11129 debug_file = (args.
length () > 2 ?
args(2).xstring_value (
"drawnow: DEBUG_FILE must be a string") :
"");
11134 error (
"drawnow: nothing to draw");
11200 int nargin = args.
length ();
11202 if (nargin < 3 || nargin > 4)
11205 double h =
args(0).xdouble_value (
"addlistener: invalid handle H");
11212 error (
"addlistener: invalid graphics object (= %g)", h);
11218 if (args.
length () == 4)
11221 if (persistent.
compare (
"persistent"))
11228 DEFUN (dellistener, args, ,
11261 double h =
args(0).xdouble_value (
"dellistener: invalid handle");
11263 std::string pname =
args(1).xstring_value (
"dellistener: PROP must be a string");
11268 error (
"dellistener: invalid graphics object (= %g)", h);
11272 if (args.
length () == 2)
11276 if (
args(2).is_string ()
11277 &&
args(2).string_value () ==
"persistent")
11368 std::string name =
args(0).xstring_value (
"addproperty: NAME must be a string");
11370 double h =
args(1).xdouble_value (
"addproperty: invalid handle H");
11375 error (
"addproperty: invalid graphics object (= %g)", h);
11379 std::string type =
args(2).xstring_value (
"addproperty: TYPE must be a string");
11382 error (
"addproperty: a '%s' property already exists in the graphics object",
11401 error (
"%s: invalid handle (= %g)", func.c_str (), handle);
11416 error (
"%s: invalid handle (= %g)", func.c_str (), handle);
11435 if (result.
length () > 0)
11436 return result(0).bool_value ();
11446 waitfor_results.erase (
id);
11455 if (c.
numel () >= 4)
11457 double h =
c(2).double_value ();
11494 uint32_t
id =
args(2).uint32_scalar_value ().value ();
11498 double h =
args(0).double_value ();
11511 if (compare_property_values (pvalue,
args(5)))
11512 waitfor_results[
id] =
true;
11516 waitfor_results[
id] =
true;
11527 uint32_t
id =
args(2).uint32_scalar_value ().value ();
11529 waitfor_results[
id] =
true;
11535 DEFUN (waitfor, args, ,
11577 if (args.
length () == 0)
11580 double h =
args(0).xdouble_value (
"waitfor: invalid handle value");
11596 pname =
args(1).xstring_value (
"waitfor: PROP must be a string");
11598 if (pname.empty ())
11599 error (
"waitfor: PROP must be a non-empty string");
11601 if (pname !=
"timeout")
11603 if (pname.
compare (
"\\timeout"))
11611 "waitfor_listener"));
11616 if (
args(2).is_string ())
11629 Cell listener (1, max_arg_index >= 2 ? 5 : 4);
11633 waitfor_results[
id] =
false;
11635 listener(0) = wf_listener;
11638 listener(3) =
pname;
11640 if (max_arg_index >= 2)
11641 listener(4) =
args(2);
11653 if (max_arg_index >= 2
11654 && compare_property_values (go.
get (pname),
args(2)))
11655 waitfor_results[
id] =
true;
11671 "waitfor_del_listener"));
11673 Cell del_listener (1, 4);
11675 del_listener(0) = wf_del_listener;
11677 del_listener(2) =
h;
11678 del_listener(3) =
pname;
11692 if (timeout_index < 0 && args.
length () > (max_arg_index + 1))
11694 caseless_str s =
args(max_arg_index + 1).xstring_value (
"waitfor: invalid parameter, expected 'timeout'");
11697 error (
"waitfor: invalid parameter '%s'", s.c_str ());
11699 timeout_index = max_arg_index + 1;
11702 if (timeout_index >= 0)
11704 if (args.
length () <= (timeout_index + 1))
11705 error (
"waitfor: missing TIMEOUT value");
11707 timeout =
args(timeout_index + 1).xscalar_value (
"waitfor: TIMEOUT must be a scalar >= 1");
11711 warning (
"waitfor: TIMEOUT value must be >= 1, using 1 instead");
11746 if (! pname.empty () && waitfor_results[
id])
11763 if (start + timeout < now)
11771 DEFUN (__zoom__, args, ,
11779 int nargin = args.
length ();
11781 if (nargin != 2 && nargin != 3)
11784 double h =
args(0).double_value ();
11790 if (! handle.
ok ())
11791 error (
"__zoom__: invalid handle");
11802 if (opt ==
"out" || opt ==
"reset")
11816 double factor =
args(2).scalar_value ();
11818 ax_props.
zoom (mode, factor);
static Matrix default_axes_ticklength(void)
uint8NDArray uint8_array_value(void) const
enum double_radio_property::current_enum current_type
int warning_enabled(const std::string &id)
void do_register_toolkit(const std::string &name)
std::map< graphics_handle, graphics_object >::iterator iterator
static void pop_figure(const graphics_handle &h)
static graphics_event create_set_event(const graphics_handle &h, const std::string &name, const octave_value &value, bool notify_toolkit=true)
OCTAVE_EXPORT octave_value_list Fdrawnow(const octave_value_list &args, int) only graphic objects are updated and no other events or callbacks are processed.The third calling form of ode
void warning_with_id(const char *id, const char *fmt,...)
string_vector keys(void) const
static bool has_core_property(const caseless_str &pname)
octave_value get_default(const caseless_str &name) const
static void convert_cdata_2(bool is_scaled, bool is_real, double clim_0, double clim_1, const double *cmapv, double x, octave_idx_type lda, octave_idx_type nc, octave_idx_type i, double *av)
plist_map_iterator find(const std::string &go_name)
double get_fontsize_points(double box_pix_height=0) const
const Cell & contents(const_iterator p) const
#define OCTAVE_DEFAULT_FONTNAME
bool is_empty(void) const
octave_value get_extent(void) const
OCTINTERP_API void octave_sleep(double seconds)
graphics_handle get_parent(void) const
static Matrix default_screensize(void)
static std::set< double > updating_aspectratios
octave_value get_color_data(void) const
std::string get_busyaction(void) const
static Matrix default_axes_tick(void)
void rotate3d(double x0, double x1, double y0, double y1, bool push_to_zoom_stack=true)
virtual void reparent(const graphics_handle &np)
OCTAVE_EXPORT octave_value_list column
For example cd octave end example noindent changes the current working directory to file
void update_axis_limits(const std::string &axis_type)
static double default_screenpixelsperinch(void)
static caseless_str validate_property_name(const std::string &who, const std::string &what, const std::set< std::string > &pnames, const caseless_str &pname)
static octave_map cat(int dim, octave_idx_type n, const octave_scalar_map *map_list)
static Matrix default_axes_outerposition(void)
std::string values_as_string(void) const
static Matrix default_axes_view(void)
bool is_real_type(void) const
void set_fontunits(const octave_value &val)
virtual bool do_set(const octave_value &)
octave_idx_type nelem(void) const
std::map< graphics_handle, graphics_object > handle_map
OCTINTERP_API bool is_equal(const octave_value &v) const
enum color_property::current_enum current_type
graphics_handle do_get_handle(bool integer_figure_handle)
void reset_default_properties(void)
static bool executing_callback
bool is_visible(void) const
void override_defaults(base_graphics_object &obj)
void(* event_fcn)(void *)
void update_text_extent(void)
virtual property get_property(const caseless_str &pname)
void convert_cdata_1(bool is_scaled, bool is_real, double clim_0, double clim_1, const double *cmapv, const T *cv, octave_idx_type lda, octave_idx_type nc, double *av)
static Matrix default_control_sliderstep(void)
octave_value reshape(const dim_vector &dv) const
octave_idx_type rows(void) const
static property_list::pval_map_type factory_defaults(void)
void do_renumber_figure(const graphics_handle &old_gh, const graphics_handle &new_gh)
static void register_toolkit(const std::string &name)
Matrix get_data_position(void) const
void resize(octave_idx_type nr, octave_idx_type nc, double rfv=0)
octave_int< T > xmax(const octave_int< T > &x, const octave_int< T > &y)
graphics_handle gca(void)
void erase(const std::string pname)
static octave_value convert_cdata(const base_properties &props, const octave_value &cdata, bool is_scaled, int cdim)
static Matrix default_figure_paperposition(void)
graphics_handle get_xlabel(void) const
void update_xlabel_position(void)
void set_horizontalalignmentmode(const octave_value &val)
static Matrix do_translate(double x0, double x1, const Matrix &lims, bool is_logscale)
int8NDArray int8_array_value(void) const
static Matrix default_patch_xdata(void)
static Cell available_toolkits_list(void)
Matrix get_boundingbox(bool internal=false, const Matrix &parent_pix_size=Matrix()) const
void insert_property(const std::string &name, property p)
static property_list::pval_map_type factory_defaults(void)
void update_limits(void) const
void do_execute_listener(const graphics_handle &h, const octave_value &l)
bool isa(const std::string &go_name) const
void update_axes_layout(void)
static Matrix default_data(void)
virtual void init_integerhandle(const octave_value &)
bool is_uint16_type(void) const
graphics_handle get_zlabel(void) const
void set_rotationmode(const octave_value &val)
static void run_event_hooks(void)
OCTINTERP_API void print_usage(void)
std::set< caseless_str > possible_vals
std::set< std::string >::const_iterator const_available_toolkits_iterator
bool is_function(void) const
octave_idx_type numel(void) const
Number of elements in the array.
static std::string dir_sep_chars(void)
static Matrix default_patch_ydata(void)
void update_fontunits(void)
identity matrix If supplied two scalar respectively For allows like xample val
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE * f
int16NDArray int16_array_value(void) const
void request_autopos(void)
virtual void defaults(void) const
octave_idx_type length(void) const
OCTINTERP_API bool do_set(const octave_value &v)
static bool is_octave_thread(void)
std::string value_as_string(const std::string &prop)
void set_linestyleorder(const octave_value &val)
Return the CPU time used by your Octave session The first output is the total time spent executing your process and is equal to the sum of second and third which are the number of CPU seconds spent executing in user mode and the number of CPU seconds spent executing in system mode
void set_verticalalignmentmode(const octave_value &val)
bool is_scalar_type(void) const
std::string default_value(void) const
bool is_numeric_type(void) const
bool is_climinclude(void) const
static OCTAVE_NORETURN void err_set_invalid(const std::string &pname)
bool is_defined(void) const
#define CHECK_ARRAY_EQUAL(T, F, A)
static bool updating_zlabel_position
static bool updating_axes_layout
RowVector xform2cam(const ColumnVector &v)
void execute_deletefcn(const octave_value &data=octave_value()) const
static bool has_core_property(const caseless_str &pname)
virtual void remove_all_listeners(void)
static void cleanup_waitfor_postset_listener(const octave_value &listener)
Matrix xform_matrix(void)
void do_post_event(const graphics_event &e)
octave_value get_dynamic(const caseless_str &pname) const
void sync_positions(void)
std::set< std::string > type_constraints
const_iterator find(const std::string pname) const
bool isa(const std::string &go_name) const
void resize(int n, int fill_value=0)
octave_value get_extent(void) const
Matrix extract_n(octave_idx_type r1, octave_idx_type c1, octave_idx_type nr, octave_idx_type nc) const
virtual void add_listener(const caseless_str &, const octave_value &, listener_mode=POSTSET)
static double y_dpi(void)
uint64NDArray uint64_array_value(void) const
static void push_figure(const graphics_handle &h)
virtual octave_value get_xlim(void) const
OCTINTERP_API void run_listeners(listener_mode mode=POSTSET)
bool positionmode_is(const std::string &v) const
virtual octave_value get_alim(void) const
Matrix get_axis_limits(double xmin, double xmax, double min_pos, double max_neg, bool logscale)
static bool has_core_property(const caseless_str &pname)
void do_post_function(graphics_event::event_fcn fcn, void *fcn_data)
void set_units(const octave_value &val)
graphics_toolkit get_toolkit(void) const
virtual std::string graphics_object_name(void) const
pval_map_type::const_iterator pval_map_const_iterator
static void execute_listener(const graphics_handle &h, const octave_value &l)
Matrix get_extent(bool with_text=false, bool only_text_height=false) const
#define DEFUN(name, args_name, nargout_name, doc)
set_event(const graphics_handle &h, const std::string &name, const octave_value &value, bool do_notify_toolkit=true)
void error(const char *fmt,...)
void set_dynamic(const caseless_str &pname, const octave_value &val)
void do_free(const graphics_handle &h)
int32NDArray int32_array_value(void) const
void set_fontunits(const octave_value &val)
void zoom(const std::string &mode, double factor, bool push_to_zoom_stack=true)
callback_event(const graphics_handle &h, const std::string &name, const octave_value &data=Matrix())
base_graphics_event * rep
OCTINTERP_API octave_value_list set_warning_state(const std::string &id, const std::string &state)
property get_property_dynamic(const caseless_str &pname)
void set(const caseless_str &name, const octave_value &val)
bool is_int8_type(void) const
std::list< dim_vector > size_constraints
static Matrix default_axes_position(void)
virtual void update_axis_limits(const std::string &axis_type)
virtual Matrix get_boundingbox(bool=false, const Matrix &=Matrix()) const
pval_map_type::iterator pval_map_iterator
virtual void initialize(const graphics_object &go)
static Matrix figure_handle_list(bool show_hidden=false)
static property_list::pval_map_type factory_defaults(void)
void adopt(const graphics_handle &h)
OCTINTERP_API bool str2rgb(const std::string &str)
bool contains(const std::string &val, std::string &match)
void setfield(const std::string &key, const octave_value &val)
static void xset_gcbo(const graphics_handle &h)
std::set< graphics_handle >::iterator free_list_iterator
static void restore_gcbo(void)
void translate_view(const std::string &mode, double x0, double x1, double y0, double y1, bool push_to_zoom_stack=true)
static double make_handle_fraction(void)
bool verticalalignmentmode_is(const std::string &v) const
octave_value resize(const dim_vector &dv, bool fill=false) const
static std::set< double > updating_axis_limits
void do_restore_gcbo(void)
double calc_tick_sep(double minval, double maxval)
void set_position(const octave_value &val)
static graphics_handle make_graphics_handle(const std::string &go_name, const graphics_handle &parent, bool integer_figure_handle=false, bool do_createfcn=true, bool do_notify_toolkit=true)
T & elem(octave_idx_type n)
static property_list::pval_map_type factory_defaults(void)
void update_ticklength(void)
bool rotationmode_is(const std::string &v) const
octave_idx_type numel(void) const
static void force_close_figure(const graphics_handle &h)
std::string get_style(void) const
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
bool is_int32_type(void) const
function_event(graphics_event::event_fcn fcn, void *data=0)
static bool is_handle_visible(const graphics_handle &h)
bool has_dynamic_property(const std::string &pname)
friend class graphics_object
virtual void delete_children(bool clear=false)
static void cleanup_waitfor_predelete_listener(const octave_value &listener)
static std::string get_graphics_object_type(double val)
void set_rotation(const octave_value &val)
void update_axis_limits(const std::string &axis_type)
static void max_axes_scale(double &s, Matrix &limits, const Matrix &kids, double pbfactor, double dafactor, char limit_type, bool tight)
std::string get_units(void) const
static Matrix default_surface_xdata(void)
static std::string default_toolkit(void)
Cell getfield(const std::string &key) const
static double default_screendepth(void)
void delete_property_listener(const std::string &nm, const octave_value &v, listener_mode mode=POSTSET)
graphics_handle do_make_figure_handle(double val, bool do_notify_toolkit)
void set_xlabel(const octave_value &val)
void delete_text_child(handle_property &h)
graphics_handle current_val
const_iterator end(void) const
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)
static Matrix default_lim(bool logscale=false)
void update_axis_limits(const std::string &axis_type)
bool is_function_handle(void) const
octave_idx_type rows(void) const
property_list get_factory_defaults_list(void) const
octave_value get(bool all=false) const
octave_base_value * clone(void) const
void build_user_defaults_map(property_list::pval_map_type &def, const std::string go_name) const
void calc_ticklabels(const array_property &ticks, any_property &labels, bool is_logscale)
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
OCTINTERP_API bool do_set(const octave_value &newval)
Matrix compute_xlim(void) const
graphics_xform get_transform(void) const
RowVector transpose(void) const
bool has_readonly_property(const caseless_str &pname) const
virtual void update_boundingbox(void)
cell array If invoked with two or more scalar integer or a vector of integer values
static void delete_graphics_object(const graphics_handle &h)
bool is_handle_visible(void) const
#define CONVERT_CDATA_1(ARRAY_T, VAL_FN, IS_REAL)
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
void do_post_callback(const graphics_handle &h, const std::string &name, const octave_value &data)
octave_value get(void) const
virtual void adopt(const graphics_handle &h)
Cell cell_value(void) const
int64NDArray int64_array_value(void) const
static void check_limit_vals(double &min_val, double &max_val, double &min_pos, double &max_neg, const octave_value &data)
void update_fontunits(const caseless_str &old_units)
Array< T > as_column(void) const
Return the array as a column vector.
virtual octave_value get(bool all=false) const
graphics_handle gcf(void)
virtual void finalize(const graphics_object &go)
void update_units(const caseless_str &old_units)
void pan(const std::string &mode, double factor, bool push_to_zoom_stack=true)
bool is_aliminclude(void) const
const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
void set_defaults(const std::string &mode)
void update_aspectratios(void)
static void cleanup_waitfor_id(uint32_t id)
static void initialize_r(const graphics_handle &h)
void execute_createfcn(const octave_value &data=octave_value()) const
static void free(const graphics_handle &h)
callback_event(const graphics_handle &h, const octave_value &cb, const octave_value &data=Matrix())
virtual octave_value get_default(const caseless_str &) const
ColumnVector row_max(void) const
static bool updating_xlabel_position
Matrix xform_translate(double x, double y, double z)
void set_zlabel(const octave_value &val)
void initialize(const graphics_object &go)
octave_idx_type columns(void) const
create a structure array and initialize its values The dimensions of each cell array of values must match Singleton cells and non cell values are repeated so that they fill the entire array If the cells are empty
static bool has_core_property(const caseless_str &pname)
static bool has_core_property(const caseless_str &pname)
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
static bool has_core_property(const caseless_str &pname)
void do_pop_figure(const graphics_handle &h)
OCTINTERP_API void disable_warning(const std::string &id)
virtual octave_value get_clim(void) const
Complex atan(const Complex &x)
static bool updating_ylabel_position
static bool updating_patch_data
octave_fields::const_iterator const_iterator
void update_text_extent(void)
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function xample nargout(@histc)
void do_enable_event_processing(bool enable=true)
void add_fcn(void(*fcn)(void))
static Matrix default_patch_vertices(void)
const_iterator begin(void) const
virtual void update(const graphics_object &go, int id)
void set_style(const octave_value &val)
graphics_handle get_parent(void) const
virtual octave_value get_zlim(void) const
std::set< std::string > dynamic_property_names(void) const
Matrix get_children(void) const
bool isfield(const std::string &name) const
void update_title_position(void)
static bool is_figure(double val)
octave_idx_type nfields(void) const
graphics_toolkit do_get_toolkit(void) const
octave_idx_type numel(const octave_value_list &idx)
bool is_bool_type(void) const
bool is_real_scalar(void) const
ColumnVector cam2xform(const Array< double > &m)
bool is_beingdeleted(void) const
std::string string_value(bool force=false) const
plist_map_iterator end(void)
double force_in_range(double x, double lower, double upper)
static char default_im_data[]
nd deftypefn *octave_map m
std::string join(const std::string &sep="") const
virtual void delete_listener(const caseless_str &, const octave_value &, listener_mode=POSTSET)
ColumnVector xform_vector(void)
octave_value get_factory_default(const caseless_str &name) const
virtual void adopt(const graphics_handle &h)
#define OCTAVE_SAFE_CALL(F, ARGS)
void set_font(const std::string &name, const std::string &weight, const std::string &angle, double size)
static Matrix default_control_position(void)
bool is_matrix_type(void) const
Matrix get_extent_matrix(void) const
void do_delete_children(bool clear)
octave_value callback_data
bool is_string(void) const
virtual void update_autopos(const std::string &elem_type)
static void xset(const graphics_handle &h, const caseless_str &pname, const octave_value &val)
static bool is_handle(const graphics_handle &h)
bool is_double_type(void) const
static octave_value_list waitfor_listener(const octave_value_list &args, int)
octave_value get_default(const caseless_str &name) const
octave_value get(void) const
nd group nd example bool waitfor_results
Matrix xform_scale(double x, double y, double z)
void rotate_view(double delta_az, double delta_el, bool push_to_zoom_stack=true)
ColumnVector extract_n(octave_idx_type r1, octave_idx_type n) const
const T * data(void) const
static Matrix default_figure_position(void)
Matrix compute_ylim(void) const
double norm(const ColumnVector &v)
static void remove_event_hook(event_hook_fcn f)
void set_yticklabel(const octave_value &val)
string_vector & append(const std::string &s)
void set_zticklabel(const octave_value &val)
static uint32_t id_counter
static bool updating_hggroup_limits
bool is_complex_type(void) const
virtual octave_value get_factory_default(const caseless_str &) const
void resize(const dim_vector &dv, const T &rfv)
Matrix do_get_children(bool return_hidden) const
static base_graphics_object * make_graphics_object_from_type(const caseless_str &type, const graphics_handle &h=graphics_handle(), const graphics_handle &p=graphics_handle())
octave_value get_clim(void) const
Cell values_as_cell(void) const
octave_int< T > pow(const octave_int< T > &a, const octave_int< T > &b)
std::list< double > children_list
double get_fontsize_points(double box_pix_height=0) const
bool is_yliminclude(void) const
octave_value get_alim(void) const
const_iterator end(void) const
bool is_int64_type(void) const
bool is_cellstr(void) const
octave_value_list splice(octave_idx_type offset, octave_idx_type len, const octave_value_list &lst=octave_value_list()) const
static Matrix default_panel_position(void)
void set_defaults(base_graphics_object &obj, const std::string &mode)
Matrix transpose(void) const
virtual base_properties & get_properties(void)
std::map< std::string, graphics_toolkit >::const_iterator const_loaded_toolkits_iterator
static bool has_core_property(const caseless_str &pname)
static octave_value convert_linestyleorder_string(const octave_value &val)
static Matrix default_figure_papersize(void)
base_properties & get_properties(void)
virtual void remove_child(const graphics_handle &h)
static void get_array_limits(const Array< T > &m, double &emin, double &emax, double &eminp, double &emaxp)
static bool lookup_object_name(const caseless_str &name, caseless_str &go_name, caseless_str &rest)
void reset_default_properties(void)
virtual text_element * parse(const std::string &s)=0
static Matrix default_light_position(void)
static Matrix papersize_from_type(const caseless_str punits, const caseless_str ptype)
octave_idx_type length(void) const
static Matrix handle_list(bool show_hidden=false)
std::ostream & list_in_columns(std::ostream &, int width=0, const std::string &prefix="") const
void zoom_about_point(const std::string &mode, double x, double y, double factor, bool push_to_zoom_stack=true)
void renumber_parent(graphics_handle new_gh)
void do_unregister_toolkit(const std::string &name)
octave_value lookup(const caseless_str &name) const
static Matrix default_surface_ydata(void)
the sparsity preserving column transformation such that that defines the pivoting threshold can be given in which case it defines the c
static graphics_event create_function_event(event_fcn fcn, void *data=0)
static Matrix convert_text_position(const Matrix &pos, const text::properties &props, const caseless_str &from_units, const caseless_str &to_units)
ColumnVector cross(const ColumnVector &v1, const ColumnVector &v2)
graphics_object get_ancestor(const std::string &type) const
const_iterator begin(void) const
octave_value get_zlim(void) const
static dim_vector alloc(int n)
static Matrix default_colororder(void)
void update_fontunits(const caseless_str &old_units)
void override_defaults(base_graphics_object &obj)
static void close_figure(const graphics_handle &h)
dim_vector dims(void) const
double get_fontsize_points(double box_pix_height=0) const
octave_value property_value
string_vector string_vector_value(bool pad=false) const
Matrix matrix_value(bool frc_str_conv=false) const
OCTINTERP_API radio_values(const std::string &opt_string="")
void set(const caseless_str &name, const octave_value &val)
void update_zlabel_position(void)
static graphics_event create_callback_event(const graphics_handle &h, const std::string &name, const octave_value &data=Matrix())
OCTINTERP_API void execute(const octave_value &data=octave_value()) const
virtual void reset_default_properties(void)
With real return the complex result
static void execute_callback(const graphics_handle &h, const std::string &name, const octave_value &data=Matrix())
octave_int< uint32_t > octave_uint32
static void cleanup_instance(void)
void remove_child(const graphics_handle &h)
static gh_manager * instance
graphics_handle do_make_graphics_handle(const std::string &go_name, const graphics_handle &p, bool integer_figure_handle, bool do_createfcn, bool do_notify_toolkit)
static Matrix convert_position(const Matrix &pos, const caseless_str &from_units, const caseless_str &to_units, const Matrix &parent_dim)
std::set< std::string > available_toolkits
octave_value get_string(void) const
static octave_idx_type find(octave_idx_type i, octave_idx_type *pp)
octave_function * function_value(bool silent=false) const
virtual void set_defaults(const std::string &)
double get_fontsize_points(double box_pix_height=0) const
bool is_int16_type(void) const
static Matrix default_surface_cdata(void)
octave_int< T > xmin(const octave_int< T > &x, const octave_int< T > &y)
octave_value get_deletefcn(void) const
graphics_handle get_title(void) const
static void magform(double x, double &a, int &b)
void warning(const char *fmt,...)
void do_post_set(const graphics_handle &h, const std::string &name, const octave_value &value, bool notify_toolkit=true)
static std::map< caseless_str, graphics_object > dprop_obj_map
void update_ylabel_position(void)
Matrix get_boundingbox(bool internal=false, const Matrix &parent_pix_size=Matrix()) const
octave::unwind_protect frame
void recover_from_exception(void)
void set_xticklabel(const octave_value &val)
std::string type(void) const
bool valid_object(void) const
N Dimensional Array with copy-on-write semantics.
void get_children_limits(double &min_val, double &max_val, double &min_pos, double &max_neg, const Matrix &kids, char limit_type)
std::string type_name(void) const
std::string property_name
double get_rotation(void) const
OCTINTERP_API bool validate(const octave_value &v)
charNDArray max(char d, const charNDArray &m)
Matrix get_extent(text_element *elt, double rotation=0.0)
static graphics_handle make_figure_handle(double val, bool do_notify_toolkit=true)
bool is_empty(void) const
bool is_bool_scalar(void) const
const octave_char_matrix & v2
NDArray array_value(bool frc_str_conv=false) const
void update_label_color(handle_property label, color_property col)
static property_list::pval_map_type factory_defaults(void)
void update_autopos(const std::string &elem_type)
static void cleanup_instance(void)
void do_close_all_figures(void)
void do_push_figure(const graphics_handle &h)
static void do_cleanup_waitfor_listener(const octave_value &listener, listener_mode mode=POSTSET)
static void adopt(const graphics_handle &parent_h, const graphics_handle &h)
double dot(const ColumnVector &v1, const ColumnVector &v2)
virtual std::string value_as_string(const std::string &prop)
static octave_value box(JNIEnv *jni_env, void *jobj, void *jcls_arg=0)
Convert the Java object pointed to by jobj_arg with class jcls_arg to an Octave value.
void set_title(const octave_value &val)
=val(i)}if ode{val(i)}occurs in table i
static octave_value xget(const graphics_handle &h, const caseless_str &name)
std::map< std::string, pval_map_type > plist_map_type
static octave_value convert_ticklabel_string(const octave_value &val)
void calc_ticks_and_lims(array_property &lims, array_property &ticks, array_property &mticks, bool limmode_is_auto, bool is_logscale)
void cross_product(double x1, double y1, double z1, double x2, double y2, double z2, double &x, double &y, double &z)
void set_fontunits(const octave_value &val)
OCTAVE_EXPORT octave_value_list return the value of the option it must match the dimension of the state and the relative tolerance must also be a vector of the same length tem it must match the dimension of the state and the absolute tolerance must also be a vector of the same length The local error test applied at each integration step is xample roup abs(local error in x(i))<
static void xinitialize(const graphics_handle &h)
void remove_child(const graphics_handle &h)
bool is_uint8_type(void) const
void push_zoom_stack(void)
static Matrix default_image_cdata(void)
void assign(const std::string &k, const octave_value &val)
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the IEEE symbol zero divided by nd tex zero divided by nd ifnottex and any operation involving another NaN value(5+NaN).Note that NaN always compares not equal to NaN(NaN!
static property_list::pval_map_type factory_defaults(void)
static graphics_handle lookup(double val)
virtual graphics_toolkit get_toolkit(void) const
static OCTINTERP_API property create(const std::string &name, const graphics_handle &parent, const caseless_str &type, const octave_value_list &args)
bool is_interruptible(void) const
void set_fontunits(const octave_value &val)
octave_value get_xlim(void) const
octave_handle graphics_handle
void add_property_listener(const std::string &nm, const octave_value &v, listener_mode mode=POSTSET)
void normalize(ColumnVector &v)
OCTINTERP_API bool set(const octave_value &v, bool do_run=true, bool do_notify_toolkit=true)
octave_map values_as_struct(void)
octave_value get_ylim(void) const
int do_process_events(bool force=false)
void set_value_or_default(const caseless_str &name, const octave_value &val)
static OCTINTERP_API void create_instance(void)
issues an error eealso double
virtual octave_value get_ylim(void) const
virtual void mark_modified(void)
static graphics_handle get_handle(bool integer_figure_handle)
Matrix get_all_children(void) const
std::string callback_name
void set_units(const octave_value &val)
bool compare(const std::string &s, size_t limit=std::string::npos) const
bool is_modified(void) const
static void normalized_aspectratios(Matrix &aspectratios, const Matrix &scalefactors, double xlength, double ylength, double zlength)
octave_idx_type ndims(void) const
Number of dimensions.
std::string class_name(void) const
the element is set to zero In other the statement xample y
static void renumber_figure(const graphics_handle &old_gh, const graphics_handle &new_gh)
static property_list::pval_map_type factory_defaults(void)
void scale(Matrix &m, double x, double y, double z)
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the IEEE symbol NaN(Not a Number).NaN is the result of operations which do not produce a well defined 0 result.Common operations which produce a NaN are arithmetic with infinity ex($\infty-\infty $)
void set_horizontalalignment(const octave_value &val)
void clear_zoom_stack(bool do_unzoom=true)
bool any_element_is_inf_or_nan(void) const
void set_verticalalignment(const octave_value &val)
#define OCTAVE_LOCAL_BUFFER(T, buf, size)
ColumnVector row_min(void) const
static graphics_object get_object(double val)
bool is_undefined(void) const
bool is_uint64_type(void) const
octave::sys::file_stat fs(filename)
double xdouble_value(const char *fmt,...) const
std::string values_as_string(void)
ColumnVector transform(const Matrix &m, double x, double y, double z)
graphics_handle get_parent(void) const
void do_execute_callback(const graphics_handle &h, const octave_value &cb, const octave_value &data)
OCTINTERP_API int calc_dimensions(const graphics_object &gh)
static void add_event_hook(event_hook_fcn f)
virtual void update_axis_limits(const std::string &axis_type) const
void set_text_child(handle_property &h, const std::string &who, const octave_value &v)
static Matrix viridis_colormap(void)
octave_value getfield(const std::string &key) const
void set_beingdeleted(const octave_value &val)
octave_value get_color_data(void) const
OCTAVE_EXPORT octave_value_list it applies a binary function and expands as necessary singleton dimensions in either input argument function
static Matrix do_zoom(double val, double factor, const Matrix &lims, bool is_logscale)
void set_ylabel(const octave_value &val)
void reparent(const graphics_handle &h)
std::list< graphics_object > callback_objects
addproperty("my_style", gcf,"linelinestyle","--")
octave_value get_property_from_handle(double handle, const std::string &property, const std::string &func)
virtual void update_uicontextmenu(void) const
graphics_handle get_handle(void) const
OCTINTERP_API octave_value_list eval_string(const std::string &, bool silent, int &parse_status, int nargout)
static property_list::pval_map_type factory_defaults(void)
std::map< std::string, graphics_toolkit > loaded_toolkits
static property_list::pval_map_type factory_defaults(void)
static Cell loaded_toolkits_list(void)
octave_value get_color_data(void) const
std::list< graphics_handle > figure_list
graphics_handle get___myhandle__(void) const
void set_modified(const octave_value &val)
const T * fortran_vec(void) const
static OCTINTERP_API gtk_manager * instance
octave_fields::const_iterator const_iterator
bool is_single_type(void) const
MArray< T > reshape(const dim_vector &new_dims) const
Matrix calc_tightbox(const Matrix &init_pos)
octave_scalar_map as_struct(const std::string &prefix_arg) const
static double convert_font_size(double font_size, const caseless_str &from_units, const caseless_str &to_units, double parent_height=0)
void set_positionmode(const octave_value &val)
double double_value(bool frc_str_conv=false) const
static Matrix screen_size_pixels(void)
static octave_value_list waitfor_del_listener(const octave_value_list &args, int)
graphics_handle get_handle(void) const
bool is_uint32_type(void) const
virtual octave_scalar_map values_as_struct(void)
Vector representing the dimensions (size) of an Array.
static bool delete_executing
std::string get_name(void) const
OCTINTERP_API bool validate(const octave_value &v) const
bool discard_error_messages
virtual bool has_property(const caseless_str &) const
static bool has_core_property(const caseless_str &pname)
octave_value as_octave_value(void) const
endfunction addlistener(gcf,"position",@my_listener,"my string") nd group nd example eealso
static void clear(octave::dynamic_library &oct_file)
Matrix get_ticklabel_extents(const Matrix &ticks, const string_vector &ticklabels, const Matrix &limits)
uint32NDArray uint32_array_value(void) const
bool is_zliminclude(void) const
set(hf,"paperorientation") esult
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
void build_user_defaults_map(property_list::pval_map_type &def, const std::string go_name) const
static bool updating_title_position
virtual std::string values_as_string(void)
static property_list::pval_map_type factory_defaults(void)
static Matrix default_surface_zdata(void)
uint16NDArray uint16_array_value(void) const
static void xcreatefcn(const graphics_handle &h)
octave_idx_type columns(void) const
static bool is_handle_visible(const graphics_handle &h)
static bool has_core_property(const caseless_str &pname)
void update_fontunits(void)
bool is_xliminclude(void) const
plist_map_type::const_iterator plist_map_const_iterator
void update_vertex_normals(void)
void set_parent(const octave_value &val)
void xform(ColumnVector &v, const Matrix &m)
static graphics_handle current_figure(void)
static void finalize_r(const graphics_handle &h)
void set_from_list(base_graphics_object &obj, property_list &defaults)
void translate(Matrix &m, double x, double y, double z)
graphics_handle get_ylabel(void) const
where the brackets indicate optional arguments and and character or cell array For character arrays the conversion is repeated for every row
static double x_dpi(void)
bool set_property_in_handle(double handle, const std::string &property, const octave_value &arg, const std::string &func)
graphics_handle handle_value(void) const
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE * x
static ColumnVector convert_label_position(const ColumnVector &p, const text::properties &props, const graphics_xform &xform, const Matrix &bbox)
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
Matrix inverse(void) const
static void delete_graphics_objects(const NDArray vals)
bool horizontalalignmentmode_is(const std::string &v) const
charNDArray min(char d, const charNDArray &m)
static Matrix default_patch_faces(void)
static void create_instance(void)
void resize(octave_idx_type n, const double &rfv=0)
OCTINTERP_API bool do_set(const octave_value &v)
OCTINTERP_API void get_data_limits(void)
Matrix get_boundingbox(bool internal=false, const Matrix &parent_pix_size=Matrix()) const
static void xreset_default_properties(graphics_handle h, property_list::pval_map_type factory_pval)
void F(const TSRC *v, TRES *r, octave_idx_type m, octave_idx_type n)
static int process_events(void)
bool is_integer_type(void) const