Example #1
0
        private void OnTimerTick(object sender, EventArgs args)
        {
            if (_division == null)
            {
                return;
            }
            SubdivisionFace face = null;

            // check if mouse cursor is over subdivision
            Point cursor = Mouse.GetPosition(OutputBox);

            if (cursor.X >= 0 && cursor.X < OutputBox.Width &&
                cursor.Y >= 0 && cursor.Y < OutputBox.Height)
            {
                face = _division.FindFace(cursor.ToPointD());
            }

            // show current and previous face keys
            if (face == null)
            {
                CurrentFace.Content   = -1;
                PreviousFace.Content  = -1;
                IntersectFace.Content = -1;
            }
            else
            {
                CurrentFace.Content = face.Key;
                if (_faceKeys != null)
                {
                    PreviousFace.Content  = _faceKeys[face.Key].Item1;
                    IntersectFace.Content = _faceKeys[face.Key].Item2;
                }
            }
        }