User Tools

Site Tools


api:dk11:delphi:gislayervector.tgis_layervector.revertshapes_void

Table of Contents

TGIS_LayerVector.RevertShapes method

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

Revert all shapes to its original state.

Available also on: .NET | Java | ActiveX.

Syntax

// Delphi
public
  procedure RevertShapes; virtual;
// C++ Builder
public:
  virtual void RevertShapes(void);

Remarks

Use this method to revert all shapes to a file based original. All unsaved shapes will be deleted and changes not applied. See RevertAll

Example

Delphi

procedure MyClass.MakeBuffer();
var
  ll  : TGIS_LayerVector ;
  lb  : TGIS_LayerVector ;
  shp : TGIS_Shape       ;
  tmp : TGIS_Shape       ;
  buf : TGIS_Shape       ;
  tpl : TGIS_Topology    ;
begin
  // find buffer for vistual river
  ll := TGIS_LayerVector( GIS.Get( 'rivers' ) ) ;
  if not assigned( ll ) then exit ;
  lb := TGIS_LayerVector( GIS.Get( 'buffer' ) ) ;
  if not assigned( lb ) then exit ;
 
  shp := ll.FindFirst ( GisWholeWorld, 'name=''Wisla''' );
  if not assigned( shp ) then exit ;
 
  tpl := TGIS_Topology.Create ;
  try
    lb.RevertShapes ;
    tmp := tpl.MakeBuffer( shp, 1000 ) ;
    if assigned( tmp ) then begin
      buf := lb.AddShape( tmp ) ;
      tmp.Free ;
    end
    else
      buf := nil ;
  finally
    FreeObject( tpl ) ;
  end ;
 
  // recalculate and refresh layer extent
  ll.RecalcExtent ;
  lb.RecalcExtent ;
  GIS.RecalcExtent ;
  GIS.Update;
end;

}

References

2019/09/27 01:09