GNU Octave 7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
Figure.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2011-2022 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26#if ! defined (octave_Figure_h)
27#define octave_Figure_h 1
28
29#include <QRect>
30#include <QStatusBar>
31
32#include "GenericEventNotify.h"
33#include "MenuContainer.h"
34#include "Object.h"
35
36class QMainWindow;
37class QToolBar;
38class QScreen;
39
40namespace octave
41{
42 class base_qobject;
43 class interpreter;
44}
45
46namespace octave
47{
48
50 {
58 };
59
60 class Container;
61 class FigureWindow;
62 class MenuBar;
63 class ToolBar;
64
65 class Figure :
66 public Object,
67 public MenuContainer,
69 {
70 Q_OBJECT
71
72 friend class ToolBar;
73
74 public:
75 Figure (octave::base_qobject& oct_qobj, octave::interpreter& interp,
76 const graphics_object& go, FigureWindow *win);
77 ~Figure (void);
78
79 static Figure *
80 create (octave::base_qobject& oct_qobj, octave::interpreter& interp,
81 const graphics_object& go);
82
83 QString fileName (void);
84 void setFileName (const QString& name);
85
86 MouseMode mouseMode (void);
87
89 QWidget * menu (void);
91
92 void do_connections (const QObject *receiver,
93 const QObject *emitter = nullptr);
94
95 bool eventNotifyBefore (QObject *watched, QEvent *event);
96 void eventNotifyAfter (QObject *watched, QEvent *event);
97
98 protected:
100 {
104 };
105
106 protected:
107 void redraw (void);
108 void show (void);
109 void print (const QString& file_cmd, const QString& term);
110 void update (int pId);
111 void updateBoundingBox (bool internal = false, int flags = 0);
112 void beingDeleted (void);
113
114 private:
115 void showFigureStatusBar (bool visible);
116 void addCustomToolBar (QToolBar *bar, bool visible, bool isdefault);
117 void showCustomToolBar (QToolBar *bar, bool visible);
118 void set_geometry (QRect r);
119
120 void enableMouseTracking (void);
121
122 private slots:
123 void updateFigureHeight (int delta_h);
124 void updateContainer (void);
125 void figureWindowShown ();
126 void screenChanged (QScreen *);
127
128 public slots:
130
131 signals:
132 void asyncUpdate (void);
135
136 private:
141 QStatusBar *m_statusBar;
147 };
148
149}
150
151#endif
QToolBar * m_figureToolBar
Definition: Figure.h:139
MouseMode mouseMode(void)
Definition: Figure.cc:224
void print(const QString &file_cmd, const QString &term)
Definition: Figure.cc:321
void showFigureStatusBar(bool visible)
Definition: Figure.cc:541
void figureWindowShown()
Definition: Figure.cc:857
void set_geometry(QRect r)
Definition: Figure.cc:258
void asyncUpdate(void)
void interpreter_event(const octave::meth_callback &meth)
void setFileName(const QString &name)
Definition: Figure.cc:212
void updateBoundingBox(bool internal=false, int flags=0)
Definition: Figure.cc:608
void updateFigureHeight(int delta_h)
Definition: Figure.cc:564
QRect m_innerRect
Definition: Figure.h:142
QString fileName(void)
Definition: Figure.cc:198
void interpreter_event(const octave::fcn_callback &fcn)
static Figure * create(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go)
Definition: Figure.cc:113
QRect m_outerRect
Definition: Figure.h:143
Container * innerContainer(void)
Definition: Figure.cc:283
uint8NDArray slotGetPixels(void)
Definition: Figure.cc:330
bool m_blockUpdates
Definition: Figure.h:138
Container * m_container
Definition: Figure.h:137
void showCustomToolBar(QToolBar *bar, bool visible)
Definition: Figure.cc:827
void redraw(void)
Definition: Figure.cc:289
QWidget * menu(void)
Definition: Figure.cc:602
void updateStatusBar(ColumnVector pt)
Definition: Figure.cc:586
bool m_resizable
Definition: Figure.h:146
QStatusBar * m_statusBar
Definition: Figure.h:141
void addCustomToolBar(QToolBar *bar, bool visible, bool isdefault)
Definition: Figure.cc:800
bool eventNotifyBefore(QObject *watched, QEvent *event)
Definition: Figure.cc:666
void eventNotifyAfter(QObject *watched, QEvent *event)
Definition: Figure.cc:720
int m_previousHeight
Definition: Figure.h:145
void beingDeleted(void)
Definition: Figure.cc:348
~Figure(void)
Definition: Figure.cc:194
void show(void)
Definition: Figure.cc:312
UpdateBoundingBoxFlag
Definition: Figure.h:100
@ UpdateBoundingBoxAll
Definition: Figure.h:103
@ UpdateBoundingBoxSize
Definition: Figure.h:102
@ UpdateBoundingBoxPosition
Definition: Figure.h:101
QImage m_pointer_cdata
Definition: Figure.h:144
MenuBar * m_menuBar
Definition: Figure.h:140
void screenChanged(QScreen *)
Definition: Figure.cc:875
void updateContainer(void)
Definition: Figure.cc:851
void do_connections(const QObject *receiver, const QObject *emitter=nullptr)
Definition: Figure.cc:595
void update(int pId)
Definition: Figure.cc:360
void enableMouseTracking(void)
Definition: Figure.cc:899
Figure(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go, FigureWindow *win)
Definition: Figure.cc:119
Base class for Octave interfaces that use Qt.
OCTAVE_NAMESPACE_BEGIN typedef std::function< void(void)> fcn_callback
Definition: event-manager.h:47
std::function< void(interpreter &)> meth_callback
Definition: event-manager.h:48
QString name
MouseMode
Definition: Figure.h:50
@ PanMode
Definition: Figure.h:55
@ ZoomOutMode
Definition: Figure.h:54
@ RotateMode
Definition: Figure.h:52
@ NoMode
Definition: Figure.h:51
@ TextMode
Definition: Figure.h:57
@ ZoomInMode
Definition: Figure.h:53
@ SelectMode
Definition: Figure.h:56