|
Path Tracer
|
#include "InterfaceCreation.h"Functions | |
| std::string | getStringFromUser (std::string question, std::string prompt) |
| Gets a string from the user. More... | |
| char | getLowerCaseCharFromUser (std::string question, std::string prompt) |
| Gets a lowercase character from the user. More... | |
| int | getIntFromUser (std::string question, std::string prompt) |
| Gets an integer from the user. More... | |
| unsigned int | getUnsignedIntFromUser (std::string question, std::string prompt) |
| Gets a positive integer from the user. More... | |
| double | getDoubleFromUser (std::string question, std::string prompt) |
| Gets a number from the user. More... | |
| double | getPositiveDoubleFromUser (std::string question, std::string prompt) |
| Gets a positive number from the user. More... | |
| bool | getBoolFromUser (std::string question, std::string prompt) |
| Gets a boolean from the user. More... | |
| DoubleVec3D | getXYZDoubleVec3DFromUser (std::string question, std::string prompt) |
| Gets a vector from the user. More... | |
| DoubleVec3D | getRGBDoubleVec3DFromUser (std::string question, std::string prompt) |
| Gets a vector with only positive coordinates from the user. More... | |
| Material * | createDiffuseMaterial (const DoubleVec3D &emittance) |
| Interactive creation of a DiffuseMaterial. More... | |
| Material * | createRefractiveMaterial (const DoubleVec3D &emittance) |
| Interactive creation of a RefractiveMaterial. More... | |
| Material * | createSpecularMaterial (const DoubleVec3D &emittance) |
| Interactive creation of a SpecularMaterial. More... | |
| Material * | createMaterial () |
| Interactive creation of a Material. More... | |
| Object3D * | createSphere (Material *material) |
| Interactive creation of a Sphere. More... | |
| Object3D * | createTriangle (Material *material) |
| Interactive creation of a Triangle. More... | |
| Object3D * | createObject3D () |
| Interactive creation of an Object3D. More... | |
| void | to_json (json &j, const Material &mat) |
| Material conversion to json. More... | |
| Material * | importMaterialFromJson (const json &j) |
| Material conversion from json. More... | |
| void | to_json (json &j, const Object3D &obj) |
| Object3D conversion to json. More... | |
| Object3D * | importObject3DFromJson (const json &j) |
| Object3D conversion from json. More... | |
| bool | fileExists (std::string fileName) |
| Verifies if the file exists. More... | |
| std::string | formatFileName (std::string fileName, std::string extension) |
| Formats the name of the file the user gave and the extension we want. More... | |
| Material * createDiffuseMaterial | ( | const DoubleVec3D & | emittance | ) |
Interactive creation of a DiffuseMaterial.
| emittance | The emittance of the material. |
| Material * createMaterial | ( | ) |
Interactive creation of a Material.
Gets the main parameters of a material, and then calls createDiffuseMaterial(), createRefractiveMaterial() or createSpecularMaterial().
| Object3D * createObject3D | ( | ) |
Interactive creation of an Object3D.
Gets the main parameters of an object, and then calls createSphere() or createTriangle().
| Material * createRefractiveMaterial | ( | const DoubleVec3D & | emittance | ) |
Interactive creation of a RefractiveMaterial.
| emittance | The emittance of the material. |
| Material * createSpecularMaterial | ( | const DoubleVec3D & | emittance | ) |
Interactive creation of a SpecularMaterial.
| emittance | The emittance of the material. |
Interactive creation of a Sphere.
| material | The material of this sphere. |
Interactive creation of a Triangle.
| material | The material of this triangle. |
| bool fileExists | ( | std::string | fileName | ) |
Verifies if the file exists.
| fileName | The path to the file. |
| 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".
| fileName | The path to the file we want to format. |
| extension | The file extension with which we want to format the file. |
| bool getBoolFromUser | ( | std::string | question = "", |
| std::string | prompt = PROMPT |
||
| ) |
Gets a boolean from the user.
Uses the getLowerCaseCharFromUser() method. Will continue to ask the question until the user gives 't' or 'f'.
| question | The question that will be asked to the user. |
| prompt | The prompt that will be used to show the user that he or she can write something. |
| double getDoubleFromUser | ( | std::string | question = "", |
| std::string | prompt = PROMPT |
||
| ) |
Gets a number from the user.
Uses the getStringFromUser() method. Will continue to ask the question until the user gives a string that can be converted to a double.
| question | The question that will be asked to the user. |
| prompt | The prompt that will be used to show the user that he or she can write something. |
| int getIntFromUser | ( | std::string | question = "", |
| std::string | prompt = PROMPT |
||
| ) |
Gets an integer from the user.
Uses the getStringFromUser() method. Will continue to ask the question until the user gives a string that can be converted to an int.
| question | The question that will be asked to the user. |
| prompt | The prompt that will be used to show the user that he or she can write something. |
| char getLowerCaseCharFromUser | ( | std::string | question = "", |
| std::string | prompt = PROMPT |
||
| ) |
Gets a lowercase character from the user.
Uses the getStringFromUser() method and takes the first character of this string.
| question | The question that will be asked to the user. |
| prompt | The prompt that will be used to show the user that he or she can write something. |
| double getPositiveDoubleFromUser | ( | std::string | question = "", |
| std::string | prompt = PROMPT |
||
| ) |
Gets a positive number from the user.
Uses the getDoubleFromUser() method. Will continue to ask the question until the user gives a positive double.
| question | The question that will be asked to the user. |
| prompt | The prompt that will be used to show the user that he or she can write something. |
| DoubleVec3D getRGBDoubleVec3DFromUser | ( | std::string | question = "", |
| std::string | prompt = PROMPT |
||
| ) |
Gets a vector with only positive coordinates from the user.
Uses three times the getPositiveDoubleFromUser() method. Adds "r ", "g " or "b " before the prompt, to show the user which component he or she is giving.
| question | The question that will be asked to the user. |
| prompt | The prompt that will be used to show the user that he or she can write something. |
| std::string getStringFromUser | ( | std::string | question = "", |
| std::string | prompt = PROMPT |
||
| ) |
Gets a string from the user.
| question | The question that will be asked to the user. |
| prompt | The prompt that will be used to show the user that he or she can write something. |
| unsigned int getUnsignedIntFromUser | ( | std::string | question = "", |
| std::string | prompt = PROMPT |
||
| ) |
Gets a positive integer from the user.
Uses the getIntFromUser() method. Will continue to ask the question until the user gives a positive integer.
| question | The question that will be asked to the user. |
| prompt | The prompt that will be used to show the user that he or she can write something. |
| DoubleVec3D getXYZDoubleVec3DFromUser | ( | std::string | question = "", |
| std::string | prompt = PROMPT |
||
| ) |
Gets a vector from the user.
Uses three times the getDoubleFromUser() method. Adds "x ", "y " or "z " before the prompt, to show the user which coordinates he or she is giving.
| question | The question that will be asked to the user. |
| prompt | The prompt that will be used to show the user that he or she can write something. |
Material conversion from json.
| j | Json input. |
Object3D conversion from json.
| j | Json input. |
Material conversion to json.
| j | Json output. |
| mat | The material that will be converted. |
Object3D conversion to json.
| j | Json output. |
| obj | The object that will be converted. |