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

#include "Canvas.h"

Inheritance diagram for Canvas:
Collaboration diagram for 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::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
 

Detailed Description

Definition at line 49 of file Canvas.h.

Member Enumeration Documentation

◆ EventMask

Enumerator
KeyPress 
KeyRelease 

Definition at line 54 of file Canvas.h.

Constructor & Destructor Documentation

◆ ~Canvas()

virtual Canvas::~Canvas ( void  )
virtualdefault

◆ Canvas()

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

Definition at line 117 of file Canvas.h.

Member Function Documentation

◆ addEventMask()

void Canvas::addEventMask ( int  m)
inline

Definition at line 71 of file Canvas.h.

References m, and m_eventMask.

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

◆ blockRedraw()

void Canvas::blockRedraw ( bool  block = true)

Definition at line 71 of file Canvas.cc.

References m_redrawBlocked.

Referenced by Figure::beingDeleted().

◆ canvasAutoAxes()

void Canvas::canvasAutoAxes ( const graphics_handle handle)
protected

◆ canvasKeyPressEvent()

bool Canvas::canvasKeyPressEvent ( QKeyEvent *  event)
protected

◆ canvasKeyReleaseEvent()

bool Canvas::canvasKeyReleaseEvent ( QKeyEvent *  event)
protected

◆ canvasMouseDoubleClickEvent()

void Canvas::canvasMouseDoubleClickEvent ( QMouseEvent *  event)
protected

Definition at line 541 of file Canvas.cc.

References canvasMousePressEvent().

Referenced by GLCanvas::mouseDoubleClickEvent().

◆ canvasMouseMoveEvent()

◆ canvasMousePressEvent()

◆ canvasMouseReleaseEvent()

◆ canvasPaintEvent()

void Canvas::canvasPaintEvent ( void  )
protected

◆ canvasToggleAxes()

void Canvas::canvasToggleAxes ( const graphics_handle handle)
protected

◆ canvasToggleGrid()

void Canvas::canvasToggleGrid ( const graphics_handle handle)
protected

◆ canvasWheelEvent()

◆ clearEventMask()

void Canvas::clearEventMask ( int  m)
inline

Definition at line 72 of file Canvas.h.

References m, and m_eventMask.

Referenced by Figure::update().

◆ create()

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

Definition at line 1088 of file Canvas.cc.

Referenced by Container::canvas().

◆ do_getPixels()

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

Implemented in GLCanvas.

Referenced by getPixels().

◆ do_print()

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

Implemented in GLCanvas.

Referenced by print().

◆ draw()

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

Implemented in GLCanvas.

Referenced by canvasPaintEvent().

◆ drawZoomBox()

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

Implemented in GLCanvas.

Referenced by canvasPaintEvent().

◆ getPixels()

virtual uint8NDArray Canvas::getPixels ( void  )
inlinevirtual

Definition at line 85 of file Canvas.h.

References do_getPixels(), and m_handle.

Referenced by Figure::slotGetPixels().

◆ gh_callback_event [1/2]

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

◆ gh_callback_event [2/2]

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

◆ gh_set_event [1/3]

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

◆ gh_set_event [2/3]

void 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 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 Canvas::interpreter_event ( const octave::fcn_callback fcn)
signal

◆ interpreter_event [2/2]

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

◆ make_cursor()

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

Definition at line 77 of file Canvas.cc.

References m_octave_qobj.

Referenced by setCursor().

◆ print()

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

Definition at line 66 of file Canvas.h.

References do_print(), and m_handle.

Referenced by Figure::print().

◆ qWidget()

◆ redraw()

void Canvas::redraw ( bool  sync = false)

◆ resize()

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

Implemented in GLCanvas.

◆ select_object()

void Canvas::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> () 
)
protected

◆ selectFromAxes()

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

Implemented in GLCanvas.

Referenced by canvasWheelEvent(), and select_object().

◆ setCursor()

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

◆ setEventMask()

void Canvas::setEventMask ( int  m)
inline

Definition at line 73 of file Canvas.h.

References m, and m_eventMask.

Referenced by Figure::Figure().

◆ updateCurrentPoint() [1/2]

void Canvas::updateCurrentPoint ( const graphics_object &  fig,
const graphics_object &  obj 
)
protected

◆ updateCurrentPoint() [2/2]

void Canvas::updateCurrentPoint ( const graphics_object &  fig,
const graphics_object &  obj,
QMouseEvent *  event 
)
protected

Member Data Documentation

◆ m_clickMode

bool Canvas::m_clickMode
private

Definition at line 162 of file Canvas.h.

Referenced by canvasMousePressEvent(), and canvasMouseReleaseEvent().

◆ m_eventMask

int Canvas::m_eventMask
private

◆ m_handle

◆ m_interpreter

◆ m_mouseAnchor

QPoint Canvas::m_mouseAnchor
private

Definition at line 163 of file Canvas.h.

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

◆ m_mouseAxes

graphics_handle Canvas::m_mouseAxes
private

◆ m_mouseCurrent

QPoint Canvas::m_mouseCurrent
private

Definition at line 164 of file Canvas.h.

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

◆ m_mouseMode

MouseMode Canvas::m_mouseMode
private

◆ m_octave_qobj

octave::base_qobject& Canvas::m_octave_qobj
protected

Definition at line 152 of file Canvas.h.

Referenced by canvasMouseReleaseEvent(), and make_cursor().

◆ m_rectMode

bool Canvas::m_rectMode
private

Definition at line 167 of file Canvas.h.

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

◆ m_redrawBlocked

bool Canvas::m_redrawBlocked
private

Definition at line 160 of file Canvas.h.

Referenced by blockRedraw(), and canvasPaintEvent().


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