#include "Canvas.h"
Public Types | |
enum | EventMask { KeyPress = 0x01 , KeyRelease = 0x02 } |
Signals | |
void | gh_callback_event (const graphics_handle &h, const std::string &name) |
void | gh_callback_event (const graphics_handle &h, const std::string &name, const octave_value &data) |
void | gh_set_event (const graphics_handle &h, const std::string &name, const octave_value &value) |
void | gh_set_event (const graphics_handle &h, const std::string &name, const octave_value &value, bool notify_toolkit) |
void | gh_set_event (const graphics_handle &h, const std::string &name, const octave_value &value, bool notify_toolkit, bool redraw_figure) |
void | interpreter_event (const octave::fcn_callback &fcn) |
void | interpreter_event (const octave::meth_callback &meth) |
Public Member Functions | |
virtual | ~Canvas (void)=default |
void | addEventMask (int m) |
void | blockRedraw (bool block=true) |
void | clearEventMask (int m) |
virtual uint8NDArray | getPixels (void) |
void | print (const QString &file_cmd, const QString &term) |
virtual QWidget * | qWidget (void)=0 |
void | redraw (bool sync=false) |
void | setCursor (MouseMode mode, std::string fallback, QImage cdata, Matrix hotspot) |
void | setEventMask (int m) |
Static Public Member Functions | |
static Canvas * | create (octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_handle &handle, QWidget *parent, const std::string &name) |
Protected Member Functions | |
Canvas (octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_handle &handle) | |
void | canvasAutoAxes (const graphics_handle &handle) |
bool | canvasKeyPressEvent (QKeyEvent *event) |
bool | canvasKeyReleaseEvent (QKeyEvent *event) |
void | canvasMouseDoubleClickEvent (QMouseEvent *event) |
void | canvasMouseMoveEvent (QMouseEvent *event) |
void | canvasMousePressEvent (QMouseEvent *event) |
void | canvasMouseReleaseEvent (QMouseEvent *event) |
void | canvasPaintEvent (void) |
void | canvasToggleAxes (const graphics_handle &handle) |
void | canvasToggleGrid (const graphics_handle &handle) |
void | canvasWheelEvent (QWheelEvent *event) |
virtual uint8NDArray | do_getPixels (const graphics_handle &handle)=0 |
virtual void | do_print (const QString &file_cmd, const QString &term, const graphics_handle &handle)=0 |
virtual void | draw (const graphics_handle &handle)=0 |
virtual void | drawZoomBox (const QPoint &p1, const QPoint &p2)=0 |
virtual void | resize (int x, int y, int width, int height)=0 |
void | select_object (graphics_object obj, QMouseEvent *event, graphics_object ¤tObj, graphics_object &axesObj, bool axes_only=false, std::vector< std::string > omit=std::vector< std::string >()) |
virtual graphics_object | selectFromAxes (const graphics_object &ax, const QPoint &pt)=0 |
void | updateCurrentPoint (const graphics_object &fig, const graphics_object &obj) |
void | updateCurrentPoint (const graphics_object &fig, const graphics_object &obj, QMouseEvent *event) |
Protected Attributes | |
octave::interpreter & | m_interpreter |
octave::base_qobject & | m_octave_qobj |
Private Member Functions | |
QCursor | make_cursor (const QString &name, int hot_x=-1, int hot_y=-1) |
Private Attributes | |
bool | m_clickMode |
int | m_eventMask |
graphics_handle | m_handle |
QPoint | m_mouseAnchor |
graphics_handle | m_mouseAxes |
QPoint | m_mouseCurrent |
MouseMode | m_mouseMode |
bool | m_rectMode |
bool | m_redrawBlocked |
enum Canvas::EventMask |
|
virtualdefault |
|
inlineprotected |
|
inline |
Definition at line 71 of file Canvas.h.
References m, and m_eventMask.
Referenced by Panel::Panel(), and Figure::update().
void Canvas::blockRedraw | ( | bool | block = true | ) |
Definition at line 71 of file Canvas.cc.
References m_redrawBlocked.
Referenced by Figure::beingDeleted().
|
protected |
|
protected |
Definition at line 1033 of file Canvas.cc.
References octave_scalar_map::getfield(), gh_callback_event(), gh_set_event(), KeyPress, m_eventMask, m_handle, m_interpreter, Utils::makeKeyEventStruct(), and updateCurrentPoint().
Referenced by GLCanvas::keyPressEvent().
|
protected |
Definition at line 1064 of file Canvas.cc.
References gh_callback_event(), KeyRelease, m_eventMask, m_handle, m_interpreter, and Utils::makeKeyEventStruct().
Referenced by GLCanvas::keyReleaseEvent().
|
protected |
Definition at line 541 of file Canvas.cc.
References canvasMousePressEvent().
Referenced by GLCanvas::mouseDoubleClickEvent().
|
protected |
Definition at line 439 of file Canvas.cc.
References gh_callback_event(), m_handle, m_interpreter, m_mouseAxes, m_mouseCurrent, m_mouseMode, NoMode, pan_mode(), PanMode, Utils::properties(), redraw(), RotateMode, select_object(), TextMode, qt_graphics_toolkit::toolkitObject(), updateCurrentPoint(), Figure::updateStatusBar(), ZoomInMode, and ZoomOutMode.
Referenced by GLCanvas::mouseMoveEvent().
|
protected |
Definition at line 574 of file Canvas.cc.
References autoscale_axes(), button_number(), ContextMenu::executeAt(), Utils::figureSelectionType(), gh_callback_event(), gh_set_event(), m_clickMode, m_handle, m_interpreter, m_mouseAnchor, m_mouseAxes, m_mouseCurrent, m_mouseMode, m_rectMode, Figure::mouseMode(), NoMode, PanMode, Utils::properties(), redraw(), RotateMode, select_object(), TextMode, qt_graphics_toolkit::toolkitObject(), updateCurrentPoint(), ZoomInMode, and ZoomOutMode.
Referenced by canvasMouseDoubleClickEvent(), and GLCanvas::mousePressEvent().
|
protected |
Definition at line 787 of file Canvas.cc.
References annotation_dialog::get_properties(), gh_callback_event(), interpreter_event(), m_clickMode, m_handle, m_interpreter, m_mouseAnchor, m_mouseAxes, m_mouseMode, m_octave_qobj, m_rectMode, max(), min(), NoMode, octave_handle::ok(), ovl(), octave_value_list::prepend(), Utils::properties(), qWidget(), redraw(), TextMode, updateCurrentPoint(), Faddeeva::w(), zoom_mode(), ZoomInMode, and ZoomOutMode.
Referenced by GLCanvas::mouseReleaseEvent().
|
protected |
Definition at line 275 of file Canvas.cc.
References draw(), drawZoomBox(), m_handle, m_interpreter, m_mouseAnchor, m_mouseAxes, m_mouseCurrent, m_mouseMode, m_rectMode, m_redrawBlocked, octave_handle::ok(), and ZoomInMode.
Referenced by GLCanvas::paintGL().
|
protected |
|
protected |
|
protected |
Definition at line 897 of file Canvas.cc.
References gh_callback_event(), m_handle, m_interpreter, Utils::makeScrollEventStruct(), Figure::mouseMode(), NoMode, Array< T, Alloc >::numel(), pan_enabled(), pan_mode(), PanMode, Utils::properties(), redraw(), selectFromAxes(), qt_graphics_toolkit::toolkitObject(), zoom_enabled(), zoom_mode(), ZoomInMode, and ZoomOutMode.
Referenced by GLCanvas::wheelEvent().
|
inline |
Definition at line 72 of file Canvas.h.
References m, and m_eventMask.
Referenced by Figure::update().
|
static |
Definition at line 1088 of file Canvas.cc.
Referenced by Container::canvas().
|
protectedpure virtual |
Implemented in GLCanvas.
Referenced by getPixels().
|
protectedpure virtual |
|
protectedpure virtual |
Implemented in GLCanvas.
Referenced by canvasPaintEvent().
|
protectedpure virtual |
Implemented in GLCanvas.
Referenced by canvasPaintEvent().
|
inlinevirtual |
Definition at line 85 of file Canvas.h.
References do_getPixels(), and m_handle.
Referenced by Figure::slotGetPixels().
|
signal |
|
signal |
|
signal |
Referenced by canvasKeyPressEvent(), canvasMousePressEvent(), and updateCurrentPoint().
|
signal |
|
signal |
|
signal |
Referenced by Container::canvas(), canvasMouseReleaseEvent(), and GLCanvas::do_print().
|
signal |
|
private |
|
inline |
Definition at line 66 of file Canvas.h.
References do_print(), and m_handle.
Referenced by Figure::print().
|
pure virtual |
Implemented in GLCanvas.
Referenced by Container::canvas(), canvasMouseReleaseEvent(), Figure::enableMouseTracking(), redraw(), Container::resizeEvent(), setCursor(), and updateCurrentPoint().
void Canvas::redraw | ( | bool | sync = false | ) |
Definition at line 57 of file Canvas.cc.
References qWidget(), and Faddeeva::w().
Referenced by canvasMouseMoveEvent(), canvasMousePressEvent(), canvasMouseReleaseEvent(), canvasWheelEvent(), ButtonGroup::redraw(), Figure::redraw(), and Panel::redraw().
|
protectedpure virtual |
Implemented in GLCanvas.
|
protected |
Definition at line 339 of file Canvas.cc.
References m_interpreter, Array< T, Alloc >::numel(), Utils::properties(), r, and selectFromAxes().
Referenced by canvasMouseMoveEvent(), and canvasMousePressEvent().
|
protectedpure virtual |
Implemented in GLCanvas.
Referenced by canvasWheelEvent(), and select_object().
Definition at line 87 of file Canvas.cc.
References make_cursor(), Matrix, NoMode, PanMode, qWidget(), RotateMode, SelectMode, TextMode, Faddeeva::w(), ZoomInMode, and ZoomOutMode.
Referenced by Figure::update().
|
inline |
Definition at line 73 of file Canvas.h.
References m, and m_eventMask.
Referenced by Figure::Figure().
|
protected |
Definition at line 220 of file Canvas.cc.
References Utils::figureCurrentPoint(), gh_set_event(), m_interpreter, Array< T, Alloc >::numel(), Utils::properties(), qWidget(), and Faddeeva::w().
|
protected |
Definition at line 180 of file Canvas.cc.
References Utils::figureCurrentPoint(), gh_set_event(), m_interpreter, Array< T, Alloc >::numel(), and Utils::properties().
Referenced by canvasKeyPressEvent(), canvasMouseMoveEvent(), canvasMousePressEvent(), and canvasMouseReleaseEvent().
|
private |
Definition at line 162 of file Canvas.h.
Referenced by canvasMousePressEvent(), and canvasMouseReleaseEvent().
|
private |
Definition at line 166 of file Canvas.h.
Referenced by addEventMask(), canvasKeyPressEvent(), canvasKeyReleaseEvent(), clearEventMask(), and setEventMask().
|
private |
Definition at line 159 of file Canvas.h.
Referenced by canvasKeyPressEvent(), canvasKeyReleaseEvent(), canvasMouseMoveEvent(), canvasMousePressEvent(), canvasMouseReleaseEvent(), canvasPaintEvent(), canvasWheelEvent(), getPixels(), and print().
|
protected |
Definition at line 153 of file Canvas.h.
Referenced by canvasKeyPressEvent(), canvasKeyReleaseEvent(), canvasMouseMoveEvent(), canvasMousePressEvent(), canvasMouseReleaseEvent(), canvasPaintEvent(), canvasWheelEvent(), GLCanvas::do_getPixels(), GLCanvas::do_print(), GLCanvas::draw(), select_object(), and updateCurrentPoint().
|
private |
Definition at line 163 of file Canvas.h.
Referenced by canvasMousePressEvent(), canvasMouseReleaseEvent(), and canvasPaintEvent().
|
private |
Definition at line 165 of file Canvas.h.
Referenced by canvasMouseMoveEvent(), canvasMousePressEvent(), canvasMouseReleaseEvent(), and canvasPaintEvent().
|
private |
Definition at line 164 of file Canvas.h.
Referenced by canvasMouseMoveEvent(), canvasMousePressEvent(), and canvasPaintEvent().
|
private |
Definition at line 161 of file Canvas.h.
Referenced by canvasMouseMoveEvent(), canvasMousePressEvent(), canvasMouseReleaseEvent(), and canvasPaintEvent().
|
protected |
Definition at line 152 of file Canvas.h.
Referenced by canvasMouseReleaseEvent(), and make_cursor().
|
private |
Definition at line 167 of file Canvas.h.
Referenced by canvasMousePressEvent(), canvasMouseReleaseEvent(), and canvasPaintEvent().
|
private |
Definition at line 160 of file Canvas.h.
Referenced by blockRedraw(), and canvasPaintEvent().