User Tools

Site Tools


api:dk11:delphi:gislayervector.tgis_layervector.revert_tgis_uid

Table of Contents

TGIS_LayerVector.Revert method

DK11 for Delphi | GisLayerVector.TGIS_LayerVector.Revert | Constructors | Fields | Methods | Properties | Events

Reverts a shape to its original state.

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

Syntax

// Delphi
public
  procedure Revert(
    const _uid : TGIS_Uid
  ); virtual;
// C++ Builder
public:
  virtual void Revert(
    TGIS_Uid* const _uid
  );

Parameters

Name Type Description
_uid TGIS_Uid Uid of a shape to be reverted

Remarks

Use this method to revert a shape indicated by Uid to its file based original state. If shape is not saved, it will be deleted. See MakeEditable.

Example

Here is a simple procedure to revert a shape.

Delphi

procedure MyClass.RevertShape();
var
  ll  : TGIS_LayerVector ;
  tmp : TGIS_Shape       ;
begin
  if GIS.Items.Count=0 then exit;
 
  // get first layer
  ll := TGIS_LayerVector (GIS.Items[0]) ;
  tmp := ll.FindFirst(GisWholeWorld,'NAME=ABC');
 
  // if first found, get original state
  if assigned( tmp ) then
     ll.Revert(tmp.Uid);
 
  GIS.Update;
end;
2022/11/16 01:22

Page Tools