CAM Library
API Reference
Point Array Functions

Available Internal Point Array Functions used by CAM Library. More...

Functions

int camlib_PointArray_Empty ()
 Clear internal point array. May be used after camlib_ActivateCell. More...
 
int camlib_PointArray_Append (float x, float y)
 Add point to internal point array. May be used after camlib_ActivateCell. More...
 
int camlib_PointArray_Assign (int num, float x, float y)
 Modify existing point in the internal point array. May be used after camlib_ActivateCell. More...
 
int camlib_PointArray_GetCount ()
 Get number of points currently in the internal point array. May be used after camlib_ActivateCell. More...
 

Detailed Description

Available Internal Point Array Functions used by CAM Library.

Function Documentation

◆ camlib_PointArray_Append()

int camlib_PointArray_Append ( float  x,
float  y 
)

Add point to internal point array. May be used after camlib_ActivateCell.

Parameters
xPoint to add to array (X value in user units). To change user units see, camlib_SetUserUnits or camlib_GetUserUnits
yPoint to add to array (Y value in user units). To change user units see, camlib_SetUserUnits or camlib_GetUserUnits
Returns
Returns 0 if successful, else -1.
Sample Code C++:
camlib_SetUserUnits( "inch" ) // Sets activation user units to Inches
camlib_PointArray_Empty(); //Clears internal point array
camlib_PointArray_Append( 0.0, 0.0 ); //Add 0,0 to internal point array
camlib_PointArray_Append( 2.0, 0.0 ); //Add 2,0 to internal point array
camlib_PointArray_Append( 1.0, 1.0 ); //Add 2,2 to internal point array
camlib_PointArray_Append( 0.0, 0.0 ); //Add 0,0 to internal point array (i.e. close)
camlib_Add_Polygon( 1 ); //Add Polygon (i.e. triangle) to layer 1.

◆ camlib_PointArray_Assign()

int camlib_PointArray_Assign ( int  num,
float  x,
float  y 
)

Modify existing point in the internal point array. May be used after camlib_ActivateCell.

Parameters
numArray value to modify. First point starts with 0.
xPoint to add to array (X value in user units). To change user units see, camlib_SetUserUnits or camlib_GetUserUnits
yPoint to add to array (Y value in user units). To change user units see, camlib_SetUserUnits or camlib_GetUserUnits
Returns
Returns 0 if successful, else -1.
Sample Code C++:
camlib_SetUserUnits( "inch" ) // Sets activation user units to Inches
camlib_PointArray_Empty(); //Clears internal point array
camlib_PointArray_Append( 0.0, 0.0 ); //Add 0,0 to internal point array
camlib_PointArray_Append( 2.0, 0.0 ); //Add 2,0 to internal point array
camlib_PointArray_Append( 1.0, 1.0 ); //Add 2,2 to internal point array
camlib_PointArray_Append( 0.0, 0.0 ); //Add 0,0 to internal point array (i.e. close)
camlib_PointArray_Assign( 1, 5.0, 0.0 ); //Change point 1 to 5,0
camlib_Add_Polygon( 1 ); //Add Polygon (i.e. triangle) to layer 1.

◆ camlib_PointArray_Empty()

int camlib_PointArray_Empty ( )

Clear internal point array. May be used after camlib_ActivateCell.

Returns
Returns 0 if successful, else -1.

◆ camlib_PointArray_GetCount()

int camlib_PointArray_GetCount ( )

Get number of points currently in the internal point array. May be used after camlib_ActivateCell.

Returns
Returns 0 if successful, else -1.
Sample Code C++:
camlib_SetUserUnits( "inch" ) // Sets activation user units to Inches
camlib_PointArray_Empty(); //Clears internal point array
camlib_PointArray_Append( 0.0, 0.0 ); //Add 0,0 to internal point array
camlib_PointArray_Append( 2.0, 0.0 ); //Add 2,0 to internal point array
camlib_PointArray_Append( 1.0, 1.0 ); //Add 2,2 to internal point array
camlib_PointArray_Append( 0.0, 0.0 ); //Add 0,0 to internal point array (i.e. close)
int nTotalPoints = camlib_PointArray_GetCount();
printf("There are %d points in the internal point array", nTotalPoints );
camlib_Add_Polygon( 1 ); //Add Polygon (i.e. triangle) to layer 1.
camlib_PointArray_Empty
int camlib_PointArray_Empty()
Clear internal point array. May be used after camlib_ActivateCell.
camlib_Add_Polygon
int camlib_Add_Polygon(int nLayer)
Add a Polygon to the active cell. May be used after camlib_ActivateCell and Point Array Functions.
camlib_PointArray_GetCount
int camlib_PointArray_GetCount()
Get number of points currently in the internal point array. May be used after camlib_ActivateCell.
camlib_PointArray_Append
int camlib_PointArray_Append(float x, float y)
Add point to internal point array. May be used after camlib_ActivateCell.
camlib_SetUserUnits
int camlib_SetUserUnits(char *value)
Set the active user units to be used with CAM Library API's.
camlib_PointArray_Assign
int camlib_PointArray_Assign(int num, float x, float y)
Modify existing point in the internal point array. May be used after camlib_ActivateCell.