23 #if defined (HAVE_CONFIG_H) 37 #if defined (HAVE_QOPENGLWIDGET) 38 # define OCTAVE_QT_OPENGL_WIDGET_FORMAT_ARGS 40 # if defined (Q_OS_WIN32) 41 # define OCTAVE_QT_OPENGL_WIDGET_FORMAT_ARGS \ 42 QGLFormat (QGL::SampleBuffers | QGL::AlphaChannel \ 43 | QGL::IndirectRendering), 45 # define OCTAVE_QT_OPENGL_WIDGET_FORMAT_ARGS \ 46 QGLFormat (QGL::SampleBuffers | QGL::AlphaChannel), 54 setFocusPolicy (Qt::ClickFocus);
82 if (go && go.
isa (
"figure"))
97 fbo (pos(2), pos(3),OCTAVE_QT_OPENGL_FBO::Attachment::Depth);
136 error (
"print: no valid OpenGL offscreen context");
139 term.toStdString ());
141 catch (octave::execution_exception&
e)
176 s.set_viewport (width (), height ());
177 return s.select (ax, pt.x (), height () - pt.y (),
187 glVertex2d (p1.x (), p1.y ());
188 glVertex2d (p2.x (), p1.y ());
189 glVertex2d (p2.x (), p2.y ());
190 glVertex2d (p1.x (), p2.y ());
191 glVertex2d (p1.x (), p1.y ());
197 glMatrixMode (GL_MODELVIEW);
201 glMatrixMode (GL_PROJECTION);
204 glOrtho (0, width (), height (), 0, 1, -1);
206 glPushAttrib (GL_DEPTH_BUFFER_BIT | GL_CURRENT_BIT);
207 glDisable (GL_DEPTH_TEST);
209 glBegin (GL_POLYGON);
210 glColor4f (0.45, 0.62, 0.81, 0.1);
215 glBegin (GL_LINE_STRIP);
216 glColor4f (0.45, 0.62, 0.81, 0.9);
222 glMatrixMode (GL_MODELVIEW);
225 glMatrixMode (GL_PROJECTION);
269 OCTAVE_QT_OPENGL_WIDGET::keyPressEvent (xevent);
276 OCTAVE_QT_OPENGL_WIDGET::keyReleaseEvent (xevent);
286 # if defined (HAVE_QT_OFFSCREEN) 287 static bool os_ctx_ok =
true;
288 if (os_ctx_ok && ! m_os_context.isValid ())
291 m_os_surface.create ();
292 if (! m_os_context.create ())
299 retval = m_os_context.makeCurrent (&m_os_surface);
void autoAxes(const graphics_handle &handle)
std::string string_value(bool force=false) const
static void post_exception(const std::exception_ptr &p)
void mouseDoubleClickEvent(QMouseEvent *event)
graphics_object selectFromAxes(const graphics_object &ax, const QPoint &pt)
virtual void draw(const graphics_object &go, bool toplevel=true)
GLCanvas(QWidget *parent, const graphics_handle &handle)
void error(const char *fmt,...)
void wheelEvent(QWheelEvent *event)
void mouseMoveEvent(QMouseEvent *event)
void canvasToggleGrid(const graphics_handle &handle)
void canvasMouseDoubleClickEvent(QMouseEvent *event)
bool begin_rendering(void)
bool isa(const std::string &go_name) const
void draw(const graphics_handle &handle)
void keyReleaseEvent(QKeyEvent *event)
void toggleAxes(const graphics_handle &handle)
void canvasToggleAxes(const graphics_handle &handle)
void glDrawZoomBox(const QPoint &p1, const QPoint &p2)
bool valid_object(void) const
void canvasMousePressEvent(QMouseEvent *event)
void canvasWheelEvent(QWheelEvent *event)
bool canvasKeyPressEvent(QKeyEvent *event)
void canvasMouseMoveEvent(QMouseEvent *event)
octave_value get(bool all=false) const
void canvasAutoAxes(const graphics_handle &handle)
void gl2ps_print(const graphics_object &fig, const std::string &stream, const std::string &term)
uint8NDArray do_getPixels(const graphics_handle &handle)
void canvasPaintEvent(void)
virtual uint8NDArray get_pixels(int width, int height)
virtual void set_viewport(int w, int h)
void canvasMouseReleaseEvent(QMouseEvent *event)
bool canvasKeyReleaseEvent(QKeyEvent *event)
void toggleGrid(const graphics_handle &handle)
#define OCTAVE_QT_OPENGL_WIDGET_FORMAT_ARGS
void mousePressEvent(QMouseEvent *event)
void drawZoomBox(const QPoint &p1, const QPoint &p2)
static graphics_object get_object(double val)
void mouseReleaseEvent(QMouseEvent *event)
graphics_object get_ancestor(const std::string &type) const
void keyPressEvent(QKeyEvent *event)
Matrix matrix_value(bool frc_str_conv=false) const
void do_print(const QString &file_cmd, const QString &term, const graphics_handle &handle)