SimpleFastOpenAtomicVisualiser
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
main.h File Reference
#include <sstream>
#include <chrono>
#include <exception>
#include <algorithm>
#include <stb_image_write.h>
#include <jGL/jGL.h>
#include <jGL/OpenGL/openGLInstance.h>
#include <jGL/Display/desktopDisplay.h>
#include <jGL/orthoCam.h>
#include <icon.h>
#include <jLog/jLog.h>
#include <atom.h>
#include <atomRenderer.h>
#include <bondRenderer.h>
#include <axes.h>
#include <util.h>
#include <glUtils.h>
#include <structureUtils.h>
#include <commandLine.h>
#include <xyz.h>
#include <config.h>
#include <camera.h>
#include <cell.h>
#include <console.h>
#include <visualisationState.h>
#include <neighbours.h>
Include dependency graph for main.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Theme
 A background and text colour theme. More...
 

Macros

#define STB_IMAGE_WRITE_IMPLEMENTATION
 

Functions

void screenshot (glm::ivec2 resolution)
 Obtain screen pixels and write to a png.
 
void keyEventCallback (GLFWwindow *window, int key, int scancode, int action, int mods)
 Override jGL default event callback.
 
Theme darkTheme ()
 A dark colour theme.
 
Theme lightTheme ()
 A light colour theme.
 
bool cameraControls (jGL::DesktopDisplay &display, Camera &camera)
 Controls for the camera.
 
bool atomControls (jGL::DesktopDisplay &display, std::vector< Atom > &atoms, std::map< int, Element > &emphasisControls, std::multimap< Element, uint64_t > &elementMap, std::vector< float > &alphaOverrides, float deemphasisAlpha)
 Controls for the Atoms position's.
 
void setAlpha (std::vector< Atom > &atoms, std::vector< float > alphas)
 Set the alpha channel of Atom colours.
 
void loadingScreenFrame (jGL::DesktopDisplay &display, Camera &camera, AtomRenderer &loadingAtoms, std::string progressMessage, Theme theme, const unsigned int resX, const unsigned int resY, bool hideInfo=false)
 Display a frame of the loading screen.
 
void backward (std::unique_ptr< Structure > &structure)
 Move back one frame.
 
void setTransparencySorting (const std::vector< Atom > &atoms, AtomRenderer &atomRenderer, BondRenderer &bondRenderer)
 Enable of disable transparency sorting if there are transparent elements.
 

Variables

const float dr = (1.0)*0.5
 
const float dtheta = (3.14)*0.025
 
const float dphi = (2.0*3.14)*0.05
 
const float emphasisedAlpha = 1.0f
 
bool closing = false
 
std::unique_ptr< jGL::jGLInstance > jGLInstance
 

Macro Definition Documentation

◆ STB_IMAGE_WRITE_IMPLEMENTATION

#define STB_IMAGE_WRITE_IMPLEMENTATION

Function Documentation

◆ atomControls()

bool atomControls ( jGL::DesktopDisplay display,
std::vector< Atom > &  atoms,
std::map< int, Element > &  emphasisControls,
std::multimap< Element, uint64_t > &  elementMap,
std::vector< float > &  alphaOverrides,
float  deemphasisAlpha 
)

Controls for the Atoms position's.

Parameters
displaythe display to get events from.
atomsthe Atoms to modify.
emphasisControlskey bindings to emphasise elements.
Returns
true if the Atoms were modified.
false if the Atoms were not modified.

◆ backward()

void backward ( std::unique_ptr< Structure > &  structure)

Move back one frame.

Parameters
structurethe Structure file.

◆ cameraControls()

bool cameraControls ( jGL::DesktopDisplay display,
Camera camera 
)

Controls for the camera.

Parameters
displaydisplay to obtain events from.
camerathe camera to update.
Returns
true if the camera moved.
false if the camera did not move.

◆ darkTheme()

Theme darkTheme ( )

A dark colour theme.

Returns
the Theme.

◆ keyEventCallback()

void keyEventCallback ( GLFWwindow window,
int  key,
int  scancode,
int  action,
int  mods 
)

Override jGL default event callback.

Remarks
So window closing can account for video writing.
Parameters
windowthe active GLFWwindow.
keythe key code.
scancodethe key's scancode.
actionthe action performed.
modsmods.

◆ lightTheme()

Theme lightTheme ( )

A light colour theme.

Returns
the Theme.

◆ loadingScreenFrame()

void loadingScreenFrame ( jGL::DesktopDisplay display,
Camera camera,
AtomRenderer loadingAtoms,
std::string  progressMessage,
Theme  theme,
const unsigned int  resX,
const unsigned int  resY,
bool  hideInfo = false 
)

Display a frame of the loading screen.

Parameters
displaythe display to get events from.
camerathe camera for the loading screen.
loadingAtomsthe Atoms to display.
progressMessagethe progress information to draw.

◆ screenshot()

void screenshot ( glm::ivec2  resolution)

Obtain screen pixels and write to a png.

Parameters
resolutionthe screen resolution.
Remarks
The file name is a timestamp.

◆ setAlpha()

void setAlpha ( std::vector< Atom > &  atoms,
std::vector< float alphas 
)

Set the alpha channel of Atom colours.

Parameters
atomsthe atoms to set.
alphasthe alphas to set.

◆ setTransparencySorting()

void setTransparencySorting ( const std::vector< Atom > &  atoms,
AtomRenderer atomRenderer,
BondRenderer bondRenderer 
)

Enable of disable transparency sorting if there are transparent elements.

Parameters
atomsthe Atoms to check.
atomRendererthe AtomRenderer to enable/disable transparency sorting on.
bondRendererthe BondRenderer to enable/disable transparency sorting on.

Variable Documentation

◆ closing

bool closing = false

◆ dphi

const float dphi = (2.0*3.14)*0.05

◆ dr

const float dr = (1.0)*0.5

◆ dtheta

const float dtheta = (3.14)*0.025

◆ emphasisedAlpha

const float emphasisedAlpha = 1.0f

◆ jGLInstance

std::unique_ptr<jGL::jGLInstance> jGLInstance