00001
00002
00003
00004
00005
00006
00007 #ifndef BALL_VIEW_DIALOGS_DISPLAYPROPERTIES_H
00008 #define BALL_VIEW_DIALOGS_DISPLAYPROPERTIES_H
00009
00010 #ifndef BALL_COMMON_GLOBAL_H
00011 # include <BALL/COMMON/global.h>
00012 #endif
00013
00014 #ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H
00015 # include <BALL/VIEW/KERNEL/modularWidget.h>
00016 #endif
00017
00018 #ifndef BALL_VIEW_DATATYPE_COLORRGBA_H
00019 # include <BALL/VIEW/DATATYPE/colorRGBA.h>
00020 #endif
00021
00022 #ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY
00023 # include <BALL/VIEW/KERNEL/preferencesEntry.h>
00024 #endif
00025
00026 #ifdef BALL_COMPILER_MSVC
00027 # include <BALL/VIEW/UIC/ui_displayProperties.h>
00028 #else
00029 # include <BALL/VIEW/UIC/displayPropertiesData.h>
00030 #endif
00031
00032
00033 namespace BALL
00034 {
00035 class Composite;
00036
00037 namespace VIEW
00038 {
00039 class Representation;
00040
00041 class ColoringSettingsDialog;
00042 class ModelSettingsDialog;
00043 class Preferences;
00044 class ModelInformation;
00045
00059 class BALL_VIEW_EXPORT DisplayProperties
00060 : public QDialog,
00061 public Ui_DisplayPropertiesData,
00062 public ModularWidget,
00063 public PreferencesEntry
00064 {
00065 Q_OBJECT
00066
00067 public:
00068
00069 BALL_EMBEDDABLE(DisplayProperties,ModularWidget)
00070
00071
00074
00078 DisplayProperties(QWidget *parent = NULL, const char* name = "DisplayProperties");
00079
00081 DisplayProperties(const DisplayProperties& dp);
00082
00085 virtual ~DisplayProperties();
00086
00088
00091
00103 virtual void onNotify(Message *message);
00104
00106
00109
00116 virtual void initializeWidget(MainControl& main_control);
00117
00119 virtual void initializePreferencesTab(Preferences &preferences);
00120
00122 virtual void finalizePreferencesTab(Preferences &preferences);
00123
00125 void applyPreferences();
00126
00132 virtual void checkMenu(MainControl& main_control);
00133
00135 void createRepresentationMode();
00136
00138 void modifyRepresentationMode(Representation* rep);
00139
00141 bool getSettingsFromString(const String& data);
00142
00144 void createRepresentation(String data_string, const vector<const Composite*>& new_systems);
00145
00147 void enableCreationForNewMolecules(bool state)
00148 { create_representations_for_new_molecules_ = state;}
00149
00151 Representation* getRepresentation()
00152 { return rep_;}
00153
00154
00155
00156
00157
00158
00159
00160 virtual Representation* createRepresentation(const List<Composite*>& composites, bool hidden = false);
00161
00162
00164 void setModelSettingsDialog(ModelSettingsDialog* dialog);
00165
00167 void setColoringSettingsDialog(ColoringSettingsDialog* dialog);
00168
00169 public slots:
00170
00172
00175
00179 void show();
00180
00181
00187 void selectModel(int index);
00188
00194 void selectMode(int index);
00195
00201 void selectColoringMethod(int index);
00202
00204 void setSurfaceDrawingPrecision(float value);
00205
00207 void setDrawingPrecision(int value);
00208
00210 void setTransparency(int value);
00211
00213 void setCustomColor(const ColorRGBA& color);
00214
00221 virtual void apply();
00222
00226 void editColor();
00227
00231 void editSelectionColor();
00232
00234 void coloringOptionsPressed();
00235
00237 void modelOptionsPressed();
00238
00240 void precisionBoxChanged(int index);
00241
00243 void transparencySliderChanged();
00244
00246 void precisionSliderChanged();
00247
00249 void coloringUpdatesChanged();
00250
00252 void modelUpdatesChanged();
00253
00255
00256
00257 protected:
00258
00259
00260 void checkDrawingPrecision_();
00261
00262
00263 virtual void getAdvancedModelOptions_();
00264
00265
00266 virtual void getAdvancedColoringOptions_();
00267
00268
00269 virtual void applyModelSettings_(Representation& rep);
00270
00271
00272 virtual void applyColoringSettings_(Representation& rep);
00273
00274 protected:
00275
00276 void applyTo_(Representation* rep);
00277
00278
00279
00280
00281 ModelSettingsDialog* model_settings_;
00282 ColoringSettingsDialog* coloring_settings_;
00283 Preferences* preferences_;
00284
00285
00286 QAction* id_;
00287
00288
00289 Representation* rep_;
00290
00291 ColorRGBA custom_color_;
00292 bool advanced_options_modified_;
00293 bool create_representations_for_new_molecules_;
00294 bool changed_selection_color_;
00295 const ModelInformation* model_information_;
00296 };
00297
00298 } }
00299
00300 #endif // BALL_VIEW_DIALOGS_DISPLAYPROPERTIES_H