User Tools

Site Tools


api:dk11:delphi:gistopology.tgis_topology.clearshape_tgis_shape_boolean

Table of Contents

TGIS_Topology.ClearShape(TGIS_Shape; Boolean) method

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

Make a copy of the shape with removal of redundant (overlapped) points.

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

Syntax

// Delphi
public
  function ClearShape(
    const _shp : TGIS_Shape;
    const _returnnewobj : Boolean
  ) : TGIS_Shape; overload;
// C++ Builder
public:
  TGIS_Shape* ClearShape(
    TGIS_Shape* const _shp,
    const bool _returnnewobj
  ) /* overload */;

Parameters

Name Type Description
_shp TGIS_Shape shape to be copied
_returnnewobj Boolean if True, then result will be returned in a newly created object; if False, then self object will be returned

Result

Type Description
TGIS_Shape returns copy of shape without redundant points

Example

Delphi

var
  topologyObj : TGIS_Topology ;
  GIS: TGIS_ViewerWnd;
 
procedure MyClass.Clear();
var
  tmp : TGIS_Shape ;
begin
  if GIS.Items.Count=0 then exit ;
 
  // let's get first shape
  tmp:= TGIS_LayerVector(GIS.Items[0]).GetShape(1) ;
  if not assigned( tmp ) then exit ;
 
  // make a clear copy and change some shape attributes
  tmp := tmp.MakeEditable ;
  tmp := topologyObj.ClearShape(tmp2) ;
  tmp.Params.Area.Color := clBlack ;
  tmp.SetPosition( tmp2.Centroid, TGIS_LayerVector(GIS.Items[0]), 10 ) ;
  GIS.Update;
end;
2022/11/30 19:19

Page Tools