13 #include <fbxsdk/fileio/fbxiosettings.h>
14 #include <fbxsdk/utils/fbxgeometryconverter.h>
293 std::vector<Object3DGroup> objectGroups;
294 std::vector<Object3D*> objects;
295 std::vector<Object3D*> lamps;
299 unsigned int samplesPerPixel;
300 unsigned int minBounces;
302 bool russianRoulette =
true;
303 double rrStopProbability = 0.1;
304 bool nextEventEstimation =
true;
305 unsigned int numberThreads = omp_get_max_threads();
307 unsigned int kdMaxObjectNumber = 10;
308 unsigned int kdMaxDepth = 10;
310 std::string backupFileName =
"backup";
311 bool backupParameters =
true;
312 bool backupObjectGroups =
true;
313 bool backupPicture =
true;
314 double leastRenderTime4PictureBackup = 180.0;
317 DoubleVec3D traceRay(
const Ray& ray,
double usedNextEventEstimation =
false,
const KDTreeNode* lastNode =
nullptr,
unsigned int bounces = 0)
const;
318 std::string getCurrentIndex(
int currentIndex,
bool displayIndex)
const;
Defines the DoubleMatrix33 class and some functions around it.
static Scene scene
The scene that will be used by the interface.
Definition: Interface.h:59
Defines the KDTreeNode class and some functions around it.
Defines the Object3DGroup class and some functions around it.
Defines the PerspectiveCamera class.
Defines the Picture class and some functions around it.
void displayRenderingProgression(unsigned int numberPixelXAlreadyComputed, unsigned int pictureWidth, double loopBeginningTime)
Prints the progression information.
Definition: Scene.cpp:341
bool importTrianglesFromFbxNode(FbxNode *node, Material *material, std::vector< Object3D * > &objects)
Imports recursively all triangles present in a FBXNode.
Definition: Scene.cpp:169
A three-dimensional vector using double values.
Definition: DoubleVec3D.h:190
A node of a k-d tree.
Definition: KDTreeNode.h:140
Abstrat class that models a material.
Definition: Material.h:77
Group of objects.
Definition: Object3DGroup.h:122
Models a perspective camera.
Definition: PerspectiveCamera.h:76
Stores radiance for every pixel.
Definition: Picture.h:120
Combination of an origin and a direction.
Definition: Ray.h:44
Stores object groups and a camera for the render.
Definition: Scene.h:291
void defaultScene()
Sets this scene's objects to default ones.
Definition: Scene.cpp:90
void setRrStopProbability(double rrStopProbability)
Setter for the russian roulette stop probability.
Definition: Scene.cpp:56
void setLeastRenderTime4PictureBackup(double leastRenderTime4PictureBackup)
Setter for the least render time after which the picture is backed up.
Definition: Scene.cpp:66
void setKDMaxObjectNumber(unsigned int kdMaxObjectNumber)
Setter for the maximum number of objects in a k-d tree leaf.
Definition: Scene.cpp:60
void setBackupFileName(std::string backupFileName)
Setter for the new name of the file in which backups will be made.
Definition: Scene.cpp:62
double getRrStopProbability() const
Getter for the russian roulette stop probability.
Definition: Scene.cpp:33
PerspectiveCamera & getCameraReference()
Getter for a reference to the camera.
Definition: Scene.cpp:29
Scene(PerspectiveCamera camera=PerspectiveCamera(), unsigned int samplesPerPixel=8, unsigned int minBounces=5)
Main constructor.
Definition: Scene.cpp:4
std::vector< Object3D * > getLamps()
Getter for the lamps.
Definition: Scene.cpp:22
void setNextEventEstimation(bool nextEventEstimation)
Setter for the next event estimation.
Definition: Scene.cpp:57
void computeObjectsAndLamps()
Computes all the objects.
Definition: Scene.cpp:80
bool getKDTree() const
Getter for the k-d tree option.
Definition: Scene.cpp:36
unsigned int getSamplesPerPixel() const
Getter for the number of samples per pixel.
Definition: Scene.cpp:30
void setBackupObjectGroups(bool backupObjectGroups)
Setter for the option to backup the object groups.
Definition: Scene.cpp:64
unsigned int getMinBounces() const
Getter for the minimum number of bounces.
Definition: Scene.cpp:31
void resetAndDeleteObjectGroups()
Deletes all object groups and their objects.
Definition: Scene.cpp:74
void setKDMaxDepth(unsigned int kdMaxDepth)
Setter for the maximum depth recursion of the k-d tree.
Definition: Scene.cpp:61
void setKDTree(bool kdTree)
Setter for the k-d tree.
Definition: Scene.cpp:59
bool getBackupObjectGroups() const
Getter for the option to backup the object groups.
Definition: Scene.cpp:41
void displayParametersPage(bool displayIndexes=true) const
Prints the parameters page.
Definition: Scene.cpp:462
bool importFBXFile(const char *filePath, Material *material, std::string name)
Imports a fbx file as triangles.
Definition: Scene.cpp:128
void setBackupParameters(bool backupParameters)
Setter for the option to backup the parameters.
Definition: Scene.cpp:63
std::string getBackupFileName() const
Getter for the name of the file in which backups will be made.
Definition: Scene.cpp:39
void setCamera(PerspectiveCamera camera)
Setter for the camera.
Definition: Scene.cpp:48
double getLeastRenderTime4PictureBackup() const
Getter for the least render time after which the picture is backed up.
Definition: Scene.cpp:43
std::vector< Object3DGroup > getObjectGroups() const
Getter for the object groups.
Definition: Scene.cpp:12
unsigned int getKDMaxDepth() const
Getter for the maximum depth recursion of the k-d tree.
Definition: Scene.cpp:38
bool getBackupParameters() const
Getter for the option to backup the parameters.
Definition: Scene.cpp:40
std::vector< Object3DGroup > & getObjectGroupsReference()
Getter for a reference to the object groups.
Definition: Scene.cpp:13
void saveObjectGroups2File(std::string fileName) const
Saves object groups to a file.
Definition: Scene.cpp:248
void setBackupPicture(bool backupPicture)
Setter for the option to backup the picture.
Definition: Scene.cpp:65
PerspectiveCamera getCamera() const
Getter for the camera.
Definition: Scene.cpp:28
std::vector< Object3D * > getObjects()
Getter for the objects.
Definition: Scene.cpp:16
void saveParameters2File(std::string fileName) const
Saves parameters to a file.
Definition: Scene.cpp:208
void setNumberThreads(unsigned int numberThreads)
Setter for the number of CPU threads.
Definition: Scene.cpp:58
void setSamplesPerPixel(unsigned int samplesPerPixel)
Setter for the number of samples per pixel.
Definition: Scene.cpp:49
void displayObjectsPage() const
Prints the objects page.
Definition: Scene.cpp:500
unsigned int getNumberThreads() const
Getter for the number of CPU threads.
Definition: Scene.cpp:35
bool getBackupPicture() const
Getter for the option to backup the picture.
Definition: Scene.cpp:42
bool getNextEventEstimation() const
Getter for the next event estimation.
Definition: Scene.cpp:34
void setObjectGroups(std::vector< Object3DGroup > groups)
Setter for the object groups.
Definition: Scene.cpp:47
void setRussianRoulette(bool russianRoulette)
Setter for the russian roulette.
Definition: Scene.cpp:51
bool getRussianRoulette() const
Getter for the russian roulette.
Definition: Scene.cpp:32
void setMinBounces(unsigned int minBounces)
Setter for the minimum number of bounces.
Definition: Scene.cpp:50
void addObjectGroup(const Object3DGroup &group)
Adds an object group to the current ones.
Definition: Scene.cpp:70
Picture * render()
Start the render of the picture.
Definition: Scene.cpp:356
unsigned int getKDMaxObjectNumber() const
Getter for the maximum number of objects in a k-d tree leaf.
Definition: Scene.cpp:37
A struct binding a pointer to an Object3D, a distance, and a pointer to a KDTreeNode.
Definition: KDTreeNode.h:152