1
#ifndef _GUI_PROJECTION_H_
2
#define _GUI_PROJECTION_H_
6
#include "fourierProjectionFace.h"
8
#include "Shortcut_Window.h"
9
#include "ColorTable.h"
10
#include <FL/Fl_Toggle_Button.H>
11
#include <FL/Fl_Round_Button.H>
15
#if defined(HAVE_FOURIER_MODEL)
17
#include "FM_FPatch.h"
18
#include "FM_WFPatch.h"
20
void select_cb(Fl_Widget *w, void *data);
21
void filter_cb(Fl_Widget *w, void *data);
22
void browse_cb(Fl_Widget *w, void *data);
23
void set_position_cb(Fl_Widget *w, void *data);
24
void invert_normal_cb(Fl_Widget *w, void *data);
25
void translate_p0_cb(Fl_Widget *w, void *data);
26
void translate_p1_cb(Fl_Widget *w, void *data);
27
void translate_p2_cb(Fl_Widget *w, void *data);
28
void translate_m0_cb(Fl_Widget *w, void *data);
29
void translate_m1_cb(Fl_Widget *w, void *data);
30
void translate_m2_cb(Fl_Widget *w, void *data);
31
void update_cb(Fl_Widget *w, void *data);
32
void close_cb(Fl_Widget *w, void *data);
33
void hide_cb(Fl_Widget *w, void *data);
34
void save_selection_cb(Fl_Widget *w, void *data);
35
void load_projection_cb(Fl_Widget *w, void *data);
36
void save_projection_cb(Fl_Widget *w, void *data);
37
void blend_cb(Fl_Widget *w, void *data);
38
void compute_cb(Fl_Widget *w, void *data);
39
void action_cb(Fl_Widget *w, void *data);
41
class uvPlot : public Fl_Window {
43
std::vector<double> _u, _v, _dist;
44
std::vector<std::complex<double> > _f; // "signed" distance
45
GmshColorTable _colorTable;
50
uvPlot(int x, int y, int w, int h, const char *l=0);
51
void set(std::vector<double> &u, std::vector<double> &v, std::vector<double> &dist,
52
std::vector<std::complex<double> > &f);
53
void get(std::vector<double> &u, std::vector<double> &v, std::vector<double> &dist,
54
std::vector<std::complex<double> > &f)
55
{ u = _u; v = _v; dist = _dist; f = _f; }
58
class projectionEditor;
62
fourierProjectionFace *face;
64
std::vector<Fl_Value_Input*> parameters;
65
projection(fourierProjectionFace *f, int x, int y, int w, int h, int BB, int BH,
69
class projectionEditor {
71
std::vector<projection*> _projections;
72
std::vector<MElement*> _elements;
73
std::vector<GEntity*> _entities;
75
Fl_Hold_Browser *_browser;
77
Fl_Round_Button *_select[2], *_pselect[2];
79
Fl_Value_Input *_modes[4];
80
Fl_Toggle_Button *_hardEdges[4], *_orientation;
84
void load(fourierProjectionFace *face, std::string tag="");
85
void show(){ _window->show(); select_cb(0, this); }
86
uvPlot *uv() { return _uvPlot; }
87
std::vector<MElement*> &getElements() { return _elements; }
88
std::vector<GEntity*> &getEntities() { return _entities; }
89
std::vector<projection*> &getProjections() { return _projections; }
90
projection *getCurrentProjection();
91
projection *getLastProjection();
92
int getSelectionMode();
94
int getMode(int i){ return (int)_modes[i]->value(); }
95
int getHardEdge(int i){ return (int)_hardEdges[i]->value(); }
96
int getOrientation(){ return (int)_orientation->value(); }
97
double getThreshold(){ return _slider->value(); }