My Project
 All Classes Files Functions Variables Enumerations Pages
fracplanet_main.h
Go to the documentation of this file.
1 /**************************************************************************/
2 /* Copyright 2009 Tim Day */
3 /* */
4 /* This file is part of Fracplanet */
5 /* */
6 /* Fracplanet is free software: you can redistribute it and/or modify */
7 /* it under the terms of the GNU General Public License as published by */
8 /* the Free Software Foundation, either version 3 of the License, or */
9 /* (at your option) any later version. */
10 /* */
11 /* Fracplanet is distributed in the hope that it will be useful, */
12 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
13 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
14 /* GNU General Public License for more details. */
15 /* */
16 /* You should have received a copy of the GNU General Public License */
17 /* along with Fracplanet. If not, see <http://www.gnu.org/licenses/>. */
18 /**************************************************************************/
19 
24 #ifndef _fracplanet_main_h_
25 #define _fracplanet_main_h_
26 
27 #include "control_about.h"
28 #include "control_render.h"
29 #include "control_save.h"
30 #include "control_terrain.h"
31 #include "parameters_render.h"
32 #include "parameters_save.h"
33 #include "parameters_terrain.h"
34 #include "random.h"
35 
36 #include "triangle_mesh_cloud.h"
37 #include "triangle_mesh_terrain.h"
38 #include "triangle_mesh_viewer.h"
39 
41 class FracplanetMain : public QWidget,public Progress
42 {
43  private:
44 
45  Q_OBJECT
46 
47  public:
48 
49  FracplanetMain(QWidget* parent,QApplication* app,const boost::program_options::variables_map& opts,bool verbose);
50  ~FracplanetMain();
51 
52  virtual void progress_start(uint target,const std::string&);
53  virtual void progress_stall(const std::string& reason);
54  virtual void progress_step(uint step);
55  virtual void progress_complete(const std::string&);
56 
57  public slots:
58 
60  void regenerate();
61 
63  void save_pov();
64 
66  void save_blender();
67 
69  void save_texture();
70 
71  private:
72 
74  const bool _verbose;
75 
76  QApplication*const application;
77 
79  boost::scoped_ptr<const TriangleMeshTerrain> mesh_terrain;
80 
82  boost::scoped_ptr<const TriangleMeshCloud> mesh_cloud;
83 
85  std::vector<const TriangleMesh*> meshes;
86 
87  ParametersTerrain parameters_terrain;
88  ParametersCloud parameters_cloud;
89  ParametersRender parameters_render;
90  ParametersSave parameters_save;
91 
92  ControlTerrain* control_terrain;
93  ControlRender* control_render;
94  ControlSave* control_save;
95  ControlAbout* control_about;
96 
97  boost::scoped_ptr<TriangleMeshViewer> viewer;
98 
99  QTabWidget* tab;
100 
101  uint last_step;
102 
103  std::auto_ptr<QProgressDialog> progress_dialog;
104  std::string progress_info;
105  bool progress_was_stalled;
106 };
107 
108 #endif
Interface for class ControlSave.
Interface for class ControlTerrain.
void regenerate()
Invoked by ControlTerrain to generate new TriangleMesh.
Definition: fracplanet_main.cpp:126
Interface for class ControlRender.
Aggregates controllable parameters for all things related to save.
Definition: parameters_save.h:30
Aggregates controllable parameters for all things related to OpenGL rendering.
Definition: parameters_render.h:32
This class aggregates the controllable parameters for all things related to cloud generation...
Definition: parameters_cloud.h:32
Encapsulates GUI elements for controlling save.
Definition: control_save.h:32
void save_texture()
Invoked by ControlSave to save to file as texture(s).
Definition: fracplanet_main.cpp:350
Interface for class TriangleMeshCloud and derived classes.
Mix-in class for call-backs from long operations.
Definition: progress.h:30
Interface for class TriangleMeshTerrain and derived classes.
This class aggregates the controllable parameters for all things related to terrain generation...
Definition: parameters_terrain.h:35
void save_blender()
Invoked by ControlSave to save to file (Blender format).
Definition: fracplanet_main.cpp:289
Encapsulates controls for setting terrain generation parameters.
Definition: control_terrain.h:36
void save_pov()
Invoked by ControlSave to save to file (POV-Ray format).
Definition: fracplanet_main.cpp:225
Interface for class ParametersSave.
Interface for class ControlAbout.
Interface for class TriangleMeshViewer.
Encapsulates GUI elements for controlling OpenGL rendering.
Definition: control_render.h:31
Top level GUI component for fracplanet application: contains parameter controls and viewing area...
Definition: fracplanet_main.h:41
Displays "About" type info.
Definition: control_about.h:30
Interface for class Random and derived classes.
Interface for class ParametersTerrain.
Interface for class ParametersRender.