Пример #1
0
        /*--------------------------------------------------------------------------------------------*/
        private void HandleLevelChange(int pDirection)
        {
            vSegments.Clear();

            NavLevel navLevel = vNavProv.GetLevel();

            foreach (NavItem navItem in navLevel.Items)
            {
                var seg = new ArcSegmentState(navItem, vSettings);
                vSegments.Add(seg);
            }

            OnLevelChange(pDirection);
        }
Пример #2
0
        /*--------------------------------------------------------------------------------------------*/
        internal void UpdateWithCursor(CursorState pCursor)
        {
            bool    allowSelect = (pCursor.IsActive && DisplayStrength > 0);
            Vector3?cursorPos   = (pCursor.IsActive ? pCursor.Position : (Vector3?)null);

            NearestSegment = null;

            foreach (ArcSegmentState seg in vSegments)
            {
                seg.UpdateWithCursor(cursorPos);

                if (!allowSelect)
                {
                    continue;
                }

                if (NearestSegment == null)
                {
                    NearestSegment = seg;
                    continue;
                }

                if (seg.HighlightDistance < NearestSegment.HighlightDistance)
                {
                    NearestSegment = seg;
                }
            }

            foreach (ArcSegmentState seg in vSegments)
            {
                if (seg.SetAsNearestSegment(seg == NearestSegment))
                {
                    break;
                }
            }
        }