1
// Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle
3
// See the LICENSE.txt file for license information. Please report all
4
// bugs and problems to <gmsh@geuz.org>.
6
#ifndef _OPENGL_WINDOW_H_
7
#define _OPENGL_WINDOW_H_
11
#include <FL/Fl_Gl_Window.H>
12
#include <FL/Fl_Box.H>
13
#include "drawContext.h"
23
double win[3]; // window coordinates
24
double wnr[3]; // world coordinates BEFORE rotation
25
double s[3]; // scaling state when the event was recorded
26
double t[3]; // translation state when the event was recorded
29
for(int i = 0; i < 3; i++)
30
win[i] = wnr[i] = s[i] = t[i] = 0.;
32
mousePosition(const mousePosition &instance)
34
for(int i = 0; i < 3; i++){
35
win[i] = instance.win[i];
36
wnr[i] = instance.wnr[i];
41
void set(drawContext *ctx);
42
void recenter(drawContext *ctx);
45
class openglWindow : public Fl_Gl_Window {
47
static openglWindow *_lastHandled;
48
mousePosition _click, _curr, _prev;
51
int _selection, _trySelection, _trySelectionXYWH[4];
53
void drawScreenMessage();
55
bool processSelectionBuffer(int type,
56
bool multipleSelection, bool meshSelection,
57
int x, int y, int w, int h,
58
std::vector<GVertex*> &vertices,
59
std::vector<GEdge*> &edges,
60
std::vector<GFace*> &faces,
61
std::vector<GRegion*> ®ions,
62
std::vector<MElement*> &elements);
66
bool addPointMode, lassoMode, selectionMode;
67
int endSelection, undoSelection, invertSelection, quitSelection;
68
std::string screenMessage[2];
69
openglWindow(int x, int y, int w, int h, const char *l=0);
71
drawContext *getDrawContext(){ return _ctx; }
72
char selectEntity(int type,
73
std::vector<GVertex*> &vertices, std::vector<GEdge*> &edges,
74
std::vector<GFace*> &faces, std::vector<GRegion*> ®ions,
75
std::vector<MElement*> &elements);
76
static openglWindow *getLastHandled(){ return _lastHandled; }
77
static void setLastHandled(openglWindow *w){ _lastHandled = w; }