Path Tracer
Functions | Variables
Interface.h File Reference

Defines some functions for the interface. More...

#include "Scene.h"
Include dependency graph for Interface.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void receiveAndExecuteGeneralCommands ()
 Receives and executes a general command. More...
 
void executeParametersCommands (char command)
 Executes a command specific to the parameters page. More...
 
void executeObjectsCommands (char command)
 Executes a command specific to the objects page. More...
 
void displayCommands ()
 Prints the available commands. More...
 
void printAll ()
 Prints the whole page. More...
 
void initInterface ()
 Starts the infinite loop of the interface. More...
 

Variables

static Scene scene
 The scene that will be used by the interface. More...
 
static PerspectiveCameracamera = scene.getCameraReference()
 A reference to the camera from the scene. More...
 
static std::vector< Object3DGroup > & objectGroups = scene.getObjectGroupsReference()
 A reference to the vector of object groups from the scene. More...
 
static bool isParametersPage = true
 Defines whether the current page is the parameters page. More...
 
static bool commandWasInvalid = false
 Defines whether the last command that was used was invalid. More...
 

Detailed Description

Defines some functions for the interface.

Function Documentation

◆ displayCommands()

void displayCommands ( )

Prints the available commands.

The available commands change depending on the active page.

See also
printAll(), receiveAndExecuteGeneralCommands(), executeParametersCommands(), executeObjectsCommands()

◆ executeObjectsCommands()

void executeObjectsCommands ( char  command)

Executes a command specific to the objects page.

See also
receiveAndExecuteGeneralCommands(), executeParametersCommands(), displayCommands()

◆ executeParametersCommands()

void executeParametersCommands ( char  command)

Executes a command specific to the parameters page.

See also
receiveAndExecuteGeneralCommands(), executeObjectsCommands(), displayCommands()

◆ initInterface()

void initInterface ( )

Starts the infinite loop of the interface.

Fills the scene with a default one. Then, it calls printAll() and receiveAndExecuteGeneralCommands() indefinitely.

See also
Scene::defaultScene(), printAll(), receiveAndExecuteGeneralCommands()

◆ printAll()

void printAll ( )

Prints the whole page.

Clears the page, prints the header, information and the available commands.

See also
clearScreenPrintHeader(), Scene::displayParametersPage(), Scene::displayObjectsPage(), displayCommands(), initInterface()

◆ receiveAndExecuteGeneralCommands()

void receiveAndExecuteGeneralCommands ( )

Receives and executes a general command.

Asks a command to the user. If it is general to both main pages (exit, for example), executes it. Else, it calls executeParametersCommands() or executeObjectsCommands().

See also
executeObjectsCommands(), executeObjectsCommands(), displayCommands(), initInterface()

Variable Documentation

◆ camera

static PerspectiveCamera & camera = scene.getCameraReference()
static

A reference to the camera from the scene.

See also
Scene::getCameraReference()

◆ commandWasInvalid

static bool commandWasInvalid = false
static

Defines whether the last command that was used was invalid.

It is used to display INVALID_COMMAND when reprinting the page.

See also
INVALID_COMMAND

◆ isParametersPage

static bool isParametersPage = true
static

Defines whether the current page is the parameters page.

If the current page is not the parameters page, then it is the objects page.

◆ objectGroups

static std::vector< Object3DGroup > & objectGroups = scene.getObjectGroupsReference()
static

A reference to the vector of object groups from the scene.

See also
Scene::getObjectGroupsReference()

◆ scene

static Scene scene
static

The scene that will be used by the interface.