Defines functions that are used when drawing the interface.
More...
#include <chrono>
#include <fstream>
#include <random>
#include <iostream>
#include <math.h>
#include "nlohmann/json.hpp"
#include <fbxsdk.h>
#include <windows.h>
Go to the source code of this file.
|
| using | json = nlohmann::json |
| |
Defines functions that are used when drawing the interface.
◆ _USE_MATH_DEFINES
| #define _USE_MATH_DEFINES |
◆ NOMINMAX
◆ json
| using json = nlohmann::json |
◆ availableCommandsHeader()
| void availableCommandsHeader |
( |
| ) |
|
Prints a header before printing which commands are available.
◆ bool2string()
| std::string bool2string |
( |
bool |
b | ) |
|
Converts a boolean to a string.
- Parameters
-
| b | The boolean that will be converted. |
- Returns
- The boolean converted into a string.
◆ clearScreenPrintHeader()
| void clearScreenPrintHeader |
( |
| ) |
|
Clears the console and prints the header.
- See also
- printAll()
◆ fileExists()
| bool fileExists |
( |
std::string |
fileName | ) |
|
Verifies if the file exists.
- Parameters
-
| fileName | The path to the file. |
- Returns
- True if the file exists, false else.
◆ formatFileName()
| std::string formatFileName |
( |
std::string |
fileName, |
|
|
std::string |
extension |
|
) |
| |
Formats the name of the file the user gave and the extension we want.
For example, it will format "test.txt" into "test.txt" and "test" into "test.txt".
- Parameters
-
| fileName | The path to the file we want to format. |
| extension | The file extension with which we want to format the file. |
- Returns
- The formated file name.
◆ getCurrentTimeSeconds()
| double getCurrentTimeSeconds |
( |
| ) |
|
Gives the number of seconds since 1st January 1970.
- Returns
- The time since 1st January 1970 in seconds.
◆ randomDouble()
Computes a random double between 0 and 1.
Simply calls unif(re).
- Returns
- A random double between 0 and 1 generated following a uniform distrbution.
- See also
- unif, re
◆ showCMDCursor()
| void showCMDCursor |
( |
bool |
show | ) |
|
Shows or hide the cursor in the interface.
Used code from Captain Obvlious. Remove blinking underscore on console / cmd prompt. [Accessed 28th December 2020]. Stackoverflow. 3rd August 2013. Available from: https://stackoverflow.com/a/18028927/12637970.
- Parameters
-
| show | Whether the cursor will be shown or hidden. |
◆ DASH_SPLITTER
| const std::string DASH_SPLITTER = std::string(26, '-') |
◆ FBX_EXTENSION
| const std::string FBX_EXTENSION = "fbx" |
◆ INVALID_COMMAND
| const std::string INVALID_COMMAND = "Invalid command." |
◆ MAX_LENGTH_STRING_FROM_USER
| constexpr unsigned int MAX_LENGTH_STRING_FROM_USER = 256 |
|
constexpr |
Maximum length for a string the user can give.
◆ OBJECTS_SAVE_EXTENSION
| const std::string OBJECTS_SAVE_EXTENSION = "ptobj" |
◆ PARAMETERS_SAVE_EXTENSION
| const std::string PARAMETERS_SAVE_EXTENSION = "ptparam" |
◆ PICTURE_EXTENSION
| const std::string PICTURE_EXTENSION = "bmp" |
◆ PICTURE_SAVE_EXTENSION_JSON
| const std::string PICTURE_SAVE_EXTENSION_JSON = "ptpict" |
◆ PROMPT
| const std::string PROMPT = "> " |
String that signals the user can write a command.
◆ re
| static std::default_random_engine re = std::default_random_engine(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count()) |
|
static |
◆ STAR_SPLITTER
| const std::string STAR_SPLITTER = std::string(26, '*') |
◆ unif
| static std::uniform_real_distribution< double > unif = std::uniform_real_distribution<double>(0, 1) |
|
static |