ソースを参照

removed outdated delaunay part

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@35461 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 16 年 前
コミット
551b8d6693

+ 4 - 10
vector/v.voronoi/Makefile

@@ -1,24 +1,18 @@
 
 MODULE_TOPDIR = ../..
 
-VORONOI = v.voronoi
-# DELAUNAY = v.delaunay
-
-PROGRAMS = $(VORONOI)
-# $(DELAUNAY)
+PGM = v.voronoi
 
 SWEEP_OBJS = sw_edgelist.o sw_geometry.o sw_heap.o sw_main.o sw_memory.o sw_output.o \
              sw_voronoi.o
 
-v_voronoi_OBJS = vo_main.o vo_extend.o vo_write.o dt_write.o $(SWEEP_OBJS)
-
-# v_delaunay_OBJS = dt_main.o vo_extend.o vo_write.o dt_write.o $(SWEEP_OBJS)
+v_voronoi_OBJS = vo_main.o vo_extend.o vo_write.o $(SWEEP_OBJS)
 
 LIBES = $(VECTLIB) $(GISLIB)
 DEPENDENCIES= $(VECTDEP) $(GISDEP)
 EXTRA_INC = $(VECT_INC)
 EXTRA_CFLAGS = $(VECT_CFLAGS)
 
-include $(MODULE_TOPDIR)/include/Make/Multi.make
+include $(MODULE_TOPDIR)/include/Make/Module.make
 
-default: multi
+default: cmd

+ 7 - 0
vector/v.voronoi/README

@@ -58,3 +58,10 @@ UPDATE 4/2008
 - TODO: complete it for Voronoi if desired
 
 Benjamin Ducke
+
+-----------------------------------------
+Jan 2009
+
+Removed delaunay part as rewritten in ../v.delaunay2/
+
+Markus Neteler

+ 0 - 2
vector/v.voronoi/delaunay_DEPRECATED

@@ -1,2 +0,0 @@
-no longer maintained.
-Continued in ../v.delaunay2/

+ 0 - 158
vector/v.voronoi/dt_main.c

@@ -1,158 +0,0 @@
-
-/*-s.delaunay
-**
-** Author: James Darrell McCauley (mccauley@ecn.purdue.edu)
-**         USDA Fellow
-**         Department of Agricultural Engineering
-**         Purdue University
-**         West Lafayette, Indiana 47907-1146 USA
-**
-** Permission to use, copy, modify, and distribute this software and its
-** documentation for any purpose and without fee is hereby granted. This
-** software is provided "as is" without express or implied warranty.
-**
-** Modification History:
-** 06 Feb 93 - James Darrell McCauley <mccauley@ecn.purdue.edu> pieced
-**             this together from stuff he found on netlib (see the manpage).
-**
-** 4 2008: Benjamin Ducke - 3D support + better memory management
-**/
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <math.h>
-#include <grass/gis.h>
-#include <grass/Vect.h>
-#include <grass/glocale.h>
-#include "sw_defs.h"
-#include "defs.h"
-
-int main(int argc, char **argv)
-{
-    struct Flag *reg_flag, *line_flag;
-    struct Option *in_opt, *out_opt;
-    struct GModule *module;
-    struct line_pnts *Points;
-    struct line_cats *Cats;
-    int nareas, area;
-
-    G_gisinit(argv[0]);
-
-    module = G_define_module();
-    module->keywords = _("vector");
-    module->description = _("Creates a Delaunay triangulation from an input "
-			    "vector map containing points or centroids.");
-
-    in_opt = G_define_standard_option(G_OPT_V_INPUT);
-    out_opt = G_define_standard_option(G_OPT_V_OUTPUT);
-
-    reg_flag = G_define_flag();
-    reg_flag->key = 'r';
-    reg_flag->description = _("Use only points in current region");
-
-    line_flag = G_define_flag();
-    line_flag->key = 'l';
-    line_flag->description =
-	_("Output triangulation as a graph (lines), not areas");
-
-    if (G_parser(argc, argv))
-	exit(EXIT_FAILURE);
-
-    if (line_flag->answer)
-	Type = GV_LINE;
-    else
-	Type = GV_BOUNDARY;
-
-    All = reg_flag->answer ? 0 : 1;
-
-    Points = Vect_new_line_struct();
-    Cats = Vect_new_cats_struct();
-
-    /* open files */
-    Vect_set_open_level(2);
-    Vect_open_old(&In, in_opt->answer, "");
-
-    /* check if we have a 3D input points map */
-    mode3d = 0;
-    if (Vect_is_3d(&In)) {
-	mode3d = 1;
-    }
-
-
-    if (mode3d) {
-	if (0 > Vect_open_new(&Out, out_opt->answer, 1)) {
-	    G_fatal_error(_("Unable to create vector map <%s>"),
-			  out_opt->answer);
-	}
-    }
-    else {
-	if (0 > Vect_open_new(&Out, out_opt->answer, 0)) {
-	    G_fatal_error(_("Unable to create vector map <%s>"),
-			  out_opt->answer);
-	}
-
-    }
-
-    Vect_hist_copy(&In, &Out);
-    Vect_hist_command(&Out);
-
-    Vect_build_partial(&Out, GV_BUILD_BASE);
-
-    /* initialize working region */
-    G_get_window(&Window);
-    G_percent(0, 100, 1);
-    Vect_region_box(&Window, &Box);
-
-    freeinit(&sfl, sizeof *sites);
-
-    readsites();
-
-    siteidx = 0;
-    geominit();
-
-    triangulate = 1;
-    plot = 0;
-    debug = 0;
-    voronoi(triangulate, nextone);
-
-    Vect_close(&In);
-
-    Vect_build_partial(&Out, GV_BUILD_ATTACH_ISLES);
-
-    nareas = Vect_get_num_areas(&Out);
-    G_debug(3, "nareas = %d", nareas);
-    for (area = 1; area <= nareas; area++) {
-	double x, y, z, angle, slope;
-	int ret;
-
-	G_percent(area, nareas, 2);
-	Vect_reset_line(Points);
-	Vect_reset_cats(Cats);
-
-	ret = Vect_get_point_in_area(&Out, area, &x, &y);
-	if (ret < 0) {
-	    G_warning(_("Cannot calculate area centroid"));
-	    continue;
-	}
-
-	ret = Vect_tin_get_z(&Out, x, y, &z, &angle, &slope);
-	G_debug(3, "area centroid z: %f", z);
-	if (ret < 0) {
-	    G_warning(_("Cannot calculate area centroid z coordinate"));
-	    continue;
-	}
-
-	Vect_append_point(Points, x, y, z);
-	Vect_cat_set(Cats, 1, area);
-
-	Vect_write_line(&Out, GV_CENTROID, Points, Cats);
-    }
-
-    Vect_build_partial(&Out, GV_BUILD_NONE);
-    Vect_build(&Out);
-    Vect_close(&Out);
-
-    exit(EXIT_SUCCESS);
-}

