User Tools

Site Tools


api:dk11:delphi:gislayervector.tgis_layervectorenumerator

TGIS_LayerVectorEnumerator class

DK11 for Delphi | GisLayerVector.TGIS_LayerVectorEnumerator | Classes | Constructors | Methods | Properties

Vector layer enumerator.

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

Syntax

// Delphi
type
  TGIS_LayerVectorEnumerator = class( TObject )
  end;
// C++ Builder
class PASCALIMPLEMENTATION TGIS_LayerVectorEnumerator : public TObject
{
};

Inheritance

→ TObject

Constructors

Inherited Overrides Protected
Name Visibility Description
Create(TGIS_LayerVector; TGIS_Extent; String; TGIS_Shape; String; Boolean) public Create an enumerator instance.
Create(TGIS_LayerVectorEnumeratorFactory; TGIS_LayerVector; TGIS_Extent; String; TGIS_Shape; String; Boolean) public Create an enumerator instance.
Destroy public Destroy an object.

Methods

Inherited Overrides Protected
Name Visibility Description
BindField public Obtain a bind number for a given field name.
GetCurrent public Get current enumerator value.
GetField public Get field value for a shape given by unique identity.
MoveNext public Move to next record
Reset public Reset enumerator.

Properties

Inherited Protected
Name Visibility Description
Current public Current enumerator value.
Cursor public Current cursor index.

Remarks

There is no garbage collector for TGIS_LayerVectorEnumerator instances. Because of this, the layer enumerator must be destroyed, by calling TGIS_LayerVectorEnumerator.Free, after it has been used. Check examples below.

Example

Delphi

// Indirect use
var
  shp : TGIS_Shape ;
begin
  // automated enumerators
  for shp in layer.Loop( some_extent ) do begin
    dosomething();
  end ;
end ;
 
// Direct use by using layer's Enumerator Factory
var
  shp : TGIS_Shape ;
  en  : TGIS_LayerVectorEnumerator ;
begin
  en := layer.Loop( some_extent ).GetEnumerator ;
  while en.MoveNext do begin
    shp := en.GetCurrent ;
    dosomething();
  end ;
  en.Free ;
end ;
 
// Direct use by using enumerator constructor
var
  shp : TGIS_Shape ;
  en  : TGIS_LayerVectorEnumerator ;
begin
  en := TGIS_LayerVectorEnumerator.Create(
          layer, some_extent, '', nil, '', True
        ) ;
  while en.MoveNext do begin
    shp := en.Current ;
    dosomething();
  end ;
  en.Free ;
end ;

2022/11/16 01:22

Page Tools