DK11 for Delphi | GisLayerVector.TGIS_Shape.Create | Overloads | Constructors | Fields | Methods | Properties
Create a shape instance.
// Delphi public constructor Create( const _source : TGIS_Shape; const _ptr : Pointer; const _mapped : Boolean; const _uid : TGIS_Uid; const _layer : TGIS_LayerVector; const _dim : TGIS_DimensionType ); overload; virtual;
// C++ Builder Create ( TGIS_Shape* const _source, const void* _ptr, const bool _mapped, TGIS_Uid* const _uid, TGIS_LayerVector* const _layer, TGIS_DimensionType* const _dim );
Name | Type | Description |
---|---|---|
_source | TGIS_Shape | If not nil then base shape will be based on this shape. Otherwise _prt, _mapped, _uid and _layer will be used. |
_ptr | Pointer | Address in memory where shape data exists. |
_mapped | Boolean | Id _ptr from mapped file or from memory. |
_uid | TGIS_Uid | Unique identity for shape. |
_layer | TGIS_LayerVector | Reference to the layer on which shape will be created. |
_dim | TGIS_DimensionType | Dimension |
Use this method to create a shape. Internally it calls Recreate method.
This is a simple procedure showing how to add a shape to the layer.
// some declarations const WKTText='POLYGON((15 15,25 15,25 25,15 25,15 15),(10 10,10 20,20 20,20 10,10 10))'; var layerObj : TGIS_LayerVector ; procedure MyClass.AddShape(); var shp, shp2 : TGIS_Shape; begin // set the original layer form layerObj.RevertAll; // let's create new shapes shp:= TGIS_Shape.Create(nil,nil,false,-1,layerObj); shp2:=TGIS_Shape.Create(nil,nil,false,-1,layerObj); try // make a duplicate shp2.Recreate(shp,nil,false,-1,layerObj); // and try build it from WKT string on the layer layerObj.AddShape( shp.CreateFromWKT(WKTText) ); finally shp.Free; shp2.Free; end; // let's see the results GIS.FullExtent; end;