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
object2viewcsMatrixTransformation matrix used to map points from the object's Object Coordinate System (OCS) into the active view / user coordinate system used during snap computations.
modeOsnapModeThe OsnapMode that specifies which snap types to compute (for example End, Mid, Center, Nearest, Intersection, Perpendicular, Tangent, etc.).
pickPoigPointThe cursor position in the current View Coordinate System (VCS). This is the primary point used to determine candidate snap points.
LastPoigPointA 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.
SegCountintZero-based segment index for segmented figures (for example polylines or polyfaces). Use -1 to indicate no specific segment (apply to the whole object).
osnapsOsnapPointsA 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
trueif at least one snap point was added toosnaps; otherwisefalse.
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.