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_tlevelOfDetail = {"levelOfDetail", "Level of detail of meshes.", "", 0}
 
Argument< uint8_tmsaa = {"msaa", "MSAA level [0-32].", "", 0}
 
Argument< uint8_tspeed = {"speed", "Play speed between 1 and 60.", "", 60}
 
Argument< BASE_MESHmesh = {"mesh", "Procedural mesh type.", "", BASE_MESH::ANY}
 
Argument< floatbondCutoff = {"bondCutOff","Cutoff to create a bond.", "", 0.0f}
 
Argument< floatbondSize = {"bondSize", "Size of bonds.", "", 1.0f}
 
Argument< floatatomSize = {"atomSize", "Global atom size scaling factor.", "", 1.0f}
 
Argument< floatglobalAtomAlpha = {"globalAtomAlpha", "Alpha colour multiplier for atoms", "", 1.0f}
 
Argument< floatglobalBondAlpha = {"globalBondAlpha", "Alpha colour multiplier for bonds", "", 1.0f}
 
Argument< floatdeemphasisAlpha = {"deemphasisAlpha", "Alpha colour for deemphasised atoms.", "", 0.25f}
 
Argument< floatatomClipCorrection = {"atomClipCorrection", "Correction for atom impostors.", "Increase if atoms clipped.", 1.5f}
 
Argument< floatbondClipCorrection = {"bondClipCorrection", "Correction for bond impostors.", "Increase if atoms clipped.", 5.0f}
 
Argument< std::filesystem::path > colourmap = {"colourmap", "The colourmap path.", "", {}}
 
Argument< std::filesystem::path > atomColours = {"atomColours", "Path for per-atom colour overrides.", "", {}}
 
Argument< vec< 2 > > resolution = {"resolution", "Window resolution in pixels.", "", {512, 512}}
 
Argument< uint64_tbondFocus = {"bondFocus", "Only draw bonds for this atom.", "", NULL_INDEX}
 
Argument< uint64_tfocus = {"focus", "Centre on a particular atom.", "", NULL_INDEX}
 
Argument< boolmeshes = {"meshes", "Use meshes for atoms.", "Toggleable at runtime.", false}
 
Argument< boolhideAtoms = {"hideAtoms", "Hide atoms.", "Toggleable at runtime.", false}
 
Argument< boolshowAxes = {"showAxes", "Show the coordinate axes.", "Toggleable at runtime.", false}
 
Argument< boolshowCell = {"showCell", "Show the simulation cell.", "Toggleable at runtime.", false}
 
Argument< boolhideInfoText = {"hideInfoText", "Hide information and statistics text.", "Toggleable at runtime.", false}
 
Argument< boolplay = {"play", "Play trajectory.", "Toggleable at runtime.", false}
 
Argument< boolnoCentering = {"noCentering", "Do not centre the atoms", "Toggleable at runtime.", false}
 
Argument< booldarkTheme = {"darkTheme", "Use dark theme", "Toggleable at runtime.", false}
 
Argument< boolnoTransparencySorting = {"noTransparencySorting", "Disable transparency sorting.", "Toggleable at runtime.", false}
 
Argument< boolsizeByMass = {"sizeByMass", "Size elements by mass.", "Toggleable at runtime.", false}
 
const charbanner
 The text banner.
 
const charossLicenses
 The OSS licenses.
 
const charGPL
 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}

◆ 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}

◆ 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}

◆ hideInfoText

Argument<bool> CommandLine::hideInfoText = {"hideInfoText", "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.", "", {512, 512}}

◆ 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.", "", {}}

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