Class TSelectPointTool

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TSelectPointTool = class(TCustomSelectScreenObjectTool)

Description

TSelectPointTool is used to select and move one or more individual vertices in a TScreenObject.

Points can be selected in either of two ways. 1. The user clicks on a node of the selected TScreenObject. If no TScreenObject is selected, the one under the curson will be selected. 2. The user drags with the mouse button down to select a group of nodes inside the selection rectangle.

Hierarchy

Overview

Fields

Private FPointIsSelected: boolean;
Private FSelectedPointScreenObject: TScreenObject;

Methods

Private procedure ShowMovedPoints;
Private function FindSelectedScreenObject(const X, Y: integer): TScreenObject;
Private function SelectPointsOfASelectedScreenObject(const X, Y: integer; const AddToSelection: boolean): boolean;
Private function SelectPointsOfAllSelectedScreenObjectsWithLine( const AddToSelection: boolean): boolean;
Private function SelectPointsWithLine(const AScreenObject: TScreenObject; const AddToSelection: boolean; out Changed: boolean): boolean;
Private function FindNodeInSelectedScreenObjects(const X, Y: integer; const AScreenObject: TScreenObject): integer;
Protected function GetHint: string; override;
Public procedure Draw(const Sender: TObject; const Direction: TViewDirection); override;
Public procedure MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;
Public procedure MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); override;
Public procedure MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

Description

Fields

Private FPointIsSelected: boolean;

FPointIsSelected: boolean; FPointIsSelected is set to true if one or more vertices on the selected TScreenObject is selected.

Private FSelectedPointScreenObject: TScreenObject;

FSelectedPointScreenObject: TScreenObject; FSelectedPointScreenObject is the TScreenObject that has been selected.

Methods

Private procedure ShowMovedPoints;

ShowMovedPoints shows how the selected TScreenObject would look if the mouse was released at its current position.

Private function FindSelectedScreenObject(const X, Y: integer): TScreenObject;

FindSelectedScreenObject returns the TScreenObject that is already selected and which has a node at or near X,Y.

Private function SelectPointsOfASelectedScreenObject(const X, Y: integer; const AddToSelection: boolean): boolean;

This procedure selects the node of a selected screen object that is at or near (X,Y).

Private function SelectPointsOfAllSelectedScreenObjectsWithLine( const AddToSelection: boolean): boolean;

SelectPointsOfAllSelectedScreenObjectsWithLine selects the nodes in SelectPointsOfAllSelectedScreenObjectsWithLine uses a "lasso" to select nodes in one selected object. All other selected objects are de-selected.

Private function SelectPointsWithLine(const AScreenObject: TScreenObject; const AddToSelection: boolean; out Changed: boolean): boolean;

SelectPointsWithLine selects nodes that are inside TCustomSelectScreenObjectTool.FSelectLine. if AddToSelection is not True, it deselects nodes that are not inside FSelectLine. Changed is set to True if any nodes have been changed from unselected to selected or vice versa.

Private function FindNodeInSelectedScreenObjects(const X, Y: integer; const AScreenObject: TScreenObject): integer;

FindNodeInSelectedScreenObjects returns the index of the first vertex in AScreenObject that is within SelectionWidth of X,Y.

Protected function GetHint: string; override;

Used to define Hint

Public procedure Draw(const Sender: TObject; const Direction: TViewDirection); override;

Draw draws in the TCustomInteractiveTool.ZoomBox to show the position of the selected points after being moved. See ShowMovedPoints.

Public procedure MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

MouseDown responds to OnMouseDown events by seeing if a node in a TScreenObject could be selected at this position. If so, it is selected. It also creates an outline that is used in dragging to select points.

Public procedure MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); override;

MouseMove responds to OnMouseMove events by showing how the TScreenObject would be changed if the mouse were released at X,Y. See ShowMovedPoints.

Public procedure MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); override;

MouseUp responds to OnMouseUp events by either moving the selected points or selecting the points inside a rectangle created by dragging with the mouse button down.


Generated by PasDoc 0.10.0 on 2006-10-31 09:56:39