예제 #1
0
        public void InitializeFace(DCELFace2D face)
        {
            face.SetCenter();
            face.Fill            = Brushes.Black;
            face.RenderTransform = new ScaleTransform(0.5, 0.5, face.Center.X, face.Center.Y);

            face.MouseEnter += new MouseEventHandler(face_MouseEnter);
            face.MouseLeave += new MouseEventHandler(face_MouseLeave);

            collection.Add(face);
        }
예제 #2
0
        void face_MouseLeave(object sender, MouseEventArgs e)
        {
            var face = sender as DCEL2D.DCELFace2D;

            switch (MeshViewMode)
            {
            case ViewMode.Geometry:
                break;

            case ViewMode.Wireframe:
                break;

            case ViewMode.DCELStructure:
                face.Fill        = Brushes.Black;
                face.Edge.Stroke = Brushes.Black;
                break;

            case ViewMode.FaceNeighbours:
                face.Fill = Brushes.Black;
                foreach (var item in buffer)
                {
                    DCELFace2D f = item as DCELFace2D;
                    f.Fill = Brushes.Black;
                }
                buffer.Clear();
                break;

            case ViewMode.FaceSides:
                face.Fill = Brushes.Black;
                foreach (var item in buffer)
                {
                    DCELHalfEdge2D f = item as DCELHalfEdge2D;
                    f.Stroke = Brushes.Black;
                }
                buffer.Clear();
                break;

            case ViewMode.FaceVertices:
                face.Fill = Brushes.Black;
                foreach (var item in buffer)
                {
                    DCELVertex2D v = item as DCELVertex2D;
                    v.Fill = Brushes.Black;
                }
                buffer.Clear();
                break;

            default:
                break;
            }
        }
예제 #3
0
        void origin_MouseLeave(object sender, MouseEventArgs e)
        {
            var origin = sender as DCEL2D.DCELVertex2D;

            switch (MeshViewMode)
            {
            case ViewMode.Geometry:
                break;

            case ViewMode.Wireframe:
                break;

            case ViewMode.DCELStructure:
                origin.Fill           = Brushes.Black;
                origin.Leaving.Stroke = Brushes.Black;
                break;

            case ViewMode.LeavingEdges:
                origin.Fill = Brushes.Black;
                foreach (var item in buffer)
                {
                    DCELHalfEdge2D he = item as DCELHalfEdge2D;
                    he.Stroke = Brushes.Black;
                }
                buffer.Clear();
                break;

            case ViewMode.AdjacentFaces:
                origin.Fill = Brushes.Black;
                foreach (var item in buffer)
                {
                    DCELFace2D f = item as DCELFace2D;
                    f.Fill = Brushes.Black;
                }
                buffer.Clear();
                break;

            case ViewMode.AdjacentVertices:
                origin.Fill = Brushes.Black;
                foreach (var item in buffer)
                {
                    DCELVertex2D v = item as DCELVertex2D;
                    v.Fill = Brushes.Black;
                }
                buffer.Clear();
                break;

            case ViewMode.KStar:
                origin.Fill = Brushes.Black;
                foreach (var item in buffer)
                {
                    DCELFace2D f = item as DCELFace2D;
                    f.Fill = Brushes.Black;
                }
                buffer.Clear();
                break;

            default:
                break;
            }
        }