1 /*****************************************************************************
4 Author: Christian Mayer
7 -------- Copyright (C) 1999 Christian Mayer (fgfs@christianmayer.de) --------
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
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
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.
23 Further information about the GNU General Public License can also be found on
24 the world wide web at http://www.gnu.org.
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
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 11.10.1999 Christian Mayer changed set<> to map<> on Bernie Bright's
42 19.10.1999 Christian Mayer change to use PLIB's sg instead of Point[2/3]D
43 and lots of wee code cleaning
44 *****************************************************************************/
46 /****************************************************************************/
48 /****************************************************************************/
52 /****************************************************************************/
54 /****************************************************************************/
59 #include <Include/compiler.h>
69 #include "FGWeatherVectorWrap.h"
70 #include "FGPhysicalProperties.h"
72 /****************************************************************************/
74 /****************************************************************************/
76 FG_USING_NAMESPACE(std);
78 typedef vector<sgVec2Wrap> Point2DList;
83 FGPhysicalProperties2D value;
85 FGVoronoiInput(const sgVec2& p, const FGPhysicalProperties2D& v)
87 sgCopyVec2(position, p);
92 struct FGVoronoiOutput
95 FGPhysicalProperties2D value;
97 FGVoronoiOutput(const Point2DList& b, const FGPhysicalProperties2D& v)
104 typedef vector<FGVoronoiInput> FGVoronoiInputList;
105 typedef vector<FGVoronoiOutput> FGVoronoiOutputList;
107 /****************************************************************************/
108 /* FUNCTION DECLARATION */
109 /****************************************************************************/
110 FGVoronoiOutputList Voronoiate(const FGVoronoiInputList& input);
112 #endif /*FGVoronoi_H*/