BALL  1.4.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
modifyRepresentationDialog.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 
5 #ifndef BALL_VIEW_DIALOGS_MODIFYSURFACEDIALOG_H
6 #define BALL_VIEW_DIALOGS_MODIFYSURFACEDIALOG_H
7 
8 #ifndef BALL_COMMON_GLOBAL_H
9 # include <BALL/COMMON/global.h>
10 #endif
11 
12 #ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
14 #endif
15 
16 #ifndef BALL_VIEW_PRIMITIVES_MESH_H
18 #endif
19 
20 #ifndef BALL_VIEW_KERNEL_REPRESENTATION_H
22 #endif
23 
24 #ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H
26 #endif
27 
28 #ifndef BALL_DATATYPE_REGULARDATA3D
30 #endif
31 
32 #ifndef BALL_DATATYPE_HASHGRID_H
33 # include <BALL/DATATYPE/hashGrid.h>
34 #endif
35 
36 #ifndef BALL_VIEW_DIALOG_MATERIALSETTINGS_H
38 #endif
39 
40 #include <BALL/VIEW/UIC/ui_modifyRepresentationDialog.h>
41 
42 namespace BALL
43 {
44  namespace VIEW
45  {
52  : public QDialog,
53  public Ui_ModifyRepresentationDialogData,
54  public ModularWidget
55  {
56  Q_OBJECT
57 
58  public:
59 
61 
62 
63  ModifyRepresentationDialog(QWidget* parent = 0, const char* name = "ModifyRepresentationDialog",
64  bool modal = FALSE, Qt::WFlags fl = 0);
65 
68 
70  virtual void onNotify(Message *message);
71 
73  void setRepresentation(Representation* rep);
74 
76  void setGrid(RegularData3D* grid);
77 
79  void setMinValue(float value);
80 
82  void setMaxValue(float value);
83 
85  void setMidValue(float value);
86 
88  void setSplitRadius(float distance);
89 
91  void setMode(Position pos);
92 
93  public slots:
94 
95  void accept();
96  void tabChanged();
97  void autoScale();
98  void choosePressed();
99  void gridSelected();
100  void show();
101  void applySplit();
102 
103  protected slots:
104 
105  void customColorTransparencyChanged();
106  void changeDrawingModeTransparencyChanged();
107  void splitMethodChanged();
108 
109  protected:
110 
112 
115  void colorByCustomColor_();
116  bool colorByGrid_();
117  bool insertGrid_(RegularData3D& grid, const String& name);
118  void removeGrid_(RegularData3D& grid);
119  void invalidateGrid_();
120  void invalidateMesh_();
121  void changeDrawingMode_();
122  void checkApplyButton_();
123 
124  void calculateIncludedVertices_(vector<bool>& include_vertex, const Mesh& org_mesh, HashSet<const Composite*>& roots);
125  inline bool checkInclude_(const AtomGrid& atom_grid, const Vector3& point) const;
126 
129 
130  ColorRGBA selected_color, min_min_color, min_color, mid_color, max_color, max_max_color;
131 
133  std::list<RegularData3D*> grid_list_;
134  vector<Vector3> vertices_;
136  };
137 
138  } // namespace VIEW
139 } // namespace BALL
140 
141 #endif