Mercurial > octave
comparison libinterp/corefcn/graphics.cc @ 31771:21f9b34eb893
maint: Eliminate "(void)" in C++ function prototypes/declarations.
* mk-opts.pl, external.txi, embedded.cc, make_int.cc, standalone.cc,
standalonebuiltin.cc, BaseControl.cc, BaseControl.h, ButtonControl.cc,
ButtonControl.h, ButtonGroup.cc, ButtonGroup.h, Canvas.cc, Canvas.h,
CheckBoxControl.cc, CheckBoxControl.h, Container.cc, Container.h,
ContextMenu.cc, ContextMenu.h, EditControl.cc, EditControl.h, Figure.cc,
Figure.h, FigureWindow.cc, FigureWindow.h, GLCanvas.cc, GLCanvas.h,
GenericEventNotify.h, KeyMap.cc, ListBoxControl.cc, ListBoxControl.h,
Logger.cc, Logger.h, Menu.cc, Menu.h, MenuContainer.h, Object.cc, Object.h,
ObjectProxy.cc, ObjectProxy.h, Panel.cc, Panel.h, PopupMenuControl.cc,
PopupMenuControl.h, PushButtonControl.cc, PushButtonControl.h, PushTool.cc,
PushTool.h, RadioButtonControl.cc, RadioButtonControl.h, SliderControl.cc,
SliderControl.h, Table.cc, Table.h, TextControl.cc, TextControl.h, TextEdit.h,
ToggleButtonControl.cc, ToggleButtonControl.h, ToggleTool.cc, ToggleTool.h,
ToolBar.cc, ToolBar.h, ToolBarButton.cc, ToolBarButton.h, gl-select.cc,
gl-select.h, qopengl-functions.h, qt-graphics-toolkit.h, qdialog.cpp,
qfontdialog.cpp, qprintdialog_win.cpp, liboctgui-build-info.h,
liboctgui-build-info.in.cc, color-picker.cc, color-picker.h, command-widget.cc,
command-widget.h, community-news.cc, community-news.h, dialog.cc, dialog.h,
documentation-bookmarks.cc, documentation-bookmarks.h,
documentation-dock-widget.cc, documentation-dock-widget.h, documentation.cc,
documentation.h, dw-main-window.cc, dw-main-window.h,
external-editor-interface.cc, external-editor-interface.h,
files-dock-widget.cc, files-dock-widget.h, find-files-dialog.cc,
find-files-dialog.h, find-files-model.cc, find-files-model.h,
gui-preferences.cc, gui-preferences.h, gui-settings.cc, gui-settings.h,
history-dock-widget.cc, history-dock-widget.h, interpreter-qobject.cc,
interpreter-qobject.h, file-editor-interface.h, file-editor-tab.cc,
file-editor-tab.h, file-editor.cc, file-editor.h, find-dialog.cc,
find-dialog.h, marker.cc, marker.h, octave-qscintilla.cc, octave-qscintilla.h,
octave-txt-lexer.cc, octave-txt-lexer.h, main-window.cc, main-window.h,
news-reader.cc, news-reader.h, octave-dock-widget.cc, octave-dock-widget.h,
octave-qobject.cc, octave-qobject.h, qt-application.cc, qt-application.h,
qt-interpreter-events.cc, qt-interpreter-events.h, release-notes.cc,
release-notes.h, set-path-dialog.cc, set-path-dialog.h, set-path-model.cc,
set-path-model.h, settings-dialog.cc, settings-dialog.h,
shortcuts-tree-widget.cc, shortcuts-tree-widget.h, tab-bar.cc, tab-bar.h,
terminal-dock-widget.cc, terminal-dock-widget.h, variable-editor-model.cc,
variable-editor-model.h, variable-editor.cc, variable-editor.h,
welcome-wizard.cc, welcome-wizard.h, workspace-model.cc, workspace-model.h,
workspace-view.cc, workspace-view.h, build-env.h, Cell.cc, Cell.h,
__contourc__.cc, __magick_read__.cc, auto-shlib.cc, auto-shlib.h,
base-text-renderer.h, bsxfun.cc, c-file-ptr-stream.cc, c-file-ptr-stream.h,
call-stack.cc, call-stack.h, debug.cc, defaults.cc, defaults.h, defun.cc,
display.cc, display.h, dynamic-ld.cc, dynamic-ld.h, environment.cc,
environment.h, error.cc, error.h, errwarn.cc, errwarn.h, event-manager.cc,
event-manager.h, event-queue.cc, event-queue.h, fcn-info.cc, fcn-info.h,
ft-text-renderer.cc, ft-text-renderer.h, genprops.awk, gh-manager.cc,
gh-manager.h, gl-render.cc, gl-render.h, gl2ps-print.cc, graphics-toolkit.h,
graphics.cc, graphics.in.h, gtk-manager.cc, gtk-manager.h, help.cc, help.h,
hook-fcn.h, input.cc, input.h, interpreter-private.cc, interpreter-private.h,
interpreter.cc, interpreter.h, jsondecode.cc, latex-text-renderer.cc,
latex-text-renderer.h, load-path.cc, load-path.h, load-save.cc, load-save.h,
ls-hdf5.cc, ls-hdf5.h, mxarray.h, oct-errno.h, oct-errno.in.cc, oct-fstrm.cc,
oct-fstrm.h, oct-handle.h, oct-hist.cc, oct-hist.h, oct-iostrm.cc,
oct-iostrm.h, oct-map.cc, oct-map.h, oct-opengl.h, oct-prcstrm.cc,
oct-prcstrm.h, oct-procbuf.cc, oct-procbuf.h, oct-process.h, oct-stdstrm.h,
oct-stream.cc, oct-stream.h, oct-strstrm.cc, oct-strstrm.h,
oct-tex-lexer.in.ll, pager.cc, pager.h, pr-flt-fmt.cc, pr-flt-fmt.h,
pr-output.cc, pr-output.h, procstream.cc, procstream.h, settings.cc,
settings.h, sighandlers.cc, sighandlers.h, stack-frame.cc, stack-frame.h,
svd.cc, syminfo.cc, syminfo.h, symrec.cc, symrec.h, symscope.cc, symscope.h,
symtab.cc, symtab.h, sysdep.cc, sysdep.h, text-engine.cc, text-engine.h,
text-renderer.cc, text-renderer.h, toplev.cc, url-handle-manager.cc,
url-handle-manager.h, variables.cc, xpow.cc, __init_fltk__.cc,
__init_gnuplot__.cc, __ode15__.cc, audiodevinfo.cc, gzip.cc,
liboctinterp-build-info.h, liboctinterp-build-info.in.cc,
mk-build-env-features.sh, mk-builtins.pl, cdef-class.cc, cdef-class.h,
cdef-manager.h, cdef-method.cc, cdef-method.h, cdef-object.cc, cdef-object.h,
cdef-package.cc, cdef-package.h, cdef-property.cc, cdef-property.h,
cdef-utils.cc, cdef-utils.h, ov-base-diag.cc, ov-base-diag.h, ov-base-int.cc,
ov-base-int.h, ov-base-mat.cc, ov-base-mat.h, ov-base-scalar.cc,
ov-base-scalar.h, ov-base-sparse.cc, ov-base-sparse.h, ov-base.cc, ov-base.h,
ov-bool-mat.cc, ov-bool-mat.h, ov-bool-sparse.cc, ov-bool-sparse.h, ov-bool.cc,
ov-bool.h, ov-builtin.cc, ov-builtin.h, ov-cell.cc, ov-cell.h, ov-ch-mat.cc,
ov-ch-mat.h, ov-class.cc, ov-class.h, ov-classdef.cc, ov-classdef.h,
ov-colon.h, ov-complex.cc, ov-complex.h, ov-cs-list.h, ov-cx-diag.cc,
ov-cx-diag.h, ov-cx-mat.cc, ov-cx-mat.h, ov-cx-sparse.cc, ov-cx-sparse.h,
ov-dld-fcn.cc, ov-dld-fcn.h, ov-fcn-handle.cc, ov-fcn-handle.h, ov-fcn.cc,
ov-fcn.h, ov-float.cc, ov-float.h, ov-flt-complex.cc, ov-flt-complex.h,
ov-flt-cx-diag.cc, ov-flt-cx-diag.h, ov-flt-cx-mat.cc, ov-flt-cx-mat.h,
ov-flt-re-diag.cc, ov-flt-re-diag.h, ov-flt-re-mat.cc, ov-flt-re-mat.h,
ov-intx.h, ov-java.cc, ov-java.h, ov-lazy-idx.cc, ov-lazy-idx.h,
ov-legacy-range.cc, ov-legacy-range.h, ov-magic-int.cc, ov-magic-int.h,
ov-mex-fcn.cc, ov-mex-fcn.h, ov-null-mat.cc, ov-null-mat.h, ov-oncleanup.cc,
ov-oncleanup.h, ov-perm.cc, ov-perm.h, ov-range.cc, ov-range.h, ov-re-diag.cc,
ov-re-diag.h, ov-re-mat.cc, ov-re-mat.h, ov-re-sparse.cc, ov-re-sparse.h,
ov-scalar.cc, ov-scalar.h, ov-str-mat.cc, ov-str-mat.h, ov-struct.cc,
ov-struct.h, ov-typeinfo.cc, ov-typeinfo.h, ov-usr-fcn.cc, ov-usr-fcn.h, ov.cc,
ov.h, ovl.cc, ovl.h, octave.cc, octave.h, anon-fcn-validator.h, bp-table.cc,
bp-table.h, comment-list.cc, comment-list.h, filepos.h, lex.h, lex.ll,
oct-lvalue.cc, oct-lvalue.h, oct-parse.yy, parse.h, profiler.cc, profiler.h,
pt-anon-scopes.h, pt-arg-list.cc, pt-arg-list.h, pt-args-block.cc,
pt-args-block.h, pt-array-list.cc, pt-array-list.h, pt-assign.cc, pt-assign.h,
pt-binop.cc, pt-binop.h, pt-bp.h, pt-cbinop.h, pt-cell.h, pt-check.h,
pt-classdef.cc, pt-classdef.h, pt-cmd.h, pt-colon.h, pt-const.h, pt-decl.cc,
pt-decl.h, pt-eval.cc, pt-eval.h, pt-except.cc, pt-except.h, pt-exp.cc,
pt-exp.h, pt-fcn-handle.cc, pt-fcn-handle.h, pt-id.cc, pt-id.h, pt-idx.cc,
pt-idx.h, pt-jump.h, pt-loop.cc, pt-loop.h, pt-mat.h, pt-misc.cc, pt-misc.h,
pt-pr-code.cc, pt-pr-code.h, pt-select.cc, pt-select.h, pt-spmd.cc, pt-spmd.h,
pt-stmt.cc, pt-stmt.h, pt-tm-const.cc, pt-tm-const.h, pt-unop.cc, pt-unop.h,
pt-walk.h, pt.cc, pt.h, token.cc, token.h, usage.h, Array-base.cc, Array.h,
CColVector.cc, CColVector.h, CDiagMatrix.cc, CDiagMatrix.h, CMatrix.cc,
CMatrix.h, CNDArray.cc, CNDArray.h, CRowVector.cc, CRowVector.h, CSparse.cc,
CSparse.h, DiagArray2.cc, DiagArray2.h, MArray.cc, MArray.h, MDiagArray2.h,
MSparse.h, MatrixType.cc, MatrixType.h, PermMatrix.cc, PermMatrix.h, Range.cc,
Range.h, Sparse-b.cc, Sparse.cc, Sparse.h, boolMatrix.cc, boolMatrix.h,
boolNDArray.cc, boolNDArray.h, boolSparse.cc, boolSparse.h, chMatrix.h,
chNDArray.h, dColVector.cc, dColVector.h, dDiagMatrix.cc, dDiagMatrix.h,
dMatrix.cc, dMatrix.h, dNDArray.cc, dNDArray.h, dRowVector.cc, dRowVector.h,
dSparse.cc, dSparse.h, dim-vector.cc, dim-vector.h, fCColVector.cc,
fCColVector.h, fCDiagMatrix.cc, fCDiagMatrix.h, fCMatrix.cc, fCMatrix.h,
fCNDArray.cc, fCNDArray.h, fCRowVector.cc, fCRowVector.h, fColVector.cc,
fColVector.h, fDiagMatrix.cc, fDiagMatrix.h, fMatrix.cc, fMatrix.h,
fNDArray.cc, fNDArray.h, fRowVector.cc, fRowVector.h, idx-vector.cc,
idx-vector.h, intNDArray.cc, intNDArray.h, liboctave-build-info.h,
liboctave-build-info.in.cc, CollocWt.cc, CollocWt.h, DAE.h, DAEFunc.h, DAERT.h,
DAERTFunc.h, DASPK.cc, DASPK.h, DASRT.cc, DASRT.h, DASSL.cc, DASSL.h, DET.h,
EIG.h, LSODE.cc, LSODE.h, ODE.h, ODEFunc.h, ODES.h, ODESFunc.h, Quad.h,
aepbalance.cc, aepbalance.h, base-dae.h, base-de.h, chol.cc, chol.h,
eigs-base.cc, fEIG.h, gepbalance.h, gsvd.cc, gsvd.h, hess.h, lu.cc, lu.h,
oct-fftw.cc, oct-fftw.h, oct-rand.cc, oct-rand.h, oct-spparms.cc,
oct-spparms.h, qr.cc, qr.h, qrp.cc, qrp.h, randmtzig.cc, randmtzig.h, schur.h,
sparse-chol.cc, sparse-chol.h, sparse-lu.cc, sparse-lu.h, sparse-qr.cc,
sparse-qr.h, svd.cc, svd.h, child-list.cc, child-list.h, dir-ops.cc, dir-ops.h,
file-ops.cc, file-ops.h, file-stat.cc, file-stat.h, lo-sysdep.cc, lo-sysdep.h,
lo-sysinfo.cc, lo-sysinfo.h, mach-info.cc, mach-info.h, oct-env.cc, oct-env.h,
oct-group.cc, oct-group.h, oct-password.cc, oct-password.h, oct-syscalls.cc,
oct-syscalls.h, oct-time.cc, oct-time.h, oct-uname.cc, oct-uname.h,
action-container.h, base-list.h, caseless-str.h, cmd-edit.cc, cmd-edit.h,
cmd-hist.cc, cmd-hist.h, data-conv.cc, file-info.h, glob-match.cc,
glob-match.h, kpse.cc, kpse.h, lo-array-errwarn.cc, lo-array-errwarn.h,
lo-hash.cc, lo-hash.h, lo-ieee.cc, lo-ieee.h, lo-regexp.cc, lo-regexp.h,
oct-inttypes.cc, oct-inttypes.h, oct-mutex.cc, oct-mutex.h, oct-refcount.h,
oct-shlib.cc, oct-shlib.h, oct-sort.cc, oct-sort.h, oct-sparse.cc,
octave-preserve-stream-state.h, pathsearch.cc, pathsearch.h, quit.cc,
singleton-cleanup.cc, singleton-cleanup.h, str-vec.cc, str-vec.h,
unwind-prot.cc, unwind-prot.h, url-transfer.cc, url-transfer.h, version.cc,
version.in.h, cxx-signal-helpers.cc, acinclude.m4, main-cli.cc, main-gui.cc,
main.in.cc, mkoctfile.in.cc, octave-build-info.h, octave-build-info.in.cc,
octave-config.in.cc, octave-svgconvert.cc, shared-fcns.h:
maint: Eliminate "(void)" in C++ function prototypes/declarations.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 24 Jan 2023 17:19:44 -0800 |
parents | faf5d5960732 |
children | 947b8c671680 |
comparison
equal
deleted
inserted
replaced
31770:1d1eff97670e | 31771:21f9b34eb893 |
---|---|
134 | 134 |
135 return caseless_str (); | 135 return caseless_str (); |
136 } | 136 } |
137 | 137 |
138 static Matrix | 138 static Matrix |
139 viridis_colormap (void) | 139 viridis_colormap () |
140 { | 140 { |
141 // The values below have been produced by viridis (64)(:) | 141 // The values below have been produced by viridis (64)(:) |
142 // It would be nice to be able to feval the | 142 // It would be nice to be able to feval the |
143 // viridis function but since there is a static property object that includes | 143 // viridis function but since there is a static property object that includes |
144 // a colormap_property object, we need to initialize this before main is | 144 // a colormap_property object, we need to initialize this before main is |
218 std::copy (cmapv, cmapv + (64*3), cmap.fortran_vec ()); | 218 std::copy (cmapv, cmapv + (64*3), cmap.fortran_vec ()); |
219 return cmap; | 219 return cmap; |
220 } | 220 } |
221 | 221 |
222 static double | 222 static double |
223 default_screendepth (void) | 223 default_screendepth () |
224 { | 224 { |
225 octave::display_info& dpy_info = octave::__get_display_info__ (); | 225 octave::display_info& dpy_info = octave::__get_display_info__ (); |
226 | 226 |
227 return dpy_info.depth (); | 227 return dpy_info.depth (); |
228 } | 228 } |
229 | 229 |
230 static Matrix | 230 static Matrix |
231 default_screensize (void) | 231 default_screensize () |
232 { | 232 { |
233 Matrix retval (1, 4); | 233 Matrix retval (1, 4); |
234 | 234 |
235 octave::display_info& dpy_info = octave::__get_display_info__ (); | 235 octave::display_info& dpy_info = octave::__get_display_info__ (); |
236 | 236 |
241 | 241 |
242 return retval; | 242 return retval; |
243 } | 243 } |
244 | 244 |
245 static double | 245 static double |
246 default_screenpixelsperinch (void) | 246 default_screenpixelsperinch () |
247 { | 247 { |
248 octave::display_info& dpy_info = octave::__get_display_info__ (); | 248 octave::display_info& dpy_info = octave::__get_display_info__ (); |
249 | 249 |
250 return (dpy_info.x_dpi () + dpy_info.y_dpi ()) / 2; | 250 return (dpy_info.x_dpi () + dpy_info.y_dpi ()) / 2; |
251 } | 251 } |
252 | 252 |
253 static Matrix | 253 static Matrix |
254 default_colororder (void) | 254 default_colororder () |
255 { | 255 { |
256 Matrix retval (7, 3, 0.0); | 256 Matrix retval (7, 3, 0.0); |
257 | 257 |
258 retval(0, 1) = 0.447; | 258 retval(0, 1) = 0.447; |
259 retval(0, 2) = 0.741; | 259 retval(0, 2) = 0.741; |
303 | 303 |
304 return m; | 304 return m; |
305 } | 305 } |
306 | 306 |
307 static Matrix | 307 static Matrix |
308 default_data (void) | 308 default_data () |
309 { | 309 { |
310 Matrix retval (1, 2); | 310 Matrix retval (1, 2); |
311 | 311 |
312 retval(0) = 0; | 312 retval(0) = 0; |
313 retval(1) = 1; | 313 retval(1) = 1; |
314 | 314 |
315 return retval; | 315 return retval; |
316 } | 316 } |
317 | 317 |
318 static Matrix | 318 static Matrix |
319 default_data_lim (void) | 319 default_data_lim () |
320 { | 320 { |
321 Matrix retval (1, 4); | 321 Matrix retval (1, 4); |
322 | 322 |
323 retval(0) = 0; | 323 retval(0) = 0; |
324 retval(1) = 1; | 324 retval(1) = 1; |
327 | 327 |
328 return retval; | 328 return retval; |
329 } | 329 } |
330 | 330 |
331 static Matrix | 331 static Matrix |
332 default_image_cdata (void) | 332 default_image_cdata () |
333 { | 333 { |
334 Matrix m (64, 64); | 334 Matrix m (64, 64); |
335 | 335 |
336 int i = 0; | 336 int i = 0; |
337 for (int col = 0; col < 64; col++) | 337 for (int col = 0; col < 64; col++) |
343 | 343 |
344 return m; | 344 return m; |
345 } | 345 } |
346 | 346 |
347 static Matrix | 347 static Matrix |
348 default_surface_xdata (void) | 348 default_surface_xdata () |
349 { | 349 { |
350 Matrix m (3, 3); | 350 Matrix m (3, 3); |
351 | 351 |
352 for (int col = 0; col < 3; col++) | 352 for (int col = 0; col < 3; col++) |
353 for (int row = 0; row < 3; row++) | 353 for (int row = 0; row < 3; row++) |
355 | 355 |
356 return m; | 356 return m; |
357 } | 357 } |
358 | 358 |
359 static Matrix | 359 static Matrix |
360 default_surface_ydata (void) | 360 default_surface_ydata () |
361 { | 361 { |
362 Matrix m (3, 3); | 362 Matrix m (3, 3); |
363 | 363 |
364 for (int row = 0; row < 3; row++) | 364 for (int row = 0; row < 3; row++) |
365 for (int col = 0; col < 3; col++) | 365 for (int col = 0; col < 3; col++) |
367 | 367 |
368 return m; | 368 return m; |
369 } | 369 } |
370 | 370 |
371 static Matrix | 371 static Matrix |
372 default_surface_zdata (void) | 372 default_surface_zdata () |
373 { | 373 { |
374 Matrix m (3, 3, 0.0); | 374 Matrix m (3, 3, 0.0); |
375 | 375 |
376 for (int row = 0; row < 3; row++) | 376 for (int row = 0; row < 3; row++) |
377 m(row, row) = 1.0; | 377 m(row, row) = 1.0; |
378 | 378 |
379 return m; | 379 return m; |
380 } | 380 } |
381 | 381 |
382 static Matrix | 382 static Matrix |
383 default_surface_cdata (void) | 383 default_surface_cdata () |
384 { | 384 { |
385 return default_surface_zdata (); | 385 return default_surface_zdata (); |
386 } | 386 } |
387 | 387 |
388 static Matrix | 388 static Matrix |
389 default_patch_faces (void) | 389 default_patch_faces () |
390 { | 390 { |
391 Matrix m (1, 3); | 391 Matrix m (1, 3); |
392 | 392 |
393 m(0) = 1.0; | 393 m(0) = 1.0; |
394 m(1) = 2.0; | 394 m(1) = 2.0; |
396 | 396 |
397 return m; | 397 return m; |
398 } | 398 } |
399 | 399 |
400 static Matrix | 400 static Matrix |
401 default_patch_vertices (void) | 401 default_patch_vertices () |
402 { | 402 { |
403 Matrix m (3, 2, 0.0); | 403 Matrix m (3, 2, 0.0); |
404 | 404 |
405 m(1) = 1.0; | 405 m(1) = 1.0; |
406 m(3) = 1.0; | 406 m(3) = 1.0; |
408 | 408 |
409 return m; | 409 return m; |
410 } | 410 } |
411 | 411 |
412 static Matrix | 412 static Matrix |
413 default_patch_xdata (void) | 413 default_patch_xdata () |
414 { | 414 { |
415 Matrix m (3, 1, 0.0); | 415 Matrix m (3, 1, 0.0); |
416 | 416 |
417 m(1) = 1.0; | 417 m(1) = 1.0; |
418 | 418 |
419 return m; | 419 return m; |
420 } | 420 } |
421 | 421 |
422 static Matrix | 422 static Matrix |
423 default_patch_ydata (void) | 423 default_patch_ydata () |
424 { | 424 { |
425 Matrix m (3, 1, 1.0); | 425 Matrix m (3, 1, 1.0); |
426 | 426 |
427 m(2) = 0.0; | 427 m(2) = 0.0; |
428 | 428 |
429 return m; | 429 return m; |
430 } | 430 } |
431 | 431 |
432 static Matrix | 432 static Matrix |
433 default_axes_position (void) | 433 default_axes_position () |
434 { | 434 { |
435 Matrix m (1, 4); | 435 Matrix m (1, 4); |
436 | 436 |
437 m(0) = 0.13; | 437 m(0) = 0.13; |
438 m(1) = 0.11; | 438 m(1) = 0.11; |
441 | 441 |
442 return m; | 442 return m; |
443 } | 443 } |
444 | 444 |
445 static Matrix | 445 static Matrix |
446 default_axes_outerposition (void) | 446 default_axes_outerposition () |
447 { | 447 { |
448 Matrix m (1, 4); | 448 Matrix m (1, 4); |
449 | 449 |
450 m(0) = 0.0; | 450 m(0) = 0.0; |
451 m(1) = 0.0; | 451 m(1) = 0.0; |
454 | 454 |
455 return m; | 455 return m; |
456 } | 456 } |
457 | 457 |
458 static Matrix | 458 static Matrix |
459 default_axes_view (void) | 459 default_axes_view () |
460 { | 460 { |
461 Matrix m (1, 2); | 461 Matrix m (1, 2); |
462 | 462 |
463 m(0) = 0.0; | 463 m(0) = 0.0; |
464 m(1) = 90.0; | 464 m(1) = 90.0; |
465 | 465 |
466 return m; | 466 return m; |
467 } | 467 } |
468 | 468 |
469 static Matrix | 469 static Matrix |
470 default_axes_tick (void) | 470 default_axes_tick () |
471 { | 471 { |
472 Matrix m (1, 6); | 472 Matrix m (1, 6); |
473 | 473 |
474 m(0) = 0.0; | 474 m(0) = 0.0; |
475 m(1) = 0.2; | 475 m(1) = 0.2; |
480 | 480 |
481 return m; | 481 return m; |
482 } | 482 } |
483 | 483 |
484 static Matrix | 484 static Matrix |
485 default_axes_ticklength (void) | 485 default_axes_ticklength () |
486 { | 486 { |
487 Matrix m (1, 2); | 487 Matrix m (1, 2); |
488 | 488 |
489 m(0) = 0.01; | 489 m(0) = 0.01; |
490 m(1) = 0.025; | 490 m(1) = 0.025; |
491 | 491 |
492 return m; | 492 return m; |
493 } | 493 } |
494 | 494 |
495 static Matrix | 495 static Matrix |
496 default_figure_position (void) | 496 default_figure_position () |
497 { | 497 { |
498 Matrix m (1, 4); | 498 Matrix m (1, 4); |
499 | 499 |
500 m(0) = 300; | 500 m(0) = 300; |
501 m(1) = 200; | 501 m(1) = 200; |
504 | 504 |
505 return m; | 505 return m; |
506 } | 506 } |
507 | 507 |
508 static Matrix | 508 static Matrix |
509 default_figure_papersize (void) | 509 default_figure_papersize () |
510 { | 510 { |
511 Matrix m (1, 2); | 511 Matrix m (1, 2); |
512 | 512 |
513 m(0) = 8.5; | 513 m(0) = 8.5; |
514 m(1) = 11.0; | 514 m(1) = 11.0; |
515 | 515 |
516 return m; | 516 return m; |
517 } | 517 } |
518 | 518 |
519 static Matrix | 519 static Matrix |
520 default_figure_paperposition (void) | 520 default_figure_paperposition () |
521 { | 521 { |
522 Matrix m (1, 4); | 522 Matrix m (1, 4); |
523 | 523 |
524 // Update if default_figure_position or default_figure_papersize change | 524 // Update if default_figure_position or default_figure_papersize change |
525 m(0) = 1.3421852580027660; | 525 m(0) = 1.3421852580027660; |
529 | 529 |
530 return m; | 530 return m; |
531 } | 531 } |
532 | 532 |
533 static std::string | 533 static std::string |
534 default_graphics_toolkit (void) | 534 default_graphics_toolkit () |
535 { | 535 { |
536 octave::gtk_manager& gtk_mgr = octave::__get_gtk_manager__ (); | 536 octave::gtk_manager& gtk_mgr = octave::__get_gtk_manager__ (); |
537 | 537 |
538 return gtk_mgr.default_toolkit (); | 538 return gtk_mgr.default_toolkit (); |
539 } | 539 } |
540 | 540 |
541 static Matrix | 541 static Matrix |
542 default_control_position (void) | 542 default_control_position () |
543 { | 543 { |
544 Matrix retval (1, 4); | 544 Matrix retval (1, 4); |
545 | 545 |
546 retval(0) = 0; | 546 retval(0) = 0; |
547 retval(1) = 0; | 547 retval(1) = 0; |
550 | 550 |
551 return retval; | 551 return retval; |
552 } | 552 } |
553 | 553 |
554 static Matrix | 554 static Matrix |
555 default_control_sliderstep (void) | 555 default_control_sliderstep () |
556 { | 556 { |
557 Matrix retval (1, 2); | 557 Matrix retval (1, 2); |
558 | 558 |
559 retval(0) = 0.01; | 559 retval(0) = 0.01; |
560 retval(1) = 0.1; | 560 retval(1) = 0.1; |
561 | 561 |
562 return retval; | 562 return retval; |
563 } | 563 } |
564 | 564 |
565 static Matrix | 565 static Matrix |
566 default_panel_position (void) | 566 default_panel_position () |
567 { | 567 { |
568 Matrix retval (1, 4); | 568 Matrix retval (1, 4); |
569 | 569 |
570 retval(0) = 0; | 570 retval(0) = 0; |
571 retval(1) = 0; | 571 retval(1) = 0; |
574 | 574 |
575 return retval; | 575 return retval; |
576 } | 576 } |
577 | 577 |
578 static Matrix | 578 static Matrix |
579 default_light_position (void) | 579 default_light_position () |
580 { | 580 { |
581 Matrix m (1, 3); | 581 Matrix m (1, 3); |
582 | 582 |
583 m(0) = 1.0; | 583 m(0) = 1.0; |
584 m(1) = 0.0; | 584 m(1) = 0.0; |
586 | 586 |
587 return m; | 587 return m; |
588 } | 588 } |
589 | 589 |
590 static Matrix | 590 static Matrix |
591 default_table_position (void) | 591 default_table_position () |
592 { | 592 { |
593 Matrix retval (1, 4); | 593 Matrix retval (1, 4); |
594 | 594 |
595 retval(0) = 20; | 595 retval(0) = 20; |
596 retval(1) = 20; | 596 retval(1) = 20; |
599 | 599 |
600 return retval; | 600 return retval; |
601 } | 601 } |
602 | 602 |
603 static Matrix | 603 static Matrix |
604 default_table_backgroundcolor (void) | 604 default_table_backgroundcolor () |
605 { | 605 { |
606 Matrix retval (2, 3); | 606 Matrix retval (2, 3); |
607 retval(0, 0) = 1; | 607 retval(0, 0) = 1; |
608 retval(0, 1) = 1; | 608 retval(0, 1) = 1; |
609 retval(0, 2) = 1; | 609 retval(0, 2) = 1; |
918 return retval; | 918 return retval; |
919 } | 919 } |
920 | 920 |
921 // This function always returns the screensize in pixels | 921 // This function always returns the screensize in pixels |
922 static Matrix | 922 static Matrix |
923 screen_size_pixels (void) | 923 screen_size_pixels () |
924 { | 924 { |
925 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 925 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
926 | 926 |
927 graphics_object obj = gh_mgr.get_object (0); | 927 graphics_object obj = gh_mgr.get_object (0); |
928 | 928 |
1326 beg = end + 1; | 1326 beg = end + 1; |
1327 } | 1327 } |
1328 } | 1328 } |
1329 | 1329 |
1330 std::string | 1330 std::string |
1331 radio_values::values_as_string (void) const | 1331 radio_values::values_as_string () const |
1332 { | 1332 { |
1333 std::string retval; | 1333 std::string retval; |
1334 | 1334 |
1335 for (const auto& val : m_possible_vals) | 1335 for (const auto& val : m_possible_vals) |
1336 { | 1336 { |
1355 | 1355 |
1356 return retval; | 1356 return retval; |
1357 } | 1357 } |
1358 | 1358 |
1359 Cell | 1359 Cell |
1360 radio_values::values_as_cell (void) const | 1360 radio_values::values_as_cell () const |
1361 { | 1361 { |
1362 octave_idx_type i = 0; | 1362 octave_idx_type i = 0; |
1363 Cell retval (nelem (), 1); | 1363 Cell retval (nelem (), 1); |
1364 | 1364 |
1365 for (const auto& val : m_possible_vals) | 1365 for (const auto& val : m_possible_vals) |
1721 | 1721 |
1722 return false; | 1722 return false; |
1723 } | 1723 } |
1724 | 1724 |
1725 void | 1725 void |
1726 array_property::get_data_limits (void) | 1726 array_property::get_data_limits () |
1727 { | 1727 { |
1728 m_min_val = m_min_pos = octave::numeric_limits<double>::Inf (); | 1728 m_min_val = m_min_pos = octave::numeric_limits<double>::Inf (); |
1729 m_max_val = m_max_neg = -octave::numeric_limits<double>::Inf (); | 1729 m_max_val = m_max_neg = -octave::numeric_limits<double>::Inf (); |
1730 | 1730 |
1731 if (! m_data.isempty ()) | 1731 if (! m_data.isempty ()) |
1933 | 1933 |
1934 class callback_props | 1934 class callback_props |
1935 { | 1935 { |
1936 public: | 1936 public: |
1937 | 1937 |
1938 callback_props (void) : m_set () { } | 1938 callback_props () : m_set () { } |
1939 | 1939 |
1940 callback_props (const callback_props&) = delete; | 1940 callback_props (const callback_props&) = delete; |
1941 | 1941 |
1942 callback_props& operator = (const callback_props&) = delete; | 1942 callback_props& operator = (const callback_props&) = delete; |
1943 | 1943 |
1944 ~callback_props (void) = default; | 1944 ~callback_props () = default; |
1945 | 1945 |
1946 bool empty (void) const { return m_set.empty (); } | 1946 bool empty () const { return m_set.empty (); } |
1947 | 1947 |
1948 void insert (const callback_property *ptr) | 1948 void insert (const callback_property *ptr) |
1949 { | 1949 { |
1950 m_set.insert (reinterpret_cast<intptr_t> (ptr)); | 1950 m_set.insert (reinterpret_cast<intptr_t> (ptr)); |
1951 } | 1951 } |
2230 } | 2230 } |
2231 } | 2231 } |
2232 } | 2232 } |
2233 | 2233 |
2234 void | 2234 void |
2235 figure::properties::update_handlevisibility (void) | 2235 figure::properties::update_handlevisibility () |
2236 { | 2236 { |
2237 if (! is_handle_visible ()) | 2237 if (! is_handle_visible ()) |
2238 { | 2238 { |
2239 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 2239 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
2240 | 2240 |
2289 } | 2289 } |
2290 } | 2290 } |
2291 } | 2291 } |
2292 | 2292 |
2293 void | 2293 void |
2294 figure::properties::update___device_pixel_ratio__ (void) | 2294 figure::properties::update___device_pixel_ratio__ () |
2295 { | 2295 { |
2296 update_text_pos (get___myhandle__ ()); | 2296 update_text_pos (get___myhandle__ ()); |
2297 } | 2297 } |
2298 | 2298 |
2299 // --------------------------------------------------------------------- | 2299 // --------------------------------------------------------------------- |
2815 %! end_unwind_protect | 2815 %! end_unwind_protect |
2816 */ | 2816 */ |
2817 | 2817 |
2818 // This function is NOT equivalent to the scripting language function gcf. | 2818 // This function is NOT equivalent to the scripting language function gcf. |
2819 graphics_handle | 2819 graphics_handle |
2820 gcf (void) | 2820 gcf () |
2821 { | 2821 { |
2822 octave_value val = xget (0, "currentfigure"); | 2822 octave_value val = xget (0, "currentfigure"); |
2823 | 2823 |
2824 return val.isempty () ? octave::numeric_limits<double>::NaN () | 2824 return val.isempty () ? octave::numeric_limits<double>::NaN () |
2825 : val.double_value (); | 2825 : val.double_value (); |
2826 } | 2826 } |
2827 | 2827 |
2828 // This function is NOT equivalent to the scripting language function gca. | 2828 // This function is NOT equivalent to the scripting language function gca. |
2829 graphics_handle | 2829 graphics_handle |
2830 gca (void) | 2830 gca () |
2831 { | 2831 { |
2832 octave_value val = xget (gcf (), "currentaxes"); | 2832 octave_value val = xget (gcf (), "currentaxes"); |
2833 | 2833 |
2834 return val.isempty () ? octave::numeric_limits<double>::NaN () | 2834 return val.isempty () ? octave::numeric_limits<double>::NaN () |
2835 : val.double_value (); | 2835 : val.double_value (); |
3038 | 3038 |
3039 return m; | 3039 return m; |
3040 } | 3040 } |
3041 | 3041 |
3042 std::set<std::string> | 3042 std::set<std::string> |
3043 base_properties::dynamic_property_names (void) const | 3043 base_properties::dynamic_property_names () const |
3044 { | 3044 { |
3045 return m_dynamic_properties; | 3045 return m_dynamic_properties; |
3046 } | 3046 } |
3047 | 3047 |
3048 bool | 3048 bool |
3131 %! close (hf); | 3131 %! close (hf); |
3132 %! end_unwind_protect | 3132 %! end_unwind_protect |
3133 */ | 3133 */ |
3134 | 3134 |
3135 void | 3135 void |
3136 base_properties::mark_modified (void) | 3136 base_properties::mark_modified () |
3137 { | 3137 { |
3138 // Mark existing object as modified | 3138 // Mark existing object as modified |
3139 m___modified__ = "on"; | 3139 m___modified__ = "on"; |
3140 | 3140 |
3141 // Attempt to mark parent object as modified if it exists | 3141 // Attempt to mark parent object as modified if it exists |
3181 if (go) | 3181 if (go) |
3182 go.update_axis_limits (axis_type, h); | 3182 go.update_axis_limits (axis_type, h); |
3183 } | 3183 } |
3184 | 3184 |
3185 void | 3185 void |
3186 base_properties::update_contextmenu (void) const | 3186 base_properties::update_contextmenu () const |
3187 { | 3187 { |
3188 if (m_contextmenu.get ().isempty ()) | 3188 if (m_contextmenu.get ().isempty ()) |
3189 return; | 3189 return; |
3190 | 3190 |
3191 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 3191 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
3199 props.add_dependent_obj (m___myhandle__); | 3199 props.add_dependent_obj (m___myhandle__); |
3200 } | 3200 } |
3201 } | 3201 } |
3202 | 3202 |
3203 bool | 3203 bool |
3204 base_properties::is_handle_visible (void) const | 3204 base_properties::is_handle_visible () const |
3205 { | 3205 { |
3206 return (m_handlevisibility.is ("on") | 3206 return (m_handlevisibility.is ("on") |
3207 || (! executing_callbacks.empty () && ! m_handlevisibility.is ("off"))); | 3207 || (! executing_callbacks.empty () && ! m_handlevisibility.is ("off"))); |
3208 } | 3208 } |
3209 | 3209 |
3210 octave::graphics_toolkit | 3210 octave::graphics_toolkit |
3211 base_properties::get_toolkit (void) const | 3211 base_properties::get_toolkit () const |
3212 { | 3212 { |
3213 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 3213 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
3214 | 3214 |
3215 graphics_object go = gh_mgr.get_object (get_parent ()); | 3215 graphics_object go = gh_mgr.get_object (get_parent ()); |
3216 | 3216 |
3219 else | 3219 else |
3220 return octave::graphics_toolkit (); | 3220 return octave::graphics_toolkit (); |
3221 } | 3221 } |
3222 | 3222 |
3223 void | 3223 void |
3224 base_properties::update_boundingbox (void) | 3224 base_properties::update_boundingbox () |
3225 { | 3225 { |
3226 Matrix kids = get_children (); | 3226 Matrix kids = get_children (); |
3227 | 3227 |
3228 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 3228 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
3229 | 3229 |
3246 if (parent_go.valid_object ()) | 3246 if (parent_go.valid_object ()) |
3247 parent_go.get_properties ().update_autopos (elem_type); | 3247 parent_go.get_properties ().update_autopos (elem_type); |
3248 } | 3248 } |
3249 | 3249 |
3250 void | 3250 void |
3251 base_properties::update_handlevisibility (void) | 3251 base_properties::update_handlevisibility () |
3252 { | 3252 { |
3253 if (is_handle_visible ()) | 3253 if (is_handle_visible ()) |
3254 return; | 3254 return; |
3255 | 3255 |
3256 // This object should not be the figure "currentobject" | 3256 // This object should not be the figure "currentobject" |
3395 if (parent_go) | 3395 if (parent_go) |
3396 parent_go.update_axis_limits (axis_type, h); | 3396 parent_go.update_axis_limits (axis_type, h); |
3397 } | 3397 } |
3398 | 3398 |
3399 void | 3399 void |
3400 base_graphics_object::remove_all_listeners (void) | 3400 base_graphics_object::remove_all_listeners () |
3401 { | 3401 { |
3402 int state = toggle_warn ("Octave:deprecated-property", false); | 3402 int state = toggle_warn ("Octave:deprecated-property", false); |
3403 octave_map m = get (true).map_value (); | 3403 octave_map m = get (true).map_value (); |
3404 toggle_warn ("Octave:deprecated-property", true, state); | 3404 toggle_warn ("Octave:deprecated-property", true, state); |
3405 | 3405 |
3454 if (parent_go) | 3454 if (parent_go) |
3455 parent_go.build_user_defaults_map (def, go_name); | 3455 parent_go.build_user_defaults_map (def, go_name); |
3456 } | 3456 } |
3457 | 3457 |
3458 void | 3458 void |
3459 base_graphics_object::reset_default_properties (void) | 3459 base_graphics_object::reset_default_properties () |
3460 { | 3460 { |
3461 if (valid_object ()) | 3461 if (valid_object ()) |
3462 { | 3462 { |
3463 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 3463 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
3464 | 3464 |
3469 xreset_default_properties (get_handle (), factory_pval); | 3469 xreset_default_properties (get_handle (), factory_pval); |
3470 } | 3470 } |
3471 } | 3471 } |
3472 | 3472 |
3473 std::string | 3473 std::string |
3474 base_graphics_object::values_as_string (void) | 3474 base_graphics_object::values_as_string () |
3475 { | 3475 { |
3476 if (! valid_object ()) | 3476 if (! valid_object ()) |
3477 error ("base_graphics_object::values_as_string: invalid graphics object"); | 3477 error ("base_graphics_object::values_as_string: invalid graphics object"); |
3478 | 3478 |
3479 std::string retval; | 3479 std::string retval; |
3533 | 3533 |
3534 return retval; | 3534 return retval; |
3535 } | 3535 } |
3536 | 3536 |
3537 octave_scalar_map | 3537 octave_scalar_map |
3538 base_graphics_object::values_as_struct (void) | 3538 base_graphics_object::values_as_struct () |
3539 { | 3539 { |
3540 octave_scalar_map retval; | 3540 octave_scalar_map retval; |
3541 | 3541 |
3542 if (! valid_object ()) | 3542 if (! valid_object ()) |
3543 error ("base_graphics_object::values_as_struct: invalid graphics object"); | 3543 error ("base_graphics_object::values_as_struct: invalid graphics object"); |
3689 } | 3689 } |
3690 | 3690 |
3691 // FIXME: This should update monitorpositions and pointerlocation, but as these | 3691 // FIXME: This should update monitorpositions and pointerlocation, but as these |
3692 // properties aren't yet used, it doesn't matter that they aren't set either. | 3692 // properties aren't yet used, it doesn't matter that they aren't set either. |
3693 void | 3693 void |
3694 root_figure::properties::update_units (void) | 3694 root_figure::properties::update_units () |
3695 { | 3695 { |
3696 std::string xunits = get_units (); | 3696 std::string xunits = get_units (); |
3697 | 3697 |
3698 Matrix scrn_sz = default_screensize (); | 3698 Matrix scrn_sz = default_screensize (); |
3699 | 3699 |
3794 | 3794 |
3795 base_properties::remove_child (h, true); | 3795 base_properties::remove_child (h, true); |
3796 } | 3796 } |
3797 | 3797 |
3798 void | 3798 void |
3799 root_figure::reset_default_properties (void) | 3799 root_figure::reset_default_properties () |
3800 { | 3800 { |
3801 // empty list of local defaults | 3801 // empty list of local defaults |
3802 m_default_properties = property_list (); | 3802 m_default_properties = property_list (); |
3803 | 3803 |
3804 remove_all_listeners (); | 3804 remove_all_listeners (); |
3848 m_currentaxes = new_currentaxes; | 3848 m_currentaxes = new_currentaxes; |
3849 } | 3849 } |
3850 } | 3850 } |
3851 | 3851 |
3852 octave_value | 3852 octave_value |
3853 figure::properties::get_number (void) const | 3853 figure::properties::get_number () const |
3854 { | 3854 { |
3855 if (m_integerhandle.is_on ()) | 3855 if (m_integerhandle.is_on ()) |
3856 return m___myhandle__.value (); | 3856 return m___myhandle__.value (); |
3857 else | 3857 else |
3858 return Matrix (); | 3858 return Matrix (); |
3859 } | 3859 } |
3860 | 3860 |
3861 octave::graphics_toolkit | 3861 octave::graphics_toolkit |
3862 figure::properties::get_toolkit (void) const | 3862 figure::properties::get_toolkit () const |
3863 { | 3863 { |
3864 return m_toolkit; | 3864 return m_toolkit; |
3865 } | 3865 } |
3866 | 3866 |
3867 void | 3867 void |
4241 | 4241 |
4242 return retval; | 4242 return retval; |
4243 } | 4243 } |
4244 | 4244 |
4245 Matrix | 4245 Matrix |
4246 figure::properties::get_auto_paperposition (void) | 4246 figure::properties::get_auto_paperposition () |
4247 { | 4247 { |
4248 Matrix pos = get_position ().matrix_value (); | 4248 Matrix pos = get_position ().matrix_value (); |
4249 Matrix sz; | 4249 Matrix sz; |
4250 | 4250 |
4251 caseless_str funits = get_units (); | 4251 caseless_str funits = get_units (); |
4411 m_papersize.set (octave_value (sz)); | 4411 m_papersize.set (octave_value (sz)); |
4412 m_paperposition.set (octave_value (pos)); | 4412 m_paperposition.set (octave_value (pos)); |
4413 } | 4413 } |
4414 | 4414 |
4415 void | 4415 void |
4416 figure::properties::update_papertype (void) | 4416 figure::properties::update_papertype () |
4417 { | 4417 { |
4418 std::string typ = get_papertype (); | 4418 std::string typ = get_papertype (); |
4419 if (typ != "<custom>") | 4419 if (typ != "<custom>") |
4420 { | 4420 { |
4421 Matrix sz = papersize_from_type (get_paperunits (), typ); | 4421 Matrix sz = papersize_from_type (get_paperunits (), typ); |
4429 if (m_paperpositionmode.is ("auto")) | 4429 if (m_paperpositionmode.is ("auto")) |
4430 m_paperposition.set (get_auto_paperposition ()); | 4430 m_paperposition.set (get_auto_paperposition ()); |
4431 } | 4431 } |
4432 | 4432 |
4433 void | 4433 void |
4434 figure::properties::update_papersize (void) | 4434 figure::properties::update_papersize () |
4435 { | 4435 { |
4436 Matrix sz = get_papersize ().matrix_value (); | 4436 Matrix sz = get_papersize ().matrix_value (); |
4437 if (sz(0) > sz(1)) | 4437 if (sz(0) > sz(1)) |
4438 { | 4438 { |
4439 std::swap (sz(0), sz(1)); | 4439 std::swap (sz(0), sz(1)); |
4597 %! close (hf); | 4597 %! close (hf); |
4598 %! end_unwind_protect | 4598 %! end_unwind_protect |
4599 */ | 4599 */ |
4600 | 4600 |
4601 void | 4601 void |
4602 figure::properties::update_paperorientation (void) | 4602 figure::properties::update_paperorientation () |
4603 { | 4603 { |
4604 std::string porient = get_paperorientation (); | 4604 std::string porient = get_paperorientation (); |
4605 Matrix sz = get_papersize ().matrix_value (); | 4605 Matrix sz = get_papersize ().matrix_value (); |
4606 if ((sz(0) > sz(1) && porient == "portrait") | 4606 if ((sz(0) > sz(1) && porient == "portrait") |
4607 || (sz(0) < sz(1) && porient == "landscape")) | 4607 || (sz(0) < sz(1) && porient == "landscape")) |
4680 %! set (0, "units", old_units); | 4680 %! set (0, "units", old_units); |
4681 %! end_unwind_protect | 4681 %! end_unwind_protect |
4682 */ | 4682 */ |
4683 | 4683 |
4684 std::string | 4684 std::string |
4685 figure::properties::get_title (void) const | 4685 figure::properties::get_title () const |
4686 { | 4686 { |
4687 std::string title; | 4687 std::string title; |
4688 if (! get_number ().isempty () && is_numbertitle ()) | 4688 if (! get_number ().isempty () && is_numbertitle ()) |
4689 { | 4689 { |
4690 std::ostringstream os; | 4690 std::ostringstream os; |
4725 | 4725 |
4726 return retval; | 4726 return retval; |
4727 } | 4727 } |
4728 | 4728 |
4729 void | 4729 void |
4730 figure::reset_default_properties (void) | 4730 figure::reset_default_properties () |
4731 { | 4731 { |
4732 // empty list of local defaults | 4732 // empty list of local defaults |
4733 m_default_properties = property_list (); | 4733 m_default_properties = property_list (); |
4734 property_list::pval_map_type plist = m_properties.factory_defaults (); | 4734 property_list::pval_map_type plist = m_properties.factory_defaults (); |
4735 | 4735 |
4745 } | 4745 } |
4746 | 4746 |
4747 // --------------------------------------------------------------------- | 4747 // --------------------------------------------------------------------- |
4748 | 4748 |
4749 void | 4749 void |
4750 axes::properties::init (void) | 4750 axes::properties::init () |
4751 { | 4751 { |
4752 m_position.add_constraint (dim_vector (1, 4)); | 4752 m_position.add_constraint (dim_vector (1, 4)); |
4753 m_outerposition.add_constraint (dim_vector (1, 4)); | 4753 m_outerposition.add_constraint (dim_vector (1, 4)); |
4754 m_tightinset.add_constraint (dim_vector (1, 4)); | 4754 m_tightinset.add_constraint (dim_vector (1, 4)); |
4755 m_looseinset.add_constraint (dim_vector (1, 4)); | 4755 m_looseinset.add_constraint (dim_vector (1, 4)); |
4943 | 4943 |
4944 return pos; | 4944 return pos; |
4945 } | 4945 } |
4946 | 4946 |
4947 void | 4947 void |
4948 axes::properties::sync_positions (void) | 4948 axes::properties::sync_positions () |
4949 { | 4949 { |
4950 // First part is equivalent to 'update_tightinset ()' | 4950 // First part is equivalent to 'update_tightinset ()' |
4951 if (m_positionconstraint.is ("innerposition")) | 4951 if (m_positionconstraint.is ("innerposition")) |
4952 update_position (); | 4952 update_position (); |
4953 else | 4953 else |
5335 sync_positions (); | 5335 sync_positions (); |
5336 override_defaults (bgo); | 5336 override_defaults (bgo); |
5337 } | 5337 } |
5338 | 5338 |
5339 octave_value | 5339 octave_value |
5340 axes::properties::get_colormap (void) const | 5340 axes::properties::get_colormap () const |
5341 { | 5341 { |
5342 if (m___colormap__.get ().isempty ()) | 5342 if (m___colormap__.get ().isempty ()) |
5343 { | 5343 { |
5344 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 5344 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
5345 | 5345 |
5452 if (climmode_is ("auto")) | 5452 if (climmode_is ("auto")) |
5453 update_axis_limits ("alim"); | 5453 update_axis_limits ("alim"); |
5454 } | 5454 } |
5455 | 5455 |
5456 inline Matrix | 5456 inline Matrix |
5457 xform_matrix (void) | 5457 xform_matrix () |
5458 { | 5458 { |
5459 Matrix m (4, 4, 0.0); | 5459 Matrix m (4, 4, 0.0); |
5460 | 5460 |
5461 for (int i = 0; i < 4; i++) | 5461 for (int i = 0; i < 4; i++) |
5462 m(i, i) = 1; | 5462 m(i, i) = 1; |
5463 | 5463 |
5464 return m; | 5464 return m; |
5465 } | 5465 } |
5466 | 5466 |
5467 inline ColumnVector | 5467 inline ColumnVector |
5468 xform_vector (void) | 5468 xform_vector () |
5469 { | 5469 { |
5470 ColumnVector v (4, 0.0); | 5470 ColumnVector v (4, 0.0); |
5471 | 5471 |
5472 v(3) = 1; | 5472 v(3) = 1; |
5473 | 5473 |
5582 | 5582 |
5583 return r; | 5583 return r; |
5584 } | 5584 } |
5585 | 5585 |
5586 inline Matrix | 5586 inline Matrix |
5587 unit_cube (void) | 5587 unit_cube () |
5588 { | 5588 { |
5589 static double data[32] = | 5589 static double data[32] = |
5590 { | 5590 { |
5591 0, 0, 0, 1, | 5591 0, 0, 0, 1, |
5592 1, 0, 0, 1, | 5592 1, 0, 0, 1, |
5619 { | 5619 { |
5620 return v.extract_n (0, 3).transpose (); | 5620 return v.extract_n (0, 3).transpose (); |
5621 } | 5621 } |
5622 | 5622 |
5623 void | 5623 void |
5624 axes::properties::update_camera (void) | 5624 axes::properties::update_camera () |
5625 { | 5625 { |
5626 double xd = (xdir_is ("normal") ? 1 : -1); | 5626 double xd = (xdir_is ("normal") ? 1 : -1); |
5627 double yd = (ydir_is ("normal") ? 1 : -1); | 5627 double yd = (ydir_is ("normal") ? 1 : -1); |
5628 double zd = (zdir_is ("normal") ? 1 : -1); | 5628 double zd = (zdir_is ("normal") ? 1 : -1); |
5629 | 5629 |
5835 } | 5835 } |
5836 | 5836 |
5837 static bool updating_axes_layout = false; | 5837 static bool updating_axes_layout = false; |
5838 | 5838 |
5839 void | 5839 void |
5840 axes::properties::update_axes_layout (void) | 5840 axes::properties::update_axes_layout () |
5841 { | 5841 { |
5842 if (updating_axes_layout) | 5842 if (updating_axes_layout) |
5843 return; | 5843 return; |
5844 | 5844 |
5845 graphics_xform xform = get_transform (); | 5845 graphics_xform xform = get_transform (); |
5998 | 5998 |
5999 update_ticklength (); | 5999 update_ticklength (); |
6000 } | 6000 } |
6001 | 6001 |
6002 void | 6002 void |
6003 axes::properties::update_ticklength (void) | 6003 axes::properties::update_ticklength () |
6004 { | 6004 { |
6005 bool mode2D = (((m_xstate > AXE_DEPTH_DIR ? 1 : 0) + | 6005 bool mode2D = (((m_xstate > AXE_DEPTH_DIR ? 1 : 0) + |
6006 (m_ystate > AXE_DEPTH_DIR ? 1 : 0) + | 6006 (m_ystate > AXE_DEPTH_DIR ? 1 : 0) + |
6007 (m_zstate > AXE_DEPTH_DIR ? 1 : 0)) == 2); | 6007 (m_zstate > AXE_DEPTH_DIR ? 1 : 0)) == 2); |
6008 | 6008 |
6085 } | 6085 } |
6086 | 6086 |
6087 static bool updating_xlabel_position = false; | 6087 static bool updating_xlabel_position = false; |
6088 | 6088 |
6089 void | 6089 void |
6090 axes::properties::update_xlabel_position (void) | 6090 axes::properties::update_xlabel_position () |
6091 { | 6091 { |
6092 if (updating_xlabel_position) | 6092 if (updating_xlabel_position) |
6093 return; | 6093 return; |
6094 | 6094 |
6095 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 6095 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
6189 } | 6189 } |
6190 | 6190 |
6191 static bool updating_ylabel_position = false; | 6191 static bool updating_ylabel_position = false; |
6192 | 6192 |
6193 void | 6193 void |
6194 axes::properties::update_ylabel_position (void) | 6194 axes::properties::update_ylabel_position () |
6195 { | 6195 { |
6196 if (updating_ylabel_position) | 6196 if (updating_ylabel_position) |
6197 return; | 6197 return; |
6198 | 6198 |
6199 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 6199 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
6293 } | 6293 } |
6294 | 6294 |
6295 static bool updating_zlabel_position = false; | 6295 static bool updating_zlabel_position = false; |
6296 | 6296 |
6297 void | 6297 void |
6298 axes::properties::update_zlabel_position (void) | 6298 axes::properties::update_zlabel_position () |
6299 { | 6299 { |
6300 if (updating_zlabel_position) | 6300 if (updating_zlabel_position) |
6301 return; | 6301 return; |
6302 | 6302 |
6303 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 6303 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
6419 } | 6419 } |
6420 | 6420 |
6421 static bool updating_title_position = false; | 6421 static bool updating_title_position = false; |
6422 | 6422 |
6423 void | 6423 void |
6424 axes::properties::update_title_position (void) | 6424 axes::properties::update_title_position () |
6425 { | 6425 { |
6426 if (updating_title_position) | 6426 if (updating_title_position) |
6427 return; | 6427 return; |
6428 | 6428 |
6429 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 6429 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
6520 } | 6520 } |
6521 | 6521 |
6522 static std::set<double> updating_aspectratios; | 6522 static std::set<double> updating_aspectratios; |
6523 | 6523 |
6524 void | 6524 void |
6525 axes::properties::update_aspectratios (void) | 6525 axes::properties::update_aspectratios () |
6526 { | 6526 { |
6527 if (updating_aspectratios.find (get___myhandle__ ().value ()) | 6527 if (updating_aspectratios.find (get___myhandle__ ().value ()) |
6528 != updating_aspectratios.end ()) | 6528 != updating_aspectratios.end ()) |
6529 return; | 6529 return; |
6530 | 6530 |
7029 { | 7029 { |
7030 return octave::xform_vector (x, y, z); | 7030 return octave::xform_vector (x, y, z); |
7031 } | 7031 } |
7032 | 7032 |
7033 Matrix | 7033 Matrix |
7034 graphics_xform::xform_eye (void) | 7034 graphics_xform::xform_eye () |
7035 { | 7035 { |
7036 return octave::xform_matrix (); | 7036 return octave::xform_matrix (); |
7037 } | 7037 } |
7038 | 7038 |
7039 ColumnVector | 7039 ColumnVector |
7160 a = x / std::pow (10.0, b); | 7160 a = x / std::pow (10.0, b); |
7161 } | 7161 } |
7162 } | 7162 } |
7163 | 7163 |
7164 void | 7164 void |
7165 axes::properties::update_outerposition (void) | 7165 axes::properties::update_outerposition () |
7166 { | 7166 { |
7167 set_positionconstraint ("outerposition"); | 7167 set_positionconstraint ("outerposition"); |
7168 caseless_str old_units = get_units (); | 7168 caseless_str old_units = get_units (); |
7169 set_units ("normalized"); | 7169 set_units ("normalized"); |
7170 | 7170 |
7219 set_units (old_units); | 7219 set_units (old_units); |
7220 update_transform (); | 7220 update_transform (); |
7221 } | 7221 } |
7222 | 7222 |
7223 void | 7223 void |
7224 axes::properties::update_position (void) | 7224 axes::properties::update_position () |
7225 { | 7225 { |
7226 set_positionconstraint ("innerposition"); | 7226 set_positionconstraint ("innerposition"); |
7227 caseless_str old_units = get_units (); | 7227 caseless_str old_units = get_units (); |
7228 set_units ("normalized"); | 7228 set_units ("normalized"); |
7229 | 7229 |
7267 set_units (old_units); | 7267 set_units (old_units); |
7268 update_transform (); | 7268 update_transform (); |
7269 } | 7269 } |
7270 | 7270 |
7271 void | 7271 void |
7272 axes::properties::update_looseinset (void) | 7272 axes::properties::update_looseinset () |
7273 { | 7273 { |
7274 caseless_str old_units = get_units (); | 7274 caseless_str old_units = get_units (); |
7275 set_units ("normalized"); | 7275 set_units ("normalized"); |
7276 | 7276 |
7277 Matrix linset = m_looseinset.get ().matrix_value (); | 7277 Matrix linset = m_looseinset.get ().matrix_value (); |
8713 | 8713 |
8714 zoom_about_point (mode, x, y, factor, push_to_zoom_stack); | 8714 zoom_about_point (mode, x, y, factor, push_to_zoom_stack); |
8715 } | 8715 } |
8716 | 8716 |
8717 void | 8717 void |
8718 axes::properties::push_zoom_stack (void) | 8718 axes::properties::push_zoom_stack () |
8719 { | 8719 { |
8720 if (m_zoom_stack.empty ()) | 8720 if (m_zoom_stack.empty ()) |
8721 { | 8721 { |
8722 m_zoom_stack.push_front (m_xlimmode.get ()); | 8722 m_zoom_stack.push_front (m_xlimmode.get ()); |
8723 m_zoom_stack.push_front (m_xlim.get ()); | 8723 m_zoom_stack.push_front (m_xlim.get ()); |
8939 | 8939 |
8940 update_transform (); | 8940 update_transform (); |
8941 } | 8941 } |
8942 | 8942 |
8943 void | 8943 void |
8944 axes::properties::unzoom (void) | 8944 axes::properties::unzoom () |
8945 { | 8945 { |
8946 if (m_zoom_stack.size () >= 7) | 8946 if (m_zoom_stack.size () >= 7) |
8947 { | 8947 { |
8948 m_view = m_zoom_stack.front (); | 8948 m_view = m_zoom_stack.front (); |
8949 m_zoom_stack.pop_front (); | 8949 m_zoom_stack.pop_front (); |
8975 update_view (); | 8975 update_view (); |
8976 } | 8976 } |
8977 } | 8977 } |
8978 | 8978 |
8979 void | 8979 void |
8980 axes::properties::update_handlevisibility (void) | 8980 axes::properties::update_handlevisibility () |
8981 { | 8981 { |
8982 if (! is_handle_visible ()) | 8982 if (! is_handle_visible ()) |
8983 { | 8983 { |
8984 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 8984 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
8985 | 8985 |
9004 | 9004 |
9005 base_properties::update_handlevisibility (); | 9005 base_properties::update_handlevisibility (); |
9006 } | 9006 } |
9007 | 9007 |
9008 void | 9008 void |
9009 figure::properties::init_toolkit (void) | 9009 figure::properties::init_toolkit () |
9010 { | 9010 { |
9011 octave::gtk_manager& gtk_mgr = octave::__get_gtk_manager__ (); | 9011 octave::gtk_manager& gtk_mgr = octave::__get_gtk_manager__ (); |
9012 | 9012 |
9013 m_toolkit = gtk_mgr.get_toolkit (); | 9013 m_toolkit = gtk_mgr.get_toolkit (); |
9014 } | 9014 } |
9024 if (do_unzoom) | 9024 if (do_unzoom) |
9025 unzoom (); | 9025 unzoom (); |
9026 } | 9026 } |
9027 | 9027 |
9028 void | 9028 void |
9029 axes::properties::trigger_normals_calc (void) | 9029 axes::properties::trigger_normals_calc () |
9030 { | 9030 { |
9031 // Find all patch (and surface) objects within axes | 9031 // Find all patch (and surface) objects within axes |
9032 std::list<graphics_object> children_list; | 9032 std::list<graphics_object> children_list; |
9033 std::list<graphics_object>::iterator children_list_iter; | 9033 std::list<graphics_object>::iterator children_list_iter; |
9034 get_children_of_type ("patch", false, true, children_list); | 9034 get_children_of_type ("patch", false, true, children_list); |
9053 } | 9053 } |
9054 } | 9054 } |
9055 } | 9055 } |
9056 | 9056 |
9057 void | 9057 void |
9058 axes::reset_default_properties (void) | 9058 axes::reset_default_properties () |
9059 { | 9059 { |
9060 // empty list of local defaults | 9060 // empty list of local defaults |
9061 m_default_properties = property_list (); | 9061 m_default_properties = property_list (); |
9062 | 9062 |
9063 // Save warning state of "Octave:deprecated-property" | 9063 // Save warning state of "Octave:deprecated-property" |
9084 } | 9084 } |
9085 | 9085 |
9086 // --------------------------------------------------------------------- | 9086 // --------------------------------------------------------------------- |
9087 | 9087 |
9088 Matrix | 9088 Matrix |
9089 line::properties::compute_xlim (void) const | 9089 line::properties::compute_xlim () const |
9090 { | 9090 { |
9091 Matrix m (1, 4); | 9091 Matrix m (1, 4); |
9092 | 9092 |
9093 m(0) = m_xdata.min_val (); | 9093 m(0) = m_xdata.min_val (); |
9094 m(1) = m_xdata.max_val (); | 9094 m(1) = m_xdata.max_val (); |
9097 | 9097 |
9098 return m; | 9098 return m; |
9099 } | 9099 } |
9100 | 9100 |
9101 Matrix | 9101 Matrix |
9102 line::properties::compute_ylim (void) const | 9102 line::properties::compute_ylim () const |
9103 { | 9103 { |
9104 Matrix m (1, 4); | 9104 Matrix m (1, 4); |
9105 | 9105 |
9106 m(0) = m_ydata.min_val (); | 9106 m(0) = m_ydata.min_val (); |
9107 m(1) = m_ydata.max_val (); | 9107 m(1) = m_ydata.max_val (); |
9112 } | 9112 } |
9113 | 9113 |
9114 // --------------------------------------------------------------------- | 9114 // --------------------------------------------------------------------- |
9115 | 9115 |
9116 Matrix | 9116 Matrix |
9117 text::properties::get_data_position (void) const | 9117 text::properties::get_data_position () const |
9118 { | 9118 { |
9119 Matrix pos = get_position ().matrix_value (); | 9119 Matrix pos = get_position ().matrix_value (); |
9120 | 9120 |
9121 if (! units_is ("data")) | 9121 if (! units_is ("data")) |
9122 pos = convert_text_position (pos, *this, get_units (), "data"); | 9122 pos = convert_text_position (pos, *this, get_units (), "data"); |
9167 | 9167 |
9168 return ext; | 9168 return ext; |
9169 } | 9169 } |
9170 | 9170 |
9171 octave_value | 9171 octave_value |
9172 text::properties::get_extent (void) const | 9172 text::properties::get_extent () const |
9173 { | 9173 { |
9174 // FIXME: This doesn't work right for 3D plots. | 9174 // FIXME: This doesn't work right for 3D plots. |
9175 // (It doesn't in Matlab either, at least not in version 6.5.) | 9175 // (It doesn't in Matlab either, at least not in version 6.5.) |
9176 Matrix m = get_extent_matrix (true); | 9176 Matrix m = get_extent_matrix (true); |
9177 Matrix pos = get_position ().matrix_value (); | 9177 Matrix pos = get_position ().matrix_value (); |
9224 | 9224 |
9225 set_fontsize (octave_value (fontsz)); | 9225 set_fontsize (octave_value (fontsz)); |
9226 } | 9226 } |
9227 | 9227 |
9228 void | 9228 void |
9229 text::properties::update_font (void) | 9229 text::properties::update_font () |
9230 { | 9230 { |
9231 double dpr = device_pixel_ratio (get___myhandle__ ()); | 9231 double dpr = device_pixel_ratio (get___myhandle__ ()); |
9232 | 9232 |
9233 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 9233 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
9234 | 9234 |
9246 m_txt_renderer.set_color (c); | 9246 m_txt_renderer.set_color (c); |
9247 | 9247 |
9248 } | 9248 } |
9249 | 9249 |
9250 void | 9250 void |
9251 text::properties::update_text_extent (void) | 9251 text::properties::update_text_extent () |
9252 { | 9252 { |
9253 int halign = 0; | 9253 int halign = 0; |
9254 int valign = 0; | 9254 int valign = 0; |
9255 | 9255 |
9256 if (horizontalalignment_is ("center")) | 9256 if (horizontalalignment_is ("center")) |
9291 || __autopos_tag___is ("zlabel") || __autopos_tag___is ("title")) | 9291 || __autopos_tag___is ("zlabel") || __autopos_tag___is ("title")) |
9292 update_autopos ("sync"); | 9292 update_autopos ("sync"); |
9293 } | 9293 } |
9294 | 9294 |
9295 void | 9295 void |
9296 text::properties::request_autopos (void) | 9296 text::properties::request_autopos () |
9297 { | 9297 { |
9298 if (__autopos_tag___is ("xlabel") || __autopos_tag___is ("ylabel") | 9298 if (__autopos_tag___is ("xlabel") || __autopos_tag___is ("ylabel") |
9299 || __autopos_tag___is ("zlabel") || __autopos_tag___is ("title")) | 9299 || __autopos_tag___is ("zlabel") || __autopos_tag___is ("title")) |
9300 update_autopos (get___autopos_tag__ ()); | 9300 update_autopos (get___autopos_tag__ ()); |
9301 } | 9301 } |
9302 | 9302 |
9303 void | 9303 void |
9304 text::properties::update_units (void) | 9304 text::properties::update_units () |
9305 { | 9305 { |
9306 if (! units_is ("data")) | 9306 if (! units_is ("data")) |
9307 { | 9307 { |
9308 set_xliminclude ("off"); | 9308 set_xliminclude ("off"); |
9309 set_yliminclude ("off"); | 9309 set_yliminclude ("off"); |
9356 } | 9356 } |
9357 | 9357 |
9358 // --------------------------------------------------------------------- | 9358 // --------------------------------------------------------------------- |
9359 | 9359 |
9360 octave_value | 9360 octave_value |
9361 image::properties::get_color_data (void) const | 9361 image::properties::get_color_data () const |
9362 { | 9362 { |
9363 return convert_cdata (*this, get_cdata (), cdatamapping_is ("scaled"), 3); | 9363 return convert_cdata (*this, get_cdata (), cdatamapping_is ("scaled"), 3); |
9364 } | 9364 } |
9365 | 9365 |
9366 // --------------------------------------------------------------------- | 9366 // --------------------------------------------------------------------- |
9375 = dynamic_cast<axes::properties&> (go.get_ancestor ("axes").get_properties ()); | 9375 = dynamic_cast<axes::properties&> (go.get_ancestor ("axes").get_properties ()); |
9376 parent_axes_prop.trigger_normals_calc (); | 9376 parent_axes_prop.trigger_normals_calc (); |
9377 } | 9377 } |
9378 | 9378 |
9379 void | 9379 void |
9380 light::properties::update_visible (void) | 9380 light::properties::update_visible () |
9381 { | 9381 { |
9382 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 9382 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
9383 | 9383 |
9384 graphics_object go = gh_mgr.get_object (get___myhandle__ ()); | 9384 graphics_object go = gh_mgr.get_object (get___myhandle__ ()); |
9385 | 9385 |
9392 } | 9392 } |
9393 | 9393 |
9394 // --------------------------------------------------------------------- | 9394 // --------------------------------------------------------------------- |
9395 | 9395 |
9396 bool | 9396 bool |
9397 patch::properties::get_do_lighting (void) const | 9397 patch::properties::get_do_lighting () const |
9398 { | 9398 { |
9399 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 9399 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
9400 | 9400 |
9401 graphics_object go = gh_mgr.get_object (get___myhandle__ ()); | 9401 graphics_object go = gh_mgr.get_object (get___myhandle__ ()); |
9402 | 9402 |
9405 | 9405 |
9406 return (ax_props.get_num_lights () > 0); | 9406 return (ax_props.get_num_lights () > 0); |
9407 } | 9407 } |
9408 | 9408 |
9409 octave_value | 9409 octave_value |
9410 patch::properties::get_color_data (void) const | 9410 patch::properties::get_color_data () const |
9411 { | 9411 { |
9412 octave_value fvc = get_facevertexcdata (); | 9412 octave_value fvc = get_facevertexcdata (); |
9413 if (fvc.is_undefined () || fvc.isempty ()) | 9413 if (fvc.is_undefined () || fvc.isempty ()) |
9414 return Matrix (); | 9414 return Matrix (); |
9415 else | 9415 else |
9417 } | 9417 } |
9418 | 9418 |
9419 static bool updating_patch_data = false; | 9419 static bool updating_patch_data = false; |
9420 | 9420 |
9421 void | 9421 void |
9422 patch::properties::update_fvc (void) | 9422 patch::properties::update_fvc () |
9423 { | 9423 { |
9424 if (updating_patch_data) | 9424 if (updating_patch_data) |
9425 return; | 9425 return; |
9426 | 9426 |
9427 Matrix xd = get_xdata ().matrix_value (); | 9427 Matrix xd = get_xdata ().matrix_value (); |
9596 } | 9596 } |
9597 return coplanar_ends; | 9597 return coplanar_ends; |
9598 } | 9598 } |
9599 | 9599 |
9600 void | 9600 void |
9601 patch::properties::update_data (void) | 9601 patch::properties::update_data () |
9602 { | 9602 { |
9603 if (updating_patch_data) | 9603 if (updating_patch_data) |
9604 return; | 9604 return; |
9605 | 9605 |
9606 Matrix idx = get_faces ().matrix_value ().transpose (); | 9606 Matrix idx = get_faces ().matrix_value ().transpose (); |
9977 m_properties.update_normals (true); | 9977 m_properties.update_normals (true); |
9978 } | 9978 } |
9979 | 9979 |
9980 | 9980 |
9981 void | 9981 void |
9982 patch::reset_default_properties (void) | 9982 patch::reset_default_properties () |
9983 { | 9983 { |
9984 // empty list of local defaults | 9984 // empty list of local defaults |
9985 m_default_properties = property_list (); | 9985 m_default_properties = property_list (); |
9986 xreset_default_properties (get_handle (), m_properties.factory_defaults ()); | 9986 xreset_default_properties (get_handle (), m_properties.factory_defaults ()); |
9987 | 9987 |
9992 } | 9992 } |
9993 | 9993 |
9994 // --------------------------------------------------------------------- | 9994 // --------------------------------------------------------------------- |
9995 | 9995 |
9996 octave_value | 9996 octave_value |
9997 scatter::properties::get_color_data (void) const | 9997 scatter::properties::get_color_data () const |
9998 { | 9998 { |
9999 octave_value c = get_cdata (); | 9999 octave_value c = get_cdata (); |
10000 if (c.is_undefined () || c.isempty ()) | 10000 if (c.is_undefined () || c.isempty ()) |
10001 return Matrix (); | 10001 return Matrix (); |
10002 else | 10002 else |
10003 return convert_cdata (*this, c, c.columns () == 1, 2); | 10003 return convert_cdata (*this, c, c.columns () == 1, 2); |
10004 } | 10004 } |
10005 | 10005 |
10006 void | 10006 void |
10007 scatter::properties::update_data (void) | 10007 scatter::properties::update_data () |
10008 { | 10008 { |
10009 Matrix xd = get_xdata ().matrix_value (); | 10009 Matrix xd = get_xdata ().matrix_value (); |
10010 Matrix yd = get_ydata ().matrix_value (); | 10010 Matrix yd = get_ydata ().matrix_value (); |
10011 Matrix zd = get_zdata ().matrix_value (); | 10011 Matrix zd = get_zdata ().matrix_value (); |
10012 Matrix cd = get_cdata ().matrix_value (); | 10012 Matrix cd = get_cdata ().matrix_value (); |
10042 } | 10042 } |
10043 | 10043 |
10044 static bool updating_scatter_cdata = false; | 10044 static bool updating_scatter_cdata = false; |
10045 | 10045 |
10046 void | 10046 void |
10047 scatter::properties::update_color (void) | 10047 scatter::properties::update_color () |
10048 { | 10048 { |
10049 if (updating_scatter_cdata) | 10049 if (updating_scatter_cdata) |
10050 return; | 10050 return; |
10051 | 10051 |
10052 Matrix series_idx = get_seriesindex ().matrix_value (); | 10052 Matrix series_idx = get_seriesindex ().matrix_value (); |
10105 } | 10105 } |
10106 | 10106 |
10107 // --------------------------------------------------------------------- | 10107 // --------------------------------------------------------------------- |
10108 | 10108 |
10109 octave_value | 10109 octave_value |
10110 surface::properties::get_color_data (void) const | 10110 surface::properties::get_color_data () const |
10111 { | 10111 { |
10112 return convert_cdata (*this, get_cdata (), cdatamapping_is ("scaled"), 3); | 10112 return convert_cdata (*this, get_cdata (), cdatamapping_is ("scaled"), 3); |
10113 } | 10113 } |
10114 | 10114 |
10115 bool | 10115 bool |
10116 surface::properties::get_do_lighting (void) const | 10116 surface::properties::get_do_lighting () const |
10117 { | 10117 { |
10118 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 10118 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
10119 | 10119 |
10120 graphics_object go = gh_mgr.get_object (get___myhandle__ ()); | 10120 graphics_object go = gh_mgr.get_object (get___myhandle__ ()); |
10121 | 10121 |
10437 base_properties::adopt (h); | 10437 base_properties::adopt (h); |
10438 update_limits (h); | 10438 update_limits (h); |
10439 } | 10439 } |
10440 | 10440 |
10441 void | 10441 void |
10442 hggroup::properties::update_limits (void) const | 10442 hggroup::properties::update_limits () const |
10443 { | 10443 { |
10444 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 10444 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
10445 | 10445 |
10446 graphics_object go = gh_mgr.get_object (m___myhandle__); | 10446 graphics_object go = gh_mgr.get_object (m___myhandle__); |
10447 | 10447 |
10671 } | 10671 } |
10672 | 10672 |
10673 // --------------------------------------------------------------------- | 10673 // --------------------------------------------------------------------- |
10674 | 10674 |
10675 void | 10675 void |
10676 uicontextmenu::properties::update_beingdeleted (void) | 10676 uicontextmenu::properties::update_beingdeleted () |
10677 { | 10677 { |
10678 // Clear the uicontextmenu property of dependent objects | 10678 // Clear the uicontextmenu property of dependent objects |
10679 if (m_beingdeleted.is ("on")) | 10679 if (m_beingdeleted.is ("on")) |
10680 { | 10680 { |
10681 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 10681 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
10721 */ | 10721 */ |
10722 | 10722 |
10723 // --------------------------------------------------------------------- | 10723 // --------------------------------------------------------------------- |
10724 | 10724 |
10725 octave_value | 10725 octave_value |
10726 uicontrol::properties::get_extent (void) const | 10726 uicontrol::properties::get_extent () const |
10727 { | 10727 { |
10728 Matrix m = m_extent.get ().matrix_value (); | 10728 Matrix m = m_extent.get ().matrix_value (); |
10729 | 10729 |
10730 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 10730 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
10731 | 10731 |
10736 | 10736 |
10737 return convert_position (m, "pixels", get_units (), parent_size); | 10737 return convert_position (m, "pixels", get_units (), parent_size); |
10738 } | 10738 } |
10739 | 10739 |
10740 void | 10740 void |
10741 uicontrol::properties::update_text_extent (void) | 10741 uicontrol::properties::update_text_extent () |
10742 { | 10742 { |
10743 // FIXME: support multiline text | 10743 // FIXME: support multiline text |
10744 | 10744 |
10745 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 10745 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
10746 | 10746 |
10748 | 10748 |
10749 set_extent (go.get_toolkit ().get_text_extent (go)); | 10749 set_extent (go.get_toolkit ().get_text_extent (go)); |
10750 } | 10750 } |
10751 | 10751 |
10752 void | 10752 void |
10753 uicontrol::properties::update_units (void) | 10753 uicontrol::properties::update_units () |
10754 { | 10754 { |
10755 Matrix pos = get_position ().matrix_value (); | 10755 Matrix pos = get_position ().matrix_value (); |
10756 | 10756 |
10757 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 10757 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
10758 | 10758 |
11486 | 11486 |
11487 return convert_font_size (fontsz, get_fontunits (), "pixels", parent_height); | 11487 return convert_font_size (fontsz, get_fontunits (), "pixels", parent_height); |
11488 } | 11488 } |
11489 | 11489 |
11490 Matrix | 11490 Matrix |
11491 uitable::properties::get_backgroundcolor_rgb (void) | 11491 uitable::properties::get_backgroundcolor_rgb () |
11492 { | 11492 { |
11493 Matrix bg = m_backgroundcolor.get ().matrix_value (); | 11493 Matrix bg = m_backgroundcolor.get ().matrix_value (); |
11494 return bg.row (0); | 11494 return bg.row (0); |
11495 } | 11495 } |
11496 | 11496 |
11497 Matrix | 11497 Matrix |
11498 uitable::properties::get_alternatebackgroundcolor_rgb (void) | 11498 uitable::properties::get_alternatebackgroundcolor_rgb () |
11499 { | 11499 { |
11500 int i = 0; | 11500 int i = 0; |
11501 Matrix bg = m_backgroundcolor.get ().matrix_value (); | 11501 Matrix bg = m_backgroundcolor.get ().matrix_value (); |
11502 if (bg.rows () > 1) | 11502 if (bg.rows () > 1) |
11503 i = 1; | 11503 i = 1; |
11504 | 11504 |
11505 return bg.row (i); | 11505 return bg.row (i); |
11506 } | 11506 } |
11507 | 11507 |
11508 Matrix | 11508 Matrix |
11509 uitable::properties::get_extent_matrix (void) const | 11509 uitable::properties::get_extent_matrix () const |
11510 { | 11510 { |
11511 return m_extent.get ().matrix_value (); | 11511 return m_extent.get ().matrix_value (); |
11512 } | 11512 } |
11513 | 11513 |
11514 octave_value | 11514 octave_value |
11515 uitable::properties::get_extent (void) const | 11515 uitable::properties::get_extent () const |
11516 { | 11516 { |
11517 // FIXME: Is it really acceptable to just let the toolkit update the extent? | 11517 // FIXME: Is it really acceptable to just let the toolkit update the extent? |
11518 Matrix m = m_extent.get ().matrix_value (); | 11518 Matrix m = m_extent.get ().matrix_value (); |
11519 | 11519 |
11520 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 11520 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
11552 | 11552 |
11553 return retval; | 11553 return retval; |
11554 } | 11554 } |
11555 | 11555 |
11556 void | 11556 void |
11557 uitoolbar::reset_default_properties (void) | 11557 uitoolbar::reset_default_properties () |
11558 { | 11558 { |
11559 // empty list of local defaults | 11559 // empty list of local defaults |
11560 m_default_properties = property_list (); | 11560 m_default_properties = property_list (); |
11561 | 11561 |
11562 remove_all_listeners (); | 11562 remove_all_listeners (); |
11601 const octave_value& data = Matrix (), | 11601 const octave_value& data = Matrix (), |
11602 int busyaction = base_graphics_event::QUEUE) | 11602 int busyaction = base_graphics_event::QUEUE) |
11603 : base_graphics_event (busyaction), m_handle (h), m_callback_name (), | 11603 : base_graphics_event (busyaction), m_handle (h), m_callback_name (), |
11604 m_callback (cb), m_callback_data (data) { } | 11604 m_callback (cb), m_callback_data (data) { } |
11605 | 11605 |
11606 void execute (void) | 11606 void execute () |
11607 { | 11607 { |
11608 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 11608 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
11609 | 11609 |
11610 if (m_callback.is_defined ()) | 11610 if (m_callback.is_defined ()) |
11611 gh_mgr.execute_callback (m_handle, m_callback, m_callback_data); | 11611 gh_mgr.execute_callback (m_handle, m_callback, m_callback_data); |
11612 else | 11612 else |
11613 gh_mgr.execute_callback (m_handle, m_callback_name, m_callback_data); | 11613 gh_mgr.execute_callback (m_handle, m_callback_name, m_callback_data); |
11614 } | 11614 } |
11615 | 11615 |
11616 private: | 11616 private: |
11617 callback_event (void) | 11617 callback_event () |
11618 : base_graphics_event (), m_handle (), m_callback_name (), | 11618 : base_graphics_event (), m_handle (), m_callback_name (), |
11619 m_callback_data () | 11619 m_callback_data () |
11620 { } | 11620 { } |
11621 | 11621 |
11622 private: | 11622 private: |
11633 mcode_event (const graphics_handle& h, const std::string& cmd, | 11633 mcode_event (const graphics_handle& h, const std::string& cmd, |
11634 int busyaction = base_graphics_event::QUEUE) | 11634 int busyaction = base_graphics_event::QUEUE) |
11635 : base_graphics_event (busyaction), m_handle (h), m_mcode (cmd) | 11635 : base_graphics_event (busyaction), m_handle (h), m_mcode (cmd) |
11636 { } | 11636 { } |
11637 | 11637 |
11638 void execute (void) | 11638 void execute () |
11639 { | 11639 { |
11640 if (! m_mcode.empty ()) | 11640 if (! m_mcode.empty ()) |
11641 { | 11641 { |
11642 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 11642 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
11643 | 11643 |
11650 } | 11650 } |
11651 } | 11651 } |
11652 } | 11652 } |
11653 | 11653 |
11654 private: | 11654 private: |
11655 mcode_event (void) | 11655 mcode_event () |
11656 : base_graphics_event (), m_handle (), m_mcode () | 11656 : base_graphics_event (), m_handle (), m_mcode () |
11657 { } | 11657 { } |
11658 | 11658 |
11659 private: | 11659 private: |
11660 graphics_handle m_handle; | 11660 graphics_handle m_handle; |
11666 { | 11666 { |
11667 public: | 11667 public: |
11668 | 11668 |
11669 // function_event objects must be created with at least a function. | 11669 // function_event objects must be created with at least a function. |
11670 | 11670 |
11671 function_event (void) = delete; | 11671 function_event () = delete; |
11672 | 11672 |
11673 function_event (graphics_event::event_fcn fcn, void *data = nullptr) | 11673 function_event (graphics_event::event_fcn fcn, void *data = nullptr) |
11674 : base_graphics_event (), m_function (fcn), m_function_data (data) | 11674 : base_graphics_event (), m_function (fcn), m_function_data (data) |
11675 { } | 11675 { } |
11676 | 11676 |
11678 | 11678 |
11679 function_event (const function_event&) = delete; | 11679 function_event (const function_event&) = delete; |
11680 | 11680 |
11681 function_event& operator = (const function_event&) = delete; | 11681 function_event& operator = (const function_event&) = delete; |
11682 | 11682 |
11683 void execute (void) | 11683 void execute () |
11684 { | 11684 { |
11685 m_function (m_function_data); | 11685 m_function (m_function_data); |
11686 } | 11686 } |
11687 | 11687 |
11688 private: | 11688 private: |
11702 : base_graphics_event (), m_handle (h), m_property_name (name), | 11702 : base_graphics_event (), m_handle (h), m_property_name (name), |
11703 m_property_value (value), m_notify_toolkit (do_notify_toolkit), | 11703 m_property_value (value), m_notify_toolkit (do_notify_toolkit), |
11704 m_redraw_figure (redraw_figure) | 11704 m_redraw_figure (redraw_figure) |
11705 { } | 11705 { } |
11706 | 11706 |
11707 void execute (void) | 11707 void execute () |
11708 { | 11708 { |
11709 gh_manager& gh_mgr = octave::__get_gh_manager__ (); | 11709 gh_manager& gh_mgr = octave::__get_gh_manager__ (); |
11710 | 11710 |
11711 octave::autolock guard (gh_mgr.graphics_lock ()); | 11711 octave::autolock guard (gh_mgr.graphics_lock ()); |
11712 | 11712 |
11754 } | 11754 } |
11755 } | 11755 } |
11756 } | 11756 } |
11757 | 11757 |
11758 private: | 11758 private: |
11759 set_event (void) | 11759 set_event () |
11760 : base_graphics_event (), m_handle (), m_property_name (), m_property_value () | 11760 : base_graphics_event (), m_handle (), m_property_name (), m_property_value () |
11761 { } | 11761 { } |
11762 | 11762 |
11763 private: | 11763 private: |
11764 graphics_handle m_handle; | 11764 graphics_handle m_handle; |
11810 return graphics_event (new set_event (h, name, data, notify_toolkit, | 11810 return graphics_event (new set_event (h, name, data, notify_toolkit, |
11811 redraw_figure)); | 11811 redraw_figure)); |
11812 } | 11812 } |
11813 | 11813 |
11814 property_list::plist_map_type | 11814 property_list::plist_map_type |
11815 root_figure::init_factory_properties (void) | 11815 root_figure::init_factory_properties () |
11816 { | 11816 { |
11817 property_list::plist_map_type plist_map; | 11817 property_list::plist_map_type plist_map; |
11818 | 11818 |
11819 plist_map["figure"] = figure::properties::factory_defaults (); | 11819 plist_map["figure"] = figure::properties::factory_defaults (); |
11820 plist_map["axes"] = axes::properties::factory_defaults (); | 11820 plist_map["axes"] = axes::properties::factory_defaults (); |