GNU Octave  4.4.1
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-2018 Michael Goffioul
4 
5 This file is part of Octave.
6 
7 Octave is free software: you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <https://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if ! defined (octave_Figure_h)
24 #define octave_Figure_h 1
25 
26 #include <QRect>
27 #include <QStatusBar>
28 
29 #include "GenericEventNotify.h"
30 #include "MenuContainer.h"
31 #include "Object.h"
32 
33 class QMainWindow;
34 class QToolBar;
35 
36 namespace QtHandles
37 {
38 
39  enum MouseMode
40  {
41  // NOTE: These values must match the order of the buttons in the
42  // MouseModeActionGroup object.
43 
44  NoMode = 0,
48  PanMode = 4,
49  TextMode = 5,
51  };
52 
53  class Container;
54  class FigureWindow;
55  class MenuBar;
56  class ToolBar;
57 
58  class MouseModeActionGroup;
59 
60  class Figure :
61  public Object,
62  public MenuContainer,
64  {
65  Q_OBJECT
66 
67  friend class ToolBar;
68 
69  public:
70  Figure (const graphics_object& go, FigureWindow *win);
71  ~Figure (void);
72 
73  static Figure * create (const graphics_object& go);
74 
75  QString fileName (void);
76  void setFileName (const QString& name);
77 
78  MouseMode mouseMode (void);
79 
80  Container * innerContainer (void);
81  QWidget * menu (void);
82  void updateStatusBar (ColumnVector pt);
83 
84  bool eventNotifyBefore (QObject *watched, QEvent *event);
85  void eventNotifyAfter (QObject *watched, QEvent *event);
86 
87  protected:
89  {
93  };
94 
95  protected:
96  void redraw (void);
97  void print (const QString& file_cmd, const QString& term);
98  void update (int pId);
99  void updateBoundingBox (bool internal = false, int flags = 0);
100  void beingDeleted (void);
101 
102  private:
103  void createFigureToolBarAndMenuBar (void);
104  void showFigureToolBar (bool visible);
105  void showMenuBar (bool visible, int height = -1);
106  void addCustomToolBar (QToolBar *bar, bool visible);
107  void showCustomToolBar (QToolBar *bar, bool visible);
108 
109  void updateFigureToolBarAndMenuBar (void);
110 
111  static void updateBoundingBoxHelper (void*);
112 
113  void close_figure_callback (void);
115  void save_figure_callback (const std::string& file);
116 
117  void enableMouseTracking (void);
118 
119  private slots:
120  void setMouseMode (MouseMode mode);
121  void fileSaveFigure (bool prompt = false);
122  void fileSaveFigureAs (void);
123  void fileCloseFigure (void);
124  void editCopy (bool choose_format = false);
125  void helpAboutOctave (void);
126  void updateMenuBar (int height = -1);
127  void updateContainer (void);
128  void toggleAxes (void);
129  void toggleGrid (void);
130  void autoAxes (void);
131 
132  public slots:
134 
135  signals:
136  void asyncUpdate (void);
137 
138  private:
141  QToolBar *m_figureToolBar;
143  QStatusBar *m_statusBar;
144  QRect m_innerRect;
145  QRect m_outerRect;
148  };
149 
150 }
151 
152 #endif
void fileSaveFigure(bool prompt=false)
Definition: Figure.cc:896
void update(int pId)
Definition: Figure.cc:429
QWidget * menu(void)
Definition: Figure.cc:624
QString fileName(void)
Definition: Figure.cc:252
QRect m_outerRect
Definition: Figure.h:145
For example cd octave end example noindent changes the current working directory to file
Definition: dirfns.cc:124
void showFigureToolBar(bool visible)
Definition: Figure.cc:544
void fileCloseFigure(void)
Definition: Figure.cc:969
static void updateBoundingBoxHelper(void *)
Definition: Figure.cc:638
Container * m_container
Definition: Figure.h:139
MouseMode
Definition: Figure.h:39
Return the CPU time used by your Octave session The first output is the total time spent executing your process and is equal to the sum of second and third which are the number of CPU seconds spent executing in user mode and the number of CPU seconds spent executing in system mode
Definition: data.cc:6348
void showCustomToolBar(QToolBar *bar, bool visible)
Definition: Figure.cc:1025
void close_figure_callback(void)
Definition: Figure.cc:715
void helpAboutOctave(void)
Definition: Figure.cc:868
void beingDeleted(void)
Definition: Figure.cc:416
void enableMouseTracking(void)
Definition: Figure.cc:1082
void editCopy(bool choose_format=false)
Definition: Figure.cc:975
Figure(const graphics_object &go, FigureWindow *win)
Definition: Figure.cc:126
void updateContainer(void)
Definition: Figure.cc:1049
void setMouseMode(MouseMode mode)
Definition: Figure.cc:878
void addCustomToolBar(QToolBar *bar, bool visible)
Definition: Figure.cc:999
nd deftypefn *std::string name
Definition: sysdep.cc:647
void asyncUpdate(void)
void copy_figure_callback(const std::string &format)
Definition: Figure.cc:945
void updateMenuBar(int height=-1)
Definition: Figure.cc:604
void fileSaveFigureAs(void)
Definition: Figure.cc:963
void createFigureToolBarAndMenuBar(void)
Definition: Figure.cc:295
MouseModeActionGroup * m_mouseModeGroup
Definition: Figure.h:146
void eventNotifyAfter(QObject *watched, QEvent *event)
Definition: Figure.cc:782
LS_TEXT format
Definition: load-save.cc:1616
void updateStatusBar(ColumnVector pt)
Definition: Figure.cc:615
MenuBar * m_menuBar
Definition: Figure.h:142
void toggleGrid(void)
Definition: Figure.cc:1064
int m_previousHeight
Definition: Figure.h:147
uint8NDArray slotGetPixels(void)
Definition: Figure.cc:400
QStatusBar * m_statusBar
Definition: Figure.h:143
bool eventNotifyBefore(QObject *watched, QEvent *event)
Definition: Figure.cc:724
Container * innerContainer(void)
Definition: Figure.cc:358
void autoAxes(void)
Definition: Figure.cc:1073
QRect m_innerRect
Definition: Figure.h:144
void toggleAxes(void)
Definition: Figure.cc:1055
bool m_blockUpdates
Definition: Figure.h:140
QToolBar * m_figureToolBar
Definition: Figure.h:141
void print(const QString &file_cmd, const QString &term)
Definition: Figure.cc:391
MouseMode mouseMode(void)
Definition: Figure.cc:274
static Figure * create(const graphics_object &go)
Definition: Figure.cc:121
void showMenuBar(bool visible, int height=-1)
Definition: Figure.cc:568
void updateFigureToolBarAndMenuBar(void)
Definition: Figure.cc:347
void redraw(void)
Definition: Figure.cc:364
void updateBoundingBox(bool internal=false, int flags=0)
Definition: Figure.cc:656
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:888
void save_figure_callback(const std::string &file)
Definition: Figure.cc:931
void setFileName(const QString &name)
Definition: Figure.cc:264