1 /*****************************************************************************
4 Author: Christian Mayer
7 ---------- Copyright (C) 1999 Christian Mayer (vader@t-online.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 *****************************************************************************/
42 /****************************************************************************/
44 /****************************************************************************/
48 /****************************************************************************/
50 /****************************************************************************/
55 #include <Voronoi/point2d.h>
56 #include "FGPhysicalProperties.h"
58 /****************************************************************************/
60 /****************************************************************************/
63 FG_USING_NAMESPACE(std);
65 typedef vector<Point2D> Point2DList;
70 FGPhysicalProperties2D value;
72 FGVoronoiInput(const Point2D& p, const FGPhysicalProperties2D& v) { position = p; value = v; }
75 struct FGVoronoiOutput
78 FGPhysicalProperties2D value;
80 FGVoronoiOutput(const Point2DList& b, const FGPhysicalProperties2D& v) {boundary = b; value = v;};
83 typedef vector<FGVoronoiInput> FGVoronoiInputList;
84 typedef vector<FGVoronoiOutput> FGVoronoiOutputList;
86 /****************************************************************************/
87 /* FUNCTION DECLARATION */
88 /****************************************************************************/
89 FGVoronoiOutputList Voronoiate(const FGVoronoiInputList& input);
91 #endif /*FGVoronoi_H*/