~ubuntu-branches/ubuntu/karmic/gmsh/karmic

« back to all changes in this revision

Viewing changes to Fltk/GUI_Projection.h

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme, Daniel Leidert
  • Date: 2008-05-18 12:46:05 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080518124605-716xqbqeo07o497k
Tags: 2.2.0-2
[Christophe Prud'homme]
* Bug fix: "gmsh ships no .desktop", thanks to Vassilis Pandis (Closes:
  #375770). Applied the Ubuntu patch.

[Daniel Leidert]
* debian/control (Vcs-Svn): Fixed.
  (Build-Depends): Use texlive instead of tetex-bin.
* debian/gmsh.doc-base (Section): Fixed accordingly to doc-base (>= 0.8.10).
* debian/rules: Removed some variable declarations, that lead to double
  configuration and seem to be useless.
  (build/gmsh): Try to avoid multiple runs by using a stamp.
  (orig-tarball): Renamed to get-orig-source and changed to use uscan.
* debian/watch: Added.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _GUI_PROJECTION_H_
 
2
#define _GUI_PROJECTION_H_
 
3
 
 
4
#include "GmshUI.h"
 
5
#include "GModel.h"
 
6
#include "fourierProjectionFace.h"
 
7
#include "GUI.h"
 
8
#include "Shortcut_Window.h"
 
9
#include "ColorTable.h"
 
10
#include <FL/Fl_Toggle_Button.H>
 
11
#include <FL/Fl_Round_Button.H>
 
12
#include <vector>
 
13
#include <complex>
 
14
 
 
15
#if defined(HAVE_FOURIER_MODEL)
 
16
 
 
17
#include "FM_FPatch.h"
 
18
#include "FM_WFPatch.h"
 
19
 
 
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);
 
40
 
 
41
class uvPlot : public Fl_Window {
 
42
 private:
 
43
  std::vector<double> _u, _v, _dist;
 
44
  std::vector<std::complex<double> > _f; // "signed" distance
 
45
  GmshColorTable _colorTable;
 
46
  double _dmin, _dmax;
 
47
  void color(double d);
 
48
  void draw();
 
49
 public:
 
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; }
 
56
};
 
57
 
 
58
class projectionEditor;
 
59
 
 
60
class projection {
 
61
 public:
 
62
  fourierProjectionFace *face;
 
63
  Fl_Group *group;
 
64
  std::vector<Fl_Value_Input*> parameters;
 
65
  projection(fourierProjectionFace *f, int x, int y, int w, int h, int BB, int BH,
 
66
             projectionEditor *e);
 
67
};
 
68
 
 
69
class projectionEditor {
 
70
 private:
 
71
  std::vector<projection*> _projections;
 
72
  std::vector<MElement*> _elements;
 
73
  std::vector<GEntity*> _entities;
 
74
  Fl_Window *_window;
 
75
  Fl_Hold_Browser *_browser;
 
76
  int _paramWin[6];
 
77
  Fl_Round_Button *_select[2], *_pselect[2];
 
78
  uvPlot *_uvPlot;
 
79
  Fl_Value_Input *_modes[4];
 
80
  Fl_Toggle_Button *_hardEdges[4], *_orientation;
 
81
  Fl_Slider *_slider;
 
82
 public:
 
83
  projectionEditor();
 
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();
 
93
  int getPatchType();
 
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(); }
 
98
};
 
99
 
 
100
#endif
 
101
 
 
102
#endif