User Tools

Site Tools


api:dk11:delphi:gistopology.tgis_topology.convexhull_tgis_shape

Table of Contents

TGIS_Topology.ConvexHull(TGIS_Shape) method

DK11 for Delphi | GisTopology.TGIS_Topology.ConvexHull | Overloads | Constructors | Methods | Properties | Events

Creates a convex hull based on the provided shape.

Available also on: .NET | Java | ActiveX | Python.

Syntax

// Delphi
public
  function ConvexHull(
    const _shape : TGIS_Shape
  ) : TGIS_ShapePolygon; overload;
// C++ Builder
public:
  TGIS_ShapePolygon* ConvexHull(
    TGIS_Shape* const _shape
  ) /* overload */;

Parameters

Name Type Description
_shape TGIS_Shape source shape

Result

Type Description
TGIS_ShapePolygon convex hull as a polygon

Remarks

The difference between a convex and a concave hull:

Convex Hull Concave Hull

Example

Delphi

var
  topologyObj : TGIS_Topology ;
  layerObj : TGIS_LayerVector ;
  shpA : TGIS_ShapePolygon ;
  shpB : TGIS_ShapePolygon ;
  GIS: TGIS_ViewerWnd;
 
procedure MyClass.Hull();
var
  tmp2 : TGIS_ShapePolygon ;
begin
  layerObj.RevertAll ;
  tmp2 := topologyObj.ConvexHull( shpA, shpB) ;
  if assigned( tmp2 ) then begin
    layerObj.AddShape( tmp2 ) ;
    tmp2.Free ;
  end ;
 
  GIS.Update;
end;
2022/11/30 19:19

Page Tools