C# Class MapAround.UI.WinForms.GeometryEditor

Represents a geometry editor.
显示文件 Open project: gkrsu/maparound.core

Private Properties

Property Type Description
drawActiveNode void
drawNodes void
insertNodeAt void
recalcActiveElements void
removeNodeAt void

Public Methods

Method Description
ClearHistory ( ) : void

Clears the history of edit operations.

DrawEditingGeometry ( Graphics g, MapToClientDelegate mapToClient, int offsetX, int offsetY ) : void

Draws editing geometry.

GetSecondaryNodes ( ) : IEnumerable

Gets secondaty nodes of the editing feature. Secondary nodes are nodes placed at the middle points of the feature segments.

InsertPatch ( int patchIndex, IEnumerable coordinates ) : void

Inserts a new coordinate patch into the editing geometry.

Redo ( ) : void

Redo edit action.

RemoveActiveNode ( ) : void

Removes the active node.

RemoveActivePatch ( ) : void

Removes the active patch.

RemovePatch ( int patchIndex ) : void

Removes specified coordinate patch.

ReplaceGeometry ( IGeometry newGeometry ) : void

Replaces currently editing geometry with the other one.

TryActivateNodeAt ( ICoordinate coordinate, double nodeSize ) : bool

Tries to activate a node at the specified position.

TryAddNode ( ICoordinate coordinate ) : bool

Tries to add a new node into editing geometry.

Undo ( ) : void

Undo edit action.

UpdateActiveNodePosition ( ICoordinate coordinate, bool commitIntoUndoList ) : bool

Updates the position of the active node with the specified value

Private Methods

Method Description
drawActiveNode ( Graphics g, MapToClientDelegate MapToClient, Color color, int offsetX, int offsetY ) : void
drawNodes ( IEnumerable nodes, Graphics g, MapToClientDelegate MapToClient, Color color, int offsetX, int offsetY ) : void
insertNodeAt ( int patchIndex, int coordinateIndex, ICoordinate coordinate ) : void
recalcActiveElements ( ) : void
removeNodeAt ( int patchIndex, int coordinateIndex ) : void

Method Details

ClearHistory() public method

Clears the history of edit operations.
public ClearHistory ( ) : void
return void

DrawEditingGeometry() public method

Draws editing geometry.
public DrawEditingGeometry ( Graphics g, MapToClientDelegate mapToClient, int offsetX, int offsetY ) : void
g System.Drawing.Graphics A System.Drawing.Graphics instance where to draw the geometry
mapToClient MapToClientDelegate A method performing map-to-screen conversion
offsetX int An X offset of geometry in pixels
offsetY int A Y offset of geometry in pixels
return void

GetSecondaryNodes() public method

Gets secondaty nodes of the editing feature. Secondary nodes are nodes placed at the middle points of the feature segments.
public GetSecondaryNodes ( ) : IEnumerable
return IEnumerable

InsertPatch() public method

Inserts a new coordinate patch into the editing geometry.
public InsertPatch ( int patchIndex, IEnumerable coordinates ) : void
patchIndex int A zero-based index of patch
coordinates IEnumerable A coordinates of inserted patch
return void

Redo() public method

Redo edit action.
public Redo ( ) : void
return void

RemoveActiveNode() public method

Removes the active node.
public RemoveActiveNode ( ) : void
return void

RemoveActivePatch() public method

Removes the active patch.
public RemoveActivePatch ( ) : void
return void

RemovePatch() public method

Removes specified coordinate patch.
public RemovePatch ( int patchIndex ) : void
patchIndex int An zero-based index of patch
return void

ReplaceGeometry() public method

Replaces currently editing geometry with the other one.
public ReplaceGeometry ( IGeometry newGeometry ) : void
newGeometry IGeometry A new instance of IGeometry
return void

TryActivateNodeAt() public method

Tries to activate a node at the specified position.
public TryActivateNodeAt ( ICoordinate coordinate, double nodeSize ) : bool
coordinate ICoordinate A coordinate of node to be activated
nodeSize double A size of node
return bool

TryAddNode() public method

Tries to add a new node into editing geometry.
public TryAddNode ( ICoordinate coordinate ) : bool
coordinate ICoordinate An instance of the ICoordinate to add
return bool

Undo() public method

Undo edit action.
public Undo ( ) : void
return void

UpdateActiveNodePosition() public method

Updates the position of the active node with the specified value
public UpdateActiveNodePosition ( ICoordinate coordinate, bool commitIntoUndoList ) : bool
coordinate ICoordinate New position of the active node
commitIntoUndoList bool A value indicating whether current update should be commited into undo list
return bool