]> git.mxchange.org Git - flightgear.git/blob - src/WeatherCM/FGVoronoi.h
Tweaks to fix problems with moon rendering introduced with ssg.
[flightgear.git] / src / WeatherCM / FGVoronoi.h
1 /*****************************************************************************
2
3  Header:       FGVoronoi.h      
4  Author:       Christian Mayer
5  Date started: 28.05.99
6
7  ---------- Copyright (C) 1999  Christian Mayer (vader@t-online.de) ----------
8
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17  details.
18
19  You should have received a copy of the GNU General Public License along with
20  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21  Place - Suite 330, Boston, MA  02111-1307, USA.
22
23  Further information about the GNU General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25
26 FUNCTIONAL DESCRIPTION
27 ------------------------------------------------------------------------------
28 library for Voronoi Diagram calculation based on Steven Fortune 'Sweep2'
29 FGVoronoi is the wraper to feed the voronoi calulation with a vetor of points
30 and any class you want, as it uses templates
31 NOTE: Sweep2 didn't free *any* memory. So I'm doing what I can, but that's not
32       good enough...
33
34 HISTORY
35 ------------------------------------------------------------------------------
36 30.05.1999 Christian Mayer      Created
37 16.06.1999 Durk Talsma          Portability for Linux
38 20.06.1999 Christian Mayer      added lots of consts
39 30.06.1999 Christian Mayer      STL portability
40 *****************************************************************************/
41
42 /****************************************************************************/
43 /* SENTRY                                                                   */
44 /****************************************************************************/
45 #ifndef FGVoronoi_H
46 #define FGVoronoi_H
47
48 /****************************************************************************/
49 /* INCLUDES                                                                 */
50 /****************************************************************************/
51 #include "compiler.h"
52 #include <vector>
53 #include <set>
54
55 #include <Voronoi/point2d.h>
56 #include "FGPhysicalProperties.h"
57                 
58 /****************************************************************************/
59 /* DEFINES                                                                  */
60 /****************************************************************************/
61 FG_USING_STD(vector);
62 FG_USING_STD(set);
63 FG_USING_NAMESPACE(std);
64
65 typedef vector<Point2D> Point2DList;
66
67 struct FGVoronoiInput
68 {
69     Point2D position;
70     FGPhysicalProperties2D value;
71
72     FGVoronoiInput(const Point2D& p, const FGPhysicalProperties2D& v) { position = p; value = v; }
73 };
74
75 struct FGVoronoiOutput
76 {
77     Point2DList boundary;
78     FGPhysicalProperties2D value;
79
80     FGVoronoiOutput(const Point2DList& b, const FGPhysicalProperties2D& v) {boundary = b; value = v;};
81 };
82
83 typedef vector<FGVoronoiInput> FGVoronoiInputList;
84 typedef vector<FGVoronoiOutput> FGVoronoiOutputList;
85
86 /****************************************************************************/
87 /* FUNCTION DECLARATION                                                     */
88 /****************************************************************************/
89 FGVoronoiOutputList Voronoiate(const FGVoronoiInputList& input);
90
91 #endif /*FGVoronoi_H*/
92
93
94
95
96
97
98