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

#include "GLCanvas.h"

Inheritance diagram for GLCanvas:
Collaboration diagram for GLCanvas:

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

 GLCanvas (octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_handle &handle, QWidget *parent)
 
 ~GLCanvas (void)
 
void addEventMask (int m)
 
void blockRedraw (bool block=true)
 
void clearEventMask (int m)
 
uint8NDArray do_getPixels (const graphics_handle &handle)
 
void do_print (const QString &file_cmd, const QString &term, const graphics_handle &handle)
 
void draw (const graphics_handle &handle)
 
void drawZoomBox (const QPoint &p1, const QPoint &p2)
 
virtual uint8NDArray getPixels (void)
 
void initializeGL (void)
 
void print (const QString &file_cmd, const QString &term)
 
QWidgetqWidget (void)
 
void redraw (bool sync=false)
 
void resize (int, int, int, int)
 
graphics_object selectFromAxes (const graphics_object &ax, const QPoint &pt)
 
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

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)
 
void keyPressEvent (QKeyEvent *event)
 
void keyReleaseEvent (QKeyEvent *event)
 
void mouseDoubleClickEvent (QMouseEvent *event)
 
void mouseMoveEvent (QMouseEvent *event)
 
void mousePressEvent (QMouseEvent *event)
 
void mouseReleaseEvent (QMouseEvent *event)
 
void paintGL (void)
 
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 >())
 
void updateCurrentPoint (const graphics_object &fig, const graphics_object &obj)
 
void updateCurrentPoint (const graphics_object &fig, const graphics_object &obj, QMouseEvent *event)
 
void wheelEvent (QWheelEvent *event)
 

Protected Attributes

octave::interpreter & m_interpreter
 
octave::base_qobject & m_octave_qobj
 

Private Member Functions

bool begin_rendering (void)
 
void end_rendering (void)
 
QCursor make_cursor (const QString &name, int hot_x=-1, int hot_y=-1)
 

Private Attributes

bool m_clickMode
 
int m_eventMask
 
octave::qopengl_functions m_glfcns
 
graphics_handle m_handle
 
QPoint m_mouseAnchor
 
graphics_handle m_mouseAxes
 
QPoint m_mouseCurrent
 
MouseMode m_mouseMode
 
bool m_rectMode
 
bool m_redrawBlocked
 
octave::opengl_renderer m_renderer
 

Detailed Description

Definition at line 59 of file GLCanvas.h.

Member Enumeration Documentation

◆ EventMask

enum Canvas::EventMask
inherited
Enumerator
KeyPress 
KeyRelease 

Definition at line 54 of file Canvas.h.

Constructor & Destructor Documentation

◆ GLCanvas()

GLCanvas::GLCanvas ( octave::base_qobject &  oct_qobj,
octave::interpreter &  interp,
const graphics_handle handle,
QWidget parent 
)

Definition at line 53 of file GLCanvas.cc.

◆ ~GLCanvas()

GLCanvas::~GLCanvas ( void  )

Definition at line 63 of file GLCanvas.cc.

Member Function Documentation

◆ addEventMask()

void Canvas::addEventMask ( int  m)
inlineinherited

Definition at line 71 of file Canvas.h.

References m, and Canvas::m_eventMask.

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

◆ begin_rendering()

bool GLCanvas::begin_rendering ( void  )
private

Definition at line 288 of file GLCanvas.cc.

Referenced by do_getPixels(), and do_print().

◆ blockRedraw()

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

Definition at line 71 of file Canvas.cc.

References Canvas::m_redrawBlocked.

Referenced by Figure::beingDeleted().

◆ canvasAutoAxes()

void Canvas::canvasAutoAxes ( const graphics_handle handle)
protectedinherited

◆ canvasKeyPressEvent()

◆ canvasKeyReleaseEvent()

bool Canvas::canvasKeyReleaseEvent ( QKeyEvent *  event)
protectedinherited

◆ canvasMouseDoubleClickEvent()

void Canvas::canvasMouseDoubleClickEvent ( QMouseEvent *  event)
protectedinherited

Definition at line 541 of file Canvas.cc.

References Canvas::canvasMousePressEvent().

Referenced by mouseDoubleClickEvent().

◆ canvasMouseMoveEvent()

◆ canvasMousePressEvent()

◆ canvasMouseReleaseEvent()

◆ canvasPaintEvent()

◆ canvasToggleAxes()

void Canvas::canvasToggleAxes ( const graphics_handle handle)
protectedinherited

◆ canvasToggleGrid()

void Canvas::canvasToggleGrid ( const graphics_handle handle)
protectedinherited

◆ canvasWheelEvent()

◆ clearEventMask()

void Canvas::clearEventMask ( int  m)
inlineinherited

Definition at line 72 of file Canvas.h.

References m, and Canvas::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 
)
staticinherited

Definition at line 1088 of file Canvas.cc.

Referenced by Container::canvas().

◆ do_getPixels()

uint8NDArray GLCanvas::do_getPixels ( const graphics_handle handle)
virtual

Implements Canvas.

Definition at line 92 of file GLCanvas.cc.

References begin_rendering(), end_rendering(), Canvas::m_interpreter, and m_renderer.

◆ do_print()

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

◆ draw()

void GLCanvas::draw ( const graphics_handle handle)
virtual

Implements Canvas.

Definition at line 73 of file GLCanvas.cc.

References Canvas::m_interpreter, and m_renderer.

◆ drawZoomBox()

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

Implements Canvas.

Definition at line 220 of file GLCanvas.cc.

References m_renderer.

