#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 |
|
virtualdefault |
|
inlineprotected |
|
inline |
Definition at line 75 of file Canvas.h.
References m, and m_eventMask.
Referenced by QtHandles::Panel::Panel(), and QtHandles::Figure::update().
void QtHandles::Canvas::blockRedraw | ( | bool | block = true | ) |
Definition at line 72 of file Canvas.cc.
References m_redrawBlocked.
Referenced by QtHandles::Figure::beingDeleted().
|
protected |
|
protected |
Definition at line 1042 of file Canvas.cc.
References graphics_object::get_ancestor(), octave::interpreter::get_gh_manager(), graphics_object::get_handle(), gh_manager::get_object(), octave_scalar_map::getfield(), gh_callback_event(), gh_set_event(), gh_manager::graphics_lock(), KeyPress, m_eventMask, m_handle, m_interpreter, QtHandles::Utils::makeKeyEventStruct(), updateCurrentPoint(), and graphics_object::valid_object().
Referenced by QtHandles::GLCanvas::keyPressEvent().
|
protected |
Definition at line 1073 of file Canvas.cc.
References graphics_object::get_ancestor(), octave::interpreter::get_gh_manager(), graphics_object::get_handle(), gh_manager::get_object(), gh_callback_event(), gh_manager::graphics_lock(), KeyRelease, m_eventMask, m_handle, m_interpreter, QtHandles::Utils::makeKeyEventStruct(), and graphics_object::valid_object().
Referenced by QtHandles::GLCanvas::keyReleaseEvent().
|
protected |
Definition at line 550 of file Canvas.cc.
References canvasMousePressEvent().
Referenced by QtHandles::GLCanvas::mouseDoubleClickEvent().
|
protected |
Definition at line 448 of file Canvas.cc.
References graphics_object::get(), graphics_object::get_ancestor(), octave::interpreter::get_gh_manager(), graphics_object::get_handle(), gh_manager::get_object(), gh_callback_event(), gh_manager::graphics_lock(), octave_value::isempty(), m_handle, m_interpreter, m_mouseAxes, m_mouseCurrent, m_mouseMode, QtHandles::NoMode, QtHandles::pan_mode(), QtHandles::PanMode, axes::properties::pixel2coord(), redraw(), axes::properties::rotate3d(), QtHandles::RotateMode, select_object(), QtHandles::TextMode, QtHandles::qt_graphics_toolkit::toolkitObject(), axes::properties::translate_view(), updateCurrentPoint(), QtHandles::Figure::updateStatusBar(), graphics_object::valid_object(), QtHandles::ZoomInMode, and QtHandles::ZoomOutMode.
Referenced by QtHandles::GLCanvas::mouseMoveEvent().
|
protected |
Definition at line 583 of file Canvas.cc.
References octave_handle::as_octave_value(), QtHandles::autoscale_axes(), QtHandles::button_number(), QtHandles::ContextMenu::executeAt(), QtHandles::Utils::figureSelectionType(), graphics_object::get(), graphics_object::get_ancestor(), octave::interpreter::get_gh_manager(), graphics_object::get_handle(), gh_manager::get_object(), graphics_object::get_parent(), graphics_object::get_properties(), gh_callback_event(), gh_set_event(), gh_manager::graphics_lock(), octave_value::isempty(), m_clickMode, m_handle, m_interpreter, m_mouseAnchor, m_mouseAxes, m_mouseCurrent, m_mouseMode, m_rectMode, QtHandles::Figure::mouseMode(), QtHandles::NoMode, QtHandles::PanMode, redraw(), QtHandles::RotateMode, select_object(), QtHandles::TextMode, QtHandles::qt_graphics_toolkit::toolkitObject(), updateCurrentPoint(), graphics_object::valid_object(), QtHandles::ZoomInMode, and QtHandles::ZoomOutMode.
Referenced by canvasMouseDoubleClickEvent(), and QtHandles::GLCanvas::mousePressEvent().
|
protected |
Definition at line 796 of file Canvas.cc.
References octave_handle::as_octave_value(), octave::interpreter::feval(), graphics_object::get(), graphics_object::get_ancestor(), octave::interpreter::get_gh_manager(), graphics_object::get_handle(), gh_manager::get_object(), annotation_dialog::get_properties(), gh_callback_event(), gh_manager::graphics_lock(), interpreter_event(), m_clickMode, m_handle, m_interpreter, m_mouseAnchor, m_mouseAxes, m_mouseMode, m_octave_qobj, m_rectMode, octave_value::matrix_value(), max(), min(), QtHandles::NoMode, octave_handle::ok(), ovl(), axes::properties::pixel2coord(), octave_value_list::prepend(), qWidget(), redraw(), QtHandles::TextMode, updateCurrentPoint(), graphics_object::valid_object(), Faddeeva::w(), axes::properties::zoom(), axes::properties::zoom_about_point(), QtHandles::zoom_mode(), QtHandles::ZoomInMode, and QtHandles::ZoomOutMode.
Referenced by QtHandles::GLCanvas::mouseReleaseEvent().
|
protected |
Definition at line 276 of file Canvas.cc.
References draw(), drawZoomBox(), octave::interpreter::get_gh_manager(), gh_manager::graphics_lock(), m_handle, m_interpreter, m_mouseAnchor, m_mouseAxes, m_mouseCurrent, m_mouseMode, m_rectMode, m_redrawBlocked, octave_handle::ok(), and QtHandles::ZoomInMode.
Referenced by QtHandles::GLCanvas::paintGL().
|
protected |
|
protected |
|
protected |
Definition at line 906 of file Canvas.cc.
References octave_handle::as_octave_value(), graphics_object::get(), graphics_object::get_ancestor(), base_properties::get_children(), octave::interpreter::get_gh_manager(), graphics_object::get_handle(), gh_manager::get_object(), graphics_object::get_properties(), gh_callback_event(), gh_manager::graphics_lock(), graphics_object::isa(), octave_value::isempty(), m_handle, m_interpreter, QtHandles::Utils::makeScrollEventStruct(), QtHandles::Figure::mouseMode(), QtHandles::NoMode, Array< T >::numel(), axes::properties::pan(), QtHandles::pan_enabled(), QtHandles::pan_mode(), QtHandles::PanMode, redraw(), selectFromAxes(), QtHandles::qt_graphics_toolkit::toolkitObject(), graphics_object::valid_object(), axes::properties::zoom(), QtHandles::zoom_enabled(), QtHandles::zoom_mode(), QtHandles::ZoomInMode, and QtHandles::ZoomOutMode.
Referenced by QtHandles::GLCanvas::wheelEvent().
|
inline |
Definition at line 76 of file Canvas.h.
References m, and m_eventMask.
Referenced by QtHandles::Figure::update().
|
static |
Definition at line 1097 of file Canvas.cc.
Referenced by QtHandles::Container::canvas().
|
protectedpure virtual |
Implemented in QtHandles::GLCanvas.
Referenced by getPixels().
|
protectedpure virtual |
Implemented in QtHandles::GLCanvas.
Referenced by print().
|
protectedpure virtual |
Implemented in QtHandles::GLCanvas.
Referenced by canvasPaintEvent().
|
protectedpure virtual |
Implemented in QtHandles::GLCanvas.
Referenced by canvasPaintEvent().
|
inlinevirtual |
Definition at line 89 of file Canvas.h.
References do_getPixels(), and m_handle.
Referenced by QtHandles::Figure::slotGetPixels().
|
signal |
|
signal |
|
signal |
Referenced by canvasKeyPressEvent(), canvasMousePressEvent(), and updateCurrentPoint().
|
signal |
|
signal |
|
signal |
Referenced by canvasMouseReleaseEvent(), and QtHandles::GLCanvas::do_print().
|
signal |
|
private |
Definition at line 78 of file Canvas.cc.
References octave::base_qobject::get_resource_manager(), octave::resource_manager::icon(), m_octave_qobj, and name.
Referenced by setCursor().
|
inline |
Definition at line 70 of file Canvas.h.
References do_print(), and m_handle.
Referenced by QtHandles::Figure::print().
|
pure virtual |
Implemented in QtHandles::GLCanvas.
Referenced by QtHandles::Container::canvas(), canvasMouseReleaseEvent(), QtHandles::Figure::enableMouseTracking(), redraw(), QtHandles::Container::resizeEvent(), setCursor(), and updateCurrentPoint().
void QtHandles::Canvas::redraw | ( | bool | sync = false | ) |
Definition at line 58 of file Canvas.cc.
References qWidget(), and Faddeeva::w().
Referenced by canvasMouseMoveEvent(), canvasMousePressEvent(), canvasMouseReleaseEvent(), canvasWheelEvent(), QtHandles::ButtonGroup::redraw(), QtHandles::Figure::redraw(), and QtHandles::Panel::redraw().
|
protectedpure virtual |
Implemented in QtHandles::GLCanvas.
|
protected |
Definition at line 340 of file Canvas.cc.
References graphics_object::get(), base_properties::get_all_children(), base_properties::get_boundingbox(), octave::interpreter::get_gh_manager(), gh_manager::get_object(), graphics_object::get_properties(), base_properties::get_xlim(), base_properties::get_ylim(), graphics_object::isa(), m_interpreter, octave_value::matrix_value(), Array< T >::numel(), axes::properties::pixel2coord(), r, selectFromAxes(), and octave_value::string_value().
Referenced by canvasMouseMoveEvent(), and canvasMousePressEvent().
|
protectedpure virtual |
Implemented in QtHandles::GLCanvas.
Referenced by canvasWheelEvent(), and select_object().
void QtHandles::Canvas::setCursor | ( | MouseMode | mode, |
std::string | fallback, | ||
QImage | cdata, | ||
Matrix | hotspot | ||
) |
Definition at line 88 of file Canvas.cc.
References make_cursor(), QtHandles::NoMode, QtHandles::PanMode, qWidget(), QtHandles::RotateMode, QtHandles::SelectMode, QtHandles::TextMode, Faddeeva::w(), QtHandles::ZoomInMode, and QtHandles::ZoomOutMode.
Referenced by QtHandles::Figure::update().
|
inline |
Definition at line 77 of file Canvas.h.
References m, and m_eventMask.
Referenced by QtHandles::Figure::Figure().
|
protected |
Definition at line 221 of file Canvas.cc.
References QtHandles::Utils::figureCurrentPoint(), base_properties::get_children(), octave::interpreter::get_gh_manager(), graphics_object::get_handle(), gh_manager::get_object(), graphics_object::get_properties(), axes::properties::get_transform(), axes::properties::get_transform_zlim(), gh_set_event(), gh_manager::graphics_lock(), graphics_object::isa(), m_interpreter, Array< T >::numel(), qWidget(), graphics_xform::untransform(), and Faddeeva::w().
|
protected |
Definition at line 181 of file Canvas.cc.
References QtHandles::Utils::figureCurrentPoint(), base_properties::get_children(), octave::interpreter::get_gh_manager(), graphics_object::get_handle(), gh_manager::get_object(), graphics_object::get_properties(), axes::properties::get_transform(), axes::properties::get_transform_zlim(), gh_set_event(), gh_manager::graphics_lock(), graphics_object::isa(), m_interpreter, Array< T >::numel(), and graphics_xform::untransform().
Referenced by canvasKeyPressEvent(), canvasMouseMoveEvent(), canvasMousePressEvent(), and canvasMouseReleaseEvent().
|
private |
Definition at line 166 of file Canvas.h.
Referenced by canvasMousePressEvent(), and canvasMouseReleaseEvent().
|
private |
Definition at line 170 of file Canvas.h.
Referenced by addEventMask(), canvasKeyPressEvent(), canvasKeyReleaseEvent(), clearEventMask(), and setEventMask().
|
private |
Definition at line 163 of file Canvas.h.
Referenced by canvasKeyPressEvent(), canvasKeyReleaseEvent(), canvasMouseMoveEvent(), canvasMousePressEvent(), canvasMouseReleaseEvent(), canvasPaintEvent(), canvasWheelEvent(), getPixels(), and print().
|
protected |
Definition at line 157 of file Canvas.h.
Referenced by canvasKeyPressEvent(), canvasKeyReleaseEvent(), canvasMouseMoveEvent(), canvasMousePressEvent(), canvasMouseReleaseEvent(), canvasPaintEvent(), canvasWheelEvent(), QtHandles::GLCanvas::do_getPixels(), QtHandles::GLCanvas::do_print(), QtHandles::GLCanvas::draw(), select_object(), and updateCurrentPoint().
|
private |
Definition at line 167 of file Canvas.h.
Referenced by canvasMousePressEvent(), canvasMouseReleaseEvent(), and canvasPaintEvent().
|
private |
Definition at line 169 of file Canvas.h.
Referenced by canvasMouseMoveEvent(), canvasMousePressEvent(), canvasMouseReleaseEvent(), and canvasPaintEvent().
|
private |
Definition at line 168 of file Canvas.h.
Referenced by canvasMouseMoveEvent(), canvasMousePressEvent(), and canvasPaintEvent().
|
private |
Definition at line 165 of file Canvas.h.
Referenced by canvasMouseMoveEvent(), canvasMousePressEvent(), canvasMouseReleaseEvent(), and canvasPaintEvent().
|
protected |
Definition at line 156 of file Canvas.h.
Referenced by canvasMouseReleaseEvent(), and make_cursor().
|
private |
Definition at line 171 of file Canvas.h.
Referenced by canvasMousePressEvent(), canvasMouseReleaseEvent(), and canvasPaintEvent().
|
private |
Definition at line 164 of file Canvas.h.
Referenced by blockRedraw(), and canvasPaintEvent().