User Tools

Site Tools


samples:samples:shapeoperations

Table of Contents

ShapeOperations sample

Documentation | Samples | ShapeOperations

Summary

ShapeOperations sample - Interactive geometry transformation of vector shapes.

Description

What the sample shows:

  • Interactive geometry transformation of vector shapes
  • Rotating shapes around a pivot point
  • Translating (moving) shapes to new locations
  • Scaling shapes with respect to reference point
  • Skewing and shearing geometric transformations
  • Mirroring and flipping shapes
  • Batch operations on multiple shapes
  • Undo/redo for transformation operations

This sample illustrates use of:

Name Description
TGIS_Shape.CentroidCalculates the geometric centroid of the shape.
TGIS_Shape.TransformTransforms shape geometry using a 3×3 matrix and translation vector, returning a new transformed shape.
TGIS_Shape.CopyGeometryReplaces this shape's geometry with geometry copied from another shape.
TGIS_Shape.CreateCopyCreate an independent deep copy of the shape geometry, attributes, and style state.
TGIS_Layer.CachedPaintFalse if the layer must be painted directly, bypassing the cache.
TGIS_ViewerWnd.InvalidateTopmostInvalidate only topmost layers.
TGIS_viewerWnd.InvalidateWholeMapInvalidate whole map.

Code

This sample is available on the following platforms (click to view the source code on GitHub):

2026/07/05 05:38

Page Tools