User Tools

Site Tools


samples:samples:shapeoperations

Table of Contents

ShapeOperations sample

Documentation | Samples | ShapeOperations

Summary

How to move, rotate and scale any given shape.

Description

A shape is copied into a temporary, top-most (CachedPaint=false) layer which, upon a shape transformation, is updated using InvalidateTopmost. Afer edition shape is copied back into the original shape, and a whole map is updated using InvalidateWholeMap.

This sample illustrates use of:

Name Description
TGIS_Shape.CentroidCalculate the central point of a shape.
TGIS_Shape.TransformTransform shape by provided matrix [_m11.._m33] and translation vector [_dx,_dy,-dz].
TGIS_Shape.CopyGeometryCopy geometry.
TGIS_Shape.CreateCopyCreate a copy of the current shape.
TGIS_Layer.CachedPaintFalse, if layer must be painted directly (bypassing cache).
TGIS_ViewerWnd.InvalidateTopmostInvalidate only topmost layers.
TGIS_viewerWnd.InvalidateWholeMapInvalidate whole map.

Code

This sample is available on following platforms (click to see source code):

2017/12/05 09:25