SimpleFastOpenAtomicVisualiser
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
CommandLine Struct Reference

Extract command line arguments. More...

#include <commandLine.h>

Collaboration diagram for CommandLine:
Collaboration graph
[legend]

Public Member Functions

 CommandLine ()=default
 
 CommandLine (uint8_t count, char **commandLine)
 Extract values from argv.
 
int lua_setOption (lua_State *lua)
 Set an option from Lua.
 
int lua_getOption (lua_State *lua)
 Get an option value in Lua.
 
void checkSpecial (std::string arg)
 Determine if help or licenses should be printed.
 
void welcome () const
 
void help () const
 Print the help message and std::exit(EXIT_SUCCESS);.
 
void licenses ()
 
void gpl ()
 

Public Attributes

Argument< std::filesystem::path > structure = {"atoms", "Structure path.", "", {}}
 
Argument< std::filesystem::path > script = {"script", "Path to Lua script", "Called each frame.", {}}
 
Argument< uint8_t > levelOfDetail = {"levelOfDetail", "Level of detail of meshes.", "", 0}
 
Argument< uint8_t > msaa = {"msaa", "MSAA level [0-32].", "", 0}
 
Argument< uint8_t > speed = {"speed", "Play speed between 1 and 60.", "", 60}
 
Argument< BASE_MESH > mesh = {"mesh", "Procedural mesh type.", "", BASE_MESH::ANY}
 
Argument< float > bondCutoff = {"bondCutOff","Cutoff to create a bond.", "", 0.0f}
 
Argument< float > bondSize = {"bondSize", "Size of bonds.", "", 1.0f}
 
Argument< float > atomSize = {"atomSize", "Global atom size scaling factor.", "", 1.0f}
 
Argument< float > globalAtomAlpha = {"globalAtomAlpha", "Alpha colour multiplier for atoms", "", 1.0f}
 
Argument< float > globalBondAlpha = {"globalBondAlpha", "Alpha colour multiplier for bonds", "", 1.0f}
 
Argument< float > deemphasisAlpha = {"deemphasisAlpha", "Alpha colour for deemphasised atoms.", "", 0.25f}
 
Argument< float > atomClipCorrection = {"atomClipCorrection", "Correction for atom impostors.", "Increase if atoms clipped.", 1.5f}
 
Argument< float > bondClipCorrection = {"bondClipCorrection", "Correction for bond impostors.", "Increase if atoms clipped.", 5.0f}
 
Argument< float > fieldOfView = {"fieldOfView", "Field of view in degrees.", "", 60.0f}
 
Argument< std::filesystem::path > colourmap = {"colourmap", "The colourmap path.", "", {}}
 
Argument< std::filesystem::path > atomColours = {"atomColours", "Path for per-atom colour overrides.", "", {}}
 
Argument< std::string > videoName = {"videoName", "Name of saved video.", "", ""}
 
Argument< vec< 2 > > resolution = {"resolution", "Window resolution in pixels.", "", {800, 800}}
 
Argument< uint64_t > bondFocus = {"bondFocus", "Only draw bonds for this atom.", "", NULL_INDEX}
 
Argument< uint64_t > focus = {"focus", "Centre on a particular atom.", "", NULL_INDEX}
 
Argument< float > cameraZoomSpeed = {"cameraZoomSpeed", "Speed of the camera's zoom.", "", 1.0}
 
Argument< float > cameraRotateSpeed = {"cameraRotateSpeed", "Speed of the camera's rotation", "", 1.0}
 
Argument< float > cameraInclineSpeed = {"cameraInclineSpeed", "Speed of the camera's inclination.", "", 1.0}
 
Argument< float > cameraPanSpeed = {"cameraPanSpeed", "Speed of the camera's pan.", "", 1.0}
 
Argument< bool > meshes = {"meshes", "Use meshes for atoms.", "Toggleable at runtime.", false}
 
Argument< bool > hideAtoms = {"hideAtoms", "Hide atoms.", "Toggleable at runtime.", false}
 
Argument< bool > showAxes = {"showAxes", "Show the coordinate axes.", "Toggleable at runtime.", false}
 
Argument< bool > showCell = {"showCell", "Show the simulation cell.", "Toggleable at runtime.", false}
 
Argument< bool > hideUI = {"hideUI", "Hide information and statistics text.", "Toggleable at runtime.", false}
 
Argument< bool > play = {"play", "Play trajectory.", "Toggleable at runtime.", false}
 
