User Tools

Site Tools


api:dk11:delphi:gislayervector.tgis_shape.copyfields_tgis_shape

Table of Contents

TGIS_Shape.CopyFields method

DK11 for Delphi | GisLayerVector.TGIS_Shape.CopyFields | Constructors | Fields | Methods | Properties

Copy fields structure.

Available also on: .NET | Java | ActiveX.

Syntax

// Delphi
public
  procedure CopyFields(
    const _shape : TGIS_Shape
  );
// C++ Builder
public:
  void CopyFields(
    TGIS_Shape* const _shape
  );

Parameters

Name Type Description
_shape TGIS_Shape shape with fields to copy

Remarks

Use this method to copy fields for given _shape. When we create a new shape and want to use an existing field structure, CopyFields method makes all for us. See example.

Example

Delphi

var
  // some declarations
  currShape : TGIS_Shape ;
  GIS: TGIS_ViewerWnd;
 
procedure MyClass.GetStructure();
var
  ll  : TGIS_LayerVector ;
  shp,shp2 : TGIS_Shape ;
begin
  if currShape=nil then exit;
 
  // get our layer
  ll  := TGIS_LayerVector( GIS.Get('realpoints') );
  if ll=nil then exit;
 
  // let's get a shape
  shp := ll.CreateShape(_TGIS_ShapeType.Polygon);
  shp := ll.GetShape( currShape.Uid ) ;
 
  // and create a new one with previous shape field structure
  shp2 := ll.CreateShape(TGIS_ShapeType.Polygon);
  shp2.CopyFields(shp);
 
  .......
 
  // after building few parts let's we effects
  shp2.AddToLayer;
 
  GIS.FullExtent;
end;
2020/05/07 01:09

Page Tools