DK11 for Delphi | GisLayerVector.TGIS_Shape.CopyFields | Constructors | Fields | Methods | Properties
Copy fields structure.
// Delphi public procedure CopyFields( const _shape : TGIS_Shape );
// C++ Builder public: void CopyFields( TGIS_Shape* const _shape );
Name | Type | Description |
---|---|---|
_shape | TGIS_Shape | shape with fields to copy |
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.
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;