Command
QisLib_AddBoundary

QisLib_AddBoundary


Function:
	int QisLib_AddBoundary(const CQisBoundary* BoundaryStruct, CVectHandle* HandlePtr);

Inputs:
	BoundaryStruct: Data cell containing information of the boundary to be added.
	HandlePtr: Pointer to an object to get the handle of the newly added boundary when the
	function returns.

Return:
	success: 0
	failure: value < 0 indicating one of the following errors

Errors:
	-1: QisLib has not been initialized.
	-2: The specified input is invalid (null).
	-3: The GDSII/OASIS file is not loaded in memory.
	-4: Internal memory failure while adding boundary.
	-5: The specified cell does not exist.
	-6: One or more input data is invalid.
	-7: File open in progress, operation not permitted.

Description:
	- This function adds a boundary to a cell.
	- If QisLib_SetAddVectorHandle is on, QisLib_AddBoundary returns a handle to the newly
	added boundary on successful completion via HandlePtr. This handle can be used to
	edit(delete) the boundary.
	- This function call is usually preceded by calls to QisLib_AddStructure and
	QisLib_AddLayer.
	- The file to which the boundary is to be added must be opened in edit mode either by
	opening it with QisLib_SetLoadMemory on or by creating a new file using
	QisLib_NewGDSII or QisLib_NewOASIS.
	- Adding data outside the extents of the cell might affect the extents of the cell or
	the cell's parents and grandparents.
	- These extents are not recomputed until QisLib_OpenStructure is called.
	- Once the extents are computed, they will not shrink back even if the polygon is deleted.
	- If the extents of a cell have not been recomputed by a call to QisLib_OpenStructure,
	polygons added outside the extents might not be drawn under certain conditions.
	- It is possible to add boundary to a cell currently not opened for viewing.

Code Snippet:
	CQisBoundary BoundaryRec;
	BoundaryRec.StructName = ...
	BoundaryRec.Layer = ...
	BoundaryRec.DataType = ...
	BoundaryRec.NumVert = ...
	if( GetVectorUnit() == _QISUNIT_DBU)
	{
		BoundaryRec.XYCoords.DBUnits = SomeArrayOfInt();
		for(i=0; i < BoundaryRec.NumVert*2; i++)
		{
			BoundaryRec.XYCoords.DBUnits[i] = ...
		}
	}
	else
	{
		BoundaryRec.XYCoords.UserUnits = SomeArrayOfDouble();
		for(i=0; i < BoundaryRec.NumVert*2; i++)
		{
			BoundaryRec.XYCoords.UserUnits[i] = ...
		}
	}
	...
	CVectHandle NewHandle;
	...
	int Return = QisLib_AddBoundary(&BoundaryRec, &NewHandle);
	switch(Return)
	{
		...
	}

References:
QisLib_AddStructure
QisLib_SetAddVectorHandle
QisLib_AddAddLayer
QisLib_DeleteVector
QisLib_SetLoadMemory
QisLib_UndeleteVector
CQisBoundary
CVectHandle