BALL  1.4.79
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
displayProperties.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 // $Id: displayProperties.h,v 1.43.16.1 2007/03/25 21:25:46 oliver Exp $
5 //
6 
7 #ifndef BALL_VIEW_DIALOGS_DISPLAYPROPERTIES_H
8 #define BALL_VIEW_DIALOGS_DISPLAYPROPERTIES_H
9 
10 #ifndef BALL_COMMON_GLOBAL_H
11 # include <BALL/COMMON/global.h>
12 #endif
13 
14 #ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H
16 #endif
17 
18 #ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
20 #endif
21 
22 #ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY
24 #endif
25 
26 #include <BALL/VIEW/UIC/ui_displayProperties.h>
27 
28 namespace BALL
29 {
30  class Composite;
31 
32  namespace VIEW
33  {
34  class Representation;
35 
36  class ColoringSettingsDialog;
37  class ModelSettingsDialog;
38  class Preferences;
39  class ModelInformation;
40 
55  : public QDialog,
56  public Ui_DisplayPropertiesData,
57  public ModularWidget,
58  public PreferencesEntry
59  {
60  Q_OBJECT
61 
62  public:
63 
65 
66 
69 
73  DisplayProperties(QWidget *parent = NULL, const char* name = "DisplayProperties");
74 
77 
80  virtual ~DisplayProperties();
81 
83 
86 
98  virtual void onNotify(Message *message);
99 
101 
104 
111  virtual void initializeWidget(MainControl& main_control);
112 
114  virtual void initializePreferencesTab(Preferences &preferences);
115 
117  virtual void finalizePreferencesTab(Preferences &preferences);
118 
120  void applyPreferences();
121 
127  virtual void checkMenu(MainControl& main_control);
128 
130  void createRepresentationMode();
131 
133  void modifyRepresentationMode(Representation* rep);
134 
136  bool getSettingsFromString(const String& data);
137 
139  void createRepresentation(String data_string, const vector<const Composite*>& new_systems);
140 
143  { create_representations_for_new_molecules_ = state;}
144 
147  { return rep_;}
148 
149  /* Create the new representation for the selection in the MolecularControl or for a given List of Composites.
150  Called by onNotify() after receiving CompositeMessage::NEW_MOLECULE and by apply().
151  To insert a new type of model, this is the only method in DisplayProperties you have to
152  change (See also VIEW/KERNEL/common.h).
153  @param hidden set to true will prevent that the representations model is created right now
154  */
155  virtual Representation* createRepresentation(const std::list<Composite*>& composites, bool hidden = false);
156 
157 
159  void setModelSettingsDialog(ModelSettingsDialog* dialog);
160 
162  void setColoringSettingsDialog(ColoringSettingsDialog* dialog);
163 
164  public slots:
165 
167 
170 
174  void show();
175 
176 
182  void selectModel(int index);
183 
189  void selectMode(int index);
190 
196  void selectColoringMethod(int index);
197 
199  void setSurfaceDrawingPrecision(float value);
200 
202  void setDrawingPrecision(int value);
203 
205  void setTransparency(int value);
206 
208  void setCustomColor(const ColorRGBA& color);
209 
216  virtual void apply();
217 
221  void editSelectionColor(QColor color);
222 
224  void coloringOptionsPressed();
225 
227  void modelOptionsPressed();
228 
230  void precisionBoxChanged(int index);
231 
233  void transparencySliderChanged();
234 
236  void precisionSliderChanged();
237 
239  void coloringUpdatesChanged();
240 
242  void modelUpdatesChanged();
243 
245 
246 
247  protected:
248 
249  //_ Set buttons and slider according to the values
250  void checkDrawingPrecision_();
251 
252  //_
253  virtual void getAdvancedModelOptions_();
254 
255  //_
256  virtual void getAdvancedColoringOptions_();
257 
258  //_
259  virtual void applyModelSettings_(Representation& rep);
260 
261  //_
262  virtual void applyColoringSettings_(Representation& rep);
263 
264  protected:
265 
266  void applyTo_(Representation* rep);
267 
268  // --------------------------------------------------------------------------------
269  // attributs
270  // --------------------------------------------------------------------------------
274 
275  // the menu entry id of the dialog
276  QAction* id_;
278 
279  // used by GeometricControl to modify an existing representation
281 
287  };
288 
289 } } // namespaces
290 
291 #endif // BALL_VIEW_DIALOGS_DISPLAYPROPERTIES_H
void enableCreationForNewMolecules(bool state)
Set if Representations are automaticaly created for new Molecules.
ColoringSettingsDialog * coloring_settings_
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
#define BALL_EMBEDDABLE(TYPE, BASE)
Definition: embeddable.h:31
Representation * getRepresentation()
Get the Representation on which DisplayProperties is working on.
ModelSettingsDialog * model_settings_
const ModelInformation * model_information_