DK11 for Delphi | GisFunctions.GisIsPointInsideExtent | Fields | Methods
Test if a given point is inside a given extent.
// Delphi function GisIsPointInsideExtent( const _ptg : TGIS_Point; const _extent : TGIS_Extent ) : Boolean; inline;
// C++ Builder extern DELPHI_PACKAGE bool GisIsPointInsideExtent( TGIS_Point* const _ptg, TGIS_Extent* const _extent );
Name | Type | Description |
---|---|---|
_ptg | TGIS_Point | point to test |
_extent | TGIS_Extent | polygon to test |
Type | Description |
---|---|
Boolean | True point is inside an extent |
This is an example of using GisIsPointInsideExtent function.
Suppose we have a GIS object of TGIS_ViewerWnd class.
Here is a simple procedure to make some tests.
procedure MyClass.GISMouseMove(X,Y,test: Integer); var shp : TGIS_Shape ; ptgA : TGIS_Point ; shp_ : TGIS_ShapePolygon ; l,k : TGIS_Line; begin // get a layer ll := TGIS_LayerVector( GIS.Get('realpoints') ); shp := ll.GetShape(1) ; // calculate position on the map ptgA := GIS.ScreenToMap( Point(x,y) ) ; // make tests case test of 1 : if GisIsPointInsideExtent( ptgA, GIS.Extent ) then shp.SetPosition( ptgA, nil, 0 ); 2 : if GisIsPointInsidePolygon( ptgA, shp_ ) then shp.SetPosition( ptgA, nil, 0 ); 3 : if GisIsLinesCommonPoint( l, k) then shp.SetPosition( ptgA, nil, 0 ); 4 : if GisGetLinesCrossing( l,k,ptgA) then shp.SetPosition( ptgA, nil, 0 ); end; end;