scene.hpp
Go to the documentation of this file.
1 /*
2 ** TP CPE Lyon
3 ** Copyright (C) 2014 Damien Rohmer
4 **
5 ** This program is free software: you can redistribute it and/or modify
6 ** it under the terms of the GNU General Public License as published by
7 ** the Free Software Foundation, either version 3 of the License, or
8 ** (at your option) any later version.
9 **
10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ** GNU General Public License for more details.
14 **
15 ** You should have received a copy of the GNU General Public License
16 ** along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
21 #pragma once
22 
23 
24 #ifndef SCENE_HPP
25 #define SCENE_HPP
26 
27 #include "../lib3d/vec3.hpp"
28 #include "../libmesh/mesh.hpp"
29 #include "../libspline/grid.hpp"
30 #include "../libspline/surface_param_drawable.hpp"
31 #include "../libinterface/picking_data.hpp"
32 #include "../libinterface/gui_interface.hpp"
33 
34 #include <vector>
35 
36 class glwidget;
37 
38 class scene
39 {
40  private:
41 
46 
47 
48 
49  public:
50 
51  // ********************************************* //
52  // ********************************************* //
53  // CONSTRUCTORS
54  // ********************************************* //
55  // ********************************************* //
56 
58  scene();
59 
60 
61  // ********************************************* //
62  // ********************************************* //
63  // Scene construction and drawing
64  // ********************************************* //
65  // ********************************************* //
66 
68  void load_model();
70  void draw_scene();
71 
72 
73 
74  // ********************************************* //
75  // ********************************************* //
76  // Gui Helpers
77  // ********************************************* //
78  // ********************************************* //
79 
80 
82  void set_glwidget(glwidget *p_widget);
83 
86 
87 
88 
89  private:
90 
91 
95  void preload_sphere();
96 
97 
101  void init_gui_visibility();
102 
103 
104 };
105 
106 #endif
Definition: gui_interface.hpp:28
Definition: grid.hpp:33
Wrapper class to help drawing a surface_param class.
Definition: surface_param_drawable.hpp:34
cpe::grid grid_1
The control grid for the spline.
Definition: scene.hpp:43
cpe::surface_param_drawable surf_1
The Spline surface.
Definition: scene.hpp:45
scene()
Empty constructor for the scene.
Definition: scene.cpp:216
Container class for a generic mesh with normal, color, texture, ...
Definition: mesh.hpp:38
cpe::gui_interface gui_visible
Storage class for visibility modified in the gui.
Definition: scene.hpp:99
void preload_sphere()
Init the sphere loading.
Definition: scene.cpp:235
void load_model()
Method called only once at the beginning (load files ...)
Definition: scene.cpp:55
void draw_scene()
Method called at every frame.
Definition: scene.cpp:169
void set_glwidget(glwidget *p_widget)
Set the GLWidget pointer.
Definition: glwidget.hpp:32
Definition: scene.hpp:38
void init_gui_visibility()
Init the visibility gui parameters.
Definition: scene.cpp:228
cpe::gui_interface & gui_visible_interface()
get the gui helper class
Definition: scene.cpp:222
cpe::mesh sphere
storage for the sphere (to draw the grid position)
Definition: scene.hpp:93