Argument< bool > noCentering = {"noCentering", "Do not centre the atoms", "Toggleable at runtime.", false}
 
Argument< bool > darkTheme = {"darkTheme", "Use dark theme", "Toggleable at runtime.", false}
 
Argument< bool > noTransparencySorting = {"noTransparencySorting", "Disable transparency sorting.", "Toggleable at runtime.", false}
 
Argument< bool > sizeByMass = {"sizeByMass", "Size elements by mass.", "Toggleable at runtime.", false}
 
const char * banner
 The text banner.
 
const char * ossLicenses
 The OSS licenses.
 
const char * GPL
 GPL v2 license text.
 

Detailed Description

Extract command line arguments.

Remarks
Values of arguments are check at construction.

Constructor & Destructor Documentation

◆ CommandLine() [1/2]

CommandLine::CommandLine ( )
default

◆ CommandLine() [2/2]

CommandLine::CommandLine ( uint8_t  count,
char **  commandLine 
)
inline

Extract values from argv.

Parameters
countthe size of commandLine.
commandLinethe value of argv.

Member Function Documentation

◆ checkSpecial()

void CommandLine::checkSpecial ( std::string  arg)
inline

Determine if help or licenses should be printed.

Parameters
argthe argument to check.
Remarks
Calls std::exit(EXIT_SUCCESS) after displaying information.

◆ gpl()

void CommandLine::gpl ( )
inline

◆ help()

void CommandLine::help ( ) const
inline

Print the help message and std::exit(EXIT_SUCCESS);.

◆ licenses()

void CommandLine::licenses ( )
inline

◆ lua_getOption()

int CommandLine::lua_getOption ( lua_State *  lua)
inline

Get an option value in Lua.

Remarks
Lua arguments are:
  1. option name
Parameters
luathe Lua context.
Returns
int the return code.

◆ lua_setOption()

int CommandLine::lua_setOption ( lua_State *  lua)
inline

Set an option from Lua.

Remarks
Lua arguments are:
  1. option name
  2. option value
Parameters
luathe Lua context.
Returns
int the return code.

◆ welcome()

void CommandLine::welcome ( ) const
inline

Member Data Documentation

◆ atomClipCorrection

Argument<float> CommandLine::atomClipCorrection = {"atomClipCorrection", "Correction for atom impostors.", "Increase if atoms clipped.", 1.5f}

◆ atomColours

Argument<std::filesystem::path> CommandLine::atomColours = {"atomColours", "Path for per-atom colour overrides.", "", {}}

◆ atomSize

Argument<float> CommandLine::atomSize = {"atomSize", "Global atom size scaling factor.", "", 1.0f}

◆ banner

const char* CommandLine::banner
Initial value:
= R"( ________ ________ ________ ________ ___ ___
|\ ____\|\ _____\\ __ \|\ __ \|\ \ / /|
\ \ \___|\ \ \__/\ \ \|\ \ \ \|\ \ \ \ / / /
\ \_____ \ \ __\\ \ \\\ \ \ __ \ \ \/ / /
\|____|\ \ \ \_| \ \ \\\ \ \ \ \ \ \ / /
____\_\ \ \__\ \ \_______\ \__\ \__\ \__/ /
|\_________\|__| \|_______|\|__|\|__|\|__|/
\|_________| SimpleFastOpenAtomicVisualiser
Copyright (C) 2025 Jerboa
SimpleFastOpenAtomicVisualiser comes with ABSOLUTELY NO WARRANTY;
for details pass the argument `-gpl'. This is free software,
and you are welcome to redistribute it under certain conditions;
pass the argument `-gpl' for details.
Repository: github.com/JerboaBurrow/SimpleFastOpenAtomicVisualiser
Bug reports: github.com/JerboaBurrow/SimpleFastOpenAtomicVisualiser/issues)"

The text banner.

◆ bondClipCorrection

Argument<float> CommandLine::bondClipCorrection = {"bondClipCorrection", "Correction for bond impostors.", "Increase if atoms clipped.", 5.0f}

◆ bondCutoff

Argument<float> CommandLine::bondCutoff = {"bondCutOff","Cutoff to create a bond.", "", 0.0f}

◆ bondFocus

Argument<uint64_t> CommandLine::bondFocus = {"bondFocus", "Only draw bonds for this atom.", "", NULL_INDEX}

◆ bondSize

Argument<float> CommandLine::bondSize = {"bondSize", "Size of bonds.", "", 1.0f}

