00001
00002
00003
00004
00005
00006
00007 #ifndef BALL_VIEW_DIALOGS_MODELSETTINGSDIALOG_H
00008 #define BALL_VIEW_DIALOGS_MODELSETTINGSDIALOG_H
00009
00010 #ifndef BALL_COMMON_GLOBAL_H
00011 # include <BALL/COMMON/global.h>
00012 #endif
00013
00014 #ifndef BALL_VIEW_MODELS_MODELPROCESSOR_H
00015 # include <BALL/VIEW/MODELS/modelProcessor.h>
00016 #endif
00017
00018 #ifndef BALL_VIEW_KERNEL_COMMON_H
00019 # include <BALL/VIEW/KERNEL/common.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_modelSettingsDialog.h>
00028 #else
00029 # include <BALL/VIEW/UIC/modelSettingsDialogData.h>
00030 #endif
00031
00032
00033 #include <QtGui/qcheckbox.h>
00034 #include <QtGui/QLabel>
00035
00036 class QSlider;
00037 class QLabel;
00038
00039 namespace BALL
00040 {
00041 class INIFile;
00042 class String;
00043
00044 namespace VIEW
00045 {
00049 class BALL_VIEW_EXPORT ModelSettingsDialog
00050 : public QWidget,
00051 public Ui_ModelSettingsDialogData,
00052 public PreferencesEntry
00053 {
00054 Q_OBJECT
00055
00056 public:
00057
00059 ModelSettingsDialog( QWidget* parent = 0, const char* name = "ModelSettingsDialog",
00060 Qt::WFlags fl = 0 );
00061
00063 virtual ~ModelSettingsDialog() {}
00064
00066 virtual void applySettingsTo(ModelProcessor& cp) const;
00067
00069 virtual ModelProcessor* createModelProcessor(ModelType type) const
00070 throw(Exception::InvalidOption);
00071
00073 virtual void getSettings(const ModelProcessor& mp);
00074
00076 virtual QWidget* getEntryFor(ModelType type);
00077
00079 float getStickStickRadius() const
00080 {return getFloatValue_(stick_radius_slider);}
00081
00083 float getBallAndStickStickRadius() const
00084 {return getFloatValue_(ball_stick_cylinder_radius_slider);}
00085
00087 bool ballAndStickDashedBondsEnabled() const
00088 {return ball_stick_dashed_bonds->isChecked();}
00089
00091 float getBallRadius() const
00092 {return getFloatValue_(ball_stick_sphere_radius_slider);}
00093
00095 float getVDWRadiusFactor() const
00096 {return getFloatValue_(vdw_radius_factor_slider);}
00097
00099 float getSurfaceProbeRadius() const
00100 {return getFloatValue_(surface_probe_radius_slider);}
00101
00103 float getTubeRadius() const
00104 {return getFloatValue_(tube_radius_slider);}
00105
00107 float getCartoonTubeRadius() const
00108 {return getFloatValue_(cartoon_tube_radius_slider);}
00109
00111 float getCartoonHelixRadius() const
00112 {return getFloatValue_(cartoon_helix_radius_slider);}
00113
00115 float getCartoonArrowWidth() const
00116 {return getFloatValue_(strand_arrow_width_slider);}
00117
00119 float getCartoonStrandHeight() const
00120 {return getFloatValue_(strand_height_slider);}
00121
00123 float getCartoonStrandWidth() const
00124 {return getFloatValue_(strand_width_slider);}
00125
00127 float getHBondsRadius() const
00128 {return getFloatValue_(hbonds_radius_slider);}
00129
00131 float getForceMaxLength() const
00132 {return getFloatValue_(force_max_length_slider);}
00133
00135 float getForceScaling() const
00136 { return getFloatValue_(force_scaling_slider);}
00137
00139 float getForceBase() const
00140 {return getFloatValue_(force_base_slider);}
00141
00143 float getForceOffset() const
00144 {return getFloatValue_(force_offset_slider);}
00145
00147 float getDNALadderRadius() const
00148 {return getFloatValue_(cartoon_dna_ladder_radius_slider);}
00149
00151 float getDNABaseRadius() const
00152 {return getFloatValue_(cartoon_dna_base_radius_slider);}
00153
00155 float getDNAHelixRadius() const
00156 {return getFloatValue_(cartoon_dna_helix_radius_slider);}
00157
00159 void setStickStickRadius(float value)
00160 { setValue_(stick_radius_slider,value);}
00161
00163 void setBallAndStickStickRadius(float value)
00164 { setValue_(ball_stick_cylinder_radius_slider,value);}
00165
00167 void setBallAndStickStickDashedBondsEnabled(bool state)
00168 { ball_stick_dashed_bonds->setChecked(state);}
00169
00171 void setBallRadius(float value)
00172 { setValue_(ball_stick_sphere_radius_slider,value);}
00173
00175 void setVDWRadiusFactor(float value)
00176 { setValue_(vdw_radius_factor_slider,value);}
00177
00179 void setSurfaceProbeRadius(float value)
00180 { setValue_(surface_probe_radius_slider,value);}
00181
00183 void setTubeRadius(float value)
00184 { setValue_(tube_radius_slider,value);}
00185
00187 void setCartoonTubeRadius(float value)
00188 { setValue_(cartoon_tube_radius_slider,value);}
00189
00191 void setCartoonHelixRadius(float value)
00192 { setValue_(cartoon_helix_radius_slider,value);}
00193
00195 void setCartoonArrowWidth(float value)
00196 { setValue_(strand_arrow_width_slider ,value);}
00197
00199 void setCartoonStrandHeight(float value)
00200 { setValue_(strand_height_slider,value);}
00201
00203 void setCartoonStrandWidth(float value)
00204 { setValue_(strand_width_slider,value);}
00205
00207 void setHBondRadius(float value)
00208 { setValue_(hbonds_radius_slider,value);}
00209
00211 void setForceMaxLenght(float value)
00212 { setValue_(force_max_length_slider,value);}
00213
00215 void setForceScaling(float value)
00216 { setValue_(force_scaling_slider,value);}
00217
00219 void setForceOffset(float value)
00220 { setValue_(force_offset_slider ,value);}
00221
00223 void setForceBase(float value)
00224 { setValue_(force_base_slider, value);}
00225
00227 void setCartoonDNALadderRadius(float value)
00228 { setValue_(cartoon_dna_ladder_radius_slider, value / 10.);}
00229
00231 void setCartoonDNAHelixRadius(float value)
00232 { setValue_(cartoon_dna_helix_radius_slider, value / 10.);}
00233
00235 void setCartoonDNABaseRadius(float value)
00236 { setValue_(cartoon_dna_base_radius_slider, value / 10.);}
00237
00238 public slots:
00239
00241
00242 protected slots:
00243 void stickRadiusChanged() {setLabelText_(stick_radius_label, stick_radius_slider);}
00244 void VDWfactorChanged() {setLabelText_(vdw_radius_factor_label, vdw_radius_factor_slider);}
00245 void ballStickSphereRadiusChanged() {setLabelText_(ball_stick_sphere_radius_label, ball_stick_sphere_radius_slider);}
00246 void ballStickCylinderRadiusChanged() {setLabelText_(ball_stick_cylinder_radius_label, ball_stick_cylinder_radius_slider);}
00247 void probeRadiusChanged() {setLabelText_(surface_probe_radius_label, surface_probe_radius_slider);}
00248 void tubeRadiusChanged() {setLabelText_(tube_radius_label, tube_radius_slider);}
00249 void cartoonTubeRadiusChanged(){setLabelText_(cartoon_tube_radius_label, cartoon_tube_radius_slider);}
00250 void cartoonHelixRadiusChanged(){setLabelText_(cartoon_helix_radius_label, cartoon_helix_radius_slider);}
00251
00252 void cartoonStrandArrowWidthChanged(){setLabelText_(strand_arrow_width_label, strand_arrow_width_slider);}
00253 void cartoonStrandHeightChanged(){setLabelText_(strand_height_label, strand_height_slider);}
00254 void cartoonStrandWidthChanged() {setLabelText_(strand_width_label, strand_width_slider);}
00255
00256 void cartoonDNAHelixRadiusChanged(){setLabelText_(cartoon_dna_helix_radius_label, cartoon_dna_helix_radius_slider);}
00257 void cartoonDNABaseRadiusChanged(){setLabelText_(cartoon_dna_base_radius_label, cartoon_dna_base_radius_slider);}
00258 void cartoonDNALadderRadiusChanged(){setLabelText_(cartoon_dna_ladder_radius_label, cartoon_dna_ladder_radius_slider);}
00259 void hbondsRadiusChanged(){setLabelText_(hbonds_radius_label, hbonds_radius_slider);}
00260 void forceScalingChanged(){setLabelText_(force_scaling_label, force_scaling_slider);}
00261 void forceMaxLengthChanged(){setLabelText_(force_max_length_label, force_max_length_slider);}
00262 void forceBaseChanged(){setLabelText_(force_base_label, force_base_slider);}
00263 void forceOffsetChanged(){setLabelText_(force_offset_label, force_offset_slider);}
00264 void changedNAMode_(bool state);
00265
00266 protected:
00267
00268 float getFloatValue_(const QSlider* const& le) const;
00269
00270 void setValue_(QSlider* le, float value);
00271
00272 void setLabelText_(QLabel* label, const QSlider* const from);
00273
00274 void setDefaultValues_();
00275 };
00276
00277 } }
00278
00279 #endif