Table of Contents

Method getOsnapPoints

Namespace
VectorDraw.Professional.vdPrimaries
Assembly
VectorDraw.Professional.dll

getOsnapPoints(Matrix, OsnapMode, gPoint, gPoint, int, OsnapPoints)

Calculates object snap points for a specific cursor position and fills the provided OsnapPoints collection with the found snap points.

public virtual bool getOsnapPoints(Matrix object2viewcs, OsnapMode mode, gPoint pickPoi, gPoint LastPoi, int SegCount, OsnapPoints osnaps)

Parameters

object2viewcs Matrix

Transformation matrix used to map points from the object's Object Coordinate System (OCS) into the active view / user coordinate system used during snap computations.

mode OsnapMode

The OsnapMode that specifies which snap types to compute (for example End, Mid, Center, Nearest, Intersection, Perpendicular, Tangent, etc.).

pickPoi gPoint

The cursor position in the current View Coordinate System (VCS). This is the primary point used to determine candidate snap points.

LastPoi gPoint

A reference point in VCS used by some snap modes (for example Perpendicular or Tangent). May be null if the current user action does not provide a reference point.

SegCount int

Zero-based segment index for segmented figures (for example polylines or polyfaces). Use -1 to indicate no specific segment (apply to the whole object).

osnaps OsnapPoints

A precreated OsnapPoints collection (in view coordinates) where computed snap points should be added. Implementations should add one or more OsnapPoint instances to this collection.

Returns

bool

true if at least one snap point was added to osnaps; otherwise false.

Remarks

The base implementation does not compute any snap points and returns false. Derived figure types should override this method to provide the appropriate snap logic for the figure's geometry. Coordinates of points added to osnaps using the AddItem(OsnapPoint) , OsnapPoint must be created with one of the fllowing contructors:
OsnapPoint(gPoint, double, OsnapMode, Matrix, Matrix, PointCoordSystem, object, IvdRenderViewProperties)
OsnapPoint(gPoint, double, OsnapMode, Matrix, Matrix, PointCoordSystem, object)
OsnapPoint(gPoint, OsnapMode, Matrix, Matrix, PointCoordSystem, IvdRenderViewProperties)
OsnapPoint(gPoint, OsnapMode, Matrix, Matrix, PointCoordSystem, object, IvdRenderViewProperties)
OsnapPoint(gPoint, OsnapMode, Matrix, Matrix, PointCoordSystem, object)
OsnapPoint(gPoint, OsnapMode, Matrix, Matrix, PointCoordSystem)
See also IvdProxyFigure for example of implementing a custom figure with a proxy figure and how to override basic methods of vdFigure for a custom figure.