DK for Delphi | GisLayerVector.TGIS_Shape.Transform | Overloads | Constructors | Fields | Methods | Properties
Transform shape by provided matrix [_m11.._m33] and translation vector [_dx,_dy,-dz].
// Delphi public function Transform( const _origin : TGIS_Point3D; const _m11 : Double; const _m12 : Double; const _m13 : Double; const _m21 : Double; const _m22 : Double; const _m23 : Double; const _m31 : Double; const _m32 : Double; const _m33 : Double; const _dx : Double; const _dy : Double; const _dz : Double; const _returnnewobj : Boolean ) : TGIS_Shape; overload;
// C++ Builder public: TGIS_Shape* Transform( TGIS_Point3D* const _origin, const double _m11, const double _m12, const double _m13, const double _m21, const double _m22, const double _m23, const double _m31, const double _m32, const double _m33, const double _dx, const double _dy, const double _dz, const bool _returnnewobj ) /* overload */;
| Name | Type | Description |
|---|---|---|
| _origin | TGIS_Point3D | origin point of the transformation |
| _m11 | Double | element [1,1] of the transformation matrix |
| _m12 | Double | element [1,2] of the transformation matrix |
| _m13 | Double | element [1,3] of the transformation matrix |
| _m21 | Double | element [2,1] of the transformation matrix |
| _m22 | Double | element [2,2] of the transformation matrix |
| _m23 | Double | element [2,3] of the transformation matrix |
| _m31 | Double | element [3,1] of the transformation matrix |
| _m32 | Double | element [3,2] of the transformation matrix |
| _m33 | Double | element [3,2] of the transformation matrix |
| _dx | Double | x translation element of translation vector |
| _dy | Double | y translation element of translation vector |
| _dz | Double | z translation element of translation vector |
| _returnnewobj | Boolean | if True, then result will be returned in a newly created object; if False, then self object will be returned |
| Type | Description |
|---|---|
| TGIS_Shape | If _returnnewobj=True, then returns newly created shape. Otherwise returns modified or unmodified self object. |
Rotate shape by 30 degrees
procedure TfrmMain.rotateShape( const _shp : TGIS_Shape ) ; var angle : Double ; center : TGIS_Point3D ; begin angle := -DegToRad( 30 ) ; center.X := shp.Extent.XMin + ( shp.Extent.XMax - shp.Extent.XMin ) / 2 ; center.Y := shp.Extent.YMin + ( shp.Extent.YMax - shp.Extent.YMin ) / 2 ; center.Z := 0 ; _shp.Transform( center, Cos( angle ), Sin( angle ), 0, -Sin( angle ), Cos( angle ), 0, 0 , 0 , 1, // 3D 0 , 0 , 0 // shift ) ; _shp.Invalidate ;