AmbientOcclusion
Molecule Class Reference

The Molecule class - This class represents a molecule. It consists of atoms and bonds. More...

#include <Molecule.h>

Inherits SceneObject.

Public Member Functions

 Molecule (QMatrix4x4 _modelMatrix)
 
 ~Molecule ()
 
void initGL (QOpenGLShaderProgram *mainShader, QOpenGLShaderProgram *shadowMapShader, QOpenGLShaderProgram *ambientOcclusionMapShader, QOpenGLShaderProgram *edgeShader, QOpenGLShaderProgram *haloShader)
 initGL - Initializes the communication with opengl More...
 
void draw (DRAW_TYPE type)
 draw - Draws the corresponding VBO to the screen More...
 
QVector3D findColor (std::string atomName)
 findColor More...
 
float findRadius (std::string atomName, RadiusEnum radiusType)
 findRadius More...
 
QVector3D findChainColor (int chainID)
 findChainColor More...
 
QVector3D findMoleculeCenter ()
 findMoleculeCenter More...
 
void centerMolecule (QVector3D center)
 centerMolecule - Resets the molecule to the center in world space (0, 0 ,0). This method must be called before initGL. Otherwise the new positions will not be updated on the GPU More...
 
float getBoundingSphereRadius ()
 getBoundingSphereRadius More...
 
QVector3D findCameraTranslation ()
 findCameraTranslation More...
 
- Public Member Functions inherited from SceneObject
 SceneObject (QMatrix4x4 _modelMatrix)
 
virtual ~SceneObject ()
 
void rotateX (float angle)
 
void rotateY (float angle)
 
void rotateZ (float angle)
 
void rotateX_World (float angle)
 
void rotateY_World (float angle)
 
void rotateZ_World (float angle)
 
void translate (QVector3D direction)
 
void setPosition (QVector3D newPos)
 

Public Attributes

std::vector< Atom > * atoms
 atoms - Contains information of all atoms-> Stores all the atoms in this molecule. More...
 
- Public Attributes inherited from SceneObject
QMatrix4x4 modelMatrix
 

Detailed Description

The Molecule class - This class represents a molecule. It consists of atoms and bonds.

Constructor & Destructor Documentation

Molecule::Molecule ( QMatrix4x4  _modelMatrix)
Molecule::~Molecule ( )

Member Function Documentation

void Molecule::centerMolecule ( QVector3D  center)

centerMolecule - Resets the molecule to the center in world space (0, 0 ,0). This method must be called before initGL. Otherwise the new positions will not be updated on the GPU

Parameters
center
void Molecule::draw ( DRAW_TYPE  type)

draw - Draws the corresponding VBO to the screen

Parameters
type- enumeration component specifying the type of this draw
QVector3D Molecule::findCameraTranslation ( )

findCameraTranslation

Returns
calculate by which distance the camera needs to be translated along positive Z-axis, so that user can see whole model at once
QVector3D Molecule::findChainColor ( int  chainID)

findChainColor

Parameters
chainID
Returns
Finds the corresponding chain color of the atom with the given id
QVector3D Molecule::findColor ( std::string  atomName)

findColor

Parameters
atomName
Returns
Finds the corresponging color and radius of the atom name. If not found the function returns a basic 4D vector containing ones (WHITE)
QVector3D Molecule::findMoleculeCenter ( )

findMoleculeCenter

Returns
Determines the center of the molecule, e.g. the center of the surrounding bounding sphere
float Molecule::findRadius ( std::string  atomName,
RadiusEnum  radiusType 
)

findRadius

Parameters
atomName
radiusType
Returns
Return the radius of the atom with the given name and type
float Molecule::getBoundingSphereRadius ( )

getBoundingSphereRadius

Returns
Returns the radius of the bounding sphere
void Molecule::initGL ( QOpenGLShaderProgram *  mainShader,
QOpenGLShaderProgram *  shadowMapShader,
QOpenGLShaderProgram *  ambientOcclusionMapShader,
QOpenGLShaderProgram *  edgeShader,
QOpenGLShaderProgram *  haloShader 
)

initGL - Initializes the communication with opengl

Parameters
mainShader
shadowMapShader
ambientOcclusionMapShader
edgeShader
haloShader

Member Data Documentation

std::vector<Atom>* Molecule::atoms

atoms - Contains information of all atoms-> Stores all the atoms in this molecule.


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