Molecule Viewer
 All Classes Functions Variables Enumerations Pages
Public Member Functions | List of all members
AppMain Class Reference

The main class of Molecule Viewer Renderer. More...

#include <AppMain.hpp>

Public Member Functions

 AppMain (void)
 Creates the Molecule Renderer.
 
void PrepareScene ()
 Sets up the shaders, the framebuffer object and the two textures for ambient occlusion and for shadow mapping.
 
void DrawScene ()
 Draws the the scene (if a molecule is loaded)
 
void UpdateWindowSize ()
 Updates the scene's camera projection matrix with the current window size. More...
 
void RotateMolecule (const double x_rotation, const double y_rotation)
 Rotates the molecule around the x and y axis. More...
 
void MoveLight (const double x_rotation, const double y_rotation)
 Rotates the the main light around the molecule (distance to molecule fixed). More...
 
void MoveCamera (const double x_translation, const double y_translation)
 Moves the camera in up/down and left/right (translation in x and y direction). More...
 
void ZoomInOut (const double z_translation)
 Moves the camera nearer to the molecule or farer away from the molecule. More...
 
bool LoadMolecule (const string filename)
 Loads a molecule (*.pdb file) with a given absolute filepath.
 
void ChangeLightIntensity (const int pointLightIntensity)
 Changes the intensity of the main point light (value between 0 and 255).
 
void ChangeAmbientIntensity (const int ambientIntensity)
 Changes the intensity of the ambient light (value between 0 and 255)
 
void ChangeGlossiness (const int glossiness)
 Changes the glossiness of the molecule (value between 0 and 255)
 
void ToggleShadow (const bool shadows)
 Turns shadows on (shadows = true) and off (shadows = false)
 
void ChangeBorder (const int borderWidth, const int depthAwareness)
 Changes the width of the borders around the molecule atoms and depth awareness of the borders (both values between 0 and 255) More...
 
void ToggleAmbientOcclusion (const bool ambientOcclusionActive)
 Turns ambient occlusion on (ambientOcclusionActive = true) and off (ambientOcclusionActive = false) More...
 
void ChangeOcclusionQuality (int occlusionQuality)
 Updates the quality (=number of directions) used for ambient occlusion computation. More...
 
void ChangeColorMode (int colorMode)
 Updates the current color mode of the rendering. More...
 
const string & GetErrorMessage () const
 

Detailed Description

The main class of Molecule Viewer Renderer.

This class implements the actual drawing of the molecule and the ambient occlusion computation.

Definition at line 13 of file AppMain.hpp.

Member Function Documentation

void AppMain::ChangeBorder ( const int  borderWidth,
const int  depthAwareness 
)

Changes the width of the borders around the molecule atoms and depth awareness of the borders (both values between 0 and 255)

  • if the depth awareness is 0, the border width is equal for all atoms
  • if the depth awareness is increased, the width depends on the depth difference to next atom behind the current one.

Definition at line 393 of file AppMain.cpp.

void AppMain::ChangeColorMode ( int  colorMode)

Updates the current color mode of the rendering.

colorMode: 0 = Color per atom, 1 = Color per chain, 2 = No color.

Definition at line 345 of file AppMain.cpp.

void AppMain::ChangeOcclusionQuality ( int  occlusionQuality)

Updates the quality (=number of directions) used for ambient occlusion computation.

occlusionQuality: 0 = low, 1 = medium, 2 = high

Definition at line 349 of file AppMain.cpp.

void AppMain::MoveCamera ( const double  x_translation,
const double  y_translation 
)

Moves the camera in up/down and left/right (translation in x and y direction).

x_translation and y_translation determine the amount of the translation

Definition at line 255 of file AppMain.cpp.

void AppMain::MoveLight ( const double  x_rotation,
const double  y_rotation 
)

Rotates the the main light around the molecule (distance to molecule fixed).

x_rotation and y_rotation determine the strength of the rotation

Definition at line 250 of file AppMain.cpp.

void AppMain::RotateMolecule ( const double  x_rotation,
const double  y_rotation 
)

Rotates the molecule around the x and y axis.

x_rotation and y_rotation determine the strength of the rotation

Definition at line 244 of file AppMain.cpp.

void AppMain::ToggleAmbientOcclusion ( const bool  ambientOcclusionActive)

Turns ambient occlusion on (ambientOcclusionActive = true) and off (ambientOcclusionActive = false)

If it is turned off, a constant value is used for the ambient lighting

Definition at line 399 of file AppMain.cpp.

void AppMain::UpdateWindowSize ( )

Updates the scene's camera projection matrix with the current window size.

Has to be called, when the window size changes!

Definition at line 291 of file AppMain.cpp.

void AppMain::ZoomInOut ( const double  z_translation)

Moves the camera nearer to the molecule or farer away from the molecule.

  • Zoom in when z_translation is negative
  • Zoom out when z_translation is positive

x_translation also determines the amount of the translation

Definition at line 275 of file AppMain.cpp.


The documentation for this class was generated from the following files: