glmoleculeview.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                        glmoleculeview.h  -  description
00003                              -------------------
00004     begin                : Mon Jul 29 2002
00005     copyright            : (C) 2002-2006 by Ben Swerts
00006     email                : bswerts@users.sourceforge.net
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00020 
00021 #ifndef GLMOLECULEVIEW_H
00022 #define GLMOLECULEVIEW_H
00023 
00025 
00026 // STL includes
00027 #include <list>
00028 #include <vector>
00029 
00030 // Qt forward class declarations
00031 //class QDomDocument;
00032 //class QDomElement;
00033 
00034 // Xbrabo forward class declarations
00035 class AtomSet;
00036 class IsoSurface;
00037 class DensityBase;
00038 class NewAtomBase;
00039 
00040 // Base class header file
00041 #include <glsimplemoleculeview.h>
00042 
00044 class GLMoleculeView : public GLSimpleMoleculeView
00045 {
00046   Q_OBJECT
00047 
00048   public:
00049     GLMoleculeView(AtomSet* atomset, QWidget* parent = 0, const char* name = 0);// constructor
00050     ~GLMoleculeView();                  // destructor
00051 
00052   signals:
00053     void atomsetChanged();              
00054 
00055   public slots:
00056     void alterCartesian();              // alters the cartesian coordinates of the selected atoms
00057     void alterInternal();               // alters the value of the selected internal coordinate
00058           void showDensity();                 // shows electron density isosurfaces 
00059     void addAtoms();                    // adds atoms using a dialog
00060     void deleteSelectedAtoms();         // deletes all selected atoms
00061     void toggleSelection();             // toggles the manipulation target
00062 
00063   protected:
00064     void mouseMoveEvent(QMouseEvent* e);// event which takes place when the mouse is moved while a mousebutton is pressed
00065     void keyPressEvent(QKeyEvent* e);   // event which takes places when a key is pressed
00066     //void wheelEvent(QWheelEvent* e);    // event which takes place when the scrollwheel of the mouse is used
00067     //void translateZ(const int amount);  // handles Z-direction translations
00068     //void translateXY(const int amountX, const int amountY); // handles X- and Y-direction translations
00069     virtual void updateShapes();        // updates the shapes vector
00070 
00071 private slots:
00072     void addGLSurface(const unsigned int index);  // adds a surface to the GL display list
00073     void updateGLSurface(const unsigned int index);         // updates an existing surface GL display list 
00074     void deleteGLSurface(const unsigned int index);         // deletes an existing surface GL display list
00075 
00076   private:
00078     enum ShapeTypesExtra{SHAPE_SURFACE = SHAPE_NEXT};
00079 
00081     float boundingSphereRadius();      // calculates the radius of the bounding sphere
00082     void translateSelection(const int xRange, const int yRange, const int zRange);        // translates the selected atoms according to the current view
00083     void rotateSelection(const double angleX, const double angleY, const double angleZ);  // rotates the selected atoms around their local center of mass
00084     void changeSelectedIC(const int range);       // changes the selected internal coordinate
00085     void drawItem(const unsigned int index);    // draws the item shapes[index]
00086     
00088     AtomSet* atoms;                     
00089     IsoSurface* isoSurface;             
00090     DensityBase* densityDialog;         
00091     NewAtomBase* newAtomDialog;         
00092     std::vector<GLuint> glSurfaces;     
00093     bool manipulateSelection;           
00094 };
00095    
00096 #endif
00097 

Generated on Fri May 19 14:31:54 2006 for Brabosphere by  doxygen 1.4.6-NO