Synopsis

PDX_MSGT igeo_AllocateApprox(long option, long init_size, long inc_size)

Purpose

Allocate the IGES linear approximation workspace

Description

Allocates the IGES approximation workspace data used to perform and manage linear approximation of IGES entities. Use igeo_FreeApprox to free the current allocated workspace or igeo_FreeAllApprox to free all the allocated workspaces. By default, if igeo_AllocateApprox is called again before igeo_FreeApprox is called, the current workspace is freed and then reallocated to the specified size. If the option IGEO_NEWAPPROX is specified, the current workspace is saved (this includes all approximation option settings) and a new workspace is allocated. When the last workspace allocated is freed, any previous workspace is restored as the current workspace. For each init_size word 3 doubles and 1 long are allocated(28 bytes). For example, an init_size value of 1000 would allocate 3000 doubles and 1000 longs initially. If the initial space is used up and more is needed, inc_size increases the size by at least 3 doubles and 1 long for each inc_size word, but may increase the size by more depending on what is being approximated at the time. If init_size and/or inc_size are less than zero(0) (-1 for example) the previous values set in igeo_AllocateApprox are used to reallocate the workspace. If init_size and/or inc_size are less than zero(0) the first time igeo_AllocateApprox is used, default values are used for init_size (5000) and inc_size (2500). If inc_size is zero(0), then once the init_size workspace is used an error is returned which indicates that no reallocation took place(GDX_NOREALLOC).

Input

option

IGEO_NEWAPPROX

Create a new workspace

init_size

The initial approximation workspace size

inc_size

The amount to increment the workspace size if the current workspace runs out or zero for no reallocation.

Return

      IGEO_NOERR
      IGEO_NOMEMORY
      Low level error return.
      .fi