Molecule Visualizer
 All Classes Namespaces Files Functions Enumerations Enumerator Macros Groups Pages
abstractscene.h
Go to the documentation of this file.
1 
7 #ifndef ABSTRACTSCENE_H
8 #define ABSTRACTSCENE_H
9 
10 #include <string>
11 #include "Camera.h"
12 
13 
14 class QOpenGLContext;
15 
16 
18 {
19 public:
20  AbstractScene() {}
21 
27  void setContext(QOpenGLContext *context) { mContext = context; }
28 
33  QOpenGLContext* context() const { return mContext; }
34 
39  virtual void initialize() = 0;
40 
45  virtual void compileShader() = 0;
46 
52  virtual void update(float t) = 0;
53 
58  virtual void render() = 0;
59 
66  virtual void resize(int width, int height) = 0;
67 
73  virtual bool loadModelFromPath(const std::string absoluteFilePath) = 0;
74 
75  virtual void rotateAzimuth(float t) = 0;
76 
77  virtual void rotatePolar(float t) = 0;
78 
79 
85  virtual void setAmbientFactor(float ambientFactor) = 0;
86 
92  virtual void setDiffuseFactor(float diffuseFactor) = 0;
93 
99  virtual void setSpecularFactor(float specularFactor) = 0;
100 
106  virtual void setNearPlane(float nearPlane) = 0;
107 
113  virtual void setFarPlane(float farPlane) = 0;
114 
121  virtual void setAmbientOcclusion(bool value) = 0;
122 
123  virtual void setShadowEnabled(bool value) = 0;
124 
125  virtual void setContourEnabled(bool value) = 0;
126 
127  virtual void setContourConstant(bool value) = 0;
128 
129  virtual void setDepthFactor(float depthFactor) = 0;
130 
131  virtual void setContourWidth(float width) = 0;
132 
133  virtual void setAmbientIntensity(float value) = 0;
134 
135  virtual void switchAmbientOcclusionQuality(int quality) = 0;
136 
137 
138  Camera mCamera;
139 
140 protected:
141  QOpenGLContext *mContext;
142 };
143 
144 #endif // ABSTRACTSCENE_H
Definition: abstractscene.h:17
virtual void update(float t)=0
A virtual member function that updates the scene (has to be overwritten).
QOpenGLContext * context() const
A member function to get the OpenGL context.
Definition: abstractscene.h:33
Definition: Camera.h:17
virtual void setSpecularFactor(float specularFactor)=0
Set the specular factor for lighting.
virtual bool loadModelFromPath(const std::string absoluteFilePath)=0
A virtual member function that loads a model from a given path(has to be overwritten).
virtual void initialize()=0
A virtual member function that initializes the scene (has to be overwritten).
virtual void setDiffuseFactor(float diffuseFactor)=0
Set the diffuse factor for lighting.
virtual void setAmbientFactor(float ambientFactor)=0
Set the ambient factor for lighting.
virtual void setNearPlane(float nearPlane)=0
Set the near plane of the camera.
virtual void render()=0
A virtual member function that renders the scene(has to be overwritten).
virtual void setFarPlane(float farPlane)=0
Set the far plane of the camera.
virtual void compileShader()=0
A virtual member function that compiles a shader(has to be overwritten).
virtual void setAmbientOcclusion(bool value)=0
Toggle ambient occlusion on/off.
virtual void resize(int width, int height)=0
A virtual member function that resizes the scene(has to be overwritten).
void setContext(QOpenGLContext *context)
A member function to set the OpenGL context.
Definition: abstractscene.h:27
Class for a Camera.