Knowledge Base Article
KB10221 - In my yacht marina management application I would like to create functionality to allow the user to create, delete, edit, and move polygons, with each polygon representing a yacht. Can I select multiple polygons and align, move, or resize all at the same time? Can I resize a polygon by selecting only one side? Can I select a node of a polygon and move only this node, and not the entire polygon?
Some of the actions that you list can be done on your own, using: shp.GetPoint...shp.AddPoint
But keep in mind that you can create a CGM symbol (in Corel Draw for example) to represent, for instance, each yacht. Then you can scale, rotate, move, etc. this symbol, and each boat represented just by point. This method will probably best address your situation.
DK v. 8.5.1 introduced TGIS_Shape.Transform to provide for typical matrix operations for scaling, rotating, moving etc. of shapes. This allows the DK developer to create a TList on his own and simply add a shape to such list:
myList.Add(shp.MakeEditable);
It is fairly important to call MakeEditable. Thanks to this, the shape will reside in the in-memory manageable list (so please never call shp.Free on such shape). Normally a shape from a SHP file resides only on disk. A pointer to the shape is valid only for a very short time (unless the next shape will not be read).
Created: 2005-09-14, Modified: 2006-07-08
|