public void CreateSelection(PtSelectContext SltCtx, DisplayItem SelectedItem) { Debug.Assert(SltCtx != null && SelectedItem != null); if (SltCtx.CurrentSelectionSet != null && SelectedItem != null) { m_SelectTolerance = SltCtx.SelectTolerance; Selection Slt = GetSelection(); Slt.SetManipulator(GetManipulator(SelectedItem)); SltCtx.CurrentSelectionSet.AddSelection(Slt); } }
protected Manipulator GetManipulator(DisplayItem SelectedItem) { Debug.Assert(SelectedItem != null); if (null == SelectedItem) return null; if (SelectedItem is DisplayItemCircle) { return OnItemSelection((DisplayItemCircle)SelectedItem); } else if (SelectedItem is DisplayItemLine) { return OnItemSelection((DisplayItemLine)SelectedItem); } else if (SelectedItem is DisplayItemPoint) { return OnItemSelection((DisplayItemPoint)SelectedItem); } else if (SelectedItem is DisplayItemText) { return OnItemSelection((DisplayItemText)SelectedItem); } return null; }
public void AddItem(DisplayItem newItem) { if (newItem != null) m_ItemList.Add(newItem); }
// Save the quality result public void AddItem(double distance, DisplayItem item) { Debug.Assert(item != null); if (null == item) return; m_HittedDLItems.AddItem(distance, item); if (item is DisplayItemPoint) m_HittedDLPoints.AddItem(distance, item); }