User Tools

Site Tools


api:dk11:delphi:gislayervector.tgis_shape.transform_tgis_point3d_double_double_double_double_ac1c95414ee429c98c013cfe4bbccbe4

TGIS_Shape.Transform(TGIS_Point3D; Double; Double; Double; Double; Double; Double; Double; Double; Double; Double; Double; Double) 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.

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
  ) : 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
  ) /* 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

Result

Type Description
TGIS_Shape Newly created transformed shape.

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

2020/05/07 01:09

Page Tools