UNITS
CLASSES, INTERFACES, OBJECTS
TYPES
VARIABLES
CONSTANTS
FUNCTIONS, PROCEDURES
IDENTIFIERS

Unit UCoreTriAPI

Description

The Unit delivers the interface to dynmic library functions J.R. Shewchuks two-dimensional quality mesh generator and delaunay triangulator.

Constants

None.

Variables

None.

Types

NameDescription
PIntegerArray Pointer to integer buffer.
PRealArray Pointer to real buffer.
PTriangulateIO Pointer to parameter record for data exechange between calling delphi application and the DLL function kernal .. see trinagle.h.
TClearIOBuffer Procedure type to clear the iobuffer, defined as dynamic loading procedure from triangle.DLL. It is like clearing a screen.
TFreeIOBuffer Procedure type to free the iobuffer for mapping stdio operations int a character buffer, defined as dynamic loading procedure from triangle.DLL.
TFreeTriangleIO Procedure type to free from DLL allocated io datasets, for dynamic loading procedure from triangle.DLL.
TGetIOBuffer Funcion type to read out a iobuffer line , defined as dynamic loading procedure from triangle.DLL.
TInteger Base data type of integer as 4 byte signed integer.
TIntegerArray Open buffer definition for integer buffer like in ANSI-C: int *IntegerArray.
TIOBufferLines Funcion type to determin the depth of the iobuffer , defined as dynamic loading procedure from triangle.DLL.
TIOBufferTextWidth Funcion type to determin the chracter buffer width of a iobuffer line , defined as dynamic loading procedure from triangle.DLL.
TOpenIOBuffer Procedure type to allocate the iobuffer for mapping stdio operations int a character buffer, defined as dynamic loading procedure from triangle.DLL.
TReal Base data type REAL as double precise float see triangle.h.
TRealArray Open buffer definition for real buffer like in ANSI-C: REAL *RealArray.
TTriangulate Function type to triangle for dynamic loading procedure from triangle.DLL.
TTriangulateIO Parameter record for data exechange between calling delphi application and the DLL function kernal .. see trinagle.h.

Functions and procedures

Overview

Function ExecTriangulate( Switches: PChar; Var InData, OutData, VorOut: PTriangulateIO): LongInt;
Procedure FreeIntegerArray(Var Data: PIntegerArray; Dummy: Integer);
Procedure FreeRealArray(Var Data: PRealArray; Dummy: Integer);
Function NewIntegerArray(Var Data: PIntegerArray; Size: Integer): Boolean;
Function NewRealArray(Var Data: PRealArray; Size: Integer): Boolean;
Procedure Report(IO: TTriangulateIO; Markers, ReportTriangles, ReportNeighbors, ReportSegments, ReportEdges, ReportNorms: Boolean);
Procedure SetIntegerArray(Buffer: PIntegerArray; index: Integer; Data: TInteger);
Procedure SetRealArray(Buffer: PRealArray; index: Integer; Data: TReal);
Function TriangulateLoadDLL( Switches: PChar; Var InData, OutData, VorOut: PTriangulateIO): LongInt;
Procedure WriteStringsIO;
Procedure _cleariobuffer; cdecl; external 'Triangle.DLL';
Procedure _dlpFreeTriangleIO(Var Data: PTriangulateIO);
Procedure _freeiobuffer; cdecl; external 'Triangle.DLL';
Procedure _freetriangleio(Data: PTriangulateIO); cdecl; external 'Triangle.DLL';
Function _getiobuffer(Num: Integer; Data: PChar): Integer; cdecl; external 'Triangle.DLL';
Procedure _InitTriangleIO(Var Data: PTriangulateIO);
Function _iobufferlines: Integer; cdecl; external 'Triangle.DLL';
Function _iobuffertextwidth: Integer; cdecl; external 'Triangle.DLL';
Procedure _openiobuffer(cMaxLine, cIOWidth: Integer); cdecl; external 'Triangle.DLL';
Function _triangulate(Switches: PChar; InData, OutData, VorOut: PTriangulateIO): Integer; cdecl; external 'Triangle.DLL';

Description

Function ExecTriangulate( Switches: PChar; Var InData, OutData, VorOut: PTriangulateIO): LongInt;

Function ExecTriangulate(Switches:PChar;Var InData, OutData,VorOut:PTriangulateIO):LongInt; Capsulation by permanent use of Dll .

