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

Revert a shape to its original state.

Available also on: .NET | Java | ActiveX.

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 a file based original. Unsaved shape 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;
2019/09/27 01:09