protected override bool OnQualify(SelectContext selectCtx, Matrix44 parentTrans) { foreach (DisplayItem item in m_ItemList) item.Qualify(selectCtx, GetChildrenTransformation(parentTrans)); return false; }
// DP: Template Method public void Qualify(SelectContext selectCtx, Matrix44 parentTrans) { //if (null == selectCtx || selectCtx.IsHitted) return; if (null == selectCtx) return; if(OnQualify(selectCtx, parentTrans)) { } }
protected override bool OnQualify(SelectContext selectCtx, Matrix44 parentTrans) { if (selectCtx == null) return false; GePoint worldPoint = MathUtil.GetTransformedPoint(m_Point, parentTrans); double dDiff = worldPoint.DistanceTo(selectCtx.WorldPoint); if (dDiff < selectCtx.SelectTolerance) { selectCtx.AddItem(dDiff, this); return true; } return false; }
protected override bool OnQualify(SelectContext selectCtx, Matrix44 parentTrans) { if (selectCtx == null) return false; GePoint worldCenterPoint = MathUtil.GetTransformedPoint(m_CenterPoint, parentTrans); double dist = worldCenterPoint.DistanceTo(selectCtx.WorldPoint); // Get the plus distance double dDiff = dist - m_dRadius; if (dDiff < 0) dDiff = -dDiff; if (dDiff < selectCtx.SelectTolerance) { selectCtx.AddItem(dDiff, this); return true; } return false; }
protected override bool OnQualify(SelectContext selectCtx, Matrix44 parentTrans) { if (selectCtx == null) return false; GeRectangle Rec = Range; GePoint worldPosition = MathUtil.GetTransformedPoint(m_Position, parentTrans); Rec.MoveTo(worldPosition); if (selectCtx.WorldPoint.X > (Rec.MinPoint.X - selectCtx.SelectTolerance) && selectCtx.WorldPoint.X < (Rec.MaxPoint.X + selectCtx.SelectTolerance) && selectCtx.WorldPoint.Y > (Rec.MinPoint.Y - selectCtx.SelectTolerance) && selectCtx.WorldPoint.Y < (Rec.MaxPoint.Y + selectCtx.SelectTolerance)) { selectCtx.AddItem(0, this); return true; } return false; }
protected abstract bool OnQualify(SelectContext selectCtx, Matrix44 parentTrans);