modelSettingsDialog.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 
00005 #ifndef BALL_VIEW_DIALOGS_MODELSETTINGSDIALOG_H
00006 #define BALL_VIEW_DIALOGS_MODELSETTINGSDIALOG_H
00007 
00008 #ifndef BALL_COMMON_GLOBAL_H
00009 # include <BALL/COMMON/global.h>
00010 #endif
00011 
00012 #ifndef BALL_VIEW_MODELS_MODELPROCESSOR_H
00013 # include <BALL/VIEW/MODELS/modelProcessor.h>
00014 #endif
00015 
00016 #ifndef BALL_VIEW_KERNEL_COMMON_H
00017 # include <BALL/VIEW/KERNEL/common.h>
00018 #endif
00019 
00020 #ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY
00021 # include <BALL/VIEW/KERNEL/preferencesEntry.h>
00022 #endif
00023 
00024 #include <BALL/VIEW/UIC/ui_modelSettingsDialog.h>
00025 
00026 #include <QtGui/qcheckbox.h>
00027 #include <QtGui/QLabel>
00028 
00029 class QSlider;
00030 class QLabel;
00031 
00032 namespace BALL
00033 {
00034   class INIFile;
00035   class String;
00036 
00037   namespace VIEW
00038   {
00042     class BALL_VIEW_EXPORT ModelSettingsDialog 
00043       : public QWidget,
00044         public Ui_ModelSettingsDialogData,
00045         public PreferencesEntry
00046     { 
00047       Q_OBJECT
00048 
00049       public:
00050 
00052       ModelSettingsDialog( QWidget* parent = 0, const char* name = "ModelSettingsDialog", 
00053                             Qt::WFlags fl = 0 );
00054 
00056       virtual ~ModelSettingsDialog() {}
00057 
00059       virtual void applySettingsTo(ModelProcessor& cp) const;
00060         
00062       virtual ModelProcessor* createModelProcessor(ModelType type) const
00063         throw(Exception::InvalidOption);
00064 
00066       virtual void getSettings(const ModelProcessor& mp);
00067 
00069       virtual QWidget* getEntryFor(ModelType type);
00070 
00072       float getStickStickRadius() const
00073         {return getFloatValue_(stick_radius_slider);}
00074 
00076       float getBallAndStickStickRadius() const
00077         {return getFloatValue_(ball_stick_cylinder_radius_slider);}
00078 
00080       bool ballAndStickDashedBondsEnabled() const
00081         {return ball_stick_dashed_bonds->isChecked();}
00082 
00084       float getBallRadius() const
00085         {return getFloatValue_(ball_stick_sphere_radius_slider);}
00086 
00088       float getVDWRadiusFactor() const
00089         {return getFloatValue_(vdw_radius_factor_slider);}
00090 
00092       float getSurfaceProbeRadius() const
00093         {return getFloatValue_(surface_probe_radius_slider);}
00094 
00096       float getTubeRadius() const
00097         {return getFloatValue_(tube_radius_slider);}
00098 
00100       float getCartoonTubeRadius() const
00101         {return getFloatValue_(cartoon_tube_radius_slider);}
00102 
00104       float getCartoonHelixRadius() const
00105         {return getFloatValue_(cartoon_helix_radius_slider);}
00106 
00108       float getCartoonArrowWidth() const
00109         {return getFloatValue_(strand_arrow_width_slider);}
00110 
00112       float getCartoonStrandHeight() const
00113         {return getFloatValue_(strand_height_slider);}
00114 
00116       float getCartoonStrandWidth() const
00117         {return getFloatValue_(strand_width_slider);}
00118 
00120       float getHBondsRadius() const
00121         {return getFloatValue_(hbonds_radius_slider);}
00122 
00124       float getForceMaxLength() const
00125         {return getFloatValue_(force_max_length_slider);}
00126 
00128       float getForceScaling() const
00129         { return getFloatValue_(force_scaling_slider);}
00130 
00132       float getForceBase() const
00133         {return getFloatValue_(force_base_slider);}
00134 
00136       float getForceOffset() const
00137         {return getFloatValue_(force_offset_slider);}
00138 
00140       float getDNALadderRadius() const
00141         {return getFloatValue_(cartoon_dna_ladder_radius_slider);}
00142 
00144       float getDNABaseRadius() const
00145         {return getFloatValue_(cartoon_dna_base_radius_slider);}
00146 
00148       float getDNAHelixRadius() const
00149         {return getFloatValue_(cartoon_dna_helix_radius_slider);}
00150 
00152       void setStickStickRadius(float value) 
00153         { setValue_(stick_radius_slider,value);}
00154 
00156       void setBallAndStickStickRadius(float value) 
00157         { setValue_(ball_stick_cylinder_radius_slider,value);}
00158 
00160       void setBallAndStickStickDashedBondsEnabled(bool state)
00161         { ball_stick_dashed_bonds->setChecked(state);}
00162 
00164       void setBallRadius(float value) 
00165         { setValue_(ball_stick_sphere_radius_slider,value);}
00166 
00168       void setVDWRadiusFactor(float value) 
00169         { setValue_(vdw_radius_factor_slider,value);}
00170 
00172       void setSurfaceProbeRadius(float value) 
00173         { setValue_(surface_probe_radius_slider,value);}
00174 
00176       void setTubeRadius(float value) 
00177         { setValue_(tube_radius_slider,value);}
00178 
00180       void setCartoonTubeRadius(float value) 
00181         { setValue_(cartoon_tube_radius_slider,value);}
00182 
00184       void setCartoonHelixRadius(float value) 
00185         { setValue_(cartoon_helix_radius_slider,value);}
00186 
00188       void setCartoonArrowWidth(float value) 
00189         { setValue_(strand_arrow_width_slider ,value);}
00190 
00192       void setCartoonStrandHeight(float value) 
00193         { setValue_(strand_height_slider,value);}
00194 
00196       void setCartoonStrandWidth(float value) 
00197         { setValue_(strand_width_slider,value);}
00198 
00200       void setHBondRadius(float value) 
00201         { setValue_(hbonds_radius_slider,value);}
00202 
00204       void setForceMaxLenght(float value) 
00205         { setValue_(force_max_length_slider,value);}
00206 
00208       void setForceScaling(float value) 
00209         { setValue_(force_scaling_slider,value);}
00210 
00212       void setForceOffset(float value) 
00213         { setValue_(force_offset_slider ,value);}
00214 
00216       void setForceBase(float value)
00217         { setValue_(force_base_slider, value);}
00218 
00220       void setCartoonDNALadderRadius(float value)
00221         { setValue_(cartoon_dna_ladder_radius_slider, value / 10.);}
00222 
00224       void setCartoonDNAHelixRadius(float value)
00225         { setValue_(cartoon_dna_helix_radius_slider, value / 10.);}
00226 
00228       void setCartoonDNABaseRadius(float value)
00229         { setValue_(cartoon_dna_base_radius_slider, value / 10.);}
00230 
00231       public slots:
00232       
00234 
00235       protected slots:
00236       void stickRadiusChanged() {setLabelText_(stick_radius_label, stick_radius_slider);}
00237       void VDWfactorChanged() {setLabelText_(vdw_radius_factor_label, vdw_radius_factor_slider);}
00238       void ballStickSphereRadiusChanged() {setLabelText_(ball_stick_sphere_radius_label, ball_stick_sphere_radius_slider);}
00239       void ballStickCylinderRadiusChanged() {setLabelText_(ball_stick_cylinder_radius_label, ball_stick_cylinder_radius_slider);}
00240       void probeRadiusChanged() {setLabelText_(surface_probe_radius_label, surface_probe_radius_slider);}
00241       void tubeRadiusChanged() {setLabelText_(tube_radius_label, tube_radius_slider);}
00242       void cartoonTubeRadiusChanged(){setLabelText_(cartoon_tube_radius_label, cartoon_tube_radius_slider);}
00243       void cartoonHelixRadiusChanged(){setLabelText_(cartoon_helix_radius_label, cartoon_helix_radius_slider);}
00244       
00245       void cartoonStrandArrowWidthChanged(){setLabelText_(strand_arrow_width_label, strand_arrow_width_slider);}
00246       void cartoonStrandHeightChanged(){setLabelText_(strand_height_label, strand_height_slider);}
00247       void cartoonStrandWidthChanged() {setLabelText_(strand_width_label, strand_width_slider);}
00248       
00249       void cartoonDNAHelixRadiusChanged(){setLabelText_(cartoon_dna_helix_radius_label, cartoon_dna_helix_radius_slider);}
00250       void cartoonDNABaseRadiusChanged(){setLabelText_(cartoon_dna_base_radius_label, cartoon_dna_base_radius_slider);}
00251       void cartoonDNALadderRadiusChanged(){setLabelText_(cartoon_dna_ladder_radius_label, cartoon_dna_ladder_radius_slider);}
00252       void hbondsRadiusChanged(){setLabelText_(hbonds_radius_label, hbonds_radius_slider);}
00253       void forceScalingChanged(){setLabelText_(force_scaling_label, force_scaling_slider);}
00254       void forceMaxLengthChanged(){setLabelText_(force_max_length_label, force_max_length_slider);}
00255       void forceBaseChanged(){setLabelText_(force_base_label, force_base_slider);}
00256       void forceOffsetChanged(){setLabelText_(force_offset_label, force_offset_slider);}
00257       void changedNAMode_(bool state);
00258 
00259       protected:
00260 
00261       float getFloatValue_(const QSlider* const& le) const;
00262 
00263       void setValue_(QSlider* le, float value);
00264 
00265       void setLabelText_(QLabel* label, const QSlider* const from);
00266 
00267       void setDefaultValues_();
00268     };
00269 
00270 } }
00271 
00272 #endif