Unit gpc

DescriptionUsesClasses, Interfaces, Objects and RecordsFunctions and ProceduresTypesConstantsVariables

Description

===========================================================================

Project: Generic Polygon Clipper

A new algorithm for calculating the difference, intersection, exclusive-or or union of arbitrary polygon sets.

File: gpc.pas Author: Alan Murta <gpc@cs.man.ac.uk> Version: 2.32 Date: 17th December 2004

Copyright: (C) Advanced Interfaces Group, University of Manchester.

This software may be freely copied, modified, and redistributed provided that this copyright notice is preserved on all copies. The intellectual property rights of the algorithms used reside with the University of Manchester Advanced Interfaces Group.

You may not distribute this software, in whole or in part, as part of any commercial product without the express consent of the author.

There is no warranty or other guarantee of fitness of this software for any purpose. It is provided solely "as is".

===========================================================================

Ported to Delphi by Richard B. Winston. Dec. 17, 2008.

Based in part on a previous port by Stefan Schedel .

Mar. 18, 2009 Correction submitted by César Aguilar

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
record Tgpc_vertex Union
record Tgpc_vertex_list Vertex list structure
record Tgpc_polygon  
record Tgpc_tristrip Tristrip set structure

Functions and Procedures

procedure gpc_read_polygon (var f : text; read_hole_flags: integer; p : Pgpc_polygon);
procedure gpc_write_polygon (var f : text; write_hole_flags: integer; p : Pgpc_polygon);
procedure gpc_add_contour (polygon : Pgpc_polygon; contour : Pgpc_vertex_list; hole : integer);
procedure gpc_polygon_clip (set_operation : Tgpc_op; subject_polygon : Pgpc_polygon; clip_polygon : Pgpc_polygon; result_polygon : Pgpc_polygon);
procedure gpc_tristrip_clip (op : Tgpc_op; subj : Pgpc_polygon; clip : Pgpc_polygon; result : Pgpc_tristrip);
procedure gpc_polygon_to_tristrip (s: Pgpc_polygon; t: Pgpc_tristrip);
procedure gpc_free_polygon (polygon : Pgpc_polygon);
procedure gpc_free_tristrip (tristrip : Pgpc_tristrip);

Types

Tgpc_op = (...);
Pgpc_vertex_array = ˆTgpc_vertex_array;
Tgpc_vertex_array = array[0.. MaxInt div sizeof(Tgpc_vertex) - 1] of Tgpc_vertex;
Pgpc_vertex_list = ˆTgpc_vertex_list;
PIntegerArray = ˆTIntegerArray;
TIntegerArray = array[0..MaxInt div sizeof(Integer) - 1] of Integer;
Pgpc_vertex_list_array = ˆTgpc_vertex_list_array;
Tgpc_vertex_list_array = array[0.. MaxInt div sizeof(Tgpc_vertex_list) - 1] of Tgpc_vertex_list;
Pgpc_polygon = ˆTgpc_polygon;
Pgpc_tristrip = ˆTgpc_tristrip;

Constants

Version = 'GPC_VERSION "2.32"';
GPC_EPSILON : double = 2.2204460492503131E-16;

Description

Functions and Procedures

procedure gpc_read_polygon (var f : text; read_hole_flags: integer; p : Pgpc_polygon);

=========================================================================== Public Function Prototypes ===========================================================================

procedure gpc_write_polygon (var f : text; write_hole_flags: integer; p : Pgpc_polygon);
 
procedure gpc_add_contour (polygon : Pgpc_polygon; contour : Pgpc_vertex_list; hole : integer);
 
procedure gpc_polygon_clip (set_operation : Tgpc_op; subject_polygon : Pgpc_polygon; clip_polygon : Pgpc_polygon; result_polygon : Pgpc_polygon);
 
procedure gpc_tristrip_clip (op : Tgpc_op; subj : Pgpc_polygon; clip : Pgpc_polygon; result : Pgpc_tristrip);
 
procedure gpc_polygon_to_tristrip (s: Pgpc_polygon; t: Pgpc_tristrip);
 
procedure gpc_free_polygon (polygon : Pgpc_polygon);
 
procedure gpc_free_tristrip (tristrip : Pgpc_tristrip);
 

Types

Tgpc_op = (...);

=========================================================================== Public Data Types ===========================================================================

Values
  • GPC_DIFF: Set operation type
  • GPC_INT: Difference
  • GPC_XOR: Intersection
  • GPC_UNION: Exclusive or
Pgpc_vertex_array = ˆTgpc_vertex_array;

vertex y component

Tgpc_vertex_array = array[0.. MaxInt div sizeof(Tgpc_vertex) - 1] of Tgpc_vertex;

Helper Type for indexing

Pgpc_vertex_list = ˆTgpc_vertex_list;
 
PIntegerArray = ˆTIntegerArray;

Vertex array pointer

TIntegerArray = array[0..MaxInt div sizeof(Integer) - 1] of Integer;
 
Pgpc_vertex_list_array = ˆTgpc_vertex_list_array;
 
Tgpc_vertex_list_array = array[0.. MaxInt div sizeof(Tgpc_vertex_list) - 1] of Tgpc_vertex_list;

Helper Type for indexing

Pgpc_polygon = ˆTgpc_polygon;
 
Pgpc_tristrip = ˆTgpc_tristrip;

Contour array pointer

Constants

Version = 'GPC_VERSION "2.32"';

=========================================================================== Constants ===========================================================================

GPC_EPSILON : double = 2.2204460492503131E-16;
 

Authors


Generated by PasDoc 0.12.1 on 2013-05-13 15:41:42