DK for Delphi | GisLayerVector.TGIS_Shape.Lock | Constructors | Fields | Methods | Properties
Locks the shape for batch geometry updates to defer expensive recalculations.
// Delphi public procedure Lock( const _lock : TGIS_Lock ); virtual;
// C++ Builder public: virtual void Lock( TGIS_Lock* const _lock );
| Name | Type | Description |
|---|---|---|
| _lock | TGIS_Lock | lock mode controlling which cached geometry state is deferred |
PURPOSE: Improves performance during bulk editing by postponing extent and related geometry updates until unlocking.
BEHAVIOR: Prevents immediate recalculation of selected cached values while points or parts are being modified. The exact deferred state depends on the _lock mode.
CONSTRAINTS: Must be paired with a later Unlock call to restore normal update behavior.
procedure MyForm.FormCreate(); var shp : TGIS_Shape; lk : TGIS_LayerVector; begin // let's create a new layer lk:=TGIS_LayerVector.Create; GIS.Add(lk); // let's create a new shape on our layer shp := lk.CreateShape( TGIS_ShapeType.Point ) ; // if successfully, let's lock, edit and unlock our shape if assigned( shp ) then begin shp.Lock( TGIS_Lock.Extent ) ; shp.AddPart ; shp.AddPoint( GisPoint( 3,3 ) ) ; shp.Params.Area.Color:=clBlack; shp.Unlock ; end;