GNU Octave  8.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-2023 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 
36 class QMainWindow;
37 class QToolBar;
38 class QScreen;
39 
41 
42 class base_qobject;
43 class interpreter;
44 
46  {
53  TextMode
54  };
55 
56 class Container;
57 class FigureWindow;
58 class MenuBar;
59 class ToolBar;
60 
61 class Figure :
62  public Object,
63  public MenuContainer,
65 {
66  Q_OBJECT
67 
68  friend class ToolBar;
69 
70 public:
71  Figure (octave::base_qobject& oct_qobj, octave::interpreter& interp,
72  const graphics_object& go, FigureWindow *win);
73  ~Figure (void);
74 
75  static Figure *
76  create (octave::base_qobject& oct_qobj, octave::interpreter& interp,
77  const graphics_object& go);
78 
79  QString fileName (void);
80  void setFileName (const QString& name);
81 
82  MouseMode mouseMode (void);
83 
84  Container * innerContainer (void);
85  QWidget * menu (void);
86  void updateStatusBar (ColumnVector pt);
87 
88  void do_connections (const QObject *receiver,
89  const QObject *emitter = nullptr);
90 
91  bool eventNotifyBefore (QObject *watched, QEvent *event);
92  void eventNotifyAfter (QObject *watched, QEvent *event);
93 
94 protected:
96  {
100  };
101 
102 protected:
103  void redraw (void);
104  void show (void);
105  void print (const QString& file_cmd, const QString& term);
106  void update (int pId);
107  void updateBoundingBox (bool internal = false, int flags = 0);
108  void beingDeleted (void);
109 
110 private:
111  void showFigureStatusBar (bool visible);
112  void addCustomToolBar (QToolBar *bar, bool visible, bool isdefault);
113  void showCustomToolBar (QToolBar *bar, bool visible);
114  void set_geometry (QRect r);
115 
116  void enableMouseTracking (void);
117 
118 private slots:
119  void updateFigureHeight (int delta_h);
120  void updateContainer (void);
121  void figureWindowShown ();
122  void screenChanged (QScreen *);
123 
124 public slots:
126 
127 signals:
128  void asyncUpdate (void);
131 
132 private:
135  QToolBar *m_figureToolBar;
137  QStatusBar *m_statusBar;
138  QRect m_innerRect;
139  QRect m_outerRect;
143 };
144 
146 
147 #endif
OCTAVE_END_NAMESPACE(octave)
MouseMode
Definition: Figure.h:46
@ TextMode
Definition: Figure.h:53
@ PanMode
Definition: Figure.h:51
@ NoMode
Definition: Figure.h:47
@ SelectMode
Definition: Figure.h:52
@ RotateMode
Definition: Figure.h:48
@ ZoomOutMode
Definition: Figure.h:50
@ ZoomInMode
Definition: Figure.h:49
Definition: Figure.h:65
static Figure * create(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go)
Definition: Figure.cc:112
void eventNotifyAfter(QObject *watched, QEvent *event)
Definition: Figure.cc:718
void setFileName(const QString &name)
Definition: Figure.cc:210
uint8NDArray slotGetPixels(void)
Definition: Figure.cc:328
int m_previousHeight
Definition: Figure.h:141
void show(void)
Definition: Figure.cc:310
~Figure(void)
Definition: Figure.cc:192
QRect m_innerRect
Definition: Figure.h:138
bool m_blockUpdates
Definition: Figure.h:134
void beingDeleted(void)
Definition: Figure.cc:346
QString fileName(void)
Definition: Figure.cc:196
void updateFigureHeight(int delta_h)
Definition: Figure.cc:562
QRect m_outerRect
Definition: Figure.h:139
void addCustomToolBar(QToolBar *bar, bool visible, bool isdefault)
Definition: Figure.cc:798
void figureWindowShown()
Definition: Figure.cc:855
void interpreter_event(const octave::fcn_callback &fcn)
Figure(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go, FigureWindow *win)
Definition: Figure.cc:118
QWidget * menu(void)
Definition: Figure.cc:600
MenuBar * m_menuBar
Definition: Figure.h:136
QStatusBar * m_statusBar
Definition: Figure.h:137
QToolBar * m_figureToolBar
Definition: Figure.h:135
void enableMouseTracking(void)
Definition: Figure.cc:897
void print(const QString &file_cmd, const QString &term)
Definition: Figure.cc:319
void do_connections(const QObject *receiver, const QObject *emitter=nullptr)
Definition: Figure.cc:593
bool eventNotifyBefore(QObject *watched, QEvent *event)
Definition: Figure.cc:664
void set_geometry(QRect r)
Definition: Figure.cc:256
void screenChanged(QScreen *)
Definition: Figure.cc:873
Container * innerContainer(void)
Definition: Figure.cc:281
void showFigureStatusBar(bool visible)
Definition: Figure.cc:539
bool m_resizable
Definition: Figure.h:142
void interpreter_event(const octave::meth_callback &meth)
UpdateBoundingBoxFlag
Definition: Figure.h:96
@ UpdateBoundingBoxPosition
Definition: Figure.h:97
@ UpdateBoundingBoxAll
Definition: Figure.h:99
@ UpdateBoundingBoxSize
Definition: Figure.h:98
void asyncUpdate(void)
void showCustomToolBar(QToolBar *bar, bool visible)
Definition: Figure.cc:825
Container * m_container
Definition: Figure.h:133
void update(int pId)
Definition: Figure.cc:358
void updateStatusBar(ColumnVector pt)
Definition: Figure.cc:584
void redraw(void)
Definition: Figure.cc:287
QImage m_pointer_cdata
Definition: Figure.h:140
MouseMode mouseMode(void)
Definition: Figure.cc:222
void updateBoundingBox(bool internal=false, int flags=0)
Definition: Figure.cc:606
void updateContainer(void)
Definition: Figure.cc:849
Definition: Object.h:47
Base class for Octave interfaces that use Qt.
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
std::function< void(void)> fcn_callback
Definition: event-manager.h:43
std::function< void(interpreter &)> meth_callback
Definition: event-manager.h:48
T * r
Definition: mx-inlines.cc:773