1. Switches parameter switches:      
  p  Triangulates a Planar Straight Line Graph (.poly file).
  r  Refines a previously generated mesh.      
  q  Quality mesh generation.  A minimum angle may be specified.
  a  Applies a maximum triangle area constraint.     
  A  Applies attributes to identify elements in certain regions.
  c  Encloses the convex hull with segments.      
  e  Generates an edge list.     
  v  Generates a Voronoi diagram.   
  n  Generates a list of triangle neighbors.     
  g  Generates an .off file for Geomview.     
  B  Suppresses output of boundary information.
  P  Suppresses output of .poly file.     
  N  Suppresses output of .node file.     
  E  Suppresses output of .ele file.     
  I  Suppresses mesh iteration numbers.      
  O  Ignores holes in .poly file.     
  X  Suppresses use of exact arithmetic.      
  z  Numbers all items starting from zero (rather than one).
  o2 Generates second-order subparametric elements.   
  Y  Suppresses boundary segment splitting.     
  S  Specifies maximum number of added Steiner points.      
  i  Uses incremental method, rather than divide-and-conquer.
  F  Uses Fortune's sweepline algorithm, rather than d-and-c.
  l  Uses vertical cuts only, rather than alternating cuts.  
  s  Force segments into mesh by splitting (instead of using CDT). 
  C  Check consistency of final mesh.     
  Q  Quiet:  No terminal output except errors.   
  V  Verbose:  Detailed information on what I'm doing. 
  h  Help:  Detailed instructions for Triangle.  

You dont have to handle files but the fields in the struct. See Procedure Report how to access data and like edges, nodes, segments etc and triangle.h !

Data Container:
     
 InData  - contains the input set  
 OutData - contains the output set     
 VorData - contains the output set for voronoi diagrams  
Result:
     
 If the Function is zero everthing is fine.     
 If not and the value is < 10000 an error occurs.    
If not and the value is > 10000 you called the syntax or info function like triangle without parameter or triangle -h

Procedure FreeIntegerArray(Var Data: PIntegerArray; Dummy: Integer);

Free a the integer buffer!

Procedure FreeRealArray(Var Data: PRealArray; Dummy: Integer);

Free a the real buffer!

Function NewIntegerArray(Var Data: PIntegerArray; Size: Integer): Boolean;

Allocate a new integer buffer!

Function NewRealArray(Var Data: PRealArray; Size: Integer): Boolean;

Allocate a real buffer!

Procedure Report(IO: TTriangulateIO; Markers, ReportTriangles, ReportNeighbors, ReportSegments, ReportEdges, ReportNorms: Boolean);

Report function like in TriCall.c

Procedure SetIntegerArray(Buffer: PIntegerArray; index: Integer; Data: TInteger);

Assign a dataset in a integer buffer!

Procedure SetRealArray(Buffer: PRealArray; index: Integer; Data: TReal);

Assign a dataset in a real buffer!

Function TriangulateLoadDLL( Switches: PChar; Var InData, OutData, VorOut: PTriangulateIO): LongInt;

Like ExecTriangle but only a example how to use the Dll by dynamic loading

Procedure WriteStringsIO;

The Procedure WriteStringsIO is the encapsulation for reading of the whole Buffer and write it to console as example how to use.

Procedure _cleariobuffer; cdecl; external 'Triangle.DLL';

The procedure _cleariobuffer will clear the strings an set the linnumer to zero its like clearing a screen.

Procedure _dlpFreeTriangleIO(Var Data: PTriangulateIO);

Free a triangulation data exchange record only available vor the input recor vor OutData and VoroutData use the external procedure _freetriangulateio !

Procedure _freeiobuffer; cdecl; external 'Triangle.DLL';

The procedure _freeoibuffer will dispose your current buffer.

Procedure _freetriangleio(Data: PTriangulateIO); cdecl; external 'Triangle.DLL';

Core dll call to free in triangle.dll allocated dynamic datasets to prevent memory access failture. It should be applied to OutData and VorData called in the function Exec triangulation.

Function _getiobuffer(Num: Integer; Data: PChar): Integer; cdecl; external 'Triangle.DLL';

The funtion _getiobuffer get back a line string of "num"th line in the buffer. The result of function is zero by bad amounts of num and 1 else. See WriteStringIO how to use

Procedure _InitTriangleIO(Var Data: PTriangulateIO);

Initialisation of a triangulation data exchange record The settings to NIL needed to have no invalid memory snatching.

Function _iobufferlines: Integer; cdecl; external 'Triangle.DLL';

The function _iobufferlines gives back the maximal number of used lines.

Function _iobuffertextwidth: Integer; cdecl; external 'Triangle.DLL';

The function _iobuffertextwidth gives back the width of the characters in the buffer.

Procedure _openiobuffer(cMaxLine, cIOWidth: Integer); cdecl; external 'Triangle.DLL';

_openiobuffer will allocate the buffer by triangle.dll the parameters: cMaxLine: is ignored now and fixed to static 127 lines of output cIOWidth: is the maximal width of each string in your buffer

Function _triangulate(Switches: PChar; InData, OutData, VorOut: PTriangulateIO): Integer; cdecl; external 'Triangle.DLL';

Core dll call of triangulation. Better use the function ExecTriangulation.

Classes, interfaces and objects

None.

Author

<Alexander Weidauer> alex.weidauer@huckfinn.de

Created

Februar 2002

Last modification

Februar 2002


Generated by pasdoc 0.6.20 on Wed 23 Jan 2002 22:58:52