1 #ifndef DSRGLWINDOW_H
2 #define DSRGLWINDOW_H
3 
4 #include "molecule.h"
5 #include "dsrgui.h"
6 
7 class DSRGlWindow : public QGLWidget
8 {
9   Q_OBJECT
10 
11 public:
12   DSRGlWindow(QWidget *parent, Molecule *m, DSRMol header, QString fragment);
13   virtual ~DSRGlWindow();
14   CEnvironment xd;        //!< MyAtom list of the molecule
15   CEnvironment selFragAt; //! MyAtom list of selected fragment atoms
16   CEnvironment fita;      //! MyAtom list of atoms where the fragment is fitted to plus the surrounding
17   Connection bonds;       //!< MyBond list of the fragment molecule bonds
18   Connection fitabonds;   //!< MyBond list of the target molecule bonds
19   Molecule *m_molecule;
20   QString source_atoms;
21   QCheckBox *showFit;
22   QCheckBox *showFitLabel;
23 public slots:
24   void display_fragment(DSRMol frag, bool clear_sel=true);
25   void makeInfo();
26   void clear_molecule();
27   void set_label_color();
28   void mousePressEvent(QMouseEvent *event);
29 signals:
30   void sourceStringChanged();
31   void updateInfo(QString);
32 protected:
33   void initializeGL();
34   void resizeGL(int width, int height);
35   void paintGL();
36   void mouseMoveEvent(QMouseEvent *event);
37   void wheelEvent(QWheelEvent *event);
38 private:
39   inline void __RotateCS( double c, double s, double& X, double& Y ) ;
40   void glTranslateL( const double dx, const double dy, const double dz );
41   void glRotateL( const double dang, const double x, const double y, const double z );
42   QFont myFont; //!< a font for the atom labels
43   Molecule mole;
44   QColor dsrLabelColor;
45   GLint vp[4];
46   void draw();
47   double L, moux, mouy;
48   void tryfit();
49   virtual QSize sizeHint() const;
50   virtual QSize minimumSizeHint() const;
51 };
52 
53 #endif // DSRGLWINDOW_H
54