User Tools

Site Tools


api:dk11:delphi:gislayervector.tgis_shape.transform_tgis_point3d_double_double_double_double_2abc090bb5b9d185a8b3471ac5cf0414

TGIS_Shape.Transform(TGIS_Point3D; Double; Double; Double; Double; Double; Double; Double; Double; Double; Double; Double; Double; Boolean) method

DK11 for Delphi | GisLayerVector.TGIS_Shape.Transform | Overloads | Constructors | Fields | Methods | Properties

Transform shape by provided matrix [_m11.._m33] and translation vector [_dx,_dy,-dz].

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

Syntax

// 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 */;

Parameters

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

Result

Type Description
TGIS_Shape If _returnnewobj=True, then returns newly created shape. Otherwise returns modified or unmodified self object.

Example

Rotate shape by 30 degrees

Delphi

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 ;

References

2022/11/16 01:22

Page Tools