◆ end_rendering()

void GLCanvas::end_rendering ( void  )
private

Definition at line 319 of file GLCanvas.cc.

Referenced by do_getPixels(), and do_print().

◆ getPixels()

virtual uint8NDArray Canvas::getPixels ( void  )
inlinevirtualinherited

Definition at line 85 of file Canvas.h.

References Canvas::do_getPixels(), and Canvas::m_handle.

Referenced by Figure::slotGetPixels().

◆ gh_callback_event [1/2]

◆ gh_callback_event [2/2]

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

◆ gh_set_event [1/3]

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

◆ 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 
)
signalinherited

◆ 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 
)
signalinherited

◆ initializeGL()

void GLCanvas::initializeGL ( void  )

Definition at line 67 of file GLCanvas.cc.

References m_glfcns.

◆ interpreter_event [1/2]

void Canvas::interpreter_event ( const octave::fcn_callback fcn)
signalinherited

◆ interpreter_event [2/2]

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

◆ keyPressEvent()

void GLCanvas::keyPressEvent ( QKeyEvent *  event)
protected

Definition at line 274 of file GLCanvas.cc.

References Canvas::canvasKeyPressEvent().

◆ keyReleaseEvent()

void GLCanvas::keyReleaseEvent ( QKeyEvent *  event)
protected

Definition at line 281 of file GLCanvas.cc.

References Canvas::canvasKeyReleaseEvent().

◆ make_cursor()

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

Definition at line 77 of file Canvas.cc.

References Canvas::m_octave_qobj.

Referenced by Canvas::setCursor().

◆ mouseDoubleClickEvent()

void GLCanvas::mouseDoubleClickEvent ( QMouseEvent *  event)
protected

Definition at line 244 of file GLCanvas.cc.

References Canvas::canvasMouseDoubleClickEvent().

◆ mouseMoveEvent()

void GLCanvas::mouseMoveEvent ( QMouseEvent *  event)
protected

Definition at line 250 of file GLCanvas.cc.

References Canvas::canvasMouseMoveEvent().

◆ mousePressEvent()

void GLCanvas::mousePressEvent ( QMouseEvent *  event)
protected

Definition at line 256 of file GLCanvas.cc.

References Canvas::canvasMousePressEvent().

◆ mouseReleaseEvent()

void GLCanvas::mouseReleaseEvent ( QMouseEvent *  event)
protected

Definition at line 262 of file GLCanvas.cc.

References Canvas::canvasMouseReleaseEvent().

◆ paintGL()

void GLCanvas::paintGL ( void  )
protected

Definition at line 238 of file GLCanvas.cc.

References Canvas::canvasPaintEvent().

◆ print()

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

Definition at line 66 of file Canvas.h.

References Canvas::do_print(), and Canvas::m_handle.

Referenced by Figure::print().

◆ qWidget()

QWidget* GLCanvas::qWidget ( void  )
inlinevirtual

Implements Canvas.

Definition at line 77 of file GLCanvas.h.

◆ redraw()

◆ resize()

void GLCanvas::resize ( int  ,
int  ,
int  ,
int   
)
inlinevirtual

Implements Canvas.

Definition at line 73 of file GLCanvas.h.

◆ 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> () 
)
protectedinherited

◆ selectFromAxes()

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

Implements Canvas.

Definition at line 203 of file GLCanvas.cc.

References m_glfcns, and select_ignore_hittest.

◆ setCursor()

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

◆ setEventMask()

void Canvas::setEventMask ( int  m)
inlineinherited

Definition at line 73 of file Canvas.h.

References m, and Canvas::m_eventMask.

Referenced by Figure::Figure().

◆ updateCurrentPoint() [1/2]

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

◆ updateCurrentPoint() [2/2]

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

◆ wheelEvent()

void GLCanvas::wheelEvent ( QWheelEvent *  event)
protected

Definition at line 268 of file GLCanvas.cc.

References Canvas::canvasWheelEvent().

Member Data Documentation

◆ m_clickMode

bool Canvas::m_clickMode
privateinherited

Definition at line 162 of file Canvas.h.

Referenced by Canvas::canvasMousePressEvent(), and Canvas::canvasMouseReleaseEvent().

◆ m_eventMask

int Canvas::m_eventMask
privateinherited

◆ m_glfcns

octave::qopengl_functions GLCanvas::m_glfcns
private

Definition at line 94 of file GLCanvas.h.

Referenced by do_print(), initializeGL(), and selectFromAxes().

◆ m_handle

◆ m_interpreter

◆ m_mouseAnchor

QPoint Canvas::m_mouseAnchor
privateinherited

◆ m_mouseAxes

◆ m_mouseCurrent

QPoint Canvas::m_mouseCurrent
privateinherited

◆ m_mouseMode

MouseMode Canvas::m_mouseMode
privateinherited

◆ m_octave_qobj

octave::base_qobject& Canvas::m_octave_qobj
protectedinherited

Definition at line 152 of file Canvas.h.

Referenced by Canvas::canvasMouseReleaseEvent(), and Canvas::make_cursor().

◆ m_rectMode

bool Canvas::m_rectMode
privateinherited

◆ m_redrawBlocked

bool Canvas::m_redrawBlocked
privateinherited

Definition at line 160 of file Canvas.h.

Referenced by Canvas::blockRedraw(), and Canvas::canvasPaintEvent().

◆ m_renderer

octave::opengl_renderer GLCanvas::m_renderer
private

Definition at line 95 of file GLCanvas.h.

Referenced by do_getPixels(), draw(), and drawZoomBox().


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