QisBool Intersection Check Functions

 QisBool_IsPointInsidePolygon Objective To check the location of a point  relative to a polygon. Prototype int QisBool_IsPointInsidePolygon(   int iX, int iY, int* iXY, int iNV, void* iBooleanHandle ); Input Arguments a.     int iX: X co-ordinate of the point in question. b.     int iY: Y co-ordinate of the point in question. c.     int* iXY: List of x,y co-ordinates of the polygon in question. d.     int iNV: Number of vertices in the polygon in question. e.     void* iBooleanHandle: Handle to an instance of QisBool obtained using QisBool_Create. Output Arguments a.     - Return Value a.     0: The point is outside the polygon. b.     1: The point is in the interior of the polygon (not on the boundary) c.     2: The point is on the boundary of the polygon but is not one of the vertices. d.     3: The point is one of the vertices of the polygon. Pre-Conditions a.     - Operation a.     This function checks the location of a point with respect to a polygon. Post-Conditions a.     - C++ Equivalent virtual int IQisBool::IsPointInsidePolygon(   int iX, int iY, int* iXY, int iNV ) = 0; See Also -

 Objective To check the location of a point relative to a set of polygons. Prototype int QisBool_IsPointInPolygons(   int iX, int iY, int** iXY, int* iNV, int iN, int* oIndices,   void* iBooleanHandle ); Input Arguments a.     int iX: X co-ordinate of the point in question. b.     int iY: Y co-ordinate of the point in question. c.     int iN: Number of polygons in the set. d.     int* iNV: A list of number of vertices for each polygon in the set. e.     int** iXY: A list of x,y co-ordinates of each polygon in the set. f.      void* iBooleanHandle: Handle to an instance of QisBool obtained using QisBool_Create. Output Arguments a.     int* oIndices: A pre-allocated array of iN integers. This array is populated with status codes (0..3) depending on the location of the point with respect to each polygon of the set. i.e If I is an index of a polygon in the set (with iNV[I] number of vertices and iXY[i] co-ordinates), then upon successful return, oIndices[I] is a value from 0..3 indicating the location of the point iX, iY relative to the polygon I. Return Value a.     success: 0 b.     failure: Invalid boolean handle or iN <= 0. Pre-Conditions a.     The array to store status codes (oIndices) must contain iN integers and must be allocated by the client. Operation a.     The function performs QisBool_IsPointInsidePolygon for each polygon in the set and populates the corresponding slot in oIndices with the status code : 0: The point is outside the polygon. 1: The point is in the interior of the polygon (not on the boundary) 2: The point is on the boundary of the polygon but is not one of the vertices. 3: The point is one of the vertices of the polygon. Post-Conditions - C++ Equivalent virtual int IQisBool::IsPointInPolygons(   int iX, int iY, int** iXY, int* iNV, int iN, int* oIndices ) = 0; See Also

 Objective To check if a boundary/path crosses another boundary. Prototype int QisBool_IsObjectInRegion(   int* iXY, int iNV, int iWidth, EPathType iPathType, int* iRegionXY,   int iRegionNV, void* iBooleanHandle ); Input Arguments a.     int* iXY: The x,y co-ordinates of the boundary/path whose location needs to be tested. b.     int iNV: The number of vertices in the boundary/path whose location needs to be tested. c.     int iWidth: For paths, specify the path width. For boundaries, this argument is ignored. d.     EPathType iPathType: eIS_BOUNDARY: Polygon to be tested is a boundary. eFLUSH_PATH: Polygon to be tested is a flush path. eROUND_PATH : Polygon to be tested is a round path. eHALFEXT_PATH : Polygon to be tested is a half extended path. e.     int* iRegionXY: The x,y co-ordinates of the polygon to be used as reference. f.      int iRegionNV: The number of vertices of the polygon to be used as a reference. g.     void* iBooleanHandle: Handle to an instance of QisBool obtained using QisBool_Create. Output Arguments - Return Value a.     success: 0: The path/boundary and the region intersect. 1: The path/boundary is inside the region. 2: The path/boundary encloses the region. 3: The path/boundary is outside the region. b.     failure: < 0. Call QisBool_ErrorMsg to get the details. Pre-Conditions a.     The reference polygon (region) must be a closed boundary. b.     The polygon to be tested can be a path or a boundary. Operation a.     This function checks the location of the polygon to be tested relative to the reference polygon (region). Post-Conditions - C++ Equivalent virtual int IQisBool::IsObjectInRegion(     int* iXY, int iNV, int iWidth, EPathType iPathType, int* iRegionXY,     int iRegionNV   ) = 0; See Also -

 Objective To setup a list of rectangular windows to be used later for QisBool_PolyCrossWindows. Prototype int QisBool_SetupWindows(   int iNWindows, int* iExtentsArr, void** oHandle, void* iBoolHandle ); Input Arguments a.     int iNWindows: Number of windows. b.     int* iExtentsArr: An array of 4*iNWindows integers specifying the min-max extents of the rectangular windows. iExtentsArr[0..3] represent the first window, iExtentsArr[4..7] represent second window and so on. c.     void* iBooleanHandle: Handle to an instance of QisBool obtained using QisBool_Create. Output Arguments a.     void** oHandle: Address of a void pointer which will store a handle to an internal object that holds the window data. This handle should not be reinterpreted in any way (for QisBool use only). Return Value a.     Always 0. Pre-Conditions - Operation a.     This function sets up a list of rectangular windows for use later during QisBool_PolyCrossWindows. Post-Conditions a.     The memory allocated internally to store the rectangular windows must be release by calling QisBool_ReleaseRegions. C++ Equivalent virtual int IQisBool::SetupWindows(   int iNWindows, int* iExtentsArr, void** oHandle ) = 0; See Also

 Objective To setup a list of polygonal windows to be used later by QisBool_PolyCrossRegions and QisBool_PolyCrossLeonovRegions. Prototype int QisBool_SetupRegions(   int iNRegions, int* iNV, int** iXY, void** oHandle, void* iBoolHandle ); Input Arguments a.     int iNRegions: Number of polygonal windows. b.     int* iNV: List of number of vertices per polygon. c.     int** iXY: List of x,y co-ordinates per polygon. d.     void* iBooleanHandle: Handle to an instance of QisBool obtained using QisBool_Create. Output Arguments a.     void** oHandle: Address of a void pointer which will store a handle to an internal object that holds the polygon data. This handle should not be reinterpreted in any way (for QisBool use only). Return Value a.     Always 0. Pre-Conditions a.     The polygonal windows can either be regular polygons (every integer of iNV is +ve) or they can contain Leonov polygons (iNV integer corresponding to outer boundaries is -ve) Operation a.     This function sets up a list of rectangular windows for use later during QisBool_PolyCrossRegions and QisBool_PolyCrossLeonovRegions. Post-Conditions a.     The memory allocated internally to store the rectangular windows must be release by calling QisBool_ReleaseRegions. C++ Equivalent virtual int IQisBool::SetupRegions(     int iNRegions, int* iNV, int** iXY, void** oHandle   ) = 0; See Also

 Objective To release the memory allocated to store the rectangular, polygonal and leonov windows by  QisBool_SetupWindows and QisBool_SetupRegions. Prototype void QisBool_ReleaseRegions(void** ioHandle, void* iBoolHandle); Input Arguments a.     void** ioHandle: Address of the handle returned by QisBool_SetupWindows or QisBool_SetupRegions. b.     void* iBooleanHandle: Handle to an instance of QisBool obtained using QisBool_Create. Output Arguments a.     void** ioHandle: The contents of this address is set to NULL upon return. Return Value - Pre-Conditions a.     *ioHandle must be a non-null void pointer returned by one of the above mentioned setup functions. Operation a.     This function releases the memory allocated to store the rectangular, polygonal and leonov windows. Post-Conditions - C++ Equivalent virtual void IQisBool::ReleaseRegions(void*& ioHandle) = 0; See Also

 Objective To check if a polygon crosses a set of rectangular windows. Prototype int QisBool_PolyCrossWindows(   int* iXY, int iNV, void* iHandle, void* iBoolHandle ); Input Arguments a.     int* iXY: The x,y co-ordinates of the polygon in question. b.     int iNV: The number of vertices of the polygon in question. c.     void* iHandle: Handle to a list of rectangular windows obtained from QisBool_SetupWindows. d.     void* iBooleanHandle: Handle to an instance of QisBool obtained using QisBool_Create. Output Arguments - Return Value a.     success: 0: The specified polygon does not cross any of the windows. 1: The specified polygon crosses one of the windows. 2: The specified polygon is fully inside one of the windows. 3: One of the windows is fully inside the polygon. b.     failure: < 0. The input polygon is not closed or invalid QisBool handle Pre-Conditions a.     The rectangular windows need to be setup using QisBool_SetupWindows before this function is called. Operation a.     This function checks if the polygon crosses any of the specified rectangular windows. b.     The same set of rectangular windows can be used over and over again for multiple calls to this function until they are released using QisBool_ReleaseRegions. Post-Conditions - C++ Equivalent virtual int IQisBool::PolyCrossWindows(int* iXY, int iNV, void* iHandle) = 0; See Also

 Objective To check if a polygon crosses a set of polygonal regions (non-leonov). Prototype int QisBool_PolyCrossRegions(   int* iXY, int iNV, void* iHandle, void* iBoolHandle ); Input Arguments a.     int* iXY: The x,y co-ordinates of the polygon in question. b.     int iNV: The number of vertices of the polygon in question. c.     void* iHandle: Handle to a list of polygon regions obtained from QisBool_SetupRegions. d.     void* iBooleanHandle: Handle to an instance of QisBool obtained using QisBool_Create. Output Arguments - Return Value a.     success: 0: The specified polygon does not cross any of the regions. 1: The specified polygon crosses one of the regions. 2: The specified polygon is fully inside one of the regions. 3: One of the regions is fully inside the polygon. b.     failure: < 0. The input polygon is not closed or invalid QisBool handle Pre-Conditions a.     The polygon regions need to be setup using QisBool_SetupRegions before this function is called. Operation a.     This function checks if the polygon crosses any of the specified polygonal regions. b.     The same set of polygonal regions can be used over and over again for multiple calls to this function until they are released using QisBool_ReleaseRegions. Post-Conditions - C++ Equivalent virtual int IQisBool::PolyCrossRegions(int* iXY, int iNV, void* iHandle) = 0; See Also

 Objective To check if a polygon crosses a set of regions containing one or more leonov regions. Prototype int QisBool_PolyCrossLeonovRegions(   int* iXY, int iNV, void* iHandle, void* iBoolHandle ); Input Arguments a.     int* iXY: The x,y co-ordinates of the polygon in question. b.     int iNV: The number of vertices of the polygon in question. c.     void* iHandle: Handle to a list of leonov regions obtained from QisBool_SetupRegions. d.     void* iBooleanHandle: Handle to an instance of QisBool obtained using QisBool_Create. Output Arguments - Return Value a.     success: 0: The specified polygon does not cross any of the regions. 1: The specified polygon crosses one of the regions. 2: The specified polygon is fully inside one of the regions. 3: One of the regions is fully inside the polygon. b.     failure: < 0. The input polygon is not closed or invalid QisBool handle. Pre-Conditions a.     The leonov regions need to be setup using QisBool_SetupRegions before this function is called. Operation a.     This function checks if the polygon crosses any of the specified polygonal regions. b.     The same set of polygonal regions can be used over and over again for multiple calls to this function until they are released using QisBool_ReleaseRegions. Post-Conditions - C++ Equivalent virtual int IQisBool::PolyCrossLeonovRegions(int* iXY, int iNV, void* iHandle) = 0; See Also

 417 Ingalls St. Santa Cruz CA 95060 [T] +1 831-426-6163 [F] +1 831-426-2824 [E] info@artwork.com