1
0
Fork 0
terragear/src/Lib/poly2tri
curt c8cc7e2a61 Contributed by Bruce Finney:
The following files have been changed to enable the latest Terragear CVS
to compile with MSVC++ 5.0

.\construct\clipper\clipper.cxx
        for( int i - lots of places

.\construct\genoutput\genobj.cxx
        fix directory logic for windows, line 320 and following

.\construct\main\main.cxx
        windows does not have an opendir function
        added code for windows directory functions
        disabled the mem allocation limit code - windows does not
        have similar functions
        for ( int i - several places

.\construct\match\match.cxx
        moved the definition of file and command outside of the ifdef line 420

.\lib\e00\e00.cxx
        for( int i  - several places

.\lib\e00\e00.cxx
        use simgear/compiler.h constructs

.\lib\geometry\contour_tree.hxx
        removed a cout statement

.\lib\geometry\poly_support.cxx
        added float.h  changed 1.0e+999 to DBL_MAX, windows doesn't go that big
        lots of for ( int i changes
        lines 193 and 208 no != operator defined - changed logic
        line 801 flag should be int, not bool, get_hole_flag returns int

.\lib\landcover\landcover.cxx
.\lib\landcover\landcover.hxx
        add include simgear/compiler.h
        see comments

.\lib\optimize\genfans.cxx
        function canonify added return at end, windows complains
        added using std  for cout and endl

.\lib\optimize\genstrips.cxx
        function tgGenStrips no return value, moved by_node into outer scope
        fix for ( int i ...

.\lib\poly2tri\construct.c
        added include <memory.h> for windows
        remove unused variables lines 435 & 437

.\lib\poly2tri\misc.c
        added HAVE_SYS_TIME_H logic for sys/time.h include file
        added logic to uses windows functions for time and rand

.\lib\poly2tri\monotone.c
        added include <memory.h> for windows
        lines 286-288 remove unused variables

.\lib\poly2tri\tri.c
        remove sys/time.h - no time functions called
        added include <memory.h> for windows

.\lib\polygon\polygon.cxx
        function polygon_to_tristrip will not compile I don't think the
        logic is complete, no returned data  added if else endif around
        function and polygon_to_tristrip_old, renamed _old function.
        Search of code reveals that function is not called by anyone.

.\lib\polygon\superpoly.cxx
        changed include <superpoly.hxx> to "superpoly.hxx"

.\lib\polygon\superpoly.hxx
        add include <windows.h> for windows before include <gl.h>
        needed for definitions used in Microsoft version of opengl

.\lib\shapelib\dbfopen.c
        added include files for windows
        lines 195-197 271-272 515-517 removed unused variables

.\lib\shapelib\shpopen.c
        added #include <stdlib.h> for malloc() and friends
        added include files for windows
        line 279 527 813 1127 removed unused variables
        line 827 cast result to int

.\lib\win32\mkdir.cpp
        documented function, remove debug lines

.\prep\demraw2ascii\main.c
        lines 46-50 remove unused variables

.\prep\demraw2ascii\rawdem.c
        line 47 changed logic to compile with MSVC
        line 244-256 set real constants to float, windows complains with
                double constants

.\prep\genairports\build.cxx
        lots of for ( int i  changes

.\prep\genairports\main.cxx
        fix mkdir logic for windows

.\prep\genairports\output.cxx
        added  using std  cout endl
        lots of for ( int i  changes
        fix mkdir logic for windows

.\prep\genairports\runway.cxx
        for ( int i  changes
        lines 117-118 161-162  remove default values for function parameters

.\prep\gshhs\main.cxx
        added using std cout

.\prep\shapefile\noaa_decode.cxx
.\prep\shapefile\shape_decode.cxx
        added using std  for cout
        lines 45-49 moved unused variables inside #if 0 block
2000-11-25 19:39:46 +00:00
..
construct.c Contributed by Bruce Finney: 2000-11-25 19:39:46 +00:00
data_1 Initial revision 2000-02-09 19:51:45 +00:00
interface.h Initial revision 2000-02-09 19:51:45 +00:00
Makefile.am Changed builddir -> srcdir for out of source tree builds. 2000-09-20 21:45:25 +00:00
makefile.orig Added a missing file. 2000-02-09 20:10:17 +00:00
misc.c Contributed by Bruce Finney: 2000-11-25 19:39:46 +00:00
monotone.c Contributed by Bruce Finney: 2000-11-25 19:39:46 +00:00
README Initial revision 2000-02-09 19:51:45 +00:00
tri.c Contributed by Bruce Finney: 2000-11-25 19:39:46 +00:00
triangulate.h Initial revision 2000-02-09 19:51:45 +00:00

	This program is an implementation of a fast polygon
triangulation algorithm based on the paper "A simple and fast
incremental randomized algorithm for computing trapezoidal
decompositions and for triangulating polygons" by Raimund Seidel.

(A copy of the implementation report is available as
	http://www.cs.unc.edu/~manocha/CODE/GEM/chapter.html)

	The algorithm handles simple polygons with holes. The input is
specified as contours. The outermost contour is anti-clockwise, while
all the inner contours must be clockwise. No point should be repeated
in the input. A sample input file 'data_1' is provided.


	The output is a list of triangles. Each triangle gives a pair
(i, j, k) where i, j, and k are indices of the vertices specified in
the input array. (The index numbering starts from 1, since the first
location v[0] in the input array of vertices is unused). The number of
output triangles produced for a polygon with n points is,
	(n - 2) + 2*(#holes)


	The algorithm also generates a qyery structure which can be
used to answer point-location queries very fast.

	int triangulate_polygon(...)
Time for triangulation: O(n log*n)
		
	int is_point_inside_polygon(...)	
Time for query        : O(log n)

	Both the routines are defined in 'tri.c'. See that file for
interfacing details.  If not used stand_alone, include the header file
"interface.h" which contains the declarations for these
functions. Inclusion of "triangulation.h" is not necessary.


	The implementation uses statically allocated arrays. Choose
appropriate value for SEGSIZE /* in triangulate.h */ depending on
input size.


	There sould not be any compilation problem. If log2() is not
defined in your math library, you will have to supply the definition.

	
USAGE:
	triangulate <filename> /* For standalone */


------------------------------------------------------------------
Bibliography:


@article{Sei91,
  AUTHOR = "R. Seidel",
  TITLE = "A simple and Fast Randomized Algorithm for Computing Trapezoidal Decompositions and for Triangulating Polygons",
  JOURNAL = "Computational Geometry Theory \& Applications",
  PAGES = "51-64",
  NUMBER = 1,    
  YEAR = 1991,
  VOLUME = 1 }


@book{o-cgc-94
, author =      "J. O'Rourke"
, title =       "Computational Geometry in {C}"
, publisher =   "Cambridge University Press"
, year =        1994
, note =        "ISBN 0-521-44592-2/Pb \$24.95,
                ISBN 0-521-44034-3/Hc \$49.95.
                Cambridge University Press
                40 West 20th Street
                New York, NY 10011-4211
                1-800-872-7423
                346+xi pages, 228 exercises, 200 figures, 219 references"
, update =      "94.05 orourke, 94.01 orourke"
, annote =      "Textbook"
}



Implementation report: Narkhede A. and Manocha D., Fast polygon
 triangulation algorithm based on Seidel's Algorithm, UNC-CH, 1994.

-------------------------------------------------------------------

UNC-CH GIVES NO WARRANTY, EXPRESSED OR IMPLIED, FOR THE SOFTWARE
AND/OR DOCUMENTATION PROVIDED, INCLUDING, WITHOUT LIMITATION, WARRANTY
OF MERCHANTABILITY AND WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE.

This software is for non-commercial use only.



				- Atul Narkhede (narkhede@cs.unc.edu)