GBRUnion DLL Functions

ACS_Gbrunion_Init

Syntax

int ACS_Gbrunion_Init (GBRUNION_INIT_STRUCT *ptr);

Description

This function is called to initialize the DLL. It should be the first function called. This function checks out the license. Failure to obtain a license is a common reason for this function to fail.

Arguments

GBRUNION_INIT_STRUCT *ptr -- executable path and window handle
                             to window of program's dialog

Return

0       : success
nonzero : failure

Data Structure

typedef struct
{
  char execPath[_MAX_PATH]; -- executable path to gbrunion.dll
  void *vParent;            -- handle to program dialog using gbrunion.dll
}GBRUNION_INIT_STRUCT;

    Example

    Suppose at install you have placed the library into a directory called: C:\WCAD\GBRUnion DLL. Then when intializing the library one should set execPath to:

    C:\WCAD\GBRUnion Dll



ACS_Gbrunion_Setup

Syntax

int ACS_Gbrunion_Setu (argc, *argv[]);

Description

This function is called to define command line options. This should be called before ACS_Gbrunion_Open

Arguments

argc       -- Argumment count

*argv[]    -- Argument list

Return

0       : success
nonzero : failure



ACS_Gbrunion_Open

Syntax

int  ACS_GBRUNION_LIB_API ACS_Gbrunion_Open();

Description

Unionizes and places the unionized polygon coordinates into an internal database.

Arguments

None

Return


0       : success
nonzero : failure




ACS_Gbrunion_GetFileInfo

Syntax

void ACS_Gbrunion_GetFileInfo ( ACS_GBRUNION_FileInfo *pFileInfo );

Description

Contains information about the internal database's units after importing and unionizing the Gerber data. (INCHES or MM) and the resolution. Typically a Gerber file is either in INCHES or MM and because of the union operation a Gerber file with 4 places of accuracy will be converted internally into a database with more precision. . It may only be called after ACS_Gbrunion_Open

Arguments

ACS_GBRUNION_FileInfo *pFileInfo   --  pointer to a data structure

Return

None

Data Structure

typedef struct
{
  char libname[_MAX_PATH];  -- internal name generated from opening input Gerber file
  char unit[32];            -- units of input Gerber file
  int  igrid;               -- integer grid of input Gerber file
} ACS_GBRUNION_FileInfo;



ACS_Gbrunion_GetPolygons

Syntax

int ACS_Gbrunion_GetPolygons ( ACS_GBRUNION_Polygon **ppolylist, int *ppolycnt);

Description

Generates a list of unionized polygons and returns a list of polygons. May only be called after ACS_Gbrunion_Open.

Arguments

ACS_GBRUNION_Polygon **ppolylist --  returned list of polygons which may or
                                     may not contain holes.
                                       

int *ppolycnt                    -- returned polygon count

Return


0       : success
nonzero : failure

Data Structure Details

Each polygon (or Leonov polygon) in the list will use this structure

typedef struct
{
  int    VCnt;              -- Vertex count of single or container polygon
  double *XY;               -- XY data of single or container polygon
  int    HoleCnt;           -- Number of holes in container polygon
  int    *HoleVCnts;        -- list of vertex counts for each contained hole
  double **HoleXYs;         -- list of XY data for each contained hole
} ACS_GBRUNION_Polygon;

Detailed Illustration




ACS_Gbrunion_FreePolygons

Syntax

void ACS_Gbrunion_FreePolygons (ACS_GBRUNION_Polygon *polylist, int polycnt); 

Description

Frees memory allocated to list created by ACS_Gbrunion_GetPolygons.

Arguments


ACS_GBRUNION_Polygon *polylist -- list of polygons generated by
                                  ACS_Gbrunion_GetPolygons

int polycnt -- polygon count of list of polygons generated by
               ACS_Gbrunion_GetPolygons

Return

None




ACS_Gbrunion_SetProgressCallbackFn

Syntax

void ACS_Gbrunion_SetProgressCallbackFn( ACSGbrUnionProgressCbFnPtr callbackFnPtr );

Description

Called to set call back function whichis to process progress information provided by the GbrUnion DLL. If not called, a the DLL will display its own dialog showing the progress. Call this prior to ACS_Gbrunion_Open.

Argument

ACSGbrUnionProgressCbFnPtr callbackFnPtr -- pointer to user defined function to be 
                                            used for display progress



ACS_Gbrunion_GetErrCode

Syntax

void ACS_Gbrunion_GetErrCode (ACS_GBRUNION_ErrorStruct *pError);

Description

Call this when you get a non zero return code from other functions in order to obtain details about the nature of the failure.

Argument

ACS_GBRUNION_ErrorStruct *pError -- returned error code and associated error text message

Data Structure

typedef struct
{
  int errcode;              -- error code set from function returning error
  char msg[8192];           -- error message set from function returning error
} ACS_GBRUNION_ErrorStruct;



ACS_Gbrunion_Close

Syntax

void ACS_Gbrunion_Close ( );

Description

Called after use of this DLL is done. Releases the license and releases any memory that it allocated.

Arguments

None

Return

None




Download On Line Documentation   Price   Revision History


ARTWORK CONVERSION SOFTWARE, INC.                  Company Profile
417 Ingalls St.,     Santa Cruz, CA 95060         Tel (831) 426-6163     Fax 426-2824               email: info@artwork.com