Inheritance: System.Windows.Controls.Canvas
コード例 #1
0
        public void ShowPointMeshCanvas()
        {
            var mesh             = new PointTriangleMesh();
            PointVertexTraits p0 = new Point(0, 0);
            PointVertexTraits p1 = new Point(1, 0);
            PointVertexTraits p2 = new Point(1, 1);
            PointVertexTraits p3 = new Point(0, 1);
            var f1 = mesh.CreateTriangle(p0, p1, p2);
            var v0 = f1.Vertices.Single(v => v.Traits == p0);
            var v1 = f1.Vertices.Single(v => v.Traits == p1);
            var v2 = f1.Vertices.Single(v => v.Traits == p2);

            mesh.CreateTriangle(v0.HalfedgeTo(v2), p3);

//            var zb = new Zoombox();

            var c = new PointTriangleMeshCanvas();

            c.Width  = 300;
            c.Height = 300;
            c.Mesh   = mesh;

//            var ch = new CanvasHost();
////            ch.Content = c;
//            var cv = new Canvas();
//            cv.Height = 300;
//            cv.Width = 300;
//            cv.Children.Add(new TextBlock() { Text = "asdasdasdasd"});
//            ch.Canvas = c;

            var w = new Window();

//             w.Content = ch;
            w.ShowDialog();
        }
コード例 #2
0
        public void ShowPointMeshCanvas()
        {
            var mesh = new PointTriangleMesh();
            PointVertexTraits p0 = new Point(0, 0);
            PointVertexTraits p1 = new Point(1, 0);
            PointVertexTraits p2 = new Point(1, 1);
            PointVertexTraits p3 = new Point(0, 1);
            var f1 = mesh.CreateTriangle(p0, p1, p2);
            var v0 = f1.Vertices.Single(v => v.Traits == p0);
            var v1 = f1.Vertices.Single(v => v.Traits == p1);
            var v2 = f1.Vertices.Single(v => v.Traits == p2);
            mesh.CreateTriangle(v0.HalfedgeTo(v2), p3);

//            var zb = new Zoombox();

            var c = new PointTriangleMeshCanvas();
            c.Width = 300;
            c.Height = 300;
            c.Mesh = mesh;

//            var ch = new CanvasHost();
////            ch.Content = c;
//            var cv = new Canvas();
//            cv.Height = 300;
//            cv.Width = 300;
//            cv.Children.Add(new TextBlock() { Text = "asdasdasdasd"});
//            ch.Canvas = c;

            var w = new Window();
//             w.Content = ch;
            w.ShowDialog();

        }