1 //Copyright (c) 2018 Ultimaker B.V.
2 //CuraEngine is released under the terms of the AGPLv3 or higher.
3 
4 #ifndef SCENE_H
5 #define SCENE_H
6 
7 #include "ExtruderTrain.h" //To store the extruders in the scene.
8 #include "MeshGroup.h" //To store the mesh groups in the scene.
9 #include "settings/Settings.h" //To store the global settings.
10 
11 namespace cura
12 {
13 
14 /*
15  * Represents a scene that should be sliced.
16  */
17 class Scene
18 {
19 public:
20     /*
21      * \brief The global settings in the scene.
22      */
23     Settings settings;
24 
25     /*
26      * \brief Which extruder to evaluate each setting on, if different from the
27      * normal extruder of the object it's evaluated for.
28      */
29     std::unordered_map<std::string, ExtruderTrain*> limit_to_extruder;
30 
31     /*
32      * \brief The mesh groups in the scene.
33      */
34     std::vector<MeshGroup> mesh_groups;
35 
36     /*
37      * \brief The extruders in the scene.
38      */
39     std::vector<ExtruderTrain> extruders;
40 
41     /*
42      * \brief The mesh group that is being processed right now.
43      *
44      * During initialisation this may be nullptr. For the most part, during the
45      * slicing process, you can be assured that this will not be null so you can
46      * safely dereference it.
47      */
48     std::vector<MeshGroup>::iterator current_mesh_group;
49 
50     /*
51      * \brief Create an empty scene.
52      *
53      * This scene will have no models in it, no extruders, no settings, no
54      * nothing.
55      * \param num_mesh_groups The number of mesh groups to allocate for.
56      */
57     Scene(const size_t num_mesh_groups);
58 
59     /*
60      * \brief Gets a string that contains all settings.
61      *
62      * This string mimics the command line call of CuraEngine. In theory you
63      * could call CuraEngine with this output in the command in order to
64      * reproduce the output.
65      */
66     const std::string getAllSettingsString() const;
67 
68     /*
69      * \brief Generate the 3D printing instructions to print a given mesh group.
70      * \param mesh_group The mesh group to slice.
71      */
72     void processMeshGroup(MeshGroup& mesh_group);
73 
74 private:
75     /*
76      * \brief You are not allowed to copy the scene.
77      */
78     Scene(const Scene&) = delete;
79 
80     /*
81      * \brief You are not allowed to copy by assignment either.
82      */
83     Scene& operator =(const Scene&) = delete;
84 };
85 
86 } //namespace cura
87 
88 #endif //SCENE_H