C

OrthogonalSnapLine

An orthogonal snap line, in other words, one that is parallel to the x or y axis.

Members

Show:

Constructors

Creates a new snap line using the provided attributes.

Parameters

orientation: SnapLineOrientation
The orientation of the snap line. This is one of HORIZONTAL or VERTICAL.
snapType: SnapLineSnapTypes
The type of the line that describes how other items will snap to this line. This is one of TOP, BOTTOM, LEFT, RIGHT, or CENTER.
visualizationType: SnapReferenceVisualizationType
The type of the visual representation of this snap line.
coordinates: Point
The coordinates of the center point of the snap line.
croppable: boolean
Whether this snap line may get cropped at obstacles if cropSnapLines is set.
weight: number
The weight (importance) of this snap line. If more than one snap line is snapped to, the one with the greater weight will be used.
snappableItems?: GraphItemTypes
The graph item types that may snap to this snap reference.
tag?: any
A tag that is associated with this snap line - see tag for a typical use of this value.
Creates a new snap line using the provided attributes.

Parameters

orientation: SnapLineOrientation
The orientation of the snap line. This is one of HORIZONTAL or VERTICAL.
snapType: SnapLineSnapTypes
The type of the line that describes how other items will snap to this line. This is one of TOP, BOTTOM, LEFT, RIGHT, or CENTER.
visualizationType: SnapReferenceVisualizationType
The type of the visual representation of this snap line.
coordinates: Point
The coordinates of the center point of the snap line.
from: number
The smaller value of the coordinate that delimits this snap line.
to: number
The greater value of the coordinate that delimits this snap line.
croppable: boolean
Whether this snap line may get cropped at obstacles if cropSnapLines is set.
weight: number
The weight (importance) of this snap line. If more than one snap line is snapped to, the one with the greater weight will be used.
snappableItems?: GraphItemTypes
The graph item types that may snap to this snap reference.
tag?: any
A tag that is associated with this snap line - see tag for a typical use of this value.

Properties

Gets the coordinates of the center point of the snap line.
readonlyfinal
Gets if this snap line may get cropped at obstacles if cropSnapLines is set.
readonlyfinal
Gets or sets the first location that delimits this snap line.
conversionfinal

Defined in

SnapLine.from
Gets the orientation of the snap line.
This is one of HORIZONTAL or VERTICAL.
readonlyfinal
Gets which types of items may snap to this snap reference.
readonlyfinal
Gets the type of the line that describes how other items will snap to this line.
This is one of TOP, BOTTOM, LEFT, RIGHT, or CENTER.
readonlyfinal
Gets the tag that is associated with this snap reference.
The tag is most commonly used for the snap result tag.
readonlyfinal
Gets or sets the second location that delimits this snap line.
conversionfinal

Defined in

SnapLine.to
Gets the visualization type which determines the visual appearance of the snap line.
readonlyfinal
Gets the weight/importance of this snap reference.
Greater values indicate greater importance.
readonlyfinal

Methods

Collects a valid SnapResult that snaps the movedPoint to this orthogonal line.

A snap result is considered to be valid if the projection of the movedPoint onto this line hits the line and the distance between the moved and the projected point is not bigger than the snapDistance.

If a valid SnapResult is found, it is added to the evt and returned.

Parameters

evt: CollectSnapResultsEventArgs
The arguments describing the movement the SnapResult shall be created for.
movedItem: IModelItem
The item that is currently moved.
movedPoint: Point
The location that shall be snapped to this line.

Return Value

SnapResult
A valid snap result on this line or null if no such snap result could be found.
Calculates a valid SnapResult that snaps the side of a reshaped rectangle described by the snapType to this orthogonal line.

The snapType describes which side of the rectangle should be snapped. If this snapType doesn't support the given snap type, null is returned. No combined SnapLineSnapTypes are supported. If snap results shall be created for multiple sides, this method should be called for each side individually.

The reshape behavior of the rectangle relative to the pointer movement is described by the reshapeContext and a snap result is only considered to be valid, if the necessary pointer delta resulting in the snap is not bigger than the snapDistance.

If a valid SnapResult is found, it is added to the evt and returned.

Parameters

evt: CollectSnapResultsEventArgs
The arguments describing the movement the SnapResult shall be created for.
reshapeContext: ReshapeRectangleContext
The reshape context that contains information about the nature of the resize.
reshapedItem: IModelItem
The item that is currently reshaped.
suggestedLayout: Rect
The layout of the item as it would be if the pointer location would not be snapped.
snapType: SnapLineSnapTypes
The side of the reshaped rectangle that shall be snapped.

Return Value

SnapResult
A valid snap result on this line or null if no such snap result could be found.
Calculates a valid SnapResult that snaps the orthogonal segment defined by the given parameters to this orthogonal line.

The orthogonal segment to snap is considered to have the same orientation as this line and is defined by the from, to, and orthogonalCoordinate parameters.

The snapType describes which side of a rectangle the orthogonal segment corresponds to. If this snapType doesn't support the given snap type, null is returned. No combined SnapLineSnapTypes are supported. If snap results shall be created for multiple sides, this method should be called for each side individually.

A snap result is considered to be valid if the extent of the orthogonal segment and this line intersect in orientation direction and if the orthogonal distance between both is not bigger than the snapDistance.

If a valid SnapResult is found, it is added to the evt and returned.

Parameters

evt: CollectSnapResultsEventArgs
The arguments describing the movement the SnapResult shall be created for.
movedItem: IModelItem
The item that is currently moved.
from: number
The start value of the orthogonal segment to snap.
to: number
The end value of the orthogonal segment to snap.
orthogonalCoordinate: number
The coordinate in the direction orthogonal to the segment orientation.
snapType: SnapLineSnapTypes
The side of a rectangle the orthogonal segment corresponds to.

Return Value

SnapResult
A valid snap result on this line or null if no such snap result could be found.