00001 #ifndef BALL_VIEW_WIDGETS_SDWIDGET_H
00002 #define BALL_VIEW_WIDGETS_SDWIDGET_H
00003
00004 #ifndef BALL_COMMON_GLOBAL_H
00005 # include <BALL/COMMON/global.h>
00006 #endif
00007
00008 #ifndef BALL_DATATYPE_OPTIONS_H
00009 # include <BALL/DATATYPE/options.h>
00010 #endif
00011
00012 #include <BALL/KERNEL/system.h>
00013 #include <QtGui/qwidget.h>
00014
00015 namespace BALL
00016 {
00017 namespace VIEW
00018 {
00019
00021 class BALL_VIEW_EXPORT SDWidget
00022 : public QWidget
00023 {
00024 public:
00025
00029
00030 struct BALL_VIEW_EXPORT Option
00031 {
00034 static const char* SHOW_HYDROGENS;
00035 };
00036
00038 struct BALL_VIEW_EXPORT Default
00039 {
00040 static const bool SHOW_HYDROGENS;
00041 };
00042
00044
00046 SDWidget(QWidget *parent = 0, bool show_hydrogens = false);
00047
00049 SDWidget(const System& system, QWidget *parent = 0, bool resize_to_parent = true);
00050
00052 virtual ~SDWidget();
00053
00057
00058 Options options;
00059
00062 void setDefaultOptions();
00064
00066 void plot(const System& system, bool clear = true, bool create_sd = true);
00067
00069 System& getSystem() {return system_;};
00070
00072 const System& getSystem() const {return system_;};
00073
00075 void setSystem(const System& system) {system_ = system;};
00076
00078 void clear();
00079
00080 protected:
00081 void paintEvent(QPaintEvent *event);
00082
00083 QPointF getEndpoint_(QRectF& character_boundary, QPointF from, QPointF to);
00084 System system_;
00085
00086 bool resize_to_parent_;
00087 bool clear_;
00088 };
00089
00090 }
00091 }
00092
00093 #endif