GNU Octave  6.2.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-2021 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 
40 namespace octave
41 {
42  class base_qobject;
43  class interpreter;
44 }
45 
46 namespace QtHandles
47 {
48 
49  enum MouseMode
50  {
57  TextMode
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:
76  const graphics_object& go, FigureWindow *win);
77  ~Figure (void);
78 
79  static Figure *
81  const graphics_object& go);
82 
83  QString fileName (void);
84  void setFileName (const QString& name);
85 
86  MouseMode mouseMode (void);
87 
88  Container * innerContainer (void);
89  QWidget * menu (void);
90  void updateStatusBar (ColumnVector pt);
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);
133 
134  private:
137  QToolBar *m_figureToolBar;
139  QStatusBar *m_statusBar;
140  QRect m_innerRect;
141  QRect m_outerRect;
145  };
146 
147 }
148 
149 #endif
QWidget * menu(void)
Definition: Figure.cc:603
void eventNotifyAfter(QObject *watched, QEvent *event)
Definition: Figure.cc:721
void screenChanged(QScreen *)
Definition: Figure.cc:877
void showFigureStatusBar(bool visible)
Definition: Figure.cc:542
void enableMouseTracking(void)
Definition: Figure.cc:901
void do_connections(const QObject *receiver, const QObject *emitter=nullptr)
Definition: Figure.cc:596
void redraw(void)
Definition: Figure.cc:290
bool eventNotifyBefore(QObject *watched, QEvent *event)
Definition: Figure.cc:667
void updateBoundingBox(bool internal=false, int flags=0)
Definition: Figure.cc:609
void showCustomToolBar(QToolBar *bar, bool visible)
Definition: Figure.cc:828
Figure(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go, FigureWindow *win)
Definition: Figure.cc:119
uint8NDArray slotGetPixels(void)
Definition: Figure.cc:331
@ UpdateBoundingBoxSize
Definition: Figure.h:102
@ UpdateBoundingBoxAll
Definition: Figure.h:103
@ UpdateBoundingBoxPosition
Definition: Figure.h:101
QToolBar * m_figureToolBar
Definition: Figure.h:137
void updateContainer(void)
Definition: Figure.cc:852
bool m_resizable
Definition: Figure.h:144
void beingDeleted(void)
Definition: Figure.cc:349
Container * m_container
Definition: Figure.h:135
void updateStatusBar(ColumnVector pt)
Definition: Figure.cc:587
void asyncUpdate(void)
void figureWindowShown()
Definition: Figure.cc:858
Container * innerContainer(void)
Definition: Figure.cc:284
QString fileName(void)
Definition: Figure.cc:199
void addCustomToolBar(QToolBar *bar, bool visible, bool isdefault)
Definition: Figure.cc:801
QRect m_innerRect
Definition: Figure.h:140
QImage m_pointer_cdata
Definition: Figure.h:142
QStatusBar * m_statusBar
Definition: Figure.h:139
MouseMode mouseMode(void)
Definition: Figure.cc:225
QRect m_outerRect
Definition: Figure.h:141
int m_previousHeight
Definition: Figure.h:143
void show(void)
Definition: Figure.cc:313
void set_geometry(QRect r)
Definition: Figure.cc:259
static Figure * create(octave::base_qobject &oct_qobj, octave::interpreter &interp, const graphics_object &go)
Definition: Figure.cc:113
void print(const QString &file_cmd, const QString &term)
Definition: Figure.cc:322
void update(int pId)
Definition: Figure.cc:361
bool m_blockUpdates
Definition: Figure.h:136
void setFileName(const QString &name)
Definition: Figure.cc:213
void updateFigureHeight(int delta_h)
Definition: Figure.cc:565
MenuBar * m_menuBar
Definition: Figure.h:138
Base class for Octave interfaces that use Qt.
QString name
T * r
Definition: mx-inlines.cc:773
MouseMode
Definition: Figure.h:50
@ ZoomOutMode
Definition: Figure.h:54
@ TextMode
Definition: Figure.h:57
@ NoMode
Definition: Figure.h:51
@ SelectMode
Definition: Figure.h:56
@ PanMode
Definition: Figure.h:55
@ ZoomInMode
Definition: Figure.h:53
@ RotateMode
Definition: Figure.h:52