-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfracplanet.cpp
99 lines (79 loc) · 3.4 KB
/
fracplanet.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/**************************************************************************/
/* Copyright 2009 Tim Day */
/* */
/* This file is part of Fracplanet */
/* */
/* Fracplanet is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation, either version 3 of the License, or */
/* (at your option) any later version. */
/* */
/* Fracplanet is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with Fracplanet. If not, see <http://www.gnu.org/licenses/>. */
/**************************************************************************/
/*! \mainpage Fracplanet : fractal terrain generator
\author Tim Day
\section introduction Introduction
"Fracplanet" is an interactive tool for generating fractal planets and terrains.
It can output the generated meshes to files suitable for use by POV-Ray.
\todo For new features to be added, see the TODO file.
*/
#include "precompiled.h"
#include "fracplanet_main.h"
//! Application code
/*! Currently this simply creates a TriangleMesh object of some sort,
then passes it to a viewer.
*/
int main(int argc,char* argv[])
{
QApplication app(argc,argv);
boost::program_options::variables_map opts;
try
{
boost::program_options::options_description opt_desc
("Recognised options (besides Qt standards):");
opt_desc.add_options()
("help,h","show list of recognised options")
("verbose,v","verbose output to stderr")
;
opt_desc.add(ParametersRender::options());
boost::program_options::store
(
boost::program_options::parse_command_line(argc,argv,opt_desc),
opts
);
boost::program_options::notify(opts);
if (opts.count("help"))
{
std::cerr << opt_desc << std::endl;
return 1;
}
}
catch (boost::program_options::error& e)
{
std::cerr << "Bad command line: " << e.what() << std::endl;
std::cerr << "Use -h or --help to list recognised options" << std::endl;
return 1;
}
const bool verbose=opts.count("verbose");
if (verbose)
std::cerr << "Setting up...\n";
FracplanetMain*const main_widget=new FracplanetMain(0,&app,opts,verbose);
if (verbose)
std::cerr << "...setup completed\n";
main_widget->show();
if (verbose)
{
std::cerr << "Fracplanet:" << std::endl;
std::cerr << " sizeof(ByteRGBA) is " << sizeof(ByteRGBA) << " (4 is good)" << std::endl;
std::cerr << " sizeof(Vertex) is " << sizeof(Vertex) << " (32 is good)" << std::endl;
std::cerr << " sizeof(Triangle) is " << sizeof(Triangle) << " (12 is good)" << std::endl;
}
main_widget->regenerate();
return app.exec();
}