vector/v.voronoi/vo_main.c → vector/v.voronoi/main.c


+ 0 - 65
vector/v.voronoi/v.delaunay.html

@@ -1,65 +0,0 @@
-<H2>DESCRIPTION</H2>
-
-<EM>v.delaunay</EM> uses an existing vector points map (<B>input</B>)
-to create a Delaunay triangulation vector map (<B>output</B>).
-<P>
-
-<BR>
-Delaunay triangulation and Voronoi diagram example:
-<center>
-<img src=v_voronoi_delaunay.png border=1><BR>
-<table border=0 width=590>
-<tr><td><center>
-<i>Delaunay Triangulation (left pane), Voronoi diagram (center pane),
-and both (right pane)</i>
-</center></td></tr>
-</table>
-</center>
-
-
-<H2>EXAMPLE</H2>
-
-Commands used with the Spearfish dataset to create the above figure.
-<div class="code"><pre>
-  g.region n=4927250 s=4919400 w=588650 e=594850
-  d.frame -c fr=one at=0,100,0,33.3333
-  d.frame -c fr=two at=0,100,33.3333,66.6667
-  d.frame -c fr=three at=0,100,66.6667,100
-
-  v.delaunay -lr in=archsites out=arch_delaunay
-  d.frame -s one
-  d.vect arch_delaunay
-  d.vect archsites color=red fcolor=red size=5 icon=basic/circle
-
-  v.voronoi -l in=archsites out=arch_voronoi
-  d.frame -s two
-  d.vect arch_voronoi type=line
-  d.vect archsites color=red fcolor=red size=5 icon=basic/circle
-
-  d.frame -s three
-  d.vect arch_voronoi type=line
-  d.vect arch_delaunay color=blue
-  d.vect archsites color=red fcolor=red size=5 icon=basic/circle
-</pre></div>
-
-
-<H2>REFERENCES</H2>
-<EM>Steve J. Fortune,  (1987).  A Sweepline Algorithm for
-    Voronoi Diagrams, Algorithmica 2, 153-174.</EM>
-
-
-<H2>SEE ALSO</H2>
-<EM>
-<A HREF="v.voronoi.html">v.voronoi</A>, 
-<A HREF="v.hull.html">v.hull</A>
-</EM>
-
-
-<H2>AUTHORS</H2>
-James Darrell McCauley, Purdue University<br>
-GRASS 5 update, improvements: <a href="mailto:aaime@libero.it">Andrea Aime</a>,
- Modena, Italy<br>
-GRASS 5.7 update: Radim Blazek
-
-<p>
-<i>Last changed: $Date$</i></p>