◆ cameraInclineSpeed

Argument<float> CommandLine::cameraInclineSpeed = {"cameraInclineSpeed", "Speed of the camera's inclination.", "", 1.0}

◆ cameraPanSpeed

Argument<float> CommandLine::cameraPanSpeed = {"cameraPanSpeed", "Speed of the camera's pan.", "", 1.0}

◆ cameraRotateSpeed

Argument<float> CommandLine::cameraRotateSpeed = {"cameraRotateSpeed", "Speed of the camera's rotation", "", 1.0}

◆ cameraZoomSpeed

Argument<float> CommandLine::cameraZoomSpeed = {"cameraZoomSpeed", "Speed of the camera's zoom.", "", 1.0}

◆ colourmap

Argument<std::filesystem::path> CommandLine::colourmap = {"colourmap", "The colourmap path.", "", {}}

◆ darkTheme

Argument<bool> CommandLine::darkTheme = {"darkTheme", "Use dark theme", "Toggleable at runtime.", false}

◆ deemphasisAlpha

Argument<float> CommandLine::deemphasisAlpha = {"deemphasisAlpha", "Alpha colour for deemphasised atoms.", "", 0.25f}

◆ fieldOfView

Argument<float> CommandLine::fieldOfView = {"fieldOfView", "Field of view in degrees.", "", 60.0f}

◆ focus

Argument<uint64_t> CommandLine::focus = {"focus", "Centre on a particular atom.", "", NULL_INDEX}

◆ globalAtomAlpha

Argument<float> CommandLine::globalAtomAlpha = {"globalAtomAlpha", "Alpha colour multiplier for atoms", "", 1.0f}

◆ globalBondAlpha

Argument<float> CommandLine::globalBondAlpha = {"globalBondAlpha", "Alpha colour multiplier for bonds", "", 1.0f}

◆ GPL

const char* CommandLine::GPL

GPL v2 license text.

◆ hideAtoms

Argument<bool> CommandLine::hideAtoms = {"hideAtoms", "Hide atoms.", "Toggleable at runtime.", false}

◆ hideUI

Argument<bool> CommandLine::hideUI = {"hideUI", "Hide information and statistics text.", "Toggleable at runtime.", false}

◆ levelOfDetail

Argument<uint8_t> CommandLine::levelOfDetail = {"levelOfDetail", "Level of detail of meshes.", "", 0}

◆ mesh

Argument<BASE_MESH> CommandLine::mesh = {"mesh", "Procedural mesh type.", "", BASE_MESH::ANY}

◆ meshes

Argument<bool> CommandLine::meshes = {"meshes", "Use meshes for atoms.", "Toggleable at runtime.", false}

◆ msaa

Argument<uint8_t> CommandLine::msaa = {"msaa", "MSAA level [0-32].", "", 0}

◆ noCentering

Argument<bool> CommandLine::noCentering = {"noCentering", "Do not centre the atoms", "Toggleable at runtime.", false}

◆ noTransparencySorting

Argument<bool> CommandLine::noTransparencySorting = {"noTransparencySorting", "Disable transparency sorting.", "Toggleable at runtime.", false}

◆ ossLicenses

const char* CommandLine::ossLicenses

The OSS licenses.

◆ play

Argument<bool> CommandLine::play = {"play", "Play trajectory.", "Toggleable at runtime.", false}

◆ resolution

Argument<vec<2> > CommandLine::resolution = {"resolution", "Window resolution in pixels.", "", {800, 800}}

◆ script

Argument<std::filesystem::path> CommandLine::script = {"script", "Path to Lua script", "Called each frame.", {}}

◆ showAxes

Argument<bool> CommandLine::showAxes = {"showAxes", "Show the coordinate axes.", "Toggleable at runtime.", false}

◆ showCell

Argument<bool> CommandLine::showCell = {"showCell", "Show the simulation cell.", "Toggleable at runtime.", false}

◆ sizeByMass

Argument<bool> CommandLine::sizeByMass = {"sizeByMass", "Size elements by mass.", "Toggleable at runtime.", false}

◆ speed

Argument<uint8_t> CommandLine::speed = {"speed", "Play speed between 1 and 60.", "", 60}

◆ structure

Argument<std::filesystem::path> CommandLine::structure = {"atoms", "Structure path.", "", {}}

◆ videoName

Argument<std::string> CommandLine::videoName = {"videoName", "Name of saved video.", "", ""}

The documentation for this struct was generated from the following file: