public SnapMatcher(SnapContext snapCtx) { Debug.Assert(snapCtx != null); m_SnapContext = snapCtx; }
public GeometryVisitor(SnapContext ctx, GePoint point) { m_SnapContext = ctx; m_ReferencePoint = (GePoint)point.Clone(); }
public GePointVisitor(SnapContext ctx, GePoint point) : base(ctx, point) { }
public static SnapContext InitalizeSnapContextFromPreSelection(GePoint mousePoint) { Debug.Assert(mousePoint != null); SnapContext snapCtx = new SnapContext(PtApp.ActiveDocument.Database); PtSelectContext sltCtx = new PtSelectContext(); sltCtx.WorldPoint = mousePoint; SelectionSet tempSet = PtApp.ActiveView.SelectionMgr.CreateSelectionSet("SnapTemporarySet"); tempSet.Clear(); sltCtx.CurrentSelectionSet = tempSet; PtApp.ActiveView.Select(sltCtx); // Set selection set. SelectionSet PreSet = PtApp.ActiveView.SelectionMgr.GetPreviewSelectionSet(); PreSet.Clear(); if (!tempSet.Empty()) { foreach (Selection selection in tempSet.Selections) { SymbolConstraint instance = selection.GetInstance(); Debug.Assert(instance != null); SymbolGeometryConstraint constr = instance.GetGeometryConstraint( mousePoint, snapCtx.SnapTolerance); if (constr != null) { // We just highlight the snapped nodes. snapCtx.CandidateProxies.Add(constr); PreSet.AddSelection(selection); } } } PtApp.ActiveView.UpdateView(); return snapCtx; }