1 | /*
|
---|
2 | * GLWorldView.hpp
|
---|
3 | *
|
---|
4 | * Created on: Auf 11, 2010
|
---|
5 | * Author: heber
|
---|
6 | */
|
---|
7 |
|
---|
8 | #ifndef GLWORLDVIEW_HPP_
|
---|
9 | #define GLWORLDVIEW_HPP_
|
---|
10 |
|
---|
11 | // include config.h
|
---|
12 | #ifdef HAVE_CONFIG_H
|
---|
13 | #include <config.h>
|
---|
14 | #endif
|
---|
15 |
|
---|
16 | #include "qglview.h"
|
---|
17 | #include "qglteapot.h"
|
---|
18 |
|
---|
19 | //class QKeyEvent;
|
---|
20 | //class GLWorldScene;
|
---|
21 | class QGLSceneNode;
|
---|
22 | class QGLPainter;
|
---|
23 |
|
---|
24 | /** This class is the view on the 3D representation of the World, i.e. the whole
|
---|
25 | * of all molecules (consisting of atoms).
|
---|
26 | *
|
---|
27 | */
|
---|
28 | class GLWorldView : public QGLView
|
---|
29 | {
|
---|
30 | Q_OBJECT
|
---|
31 | public:
|
---|
32 | GLWorldView(QWidget *parent=0);
|
---|
33 | virtual ~GLWorldView();
|
---|
34 |
|
---|
35 | public slots:
|
---|
36 |
|
---|
37 | protected:
|
---|
38 | void initializeGL(QGLPainter *painter);
|
---|
39 | void paintGL(QGLPainter *painter);
|
---|
40 | //void keyPressEvent(QKeyEvent *e);
|
---|
41 |
|
---|
42 | private:
|
---|
43 | //GLWorldScene *worldscene;
|
---|
44 | QGLSceneNode *worldscene;
|
---|
45 | };
|
---|
46 |
|
---|
47 |
|
---|
48 |
|
---|
49 | //#include "CodePatterns/Observer.hpp"
|
---|
50 | //#include "LinearAlgebra/Vector.hpp"
|
---|
51 | //#include "changetypes.hpp"
|
---|
52 | //
|
---|
53 | //class atom;
|
---|
54 | //class element;
|
---|
55 | //class molecule;
|
---|
56 | //
|
---|
57 | //class GLMoleculeView : public QGLWidget, public Observer
|
---|
58 | //{
|
---|
59 | // Q_OBJECT
|
---|
60 | //
|
---|
61 | //public:
|
---|
62 | //
|
---|
63 | // GLMoleculeView( QWidget* parent);
|
---|
64 | // ~GLMoleculeView();
|
---|
65 | //
|
---|
66 | //public slots:
|
---|
67 | //
|
---|
68 | // void setXRotation( int degrees );
|
---|
69 | // void setYRotation( int degrees );
|
---|
70 | // void setZRotation( int degrees );
|
---|
71 | // void setScale( int distance );
|
---|
72 | // void setLightPosition( int *light );
|
---|
73 | // void setLightDiffuse( int *light );
|
---|
74 | // void setLightAmbient( int *light );
|
---|
75 | // void createDialogLight();
|
---|
76 | // void toggleMultiViewEnabled();
|
---|
77 | //
|
---|
78 | // void init( QLabel *ptr );
|
---|
79 | // void initCoordinates(QLabel *ptr);
|
---|
80 | // void createView();
|
---|
81 | // void hearMoleculeSelected(molecule *mol);
|
---|
82 | // void hearAtomSelected(molecule *mol, atom *Walker);
|
---|
83 | // void hearMoleculeChanged(molecule *mol, enum ChangesinMolecule type);
|
---|
84 | // void hearAtomChanged(molecule *mol, atom *Walker, enum ChangesinAtom type);
|
---|
85 | // void hearElementChanged(element *Runner, enum ChangesinElement type);
|
---|
86 | // void hearMoleculeAdded(molecule *mol);
|
---|
87 | // void hearAtomAdded(molecule *mol, atom *Walker);
|
---|
88 | // void hearMoleculeRemoved(molecule *mol);
|
---|
89 | // void hearAtomRemoved(molecule *mol, atom *Walker);
|
---|
90 | //
|
---|
91 | //signals:
|
---|
92 | // void notifyMoleculeSelected( molecule *mol );
|
---|
93 | // void notifyAtomSelected( molecule *mol, atom *Walker );
|
---|
94 | // void notifyMoleculeChanged( molecule *mol, enum ChangesinMolecule type );
|
---|
95 | // void notifyAtomChanged( molecule *mol, atom *Walker, enum ChangesinAtom type );
|
---|
96 | // void notifyElementChanged( element *Runner, enum ChangesinElement type );
|
---|
97 | // void notifyMoleculeAdded( molecule *mol);
|
---|
98 | // void notifyElementAdded( element *Runner);
|
---|
99 | // void notifyAtomAdded( molecule *mol, atom *Walker );
|
---|
100 | // void notifyMoleculeRemoved( molecule *mol );
|
---|
101 | // void notifyAtomRemoved( molecule *mol, atom *Walker );
|
---|
102 | //
|
---|
103 | //protected:
|
---|
104 | //
|
---|
105 | // void initializeGL();
|
---|
106 | // void paintGL();
|
---|
107 | // void resizeGL( int w, int h );
|
---|
108 | // void makeSphere(const Vector &x, double radius, const unsigned char color[3]);
|
---|
109 | // void makeCylinder(const Vector &x, const Vector &y, double radius, double height, const unsigned char color[3]);
|
---|
110 | // void mousePressEvent(QMouseEvent* event);
|
---|
111 | // void mouseReleaseEvent(QMouseEvent* event);
|
---|
112 | //
|
---|
113 | //public:
|
---|
114 | //
|
---|
115 | // /** Update function as we are an Observer.
|
---|
116 | // *
|
---|
117 | // * @param publisher ref to Observable
|
---|
118 | // */
|
---|
119 | // void update(Observable *publisher);
|
---|
120 | //
|
---|
121 | // /**
|
---|
122 | // * This method is called when a special named change
|
---|
123 | // * of the Observable occured
|
---|
124 | // */
|
---|
125 | // void recieveNotification(Observable *publisher, Notification_ptr notification);
|
---|
126 | //
|
---|
127 | // /**
|
---|
128 | // * This method is called when the observed object is destroyed.
|
---|
129 | // */
|
---|
130 | // void subjectKilled(Observable *publisher);
|
---|
131 | //
|
---|
132 | //
|
---|
133 | //private:
|
---|
134 | //
|
---|
135 | // typedef std::map< size_t, node > AtomNodeMap;
|
---|
136 | // typedef std::map< std::pair< size_t, size_t> , node > BondNodeMap;
|
---|
137 | // typedef std::map< size_t, QGLMaterial *> ElementMaterialMap;
|
---|
138 | //
|
---|
139 | // ElementMaterialMap ElementNoMaterialMap;
|
---|
140 | // AtomNodeMap AtomsinSceneMap;
|
---|
141 | // BondNodeMap BondsinSceneMap;
|
---|
142 | //
|
---|
143 | // QGLMaterial* getMaterial(size_t);
|
---|
144 | // QGLSceneNode* getAtom(size_t);
|
---|
145 | // QGLSceneNode* getBond(size_t, size_t);
|
---|
146 | //
|
---|
147 | // // old stuff
|
---|
148 | //
|
---|
149 | // GLuint object; // call list for the scene to be rendered
|
---|
150 | // GLfloat xRot, yRot, zRot, scale; // rotation angles and scaling (zoom)
|
---|
151 | // Vector position; //!< position of observer
|
---|
152 | // Vector view; //!< point along line of view
|
---|
153 | // Vector top; //!< giving upwards direction
|
---|
154 | // Vector X,Y,Z; //!< vectors defining the coordinate system
|
---|
155 | // int width; //!< width of window
|
---|
156 | // int height; //!< height of window
|
---|
157 | //
|
---|
158 | // QLabel *StatusBar; //!< pointer to status bar for messages
|
---|
159 | // QLabel *CoordinatesBar; //!< pointer to coordinates bar for view port
|
---|
160 | //
|
---|
161 | // GLfloat LightPosition[4]; //!< Light Position
|
---|
162 | // GLfloat LightDiffuse[4]; //!< Diffuse Light Values
|
---|
163 | // GLfloat LightAmbient[4]; //!< Ambient Light Values
|
---|
164 | //
|
---|
165 | // QPoint LeftButtonPos; //!< mouse position on mousePressEvent for LeftButton
|
---|
166 | // QPoint MiddleButtonPos; //!< mouse position on mousePressEvent for MidButton
|
---|
167 | // QPoint RightButtonPos; //!< mouse position on mousePressEvent for RightButton
|
---|
168 | //
|
---|
169 | // unsigned char SelectionColor[3] ; //!< highlight color
|
---|
170 | //
|
---|
171 | // bool isSignaller;
|
---|
172 | //
|
---|
173 | // bool MultiViewEnabled; //!< if true, split screen into four parts with additional xy,xz,yz views
|
---|
174 | //};
|
---|
175 |
|
---|
176 | #endif /* GLWORLDVIEW_HPP_ */
|
---|