26 #if defined (HAVE_CONFIG_H)
40 #if defined (HAVE_QOPENGLWIDGET)
41 # define OCTAVE_QT_OPENGL_WIDGET_FORMAT_ARGS
43 # if defined (Q_OS_WIN32)
44 # define OCTAVE_QT_OPENGL_WIDGET_FORMAT_ARGS \
45 QGLFormat (QGL::SampleBuffers | QGL::AlphaChannel \
46 | QGL::IndirectRendering),
48 # define OCTAVE_QT_OPENGL_WIDGET_FORMAT_ARGS \
49 QGLFormat (QGL::SampleBuffers | QGL::AlphaChannel),
57 Canvas (oct_qobj, interp, gh), m_glfcns (), m_renderer (m_glfcns)
59 setFocusPolicy (Qt::ClickFocus);
100 if (go && go.
isa (
"figure"))
119 OCTAVE_QT_OPENGL_FBO::Attachment::Depth);
160 error (
"print: no valid OpenGL offscreen context");
166 term.toStdString ());
178 OCTAVE_QT_OPENGL_FBO::Attachment::Depth);
183 term.toStdString ());
188 catch (octave::execution_exception& ee)
213 return s.
select (ax, pt.x (), height () - pt.y (),
223 Matrix overlaycolor (3, 1);
224 overlaycolor(0) = 0.45;
225 overlaycolor(1) = 0.62;
226 overlaycolor(2) = 0.81;
227 double overlayalpha = 0.1;
228 Matrix bordercolor = overlaycolor;
229 double borderalpha = 0.9;
230 double borderwidth = 1.5;
233 p1.x (), p1.y (), p2.x (), p2.y (),
234 overlaycolor, overlayalpha,
235 bordercolor, borderalpha, borderwidth);
278 OCTAVE_QT_OPENGL_WIDGET::keyPressEvent (xevent);
285 OCTAVE_QT_OPENGL_WIDGET::keyReleaseEvent (xevent);
295 # if defined (HAVE_QT_OFFSCREEN)
296 static bool os_ctx_ok =
true;
297 if (os_ctx_ok && ! m_os_context.isValid ())
300 m_os_surface.create ();
301 if (! m_os_context.create ())
308 retval = m_os_context.makeCurrent (&m_os_surface);
#define OCTAVE_QT_OPENGL_WIDGET_FORMAT_ARGS
void canvasMousePressEvent(QMouseEvent *event)
bool canvasKeyReleaseEvent(QKeyEvent *event)
void canvasMouseReleaseEvent(QMouseEvent *event)
bool canvasKeyPressEvent(QKeyEvent *event)
void canvasMouseDoubleClickEvent(QMouseEvent *event)
void canvasPaintEvent(void)
octave::interpreter & m_interpreter
void canvasMouseMoveEvent(QMouseEvent *event)
void canvasWheelEvent(QWheelEvent *event)
void interpreter_event(const octave::fcn_callback &fcn)
void do_print(const QString &file_cmd, const QString &term, const graphics_handle &handle)
void drawZoomBox(const QPoint &p1, const QPoint &p2)
bool begin_rendering(void)
octave::qopengl_functions m_glfcns
void wheelEvent(QWheelEvent *event)
void keyPressEvent(QKeyEvent *event)
void mouseMoveEvent(QMouseEvent *event)
void draw(const graphics_handle &handle)
uint8NDArray do_getPixels(const graphics_handle &handle)
void mousePressEvent(QMouseEvent *event)
octave::opengl_renderer m_renderer
graphics_object selectFromAxes(const graphics_object &ax, const QPoint &pt)
void mouseDoubleClickEvent(QMouseEvent *event)
void keyReleaseEvent(QKeyEvent *event)
GLCanvas(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_handle &handle, QWidget *parent)
void mouseReleaseEvent(QMouseEvent *event)
graphics_object get_object(double val) const
octave::mutex graphics_lock(void)
octave_value get(bool all=false) const
graphics_object get_ancestor(const std::string &type) const
bool isa(const std::string &go_name) const
bool valid_object(void) const
Base class for Octave interfaces that use Qt.
gh_manager & get_gh_manager(void)
virtual void draw(const graphics_object &go, bool toplevel=true)
virtual uint8NDArray get_pixels(int width, int height)
virtual void set_viewport(int w, int h)
virtual void set_device_pixel_ratio(double dpr)
virtual void draw_zoom_box(int width, int height, int x1, int y1, int x2, int y2, const Matrix &overlaycolor, double overlayalpha, const Matrix &bordercolor, double borderalpha, double borderwidth)
graphics_object select(const graphics_object &ax, int x, int y, int flags=0)
std::string string_value(bool force=false) const
Matrix matrix_value(bool frc_str_conv=false) const
double double_value(bool frc_str_conv=false) const
void error(const char *fmt,...)
void gl2ps_print(opengl_functions &glfcns, const graphics_object &fig, const std::string &stream, const std::string &term)
octave_value::octave_value(const Array< char > &chm, char type) return retval