GNU Octave  4.2.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Figure.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2011-2017 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 the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 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 <http://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);
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 save_figure_callback (const std::string& file);
115 
116  void enableMouseTracking (void);
117 
118  private slots:
119  void setMouseMode (MouseMode mode);
120  void fileSaveFigure (bool prompt = false);
121  void fileSaveFigureAs (void);
122  void fileCloseFigure (void);
123  void editCopy (bool choose_format = false);
124  void helpAboutOctave (void);
125  void updateMenuBar (void);
126  void updateContainer (void);
127  void toggleAxes (void);
128  void toggleGrid (void);
129  void autoAxes (void);
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;
143  };
144 
145 }
146 
147 #endif
void fileSaveFigure(bool prompt=false)
Definition: Figure.cc:826
void update(int pId)
Definition: Figure.cc:411
QWidget * menu(void)
Definition: Figure.cc:589
QString fileName(void)
Definition: Figure.cc:250
QRect m_outerRect
Definition: Figure.h:141
For example cd octave end example noindent changes the current working directory to file
Definition: dirfns.cc:120
void showFigureToolBar(bool visible)
Definition: Figure.cc:511
void fileCloseFigure(void)
Definition: Figure.cc:892
static void updateBoundingBoxHelper(void *)
Definition: Figure.cc:603
Container * m_container
Definition: Figure.h:135
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:6386
void showCustomToolBar(QToolBar *bar, bool visible)
Definition: Figure.cc:948
void helpAboutOctave(void)
Definition: Figure.cc:798
void beingDeleted(void)
Definition: Figure.cc:398
void enableMouseTracking(void)
Definition: Figure.cc:1005
void editCopy(bool choose_format=false)
Definition: Figure.cc:898
Figure(const graphics_object &go, FigureWindow *win)
Definition: Figure.cc:125
void updateMenuBar(void)
Definition: Figure.cc:570
void showMenuBar(bool visible)
Definition: Figure.cc:535
void updateContainer(void)
Definition: Figure.cc:972
void setMouseMode(MouseMode mode)
Definition: Figure.cc:808
void addCustomToolBar(QToolBar *bar, bool visible)
Definition: Figure.cc:922
OCTAVE_EXPORT octave_value_list any number nd example oindent prints the prompt xample Pick a any number!nd example oindent and waits for the user to enter a value The string entered by the user is evaluated as an so it may be a literal a variable name
Definition: input.cc:871
void asyncUpdate(void)
Definition: moc-Figure.cc:136
void copy_figure_callback(const std::string &format)
Definition: Figure.cc:868
void fileSaveFigureAs(void)
Definition: Figure.cc:886
void createFigureToolBarAndMenuBar(void)
Definition: Figure.cc:293
MouseModeActionGroup * m_mouseModeGroup
Definition: Figure.h:142
void eventNotifyAfter(QObject *watched, QEvent *event)
Definition: Figure.cc:725
LS_TEXT format
Definition: load-save.cc:1580
void updateStatusBar(ColumnVector pt)
Definition: Figure.cc:580
MenuBar * m_menuBar
Definition: Figure.h:138
void toggleGrid(void)
Definition: Figure.cc:987
QStatusBar * m_statusBar
Definition: Figure.h:139
bool eventNotifyBefore(QObject *watched, QEvent *event)
Definition: Figure.cc:680
Container * innerContainer(void)
Definition: Figure.cc:356
void autoAxes(void)
Definition: Figure.cc:996
QRect m_innerRect
Definition: Figure.h:140
void toggleAxes(void)
Definition: Figure.cc:978
bool m_blockUpdates
Definition: Figure.h:136
QToolBar * m_figureToolBar
Definition: Figure.h:137
void print(const QString &file_cmd, const QString &term)
Definition: Figure.cc:389
MouseMode mouseMode(void)
Definition: Figure.cc:272
static Figure * create(const graphics_object &go)
Definition: Figure.cc:120
void updateFigureToolBarAndMenuBar(void)
Definition: Figure.cc:345
void redraw(void)
Definition: Figure.cc:362
void updateBoundingBox(bool internal=false, int flags=0)
Definition: Figure.cc:621
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:854
void save_figure_callback(const std::string &file)
Definition: Figure.cc:859
void setFileName(const QString &name)
Definition: Figure.cc:262