GNU Octave  6.2.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
QtHandles::Canvas Class Referenceabstract

#include "Canvas.h"

Inheritance diagram for QtHandles::Canvas:
Collaboration diagram for QtHandles::Canvas:

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 QWidgetqWidget (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 Canvascreate (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 &currentObj, 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::interpreterm_interpreter
 
octave::base_qobjectm_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
 

Detailed Description

Definition at line 53 of file Canvas.h.

Member Enumeration Documentation

◆ EventMask

Enumerator
KeyPress 
KeyRelease 

Definition at line 58 of file Canvas.h.

Constructor & Destructor Documentation

◆ ~Canvas()

virtual QtHandles::Canvas::~Canvas ( void  )
virtualdefault

◆ Canvas()

QtHandles::Canvas::Canvas ( octave::base_qobject oct_qobj,
octave::interpreter interp,
const graphics_handle handle 
)
inlineprotected

Definition at line 121 of file Canvas.h.

Member Function Documentation

◆ addEventMask()

void QtHandles::Canvas::addEventMask ( int  m)
inline

Definition at line 75 of file Canvas.h.

References m, and m_eventMask.

Referenced by QtHandles::Panel::Panel(), and QtHandles::Figure::update().

◆ blockRedraw()

void QtHandles::Canvas::blockRedraw ( bool  block = true)

Definition at line 72 of file Canvas.cc.

References m_redrawBlocked.

Referenced by QtHandles::Figure::beingDeleted().

◆ canvasAutoAxes()

void QtHandles::Canvas::canvasAutoAxes ( const graphics_handle handle)
protected

◆ canvasKeyPressEvent()

◆ canvasKeyReleaseEvent()

◆ canvasMouseDoubleClickEvent()

void QtHandles::Canvas::canvasMouseDoubleClickEvent ( QMouseEvent *  event)
protected

Definition at line 550 of file Canvas.cc.

References canvasMousePressEvent().

Referenced by QtHandles::GLCanvas::mouseDoubleClickEvent().

◆ canvasMouseMoveEvent()

◆ canvasMousePressEvent()

◆ canvasMouseReleaseEvent()

◆ canvasPaintEvent()

◆ canvasToggleAxes()

void QtHandles::Canvas::canvasToggleAxes ( const graphics_handle handle)
protected

◆ canvasToggleGrid()

void QtHandles::Canvas::canvasToggleGrid ( const graphics_handle handle)
protected

◆ canvasWheelEvent()

◆ clearEventMask()

void QtHandles::Canvas::clearEventMask ( int  m)
inline

Definition at line 76 of file Canvas.h.

References m, and m_eventMask.

Referenced by QtHandles::Figure::update().

◆ create()

Canvas * QtHandles::Canvas::create ( octave::base_qobject oct_qobj,
octave::interpreter interp,
const graphics_handle handle,
QWidget parent,
const std::string &  name 
)
static

Definition at line 1097 of file Canvas.cc.

Referenced by QtHandles::Container::canvas().

◆ do_getPixels()

virtual uint8NDArray QtHandles::Canvas::do_getPixels ( const graphics_handle handle)
protectedpure virtual

Implemented in QtHandles::GLCanvas.

Referenced by getPixels().

◆ do_print()

virtual void QtHandles::Canvas::do_print ( const QString &  file_cmd,
const QString &  term,
const graphics_handle handle 
)
protectedpure virtual

Implemented in QtHandles::GLCanvas.

Referenced by print().

◆ draw()

virtual void QtHandles::Canvas::draw ( const graphics_handle handle)
protectedpure virtual

Implemented in QtHandles::GLCanvas.

Referenced by canvasPaintEvent().

◆ drawZoomBox()

virtual void QtHandles::Canvas::drawZoomBox ( const QPoint &  p1,
const QPoint &  p2 
)
protectedpure virtual

Implemented in QtHandles::GLCanvas.

Referenced by canvasPaintEvent().

◆ getPixels()

virtual uint8NDArray QtHandles::Canvas::getPixels ( void  )
inlinevirtual

Definition at line 89 of file Canvas.h.

References do_getPixels(), and m_handle.

Referenced by QtHandles::Figure::slotGetPixels().

◆ gh_callback_event [1/2]

void QtHandles::Canvas::gh_callback_event ( const graphics_handle h,
const std::string &  name 
)
signal

◆ gh_callback_event [2/2]

void QtHandles::Canvas::gh_callback_event ( const graphics_handle h,
const std::string &  name,
const octave_value data 
)
signal

◆ gh_set_event [1/3]

void QtHandles::Canvas::gh_set_event ( const graphics_handle h,
const std::string &  name,
const octave_value value 
)
signal

◆ gh_set_event [2/3]

void QtHandles::Canvas::gh_set_event ( const graphics_handle h,
const std::string &  name,
const octave_value value,
bool  notify_toolkit 
)
signal

◆ gh_set_event [3/3]

void QtHandles::Canvas::gh_set_event ( const graphics_handle h,
const std::string &  name,
const octave_value value,
bool  notify_toolkit,
bool  redraw_figure 
)
signal

◆ interpreter_event [1/2]

void QtHandles::Canvas::interpreter_event ( const octave::fcn_callback fcn)
signal

◆ interpreter_event [2/2]

void QtHandles::Canvas::interpreter_event ( const octave::meth_callback meth)
signal

◆ make_cursor()

QCursor QtHandles::Canvas::make_cursor ( const QString &  name,
int  hot_x = -1,
int  hot_y = -1 
)
private

◆ print()

void QtHandles::Canvas::print ( const QString &  file_cmd,
const QString &  term 
)
inline

Definition at line 70 of file Canvas.h.

References do_print(), and m_handle.

Referenced by QtHandles::Figure::print().

◆ qWidget()

◆ redraw()

◆ resize()

virtual void QtHandles::Canvas::resize ( int  x,
int  y,
int  width,
int  height 
)
protectedpure virtual

Implemented in QtHandles::GLCanvas.

◆ select_object()

◆ selectFromAxes()

virtual graphics_object QtHandles::Canvas::selectFromAxes ( const graphics_object ax,
const QPoint &  pt 
)
protectedpure virtual

Implemented in QtHandles::GLCanvas.

Referenced by canvasWheelEvent(), and select_object().

◆ setCursor()

void QtHandles::Canvas::setCursor ( MouseMode  mode,
std::string  fallback,
QImage  cdata,
Matrix  hotspot 
)

◆ setEventMask()

void QtHandles::Canvas::setEventMask ( int  m)
inline

Definition at line 77 of file Canvas.h.

References m, and m_eventMask.

Referenced by QtHandles::Figure::Figure().

◆ updateCurrentPoint() [1/2]

◆ updateCurrentPoint() [2/2]

Member Data Documentation

◆ m_clickMode

bool QtHandles::Canvas::m_clickMode
private

Definition at line 166 of file Canvas.h.

Referenced by canvasMousePressEvent(), and canvasMouseReleaseEvent().

◆ m_eventMask

int QtHandles::Canvas::m_eventMask
private

◆ m_handle

◆ m_interpreter

◆ m_mouseAnchor

QPoint QtHandles::Canvas::m_mouseAnchor
private

Definition at line 167 of file Canvas.h.

Referenced by canvasMousePressEvent(), canvasMouseReleaseEvent(), and canvasPaintEvent().

◆ m_mouseAxes

graphics_handle QtHandles::Canvas::m_mouseAxes
private

◆ m_mouseCurrent

QPoint QtHandles::Canvas::m_mouseCurrent
private

Definition at line 168 of file Canvas.h.

Referenced by canvasMouseMoveEvent(), canvasMousePressEvent(), and canvasPaintEvent().

◆ m_mouseMode

MouseMode QtHandles::Canvas::m_mouseMode
private

◆ m_octave_qobj

octave::base_qobject& QtHandles::Canvas::m_octave_qobj
protected

Definition at line 156 of file Canvas.h.

Referenced by canvasMouseReleaseEvent(), and make_cursor().

◆ m_rectMode

bool QtHandles::Canvas::m_rectMode
private

Definition at line 171 of file Canvas.h.

Referenced by canvasMousePressEvent(), canvasMouseReleaseEvent(), and canvasPaintEvent().

◆ m_redrawBlocked

bool QtHandles::Canvas::m_redrawBlocked
private

Definition at line 164 of file Canvas.h.

Referenced by blockRedraw(), and canvasPaintEvent().


The documentation for this class was generated from the following files: