~ubuntu-branches/debian/squeeze/gmsh/squeeze

« back to all changes in this revision

Viewing changes to Fltk/GUI.h

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme
  • Date: 2009-09-02 18:12:15 UTC
  • mfrom: (1.2.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090902181215-yla8zvcas2ucvkm9
[Christophe Prud'homme]
* New upstream release
  + fixed surface mesh orientation bug introduced in 2.4.0;
  + mesh and graphics code refactoring;
  + small usability enhancements and bug fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle
2
 
//
3
 
// See the LICENSE.txt file for license information. Please report all
4
 
// bugs and problems to <gmsh@geuz.org>.
5
 
 
6
 
#ifndef _GUI_H_
7
 
#define _GUI_H_
8
 
 
9
 
#include <string>
10
 
#include <vector>
11
 
#include <FL/Fl.H>
12
 
 
13
 
#define GMSH_WINDOW_BOX FL_FLAT_BOX
14
 
#define NB_BUTT_SCROLL 25
15
 
#define NB_HISTORY_MAX 1000
16
 
#define IW (10 * FL_NORMAL_SIZE)    // input field width
17
 
#define BB (7 * FL_NORMAL_SIZE)     // width of a button with internal label
18
 
#define BH (2 * FL_NORMAL_SIZE + 1) // button height
19
 
#define WB (7)                      // window border
20
 
 
21
 
class graphicWindow;
22
 
class openglWindow;
23
 
class menuWindow;
24
 
class optionWindow;
25
 
class fieldWindow;
26
 
class pluginWindow;
27
 
class statisticsWindow;
28
 
class visibilityWindow;
29
 
class clippingWindow;
30
 
class messageWindow;
31
 
class manipWindow;
32
 
class geometryContextWindow;
33
 
class meshContextWindow;
34
 
class aboutWindow;
35
 
class solverWindow;
36
 
 
37
 
class GVertex;
38
 
class GEdge;
39
 
class GFace;
40
 
class GRegion;
41
 
class MElement;
42
 
 
43
 
class GUI{
44
 
 private:
45
 
  static GUI *_instance;
46
 
 public:
47
 
  std::vector<GVertex*> selectedVertices;
48
 
  std::vector<GEdge*> selectedEdges;
49
 
  std::vector<GFace*> selectedFaces;
50
 
  std::vector<GRegion*> selectedRegions;
51
 
  std::vector<MElement*> selectedElements;
52
 
 public:
53
 
  std::vector<graphicWindow*> graph;
54
 
  menuWindow *menu;
55
 
  optionWindow *options;
56
 
  fieldWindow *fields;
57
 
  pluginWindow *plugins;
58
 
  statisticsWindow *stats;
59
 
  visibilityWindow *visibility;
60
 
  clippingWindow *clipping;
61
 
  messageWindow *messages;
62
 
  manipWindow *manip;
63
 
  geometryContextWindow *geoContext;
64
 
  meshContextWindow *meshContext;
65
 
  aboutWindow *about;
66
 
  std::vector<solverWindow*> solver;
67
 
 public:
68
 
  GUI(int argc, char **argv);
69
 
  ~GUI(){}
70
 
  // return the single static instance of the GUI
71
 
  static GUI *instance(int argc=0, char **argv=0);
72
 
  // check if the GUI is available
73
 
  static bool available(){ return (_instance != 0); }
74
 
  // run the GUI until there's no window left
75
 
  int run(){ return Fl::run(); }
76
 
  // check (now!) if there are any pending events, and process them
77
 
  void check(){ Fl::check(); }
78
 
  // wait (possibly indefinitely) for any events, then process them
79
 
  void wait(){ Fl::wait(); }
80
 
  // wait (at most time seconds) for any events, then process them
81
 
  void wait(double time){ Fl::wait(time); }
82
 
  // test application-level keyboard shortcuts
83
 
  int testGlobalShortcuts(int event);
84
 
  // test the arrow shortcuts (not in the application-level shortcuts)
85
 
  // since it is used elsewhere (where we want to override widget
86
 
  // navigation). This is necessary since FLTK 1.1.
87
 
  int testArrowShortcuts();
88
 
  // set the title of the graphic windows
89
 
  void setGraphicTitle(std::string title);
90
 
  // update the GUI when views get added or deleted
91
 
  void updateViews();
92
 
  // update the GUI when fields change
93
 
  void updateFields();
94
 
  // reset the visibility window
95
 
  void resetVisibility();
96
 
  // store current window positions and sizes in CTX
97
 
  void storeCurrentWindowsInfo();
98
 
  // get the last opengl window that received an event
99
 
  openglWindow *getCurrentOpenglWindow();
100
 
  // split the current opengl window
101
 
  void splitCurrentOpenglWindow(char how);
102
 
  // select an entity in the most recent graphic window
103
 
  char selectEntity(int type);
104
 
  // display status message
105
 
  void setStatus(const char *msg, int num);
106
 
  // create the window for physical context dependant definitions
107
 
  void callForSolverPlugin(int dim);
108
 
};
109
 
 
110
 
void redraw_cb(Fl_Widget *w, void *data);
111
 
void window_cb(Fl_Widget *w, void *data);
112
 
 
113
 
class Fl_Browser;
114
 
void add_multiline_in_browser(Fl_Browser *o, const char *prefix, 
115
 
                              const char *str, int wrap=0);
116
 
 
117
 
#endif