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
00014 #include <QtGui/QWidget>
00015
00016 namespace BALL
00017 {
00018 namespace VIEW
00019 {
00020
00022 class BALL_VIEW_EXPORT SDWidget
00023 : public QWidget
00024 {
00025 Q_OBJECT
00026
00027 public:
00028
00032
00033 struct BALL_VIEW_EXPORT Option
00034 {
00037 static const char* SHOW_HYDROGENS;
00038 };
00039
00041 struct BALL_VIEW_EXPORT Default
00042 {
00043 static const bool SHOW_HYDROGENS;
00044 };
00045
00047
00049 SDWidget(QWidget *parent = 0, bool show_hydrogens = false);
00050
00052 SDWidget(const System& system, QWidget *parent = 0);
00053
00055 virtual ~SDWidget();
00056
00060
00061 Options options;
00062
00065 void setDefaultOptions();
00067
00069 void plot(const System& system, bool create_sd = true);
00070
00072 System& getSystem() {return system_;};
00073
00075 const System& getSystem() const {return system_;};
00076
00078 void setSystem(const System& system) {system_ = system;};
00079
00081 void clear();
00082
00083 QSize sizeHint() const;
00084
00085 protected slots:
00086 void exportImage_();
00087
00088 protected:
00089 void setup_();
00090 void paintEvent(QPaintEvent *event);
00091
00092 void renderSD_(QPaintDevice* paint_device);
00093 void drawFrame_();
00094
00095 QPointF getEndpoint_(QRectF& character_boundary, QPointF from, QPointF to, bool character_is_from);
00096 System system_;
00097
00098 bool resize_to_parent_;
00099
00100 Vector3 upper_;
00101 Vector3 lower_;
00102 };
00103
00104 }
00105 }
00106
00107 #endif