Inheritance: System.Windows.Media.Media3D.Material
        public static Model3D GetSkeletonModel(AnimData animData, int frameNo)
        {
            if (null == animData) {
                return null;
            }

            GeometryModel3D model = new GeometryModel3D();
            MeshGeometry3D mesh = new MeshGeometry3D();

            Point3D[] parentPoints = new Point3D[64];
            parentPoints[0] = new Point3D(0, 0, 0);

            for (int jointNum = 0; jointNum < animData.skeletonDef.GetLength(0); ++jointNum)
            {
                int parentIndex = animData.skeletonDef[jointNum];
                // Binding position
                Point3D pos = animData.bindingPose[jointNum];

                if (frameNo >= 0)
                {
                    AnimMeshPose pose = animData.perFrameFKPoses[frameNo, jointNum];
                    pos = pose.Position;
                }
                parentPoints[parentIndex + 1] = pos;
                AddBone(mesh, parentPoints[parentIndex], pos);
            }

            model.Geometry = mesh;

            DiffuseMaterial dm = new DiffuseMaterial();
            dm.Brush = new SolidColorBrush(Colors.DarkGreen);
            model.Material = dm;

            return model;
        }
Example #2
0
        public void aricondition(double x, double y, double z)
        {
            type = 4;
            DiffuseMaterial material1 = new DiffuseMaterial();
            material1.Brush = Brushes.LightGray;
            DiffuseMaterial material2 = new DiffuseMaterial();
            ImageBrush brush = new ImageBrush();
            brush.ImageSource = new BitmapImage(new Uri(@"air.jpg", UriKind.Relative));
            material2.Brush = brush;

            Model3DGroup cube = new Model3DGroup();
            material[0] = material1;
            material[1] = material1;
            material[2] = material1;
            material[3] = material1;
            material[4] = material1;
            material[5] = material1;
            material[6] = material1;
            material[7] = material1;
            material[8] = material2;
            material[9] = material2;
            material[10] = material1;
            material[11] = material1;
            cubegroup( x, y, z,ref cube, material);
            this.Content = cube;           
        }
Example #3
0
        //--------------------------------------------------------------------------------------------
        public Model3DGroup CreateCube()
        {
            Model3DGroup models = new Model3DGroup();

            Point3D p0 = new Point3D(0, 0, 0);
            Point3D p1 = new Point3D(1, 0, 0);
            Point3D p2 = new Point3D(1, 1, 0);
            Point3D p3 = new Point3D(0, 1, 0);
            Point3D p4 = new Point3D(0, 0, 1);
            Point3D p5 = new Point3D(1, 0, 1);
            Point3D p6 = new Point3D(1, 1, 1);
            Point3D p7 = new Point3D(0, 1, 1);

            ImageBrush myBrush = new ImageBrush(new BitmapImage(new Uri(@"brick.jpg", UriKind.RelativeOrAbsolute)));
            myBrush.TileMode = TileMode.Tile;

            //BitmapImage brickjpg = new BitmapImage();
            //brickjpg.BeginInit();
            //brickjpg.UriSource = new Uri(@"brick.jpg", UriKind.RelativeOrAbsolute);
            //brickjpg.EndInit();
            //DiffuseMaterial DiffMat = new DiffuseMaterial(new ImageBrush(brickjpg));

            DiffuseMaterial DiffMat = new DiffuseMaterial(myBrush);

            models.Children.Add(CreateRectangle(p3, p2, p1, p0, DiffMat));
            models.Children.Add(CreateRectangle(p4, p5, p6, p7, DiffMat));
            models.Children.Add(CreateRectangle(p0, p1, p5, p4, DiffMat));
            models.Children.Add(CreateRectangle(p1, p2, p6, p5, DiffMat));
            models.Children.Add(CreateRectangle(p2, p3, p7, p6, DiffMat));
            models.Children.Add(CreateRectangle(p3, p0, p4, p7, DiffMat));

            return models;
        }
 public Neuron(Point3D position, ModelVisual3D visual, DiffuseMaterial material)
 {
     _position = position;
     this.Visual = visual;
     this.Material = material;
     this.Value = 0d;
 }
Example #5
0
        public ParticleSystem(int maxCount, System.Windows.Media.Color color)
        {
            this.maxParticleCount = maxCount;

            this.particleList = new List<Particle>();

            this.particleModel = new GeometryModel3D();
            this.particleModel.Geometry = new MeshGeometry3D();

            Ellipse e = new Ellipse();
            e.Width = 32.0;
            e.Height = 32.0;
            RadialGradientBrush b = new RadialGradientBrush();
            b.GradientStops.Add(new GradientStop(System.Windows.Media.Color.FromArgb(0xFF, color.R, color.G, color.B), 0.25));
            b.GradientStops.Add(new GradientStop(System.Windows.Media.Color.FromArgb(0x00, color.R, color.G, color.B), 1.0));
            e.Fill = b;
            e.Measure(new System.Windows.Size(32, 32));
            e.Arrange(new Rect(0, 0, 32, 32));

            var brush = new VisualBrush(e);

            DiffuseMaterial material = new DiffuseMaterial(brush);

            this.particleModel.Material = material;

            this.rand = new Random(brush.GetHashCode());
        }
Example #6
0
        public void Setup3DItem(Model3DGroup targetGroup, DiffuseMaterial diffuseMaterialBrushPair,
            Size size, Point center, Material backMaterial, Rect backTextureCoordinates)
        {
            _locationDesired = new Point3D(center.X, center.Y, 0);
            _locationCurrent = new Point3D(0, 0, Rnd.NextDouble() * 10 - 20);
            _size = size;

            Point3D topLeft = new Point3D(-size.Width / 2, size.Height / 2, 0);
            Point3D topRight = new Point3D(size.Width / 2, size.Height / 2, 0);
            Point3D bottomLeft = new Point3D(-size.Width / 2, -size.Height / 2, 0);
            Point3D bottomRight = new Point3D(size.Width / 2, -size.Height / 2, 0);

            DiffuseMaterial = diffuseMaterialBrushPair;

            _quad.Children.Add(
                CreateTile(
                    diffuseMaterialBrushPair,
                    backMaterial,
                    _borderMaterial,
                    new Size3D(size.Width, size.Height, .01),
                    backTextureCoordinates));

            Transform3DGroup group = new Transform3DGroup();

            group.Children.Add(new RotateTransform3D(_verticalFlipRotation));
            group.Children.Add(new RotateTransform3D(this._quaternionRotation3D));

            group.Children.Add(_scaleTransform);
            group.Children.Add(_translate);

            _quad.Transform = group;

            targetGroup.Children.Add(_quad);
        }
Example #7
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.hxViewport3D = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

            case 2:
                this.modelVisual3D = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;

            case 3:
                this.model2 = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;

            case 4:
                this.meshMain = ((System.Windows.Media.Media3D.MeshGeometry3D)(target));
                return;

            case 5:
                this.matDiffuseMain = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;

            case 6:
                this.textEdit = ((System.Windows.Controls.RichTextBox)(target));
                return;

            case 7:
                this.debugOutput = ((System.Windows.Controls.RichTextBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #8
0
        public PhotoAlbum()
        {
            InitializeComponent();
            dt.Interval = TimeSpan.FromSeconds(2);
            dt.Tick += new EventHandler(dt_Tick);
            for (int i = 0; i < 16; i++)
            {
                ImageBrush ib = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/images/albums/im" + i + ".jpg")));
                ib.Stretch = Stretch.Uniform;

                ModelVisual3D mv = new ModelVisual3D();
                Material mat = new DiffuseMaterial(ib);
                GeometryModel3D plane = new GeometryModel3D(planeFactory.Mesh, mat);
                mv.Content = plane;
                mvs[i] = mv;
                myViewPort3D.Children.Add(mv);
                Matrix3D trix = new Matrix3D();
                double x = ran.NextDouble() * 50 - 50;
                double y = ran.NextDouble() * 2 - 2;
                double z = -i * 10;
                p3s[i] = new Point3D(x, y, z);
                trix.Append(new TranslateTransform3D(x, y, z).Value);
                mv.Transform = new MatrixTransform3D(trix);
            }

            pa = new Point3DAnimation(p3s[0], TimeSpan.FromMilliseconds(300));
            pa.AccelerationRatio = 0.3;
            pa.DecelerationRatio = 0.3;
            pa.Completed += new EventHandler(pa_Completed);
            cam.BeginAnimation(PerspectiveCamera.PositionProperty, pa);
        }
        public Model3DGroup CreateTriangleModel(Point3D p0, Point3D p1, Point3D p2)
        {
            MeshGeometry3D mesh = new MeshGeometry3D();
            mesh.Positions.Add(p0);
            mesh.Positions.Add(p1);
            mesh.Positions.Add(p2);

            for (int i = 0; i < 3; i++)
            {
                mesh.TriangleIndices.Add(i);
            }

            Vector3D normal = CalculateNormal(p0, p1, p2);

            for (int i = 0; i < 3; i++)
            {
                mesh.Normals.Add(normal);
            }

            Material material = new DiffuseMaterial(new SolidColorBrush(Colors.DarkCyan));
            GeometryModel3D model = new GeometryModel3D(mesh, material);
            Model3DGroup group = new Model3DGroup();
            group.Children.Add(model);
            return group;
        }
        private void simpleButtonClick(object sender, RoutedEventArgs e)
        {
            MeshGeometry3D triagleMesh = new MeshGeometry3D();
            Point3D p0 = new Point3D(0, 0, 0);
            Point3D p1 = new Point3D(5, 0, 0);
            Point3D p2 = new Point3D(0, 0, 5);

            triagleMesh.Positions.Add(p0);
            triagleMesh.Positions.Add(p1);
            triagleMesh.Positions.Add(p2);

            triagleMesh.TriangleIndices.Add(0);
            triagleMesh.TriangleIndices.Add(2);
            triagleMesh.TriangleIndices.Add(1);

            Vector3D normal = new Vector3D(0, 1, 0);
            triagleMesh.Normals.Add(normal);
            triagleMesh.Normals.Add(normal);
            triagleMesh.Normals.Add(normal);

            Material material = new DiffuseMaterial(new SolidColorBrush(Colors.LawnGreen));
            GeometryModel3D triangleModel = new GeometryModel3D(triagleMesh, material);

            ModelVisual3D model = new ModelVisual3D();
            model.Content = triangleModel;
            this.mainViewport.Children.Add(model);
        }
Example #11
0
        public NodesVisual()
        {
            InitializeComponent();

            // Make IMU model here

            Model3DGroup items = new Model3DGroup();
            GeometryModel3D model = new GeometryModel3D();
            MeshGeometry3D geom = new MeshGeometry3D();
            DiffuseMaterial paint = new DiffuseMaterial(new SolidColorBrush(Colors.Red));

            double xPos, yPos, zPos;

            for(int z = 0; z < 2; z++)
                for (int y = 0; y < 2; y++)
                    for (int x = 0; x < 2; x++)
                    {
                        xPos = x * CUBE_SIZE - CUBE_SIZE / 2;
                        yPos = y * CUBE_SIZE - CUBE_SIZE / 2;
                        zPos = z * CUBE_SIZE - CUBE_SIZE / 2;

                        geom.Positions.Add(new Point3D(xPos, yPos, zPos));
                        Debug.Print("(" + x + "," + y + "," + z + ")");
                    }
            

            // TriangleIndices = "2 3 1  2 1 0  7 1 3  7 5 1  6 5 7  6 4 5  6 2 0  6 0 4  2 7 3  2 6 7  0 1 5  0 5 4" >
            geom.TriangleIndices.Add(2);    geom.TriangleIndices.Add(3);    geom.TriangleIndices.Add(1);
            geom.TriangleIndices.Add(2);    geom.TriangleIndices.Add(1);    geom.TriangleIndices.Add(0);
            geom.TriangleIndices.Add(7);    geom.TriangleIndices.Add(1);    geom.TriangleIndices.Add(3);

            geom.TriangleIndices.Add(7);    geom.TriangleIndices.Add(5);    geom.TriangleIndices.Add(1);
            geom.TriangleIndices.Add(6);    geom.TriangleIndices.Add(5);    geom.TriangleIndices.Add(7);
            geom.TriangleIndices.Add(6);    geom.TriangleIndices.Add(4);    geom.TriangleIndices.Add(5);

            geom.TriangleIndices.Add(6);    geom.TriangleIndices.Add(2);    geom.TriangleIndices.Add(0);
            geom.TriangleIndices.Add(6);    geom.TriangleIndices.Add(0);    geom.TriangleIndices.Add(4);
            geom.TriangleIndices.Add(2);    geom.TriangleIndices.Add(7);    geom.TriangleIndices.Add(3);

            geom.TriangleIndices.Add(2);    geom.TriangleIndices.Add(6);    geom.TriangleIndices.Add(7);
            geom.TriangleIndices.Add(0);    geom.TriangleIndices.Add(1);    geom.TriangleIndices.Add(5);
            geom.TriangleIndices.Add(0);    geom.TriangleIndices.Add(5);    geom.TriangleIndices.Add(4);

            model.Material = paint;
            model.Geometry = geom;
            items.Children.Add(model);

            imu = new ModelVisual3D();
            imu.Content = items;
            viewportIMU.Children.Add(imu);

            combobox_nodeSelect.Items.Clear();
            Nodes.UpdateAvailableSensors();

            foreach (string sensor in Nodes.COM_Ports)
                combobox_nodeSelect.Items.Add(sensor);

            if (!combobox_nodeSelect.Items.IsEmpty)
                combobox_nodeSelect.SelectedIndex = 0;
        }
Example #12
0
        public FlipTile(DiffuseMaterial frontMaterial,
            Size size, Point center, Material backMaterial, Rect backTextureCoordinates)
        {
            m_locationDesired = new Point3D(center.X, center.Y, 0);
            m_locationCurrent = new Point3D(0, 0, Util.Rnd.NextDouble() * 10 - 20);
            m_size = size;

            Point3D topLeft = new Point3D(-size.Width / 2, size.Height / 2, 0);
            Point3D topRight = new Point3D(size.Width / 2, size.Height / 2, 0);
            Point3D bottomLeft = new Point3D(-size.Width / 2, -size.Height / 2, 0);
            Point3D bottomRight = new Point3D(size.Width / 2, -size.Height / 2, 0);

            m_frontMaterial = frontMaterial;

            Model3DGroup quad = new Model3DGroup();
            quad.Children.Add(
                CreateTile(
                    frontMaterial,
                    backMaterial,
                    m_borderMaterial,
                    new Size3D(size.Width, size.Height, .01),
                    backTextureCoordinates));

            Transform3DGroup group = new Transform3DGroup();

            group.Children.Add(new RotateTransform3D(m_verticalFlipRotation));
            group.Children.Add(new RotateTransform3D(m_quaternionRotation3D));

            group.Children.Add(m_scaleTransform);
            group.Children.Add(m_translate);

            quad.Transform = group;

            this.Visual3DModel = quad;
        }
Example #13
0
        public void floor(double l, double h, double w)
        {
            DiffuseMaterial material1 = new DiffuseMaterial();
            ImageBrush brush = new ImageBrush();
            brush.ImageSource = new BitmapImage(new Uri(@"floor15.jpg", UriKind.Relative));
            brush.Viewport = new Rect(0, 0, 0.1, 0.1);
            brush.TileMode = TileMode.Tile;
            material1.Brush = brush;

            Model3DGroup cube = new Model3DGroup();
            material[0] = material1;
            material[1] = material1;
            material[2] = material1;
            material[3] = material1;
            material[4] = material1;
            material[5] = material1;
            material[6] = material1;
            material[7] = material1;
            material[8] = material1;
            material[9] = material1;
            material[10] = material1;
            material[11] = material1;
            cubegroup(l, h, w,ref cube,  material);
            this.Content = cube;  
        }
Example #14
0
        private ModelVisual3D makeTriangle(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3)
        {
            MeshGeometry3D triangleMesh = new MeshGeometry3D();

            Point3D point0 = new Point3D(x1, y1, z1);
            Point3D point1 = new Point3D(x2, y2, z2);
            Point3D point2 = new Point3D(x3, y3, z3);

            triangleMesh.Positions.Add(point0);
            triangleMesh.Positions.Add(point1);
            triangleMesh.Positions.Add(point2);

            triangleMesh.TriangleIndices.Add(0); // Важно - порядок обхода
            triangleMesh.TriangleIndices.Add(2);
            triangleMesh.TriangleIndices.Add(1);

            Vector3D normal = new Vector3D(0, 1, 0);
            triangleMesh.Normals.Add(normal);
            triangleMesh.Normals.Add(normal);
            triangleMesh.Normals.Add(normal);

            Material material = new DiffuseMaterial(new SolidColorBrush(Colors.Red));

            return new ModelVisual3D { Content = new GeometryModel3D(triangleMesh, material) };
        }
        private void WindowLoaded(object sender, EventArgs e)
        {
            //Set camera viewpoint and properties.
            myPCamera.FarPlaneDistance = 20;
            myPCamera.NearPlaneDistance = 1;
            myPCamera.FieldOfView = 45;
            myPCamera.Position = new Point3D(-5, 2, 3);
            myPCamera.LookDirection = new Vector3D(5, -2, -3);
            myPCamera.UpDirection = new Vector3D(0, 1, 0);

            //Add light sources to the scene.
            myDirLight.Color = Colors.White;
            myDirLight.Direction = new Vector3D(-3, -4, -5);
            teapotModel.Geometry = (MeshGeometry3D)Application.Current.Resources["myTeapot"];

            //Define material and apply to the mesh geometries.
            DiffuseMaterial teapotMaterial = new DiffuseMaterial(new SolidColorBrush(Colors.Blue));

            teapotModel.Material = teapotMaterial;

            //Add 3D model and lights to the collection; add the collection to the visual.

            modelGroup.Children.Add(teapotModel);
            modelGroup.Children.Add(myDirLight);

            ModelVisual3D modelsVisual = new ModelVisual3D();
            modelsVisual.Content = modelGroup;

            //Add the visual and camera to the Viewport3D.
            myViewport.Camera = myPCamera;
            myViewport.Children.Add(modelsVisual);

            mainWindow.Content = myViewport;
        }
Example #16
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public Sphere()
            : base()
        {
            GeometryTransform.Children.Add(scaleTransform);
            GeometryTransform.Children.Add(translateTransform);

            Material = new DiffuseMaterial(Brushes.Blue);
            Geometry = GetMesh();
        }
Example #17
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.tbValues = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 2:
                this.btnGo = ((System.Windows.Controls.Button)(target));

            #line 25 "..\..\Window1.xaml"
                this.btnGo.Click += new System.Windows.RoutedEventHandler(this.btnGo_Click);

            #line default
            #line hidden
                return;

            case 3:
                this.tbAccVals = ((System.Windows.Controls.TextBox)(target));
                return;

            case 4:
                this.viewport3D1 = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 5:
                this.camMain = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

            case 6:
                this.dirLightMain = ((System.Windows.Media.Media3D.DirectionalLight)(target));
                return;

            case 7:
                this.MyModel = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;

            case 8:
                this.meshMain = ((System.Windows.Media.Media3D.MeshGeometry3D)(target));
                return;

            case 9:
                this.matDiffuseMain = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;

            case 10:
                this.rotate = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 11:
                this.slider1 = ((System.Windows.Controls.Slider)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #18
0
        /// <summary>
        /// Default constructor
        /// </summary>
        public Cylinder()
        {
            GeometryTransform.Children.Add(scaleTransform);
            GeometryTransform.Children.Add(orientationTransform);
            GeometryTransform.Children.Add(translateTransform);

            Material = new DiffuseMaterial(Brushes.Blue);

            Geometry = GetMesh();
        }
 private void AddUIP3DPlane()
 {
     var rectangle = SimpleGeometry3D.CreateRectangle(2, 3);
     var viewport2D = new Viewport2DVisual3D();
     viewport2D.Geometry = rectangle;
     viewport2D.Visual = _soundVisualizer;
     var material = new DiffuseMaterial { Brush = Brushes.Black };
     Viewport2DVisual3D.SetIsVisualHostMaterial(material, true);
     viewport2D.Material = material;
     viewport2D.Transform = new TranslateTransform3D(0, -0.5, 0);
     _scene.Add2DUI(viewport2D);
 }
 public static Material ToMaterial(this IfcSurfaceStyleShading shading)
 {
     if (shading is IfcSurfaceStyleRendering)
         return ((IfcSurfaceStyleRendering) shading).ToMaterial();
     byte red = Convert.ToByte(shading.SurfaceColour.Red*255);
     byte green = Convert.ToByte(shading.SurfaceColour.Green*255);
     byte blue = Convert.ToByte(shading.SurfaceColour.Blue*255);
     Color col = Color.FromRgb(red, green, blue);
     Brush brush = new SolidColorBrush(col);
     Material mat = new DiffuseMaterial(brush);
     return mat;
 }
Example #21
0
        public static GeometryModel3D CreateCubeModel(Point3D P0, double w, double h, double d, Color color)
        {
            MeshGeometry3D mesh = new MeshGeometry3D();

            addCubeToMesh(P0, w, h, d, mesh);

            Material material = new DiffuseMaterial(new SolidColorBrush(color));

            GeometryModel3D model = new GeometryModel3D(mesh, material);

            return model;
        }
        /// <summary>
        /// This method returns a 3D representation of this building walls
        /// </summary>
        /// <param name="nodesDict">List of all the nodes on the map</param>
        /// <param name="map">bounds of the map</param>
        /// <param name="brush">Color of these walls</param>
        /// <returns>ModelUIElement3D of these walls</returns>
        public ModelUIElement3D get3DWalls(Dictionary<long, OsmSharp.Osm.Node> nodesDict, Map map, ImageBrush brush)
        {
            // Surrounding tags of the mesh
            ModelUIElement3D model = new ModelUIElement3D();
            GeometryModel3D geometryModel = new GeometryModel3D();

            // Mesh and his his properties
            MeshGeometry3D mesh = new MeshGeometry3D();
            DiffuseMaterial material = new DiffuseMaterial((System.Windows.Media.Brush)brush);
            Point3DCollection positions = new Point3DCollection();
            PointCollection texturePoints = new PointCollection();
            Int32Collection indices = new Int32Collection();

            // Add Points of surface and with add points of surface with height 0
            positions = getScaledPositionsWall(nodesDict, map);

            // Add indices to the collection
            for (int i = 0; i < positions.Count - 2; i += 2) {
                indices.Add(i);
                indices.Add(i + 2);
                indices.Add(i + 1);
                indices.Add(i + 3);
                indices.Add(i + 1);
                indices.Add(i + 2);

                // Get the width and height of a wall
                float widthWall = (float)Math.Sqrt(Math.Pow(positions[i].X - positions[i + 2].X, 2) + Math.Pow(positions[i].Y - positions[i + 2].Y, 2));
                int imageWidth = (int)(brush.ImageSource.Width * widthWall);
                int imageHeight = (int)(brush.ImageSource.Height * height);

                // Add texture coordinates
                texturePoints.Add(new System.Windows.Point(0, imageHeight));
                texturePoints.Add(new System.Windows.Point(0, 0));
                texturePoints.Add(new System.Windows.Point(imageWidth, imageHeight));
                texturePoints.Add(new System.Windows.Point(imageWidth, 0));
            }

            // Add these collections to the mesh
            mesh.Positions = positions;
            mesh.TriangleIndices = indices;
            mesh.TextureCoordinates = texturePoints;

            // Set the color of front and back of the triangle
            geometryModel.Material = material;
            geometryModel.BackMaterial = material;

            // Add the mesh to the model
            geometryModel.Geometry = mesh;
            model.Model = geometryModel;

            return model;
        }
Example #23
0
        public Cube(Point3D center, double radius, Action action) {
            Center = center;
            Radius = radius;
            Action = action;
            Notified = false;
            SolidColorBrush = new SolidColorBrush();
            SolidColorBrush.Opacity = _Constants.BaseOpacity;
            SolidColorBrush.Color = _Constants.DefaultCubeColour;
            Material = new DiffuseMaterial(SolidColorBrush);
            MeshBuilder meshBuilder = new MeshBuilder();
            meshBuilder.AddBox(center, radius, radius, radius);

            ModelVisual3D = Engine._3DUtil.WrapMeshAndMaterialIntoModelVisual3D(meshBuilder.ToMesh(), Material);
        }
Example #24
0
        public Screen(Point3D ul,Point3D ur, Point3D ll)
        {
            LL = ll;
            UL = ul;
            UR = ur;

            GeometryModel3D model = new GeometryModel3D();
            model.Geometry = CreateGeometry();

            DiffuseMaterial material = new DiffuseMaterial(Brushes.LightBlue);
            model.Material = material;

            Content = model;
        }
		protected Section3DChartBase()
		{
			border.Color = DefaultColor;

			Material material = new DiffuseMaterial { Brush = new SolidColorBrush(Color.FromArgb(0x7F, 0x4C, 0x88, 0xFF)) };
			material.Freeze();

			billboard.Material = material;
			billboard.BackMaterial = material;

			Children.Add(billboard);
			Children.Add(border);

			UpdateUI();
		}
        private void LoadMesh(double fieldOfView)
        {
            if ((myViewport3D != null) && (modelGroup.Children.Count > 0))
            {
                myViewport3D.Children.Remove(modelsVisual);
                modelGroup.Children.Clear();
            }

            ((PerspectiveCamera)myViewport3D.Camera).FieldOfView = fieldOfView;

            // Define the material for the model.
            SolidColorBrush brush = new SolidColorBrush(Colors.Cyan);
            DiffuseMaterial colorMaterial = new DiffuseMaterial(brush);

            // Load the mesh for the model.
            MeshGeometry3D objMesh = (MeshGeometry3D)Application.Current.Resources[_mesh];
            objModel = new GeometryModel3D(objMesh, colorMaterial);

            // Define the projection camera and add to the model.
            SetProjectionCamera(myViewport3D, modelGroup);

            modelGroup.Children.Add(objModel);

            // Add ambient light to the model group.
            if (checkBoxAmbientLight.IsChecked == true)
            {
                myLights.ShowAmbientLight(true, modelGroup);
            }

            // Add directional lights to the model group.
            if (checkBoxDirLightOne.IsChecked == true)
            {
                myLights.ShowDirLight(0, true, modelGroup);
            }
            if (checkBoxDirLightTwo.IsChecked == true)
            {
                myLights.ShowDirLight(1, true, modelGroup);
            }

            // Add the model group data to the viewport.
            modelsVisual.Content = modelGroup;
            myViewport3D.Children.Add(modelsVisual);

            checkBoxPointLight.IsChecked = false;
            xyzPointLight.Foreground = System.Windows.Media.Brushes.LightGray;
            currKeyMode = KeyMode.Camera;
            rbPosition1.IsChecked = true;
        }
Example #27
0
        public Cube3D()
        {
            Canvas.SetLeft(this,0);
            Canvas.SetTop(this,0);
            this.Width=733;
            this.Height = 400;
            this.ClipToBounds = true;

            //add camera
            PerspectiveCamera myPCamera = new PerspectiveCamera();
            myPCamera.Position = new Point3D(0, 30, 90);
            myPCamera.LookDirection = new Vector3D(0, -20, -90);
            myPCamera.FieldOfView = 80;
            this.Camera = myPCamera;

            //add light
            ModelVisual3D mv3dLight = new ModelVisual3D();
            DirectionalLight myDirLight = new DirectionalLight();
            myDirLight.Color = Colors.White;
            myDirLight.Direction = new Vector3D(-2, -3, -1);
            mv3dLight.Content = myDirLight;
            this.Children.Add(mv3dLight);

            //add material and mesh geometry
            Viewport2DVisual3D vpMaterial = new Viewport2DVisual3D();
            DiffuseMaterial dm = new DiffuseMaterial();
            dm.Brush = Brushes.Transparent;
            vpMaterial.Material = dm;
            MeshGeometry3D vpg = new MeshGeometry3D();
            vpg.Positions.Add(new Point3D(-55,0,-30));
            vpg.Positions.Add(new Point3D(-55,0,30));
            vpg.Positions.Add(new Point3D(55,0,30));
            vpg.Positions.Add(new Point3D(55,0,-30));
            vpg.TextureCoordinates.Add(new Point(0,0));
            vpg.TextureCoordinates.Add(new Point(0,1));
            vpg.TextureCoordinates.Add(new Point(1,1));
            vpg.TextureCoordinates.Add(new Point(1,0));
            vpg.TriangleIndices.Add(0);
            vpg.TriangleIndices.Add(1);
            vpg.TriangleIndices.Add(2);
            vpg.TriangleIndices.Add(2);
            vpg.TriangleIndices.Add(3);
            vpg.TriangleIndices.Add(0);
            vpMaterial.Geometry = vpg;
            this.Children.Add(vpMaterial);

            this.Loaded += new RoutedEventHandler(OnLoad);
        }
Example #28
0
        public MaterialLibrary(Loader l)
        {
            MaterialGroup group = null;
            DiffuseMaterial diffuse = null;
            SpecularMaterial specular = null;

            foreach (Instruction i in l.Parse())
            {
                switch (i.Type)
                {
                    case "newmtl":
                        group = new MaterialGroup();

                        diffuse = new DiffuseMaterial();
                        group.Children.Add(diffuse);
                        specular = new SpecularMaterial();
                        group.Children.Add(specular);

                        Materials.Add(i.Arg, group);
                        break;
                    case "Ns":
                        specular.SpecularPower = i.Double();
                        break;
                    case "d":
                    case "Tr":
                        diffuse.Brush.Opacity = i.Float();
                        break;
                    case "Ka":
                        diffuse.AmbientColor = i.Color();
                        break;
                    case "Kd":
                        diffuse.Brush = new SolidColorBrush(i.Color());
                        break;
                    case "Ks":
                        specular.Brush = new SolidColorBrush(i.Color());
                        break;
                    // TODO: UV Maps
                    case "illum":
                    case "Ni": // Index of Refraction
                        // Unsupported, ignore
                        break;
                    default:
                        // Unrecognized symbol
                        break;
                }
            }
        }
Example #29
0
        /// <summary>
        /// Builds the 3D model for the cartoon view a the given residue.
        /// </summary>
        /// <param name="residue">A residue.</param>
        /// <param name="initialColor">The residue's current color.</param>
        internal Cartoon(Residue residue, Color initialColor)
        {
            this.residue = residue;

            this.materialGroup = new MaterialGroup();

            this.diffuseMaterial = new DiffuseMaterial(new SolidColorBrush(initialColor));
            this.materialGroup.Children.Add(diffuseMaterial);

            SpecularMaterial specularMaterial = new SpecularMaterial();
            specularMaterial.Brush = new SolidColorBrush(Color.FromArgb(192, 255, 255, 255));
            specularMaterial.SpecularPower = 50;
            this.materialGroup.Children.Add(specularMaterial);

            this.model = new Model3DGroup();

            this.residue.Ribbon.GetResidueSpline(this.residue, out this.ribbonPoints,
                out this.torsionVectors, out this.normalVectors);

            if (this.residue.IsHelix)
            {
                this.AddTube(Cartoon.helixWidth, Cartoon.helixHeight);

                if (this.residue.IsStructureStart)
                    this.AddTubeCap(Cartoon.helixWidth, Cartoon.helixHeight);

                if (this.residue.IsStructureEnd)
                    this.AddTubeCap(Cartoon.helixWidth, Cartoon.helixHeight);
            }
            else if (this.residue.IsSheet)
            {
                this.AddSheet();

                if (this.residue.IsStructureStart || this.residue.IsStructureEnd)
                    this.AddSheetCap();
            }
            else
            {
                this.AddTube(Cartoon.turnWidth, Cartoon.turnWidth);

                if (this.residue.IsStructureStart)
                    this.AddTubeCap(Cartoon.turnWidth, Cartoon.turnWidth);

                if (this.residue.IsStructureEnd)
                    this.AddTubeCap(Cartoon.turnWidth, Cartoon.turnWidth);
            }
        }
Example #30
0
        /// <summary>
        /// Add a 3D model to the instance
        /// </summary>
        private void Init()
        {
            Model3DGroup group = ((Model3DGroup)Core.Instance.Models["point"]).Clone();
            MeshGeometry3D mesh = ((MeshGeometry3D)Core.Instance.Models["pointMesh"]).Clone();
            //Model3DGroup g2 = group.Clone();

            SolidColorBrush b = new SolidColorBrush(Color.FromArgb(255, 255, 255, 0));
            DiffuseMaterial material = new DiffuseMaterial(b);
            GeometryModel3D model2 = new GeometryModel3D(mesh, material);

            ScaleTransform3D scale = new ScaleTransform3D();
            TranslateTransform3D move = new TranslateTransform3D();
            TranslateTransform3D move2 = new TranslateTransform3D();
            AxisAngleRotation3D rotate = new AxisAngleRotation3D();
            Transform3DGroup t = new Transform3DGroup();
            double factor = 3;
            Console.WriteLine(_Point.X + "  " + _Point.Y);
            move.OffsetX = (1 / factor) * _Point.X;
            move.OffsetZ = 0.5;//;// new Random().NextDouble();
            move.OffsetY = -(1 / factor) * _Point.Y;//Y*factor;

            move2.OffsetY = -2;

            rotate.Axis = new Vector3D(1, 0, 0);
            rotate.Angle = 270;

            scale.ScaleX = factor;
            scale.ScaleY = factor;
            scale.ScaleZ = factor;
            t.Children.Add(move);
            t.Children.Add(scale);
            t.Children.Add(new RotateTransform3D(rotate));
            t.Children.Add(move2);
            t.Children.Add(_Scale);
            group.Transform = t;
            this.Content = group;// (Model3DGroup)Core.Instance.Models["side"];

            ColorAnimation da = new ColorAnimation(Color.FromArgb(150, 255, 255, 0), Color.FromArgb(255, 255, 255, 0),  new Duration(new TimeSpan(0, 0, 1)));
            da.RepeatBehavior = RepeatBehavior.Forever;
            da.AutoReverse = true;
            GeometryModel3D m1 = (GeometryModel3D)group.Children[0];
            GeometryModel3D m2 = (GeometryModel3D)group.Children[0];
            ((DiffuseMaterial)m1.Material).BeginAnimation(DiffuseMaterial.ColorProperty, da);
            ((DiffuseMaterial)m2.Material).BeginAnimation(DiffuseMaterial.ColorProperty, da);
            //model2.Material.colo
            //move2.BeginAnimation(TranslateTransform3D.OffsetYProperty, da);
        }
Example #31
0
        public static Model3DGroup CreateTriangleFace(Point3D p0, Point3D p1, Point3D p2, Color color)
        {
            MeshGeometry3D mesh = new MeshGeometry3D(); mesh.Positions.Add(p0); mesh.Positions.Add(p1); mesh.Positions.Add(p2); mesh.TriangleIndices.Add(0); mesh.TriangleIndices.Add(1); mesh.TriangleIndices.Add(2);

            Vector3D normal = CalcNormal(p0, p1, p2);
            mesh.Normals.Add(normal);
            mesh.Normals.Add(normal);
            mesh.Normals.Add(normal);

            Material material = new DiffuseMaterial(
                new SolidColorBrush(color));
            GeometryModel3D model = new GeometryModel3D(
                mesh, material);
            Model3DGroup group = new Model3DGroup();
            group.Children.Add(model);
            return group;
        }
        private void RenderSomeModels()
        {
            myViewport.Name = "myViewport";
            //Set camera viewpoint and properties.
            myPCamera.FarPlaneDistance = 20;
            myPCamera.NearPlaneDistance = 1;
            myPCamera.FieldOfView = 45;
            myPCamera.Position = new Point3D(-5, 2, 3);
            myPCamera.LookDirection = new Vector3D(5, -2, -3);
            myPCamera.UpDirection = new Vector3D(0, 1, 0);

            //Add light sources to the scene.
            myDirLight.Color = Colors.White;
            myDirLight.Direction = new Vector3D(-3, -4, -5);

            teapotModel.Geometry = (MeshGeometry3D)Application.Current.Resources["myTeapot"];

            //Define DiffuseMaterial and apply to the mesh geometries.
            DiffuseMaterial teapotMaterial = new DiffuseMaterial(new SolidColorBrush(Colors.Blue));
            //Define a transformation
            RotateTransform3D myRotateTransform = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(0, 2, 0), 1));
            //Define an animation for the transformation
            DoubleAnimation myAnimation = new DoubleAnimation();
            myAnimation.From = 1;
            myAnimation.To = 361;
            myAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(5000));
            myAnimation.RepeatBehavior = RepeatBehavior.Forever;
            //Add animation to the transformation
            myRotateTransform.Rotation.BeginAnimation(AxisAngleRotation3D.AngleProperty, myAnimation);

            //Add transformation to the model
            teapotModel.Transform = myRotateTransform;

            teapotModel.Material = teapotMaterial;

            //Add the model to the model group collection
            modelGroup.Children.Add(teapotModel);
            modelGroup.Children.Add(myDirLight);
            myViewport.Camera = myPCamera;

            myModelVisual3D.Content = modelGroup;
            myViewport.Children.Add(myModelVisual3D);

            //add the Viewport3D to the window
            mainWindow.Content = myViewport;
        }
Example #33
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 6 "..\..\..\MainWindow.xaml"
                ((Microsoft.Samples.Kinect.HDFaceBasics.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.layoutGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.txt_Status = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 4:

            #line 31 "..\..\..\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.StartCapture_Button_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.viewport3d = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 6:
                this.theGeometry = ((System.Windows.Media.Media3D.MeshGeometry3D)(target));
                return;

            case 7:
                this.theMaterial = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #34
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ColorImage = ((System.Windows.Controls.Image)(target));
                return;

            case 2:
                this.viewport3d = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 3:
                this.theGeometry = ((System.Windows.Media.Media3D.MeshGeometry3D)(target));
                return;

            case 4:
                this.theMaterial = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.XRotation = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 2:
                this.YRotation = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 3:
                this.ZRotation = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 4:
                this.CubeMaterial = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;

            case 5:
                this.XRotation2 = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 6:
                this.YRotation2 = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 7:
                this.ZRotation2 = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 8:
                this.CubeMaterial2 = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #36
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.viewport3D1 = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 2:
                this.camMain = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

            case 3:
                this.dirLightMain = ((System.Windows.Media.Media3D.DirectionalLight)(target));
                return;

            case 4:
                this.MyModel = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;

            case 5:
                this.meshMain = ((System.Windows.Media.Media3D.MeshGeometry3D)(target));
                return;

            case 6:
                this.matDiffuseMain = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;

            case 7:
                this.rotate = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 8:
                this.slider1 = ((System.Windows.Controls.Slider)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #37
0
        /// <summary>
        /// 初始化3D模型
        /// </summary>
        private void init3DModels(List <string> modelsNames)
        {
            //var modelsNames = System.IO.Directory.GetFiles(Utility.ConstValue.AppPath + @"3D_Models", "*.STL", SearchOption.TopDirectoryOnly).ToList();
            //var modelsNames = System.IO.Directory.GetFiles(Utility.ConstValue.AppPath + @"3D_Models/工件/1号工件", "*.STL", SearchOption.TopDirectoryOnly).ToList();

            HelixToolkit.Wpf.ModelImporter import = new HelixToolkit.Wpf.ModelImporter();
            //joints = new List<Joint>();
            Model3DGroup model3DGroup = new Model3DGroup();

            foreach (string modelName in modelsNames)
            {
                var              materialGroup = new MaterialGroup();
                Color            mainColor     = Colors.White;
                EmissiveMaterial emissMat      = new EmissiveMaterial(new SolidColorBrush(mainColor));
                System.Windows.Media.Media3D.DiffuseMaterial diffMat = new System.Windows.Media.Media3D.DiffuseMaterial(new SolidColorBrush(mainColor));
                SpecularMaterial specMat = new SpecularMaterial(new SolidColorBrush(mainColor), 200);
                materialGroup.Children.Add(emissMat);
                materialGroup.Children.Add(diffMat);
                materialGroup.Children.Add(specMat);

                var link = import.Load(modelName);
                System.Windows.Media.Media3D.GeometryModel3D model = link.Children[0] as System.Windows.Media.Media3D.GeometryModel3D;
                model.Material     = materialGroup;
                model.BackMaterial = materialGroup;
                //joints.Add(new Joint(link));
                model3DGroup.Children.Add(link);
            }

            ModelVisual3D modelVisual3D = new ModelVisual3D();

            modelVisual3D.Content = model3DGroup;

            mainContent.Children.Add(modelVisual3D);
            mainContent.InputBindings.Add(new MouseBinding(this.PointSelectionCommand, new MouseGesture(MouseAction.LeftClick)));
            mainContent.ZoomExtents();
        }
Example #38
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 9 "..\..\MainWindow.xaml"
                ((linearAlgebra.MainWindow)(target)).KeyDown += new System.Windows.Input.KeyEventHandler(this.OnKeyDown);

            #line default
            #line hidden
                return;

            case 2:
                this.viewport3D = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 3:
                this.camMain = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

            case 4:
                this.dirLightMain = ((System.Windows.Media.Media3D.DirectionalLight)(target));
                return;

            case 5:
                this.MyModel = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;

            case 6:
                this.cube = ((System.Windows.Media.Media3D.MeshGeometry3D)(target));
                return;

            case 7:
                this.matDiffuseMain = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;

            case 8:
                this.Color = ((System.Windows.Media.SolidColorBrush)(target));
                return;

            case 9:
                this.Model2 = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;

            case 10:
                this.cone = ((System.Windows.Media.Media3D.MeshGeometry3D)(target));
                return;

            case 11:
                this.matDiffuseMain2 = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;

            case 12:
                this.Color2 = ((System.Windows.Media.SolidColorBrush)(target));
                return;

            case 13:
                this.textBox = ((System.Windows.Controls.TextBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 6 "..\..\..\MainWindow.xaml"
                ((FFEA.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.layoutGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.Tabs = ((System.Windows.Controls.TabControl)(target));
                return;

            case 4:
                this.viewport3d = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 5:
                this.theGeometry = ((System.Windows.Media.Media3D.MeshGeometry3D)(target));
                return;

            case 6:
                this.theMaterial = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;

            case 7:
                this.Button_Recording = ((System.Windows.Controls.Button)(target));

            #line 129 "..\..\..\MainWindow.xaml"
                this.Button_Recording.Click += new System.Windows.RoutedEventHandler(this.Button_Record_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.saveFootage = ((System.Windows.Controls.Button)(target));

            #line 130 "..\..\..\MainWindow.xaml"
                this.saveFootage.Click += new System.Windows.RoutedEventHandler(this.SaveFootage_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.label1 = ((System.Windows.Controls.Label)(target));
                return;

            case 10:
                this.label1_Copy = ((System.Windows.Controls.Label)(target));
                return;

            case 11:
                this.label1_Copy1 = ((System.Windows.Controls.Label)(target));
                return;

            case 12:
                this.label1_Copy2 = ((System.Windows.Controls.Label)(target));
                return;

            case 13:
                this.label1_Copy3 = ((System.Windows.Controls.Label)(target));
                return;

            case 14:
                this.ExpressioncomboBox = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 15:
                this.IDtextBox = ((System.Windows.Controls.TextBox)(target));
                return;

            case 16:
                this.AgeTextBox = ((System.Windows.Controls.TextBox)(target));
                return;

            case 17:
                this.RaceTextBox = ((System.Windows.Controls.TextBox)(target));
                return;

            case 18:
                this.MaleButton = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 19:
                this.FemaleButton = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 20:
                this.loadFootage = ((System.Windows.Controls.Button)(target));

            #line 151 "..\..\..\MainWindow.xaml"
                this.loadFootage.Click += new System.Windows.RoutedEventHandler(this.loadFootage_Click);

            #line default
            #line hidden
                return;

            case 21:
                this.loadedFileName = ((System.Windows.Controls.Label)(target));
                return;

            case 22:
                this.label2 = ((System.Windows.Controls.Label)(target));
                return;

            case 23:
                this.Savepattern = ((System.Windows.Controls.Button)(target));

            #line 154 "..\..\..\MainWindow.xaml"
                this.Savepattern.Click += new System.Windows.RoutedEventHandler(this.saveAsPattern_clicked);

            #line default
            #line hidden
                return;

            case 24:
                this.reviewFootage = ((System.Windows.Controls.Image)(target));
                return;

            case 25:
                this.playBack = ((System.Windows.Controls.Button)(target));

            #line 171 "..\..\..\MainWindow.xaml"
                this.playBack.Click += new System.Windows.RoutedEventHandler(this.PlayBack_Click);

            #line default
            #line hidden
                return;

            case 26:
                this.playForward = ((System.Windows.Controls.Button)(target));

            #line 172 "..\..\..\MainWindow.xaml"
                this.playForward.Click += new System.Windows.RoutedEventHandler(this.playFootage_Click);

            #line default
            #line hidden
                return;

            case 27:
                this.Mthods = ((System.Windows.Controls.Label)(target));
                return;

            case 28:
                this.analysisOne = ((System.Windows.Controls.Button)(target));

            #line 185 "..\..\..\MainWindow.xaml"
                this.analysisOne.Click += new System.Windows.RoutedEventHandler(this.analysis_clicked);

            #line default
            #line hidden
                return;

            case 29:
                this.TextBox_Library = ((System.Windows.Controls.TextBox)(target));

            #line 186 "..\..\..\MainWindow.xaml"
                this.TextBox_Library.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.TextBox_Library_TextChanged);

            #line default
            #line hidden
                return;

            case 30:
                this.library = ((System.Windows.Controls.Label)(target));
                return;

            case 31:
                this.refresh = ((System.Windows.Controls.Button)(target));

            #line 188 "..\..\..\MainWindow.xaml"
                this.refresh.Click += new System.Windows.RoutedEventHandler(this.refresh_library_clicked);

            #line default
            #line hidden
                return;

            case 32:
                this.croseValidation = ((System.Windows.Controls.TextBox)(target));
                return;

            case 33:
                this.CrossValidateAU = ((System.Windows.Controls.Button)(target));

            #line 190 "..\..\..\MainWindow.xaml"
                this.CrossValidateAU.Click += new System.Windows.RoutedEventHandler(this.AUCrossValidate_Clicked);

            #line default
            #line hidden
                return;

            case 34:
                this.label = ((System.Windows.Controls.Label)(target));
                return;

            case 35:
                this.label_Copy = ((System.Windows.Controls.Label)(target));
                return;

            case 36:
                this.database = ((System.Windows.Controls.Button)(target));

            #line 193 "..\..\..\MainWindow.xaml"
                this.database.Click += new System.Windows.RoutedEventHandler(this.Database_Click);

            #line default
            #line hidden
                return;

            case 37:
                this.KvalueBox = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 38:
                this.k1 = ((System.Windows.Controls.ComboBoxItem)(target));
                return;

            case 39:
                this.k2 = ((System.Windows.Controls.ComboBoxItem)(target));
                return;

            case 40:
                this.k3 = ((System.Windows.Controls.ComboBoxItem)(target));
                return;

            case 41:
                this.k4 = ((System.Windows.Controls.ComboBoxItem)(target));
                return;

            case 42:
                this.k5 = ((System.Windows.Controls.ComboBoxItem)(target));
                return;

            case 43:
                this.k6 = ((System.Windows.Controls.ComboBoxItem)(target));
                return;

            case 44:
                this.checkSVM = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 45:
                this.checkKNN = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 46:
                this.TestExpression = ((System.Windows.Controls.TextBox)(target));
                return;

            case 47:
                this.Load_expression = ((System.Windows.Controls.Button)(target));

            #line 221 "..\..\..\MainWindow.xaml"
                this.Load_expression.Click += new System.Windows.RoutedEventHandler(this.Load_expression_Click);

            #line default
            #line hidden
                return;

            case 48:
                this.dataGridAU = ((System.Windows.Controls.DataGrid)(target));

            #line 222 "..\..\..\MainWindow.xaml"
                this.dataGridAU.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.DataGridAU_SelectionChanged);

            #line default
            #line hidden
                return;

            case 49:
                this.ExpressionValidation = ((System.Windows.Controls.Button)(target));

            #line 227 "..\..\..\MainWindow.xaml"
                this.ExpressionValidation.Click += new System.Windows.RoutedEventHandler(this.ExpressionValidation_Click);

            #line default
            #line hidden
                return;

            case 50:
                this.guessButton = ((System.Windows.Controls.Button)(target));

            #line 228 "..\..\..\MainWindow.xaml"
                this.guessButton.Click += new System.Windows.RoutedEventHandler(this.GuessExpression_Click);

            #line default
            #line hidden
                return;

            case 51:
                this.results = ((System.Windows.Controls.TextBox)(target));
                return;

            case 52:
                this.loadfile = ((System.Windows.Controls.Label)(target));
                return;

            case 53:
                this.ExpressionImg = ((System.Windows.Controls.Image)(target));
                return;

            case 54:
                this.ExpressionKvalue = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 55:
                this.SVMSelcted = ((System.Windows.Controls.RadioButton)(target));
                return;

            case 56:
                this.KNNSelected = ((System.Windows.Controls.RadioButton)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #40
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.griddnnmm = ((System.Windows.Controls.Grid)(target));

            #line 10 "..\..\MainWindow.xaml"
                this.griddnnmm.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.grdm);

            #line default
            #line hidden
                return;

            case 2:
                this.viewport3D1 = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 3:
                this.camusernnn = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

            case 4:
                this.dirLightMain = ((System.Windows.Media.Media3D.DirectionalLight)(target));
                return;

            case 5:
                this.MyModel = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;

            case 6:
                this.meshMain = ((System.Windows.Media.Media3D.MeshGeometry3D)(target));
                return;

            case 7:
                this.diffuseennn = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;

            case 8:
                this.cangroupname = ((System.Windows.Media.Media3D.Transform3DGroup)(target));
                return;

            case 9:
                this.rotate = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 10:
                this.rotatey = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 11:
                this.rotatez = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 12:
                this.viewport3D12 = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 13:
                this.camusermmm = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

            case 14:
                this.dirLightMain2 = ((System.Windows.Media.Media3D.DirectionalLight)(target));
                return;

            case 15:
                this.MyModel2 = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;

            case 16:
                this.wtfrmodel = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;

            case 17:
                this.tr = ((System.Windows.Media.Media3D.MeshGeometry3D)(target));
                return;

            case 18:
                this.diffuseemmm = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;

            case 19:
                this.rotate2 = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 20:
                this.rotatey2 = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 21:
                this.rotatez2 = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 22:
                this.slider1 = ((System.Windows.Controls.Slider)(target));

            #line 146 "..\..\MainWindow.xaml"
                this.slider1.DataContextChanged += new System.Windows.DependencyPropertyChangedEventHandler(this.cngs);

            #line default
            #line hidden
                return;

            case 23:
                this.slider1y = ((System.Windows.Controls.Slider)(target));
                return;

            case 24:
                this.slider1z = ((System.Windows.Controls.Slider)(target));
                return;

            case 25:
                this.label = ((System.Windows.Controls.Label)(target));
                return;

            case 26:
                this.label1 = ((System.Windows.Controls.Label)(target));
                return;

            case 27:
                this.label1_Copy = ((System.Windows.Controls.Label)(target));
                return;

            case 28:
                this.label1_Copy1 = ((System.Windows.Controls.Label)(target));
                return;

            case 29:
                this.slider1_Copy = ((System.Windows.Controls.Slider)(target));
                return;

            case 30:
                this.slider1y_Copy = ((System.Windows.Controls.Slider)(target));
                return;

            case 31:
                this.slider1z_Copy = ((System.Windows.Controls.Slider)(target));
                return;

            case 32:
                this.label_Copy = ((System.Windows.Controls.Label)(target));
                return;

            case 33:
                this.label_Copy1 = ((System.Windows.Controls.Label)(target));
                return;

            case 34:
                this.button = ((System.Windows.Controls.Button)(target));

            #line 179 "..\..\MainWindow.xaml"
                this.button.Click += new System.Windows.RoutedEventHandler(this.Button_Click);

            #line default
            #line hidden
                return;

            case 35:
                this.button_Copy = ((System.Windows.Controls.Button)(target));

            #line 180 "..\..\MainWindow.xaml"
                this.button_Copy.Click += new System.Windows.RoutedEventHandler(this.Button_Copy_Click);

            #line default
            #line hidden
                return;

            case 36:
                this.button_Copy1 = ((System.Windows.Controls.Button)(target));

            #line 181 "..\..\MainWindow.xaml"
                this.button_Copy1.Click += new System.Windows.RoutedEventHandler(this.Button_Copy1_Click);

            #line default
            #line hidden
                return;

            case 37:
                this.label_Copy2 = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #41
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 7 "..\..\..\MainWindow.xaml"
                ((ThreeDFaces.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden

            #line 7 "..\..\..\MainWindow.xaml"
                ((ThreeDFaces.MainWindow)(target)).StateChanged += new System.EventHandler(this.Window_StateChanged);

            #line default
            #line hidden
                return;

            case 2:

            #line 12 "..\..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.miEdit_Click);

            #line default
            #line hidden
                return;

            case 3:

            #line 14 "..\..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.miDelete_Click);

            #line default
            #line hidden
                return;

            case 4:

            #line 17 "..\..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.m_iMapping_Click);

            #line default
            #line hidden
                return;

            case 5:

            #line 18 "..\..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.m_iMapping_Click);

            #line default
            #line hidden
                return;

            case 6:

            #line 19 "..\..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.m_iMapping_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.layoutGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 8:
                this.RefImage = ((System.Windows.Controls.Image)(target));

            #line 52 "..\..\..\MainWindow.xaml"
                this.RefImage.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.RefImage_MouseLeftButtonDown1);

            #line default
            #line hidden
                return;

            case 9:
                this.checkNoStretch = ((System.Windows.Controls.CheckBox)(target));

            #line 54 "..\..\..\MainWindow.xaml"
                this.checkNoStretch.Checked += new System.Windows.RoutedEventHandler(this.checkNoStretch_Checked);

            #line default
            #line hidden

            #line 54 "..\..\..\MainWindow.xaml"
                this.checkNoStretch.Unchecked += new System.Windows.RoutedEventHandler(this.checkNoStretch_Unchecked);

            #line default
            #line hidden
                return;

            case 10:
                this.internallayout = ((System.Windows.Controls.Grid)(target));
                return;

            case 11:
                this.Text1 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 12:
                this.Text2 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 13:
                this.Button1 = ((System.Windows.Controls.Button)(target));

            #line 89 "..\..\..\MainWindow.xaml"
                this.Button1.Click += new System.Windows.RoutedEventHandler(this.Button1_Click);

            #line default
            #line hidden
                return;

            case 14:
                this.sliderx = ((System.Windows.Controls.Slider)(target));

            #line 96 "..\..\..\MainWindow.xaml"
                this.sliderx.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slider_ValueChanged);

            #line default
            #line hidden
                return;

            case 15:
                this.slidery = ((System.Windows.Controls.Slider)(target));

            #line 104 "..\..\..\MainWindow.xaml"
                this.slidery.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slider_ValueChanged);

            #line default
            #line hidden
                return;

            case 16:
                this.sliderz = ((System.Windows.Controls.Slider)(target));

            #line 113 "..\..\..\MainWindow.xaml"
                this.sliderz.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slider_ValueChanged);

            #line default
            #line hidden
                return;

            case 17:
                this.Button3 = ((System.Windows.Controls.Button)(target));

            #line 115 "..\..\..\MainWindow.xaml"
                this.Button3.Click += new System.Windows.RoutedEventHandler(this.Button3_Click);

            #line default
            #line hidden
                return;

            case 18:
                this.Button4 = ((System.Windows.Controls.Button)(target));

            #line 117 "..\..\..\MainWindow.xaml"
                this.Button4.Click += new System.Windows.RoutedEventHandler(this.Button4_Click);

            #line default
            #line hidden
                return;

            case 19:
                this.Button5 = ((System.Windows.Controls.Button)(target));

            #line 118 "..\..\..\MainWindow.xaml"
                this.Button5.Click += new System.Windows.RoutedEventHandler(this.Button5_Click);

            #line default
            #line hidden

            #line 118 "..\..\..\MainWindow.xaml"
                this.Button5.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Button5_MouseRightButtonDown);

            #line default
            #line hidden
                return;

            case 20:
                this.Button6 = ((System.Windows.Controls.Button)(target));

            #line 119 "..\..\..\MainWindow.xaml"
                this.Button6.Click += new System.Windows.RoutedEventHandler(this.Button6_Click);

            #line default
            #line hidden

            #line 119 "..\..\..\MainWindow.xaml"
                this.Button6.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Button6_MouseRightButtonDown);

            #line default
            #line hidden
                return;

            case 21:
                this.Button7 = ((System.Windows.Controls.Button)(target));

            #line 120 "..\..\..\MainWindow.xaml"
                this.Button7.Click += new System.Windows.RoutedEventHandler(this.Button7_Click);

            #line default
            #line hidden
                return;

            case 22:
                this.sliderBrightness = ((System.Windows.Controls.Slider)(target));

            #line 121 "..\..\..\MainWindow.xaml"
                this.sliderBrightness.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slider_ValueChanged);

            #line default
            #line hidden
                return;

            case 23:
                this.sliderContrast = ((System.Windows.Controls.Slider)(target));

            #line 129 "..\..\..\MainWindow.xaml"
                this.sliderContrast.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slider_ValueChanged);

            #line default
            #line hidden
                return;

            case 24:
                this.ImageMesh = ((System.Windows.Controls.Image)(target));

            #line 147 "..\..\..\MainWindow.xaml"
                this.ImageMesh.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.ImageMesh_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 25:
                this.chkImageMesh = ((System.Windows.Controls.CheckBox)(target));

            #line 150 "..\..\..\MainWindow.xaml"
                this.chkImageMesh.Checked += new System.Windows.RoutedEventHandler(this.chkImageMesh_Checked);

            #line default
            #line hidden

            #line 150 "..\..\..\MainWindow.xaml"
                this.chkImageMesh.Unchecked += new System.Windows.RoutedEventHandler(this.chkImageMesh_Unchecked);

            #line default
            #line hidden
                return;

            case 26:
                this.chkGrid = ((System.Windows.Controls.CheckBox)(target));

            #line 151 "..\..\..\MainWindow.xaml"
                this.chkGrid.Checked += new System.Windows.RoutedEventHandler(this.chkGrid_Checked);

            #line default
            #line hidden

            #line 151 "..\..\..\MainWindow.xaml"
                this.chkGrid.Unchecked += new System.Windows.RoutedEventHandler(this.chkGrid_Unchecked);

            #line default
            #line hidden
                return;

            case 27:
                this.sliderRed = ((System.Windows.Controls.Slider)(target));

            #line 163 "..\..\..\MainWindow.xaml"
                this.sliderRed.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.sliderColor_ValueChanged);

            #line default
            #line hidden
                return;

            case 28:
                this.sliderGreen = ((System.Windows.Controls.Slider)(target));

            #line 166 "..\..\..\MainWindow.xaml"
                this.sliderGreen.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.sliderColor_ValueChanged);

            #line default
            #line hidden
                return;

            case 29:
                this.sliderBlue = ((System.Windows.Controls.Slider)(target));

            #line 169 "..\..\..\MainWindow.xaml"
                this.sliderBlue.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.sliderColor_ValueChanged);

            #line default
            #line hidden
                return;

            case 30:
                this.labelColor = ((System.Windows.Controls.Label)(target));
                return;

            case 31:
                this.sliderAmb = ((System.Windows.Controls.Slider)(target));

            #line 173 "..\..\..\MainWindow.xaml"
                this.sliderAmb.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.sliderColor_ValueChanged);

            #line default
            #line hidden
                return;

            case 32:
                this.vscrollz = ((System.Windows.Controls.Slider)(target));

            #line 189 "..\..\..\MainWindow.xaml"
                this.vscrollz.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slider_ValueChanged);

            #line default
            #line hidden
                return;

            case 33:
                this.vscroll = ((System.Windows.Controls.Slider)(target));

            #line 198 "..\..\..\MainWindow.xaml"
                this.vscroll.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slider_ValueChanged);

            #line default
            #line hidden
                return;

            case 34:
                this.GridVSnap = ((System.Windows.Controls.Grid)(target));

            #line 200 "..\..\..\MainWindow.xaml"
                this.GridVSnap.PreviewMouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.GridVSnap_PreviewMouseWheel);

            #line default
            #line hidden
                return;

            case 35:
                this.VSnap0 = ((System.Windows.Controls.Image)(target));

            #line 209 "..\..\..\MainWindow.xaml"
                this.VSnap0.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.VSnap_MouseRightButtonDown);

            #line default
            #line hidden

            #line 209 "..\..\..\MainWindow.xaml"
                this.VSnap0.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.VSnap_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 36:
                this.VSnap1 = ((System.Windows.Controls.Image)(target));

            #line 210 "..\..\..\MainWindow.xaml"
                this.VSnap1.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.VSnap_MouseRightButtonDown);

            #line default
            #line hidden

            #line 210 "..\..\..\MainWindow.xaml"
                this.VSnap1.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.VSnap_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 37:
                this.VSnap2 = ((System.Windows.Controls.Image)(target));

            #line 211 "..\..\..\MainWindow.xaml"
                this.VSnap2.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.VSnap_MouseRightButtonDown);

            #line default
            #line hidden

            #line 211 "..\..\..\MainWindow.xaml"
                this.VSnap2.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.VSnap_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 38:
                this.VSnap3 = ((System.Windows.Controls.Image)(target));

            #line 212 "..\..\..\MainWindow.xaml"
                this.VSnap3.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.VSnap_MouseRightButtonDown);

            #line default
            #line hidden

            #line 212 "..\..\..\MainWindow.xaml"
                this.VSnap3.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.VSnap_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 39:
                this.VSnap4 = ((System.Windows.Controls.Image)(target));

            #line 213 "..\..\..\MainWindow.xaml"
                this.VSnap4.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.VSnap_MouseRightButtonDown);

            #line default
            #line hidden

            #line 213 "..\..\..\MainWindow.xaml"
                this.VSnap4.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.VSnap_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 40:
                this.VSnap5 = ((System.Windows.Controls.Image)(target));

            #line 214 "..\..\..\MainWindow.xaml"
                this.VSnap5.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.VSnap_MouseRightButtonDown);

            #line default
            #line hidden

            #line 214 "..\..\..\MainWindow.xaml"
                this.VSnap5.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.VSnap_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 41:
                this.GridFModel = ((System.Windows.Controls.Grid)(target));

            #line 217 "..\..\..\MainWindow.xaml"
                this.GridFModel.PreviewMouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.GridFModel_PreviewMouseWheel);

            #line default
            #line hidden
                return;

            case 42:
                this.FModel0 = ((System.Windows.Controls.Image)(target));

            #line 226 "..\..\..\MainWindow.xaml"
                this.FModel0.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Image_Face_MouseLeftButtonDown);

            #line default
            #line hidden

            #line 227 "..\..\..\MainWindow.xaml"
                this.FModel0.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Image_Face_MouseRightButtonDown);

            #line default
            #line hidden
                return;

            case 43:
                this.FModel1 = ((System.Windows.Controls.Image)(target));

            #line 228 "..\..\..\MainWindow.xaml"
                this.FModel1.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Image_Face_MouseLeftButtonDown);

            #line default
            #line hidden

            #line 229 "..\..\..\MainWindow.xaml"
                this.FModel1.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Image_Face_MouseRightButtonDown);

            #line default
            #line hidden
                return;

            case 44:
                this.FModel2 = ((System.Windows.Controls.Image)(target));

            #line 230 "..\..\..\MainWindow.xaml"
                this.FModel2.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Image_Face_MouseLeftButtonDown);

            #line default
            #line hidden

            #line 231 "..\..\..\MainWindow.xaml"
                this.FModel2.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Image_Face_MouseRightButtonDown);

            #line default
            #line hidden
                return;

            case 45:
                this.FModel3 = ((System.Windows.Controls.Image)(target));

            #line 232 "..\..\..\MainWindow.xaml"
                this.FModel3.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Image_Face_MouseLeftButtonDown);

            #line default
            #line hidden

            #line 233 "..\..\..\MainWindow.xaml"
                this.FModel3.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Image_Face_MouseRightButtonDown);

            #line default
            #line hidden
                return;

            case 46:
                this.FModel4 = ((System.Windows.Controls.Image)(target));

            #line 234 "..\..\..\MainWindow.xaml"
                this.FModel4.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Image_Face_MouseLeftButtonDown);

            #line default
            #line hidden

            #line 235 "..\..\..\MainWindow.xaml"
                this.FModel4.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Image_Face_MouseRightButtonDown);

            #line default
            #line hidden
                return;

            case 47:
                this.FModel5 = ((System.Windows.Controls.Image)(target));

            #line 236 "..\..\..\MainWindow.xaml"
                this.FModel5.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Image_Face_MouseLeftButtonDown);

            #line default
            #line hidden

            #line 237 "..\..\..\MainWindow.xaml"
                this.FModel5.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Image_Face_MouseRightButtonDown);

            #line default
            #line hidden
                return;

            case 48:
                this.MainGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 49:
                this.ColorImage = ((System.Windows.Controls.Image)(target));

            #line 240 "..\..\..\MainWindow.xaml"
                this.ColorImage.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.ColorImage_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

            case 50:
                this.MeshGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 51:
                this.MeshImage = ((System.Windows.Controls.Image)(target));

            #line 242 "..\..\..\MainWindow.xaml"
                this.MeshImage.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.MeshImage_MouseLeftButtonDown);

            #line default
            #line hidden

            #line 242 "..\..\..\MainWindow.xaml"
                this.MeshImage.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.MeshImage_MouseRightButtonDown);

            #line default
            #line hidden
                return;

            case 52:
                this.viewport3d = ((System.Windows.Controls.Viewport3D)(target));

            #line 244 "..\..\..\MainWindow.xaml"
                this.viewport3d.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.viewport3d_MouseDown);

            #line default
            #line hidden

            #line 244 "..\..\..\MainWindow.xaml"
                this.viewport3d.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.viewport3d_MouseRightButtonDown);

            #line default
            #line hidden
                return;

            case 53:
                this.amlight = ((System.Windows.Media.Media3D.AmbientLight)(target));
                return;

            case 54:
                this.dirlight = ((System.Windows.Media.Media3D.DirectionalLight)(target));
                return;

            case 55:
                this.theGeometry = ((System.Windows.Media.Media3D.MeshGeometry3D)(target));
                return;

            case 56:
                this.theMaterial = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;

            case 57:
                this.hscroll = ((System.Windows.Controls.Slider)(target));

            #line 373 "..\..\..\MainWindow.xaml"
                this.hscroll.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slider_ValueChanged);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Example #42
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ligthsComboBox = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 2:
                this.drl = ((System.Windows.Controls.ComboBoxItem)(target));

            #line 47 "..\..\..\Views\MainWindow.xaml"
                this.drl.Selected += new System.Windows.RoutedEventHandler(this.LightSelected);

            #line default
            #line hidden
                return;

            case 3:
                this.aml = ((System.Windows.Controls.ComboBoxItem)(target));

            #line 48 "..\..\..\Views\MainWindow.xaml"
                this.aml.Selected += new System.Windows.RoutedEventHandler(this.LightSelected);

            #line default
            #line hidden
                return;

            case 4:
                this.ptl = ((System.Windows.Controls.ComboBoxItem)(target));

            #line 49 "..\..\..\Views\MainWindow.xaml"
                this.ptl.Selected += new System.Windows.RoutedEventHandler(this.LightSelected);

            #line default
            #line hidden
                return;

            case 5:
                this.spl = ((System.Windows.Controls.ComboBoxItem)(target));

            #line 50 "..\..\..\Views\MainWindow.xaml"
                this.spl.Selected += new System.Windows.RoutedEventHandler(this.LightSelected);

            #line default
            #line hidden
                return;

            case 6:

            #line 52 "..\..\..\Views\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 7:
                this.mainViewport = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 8:
                this.perspectiveCameraEditor = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

            case 9:
                this.LightGroup = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 10:
                this.MaterialGroup = ((System.Windows.Media.Media3D.MaterialGroup)(target));
                return;

            case 11:
                this.DiffuseMaterial = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;

            case 12:
                this.transformGroup = ((System.Windows.Media.Media3D.Transform3DGroup)(target));
                return;

            case 13:
                this.figureRotateTransformationX = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 14:
                this.figureRotateTransformationY = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 15:
                this.figureRotateTransformationZ = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 16:
                this.gridSliderX = ((System.Windows.Controls.Slider)(target));
                return;

            case 17:
                this.gridSliderY = ((System.Windows.Controls.Slider)(target));
                return;

            case 18:
                this.gridSliderZ = ((System.Windows.Controls.Slider)(target));
                return;

            case 19:
                this.objectSliderX = ((System.Windows.Controls.Slider)(target));

            #line 129 "..\..\..\Views\MainWindow.xaml"
                this.objectSliderX.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.ObjectSliderValueChanged);

            #line default
            #line hidden
                return;

            case 20:
                this.objectSliderY = ((System.Windows.Controls.Slider)(target));

            #line 130 "..\..\..\Views\MainWindow.xaml"
                this.objectSliderY.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.ObjectSliderValueChanged);

            #line default
            #line hidden
                return;

            case 21:
                this.objectSliderZ = ((System.Windows.Controls.Slider)(target));

            #line 131 "..\..\..\Views\MainWindow.xaml"
                this.objectSliderZ.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.ObjectSliderValueChanged);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Example #43
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 5 "..\..\Window1.xaml"
                ((WaveSim.Window1)(target)).MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.Window_MouseWheel);

            #line default
            #line hidden
                return;

            case 2:
                this.grid1 = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.btnStart = ((System.Windows.Controls.Button)(target));

            #line 11 "..\..\Window1.xaml"
                this.btnStart.Click += new System.Windows.RoutedEventHandler(this.btnStart_Click);

            #line default
            #line hidden
                return;

            case 4:
                this.viewport3D1 = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 5:
                this.camMain = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

            case 6:
                this.vis3DLighting = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;

            case 7:
                this.dirLightMain = ((System.Windows.Media.Media3D.DirectionalLight)(target));
                return;

            case 8:
                this.gmodMain = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;

            case 9:
                this.meshMain = ((System.Windows.Media.Media3D.MeshGeometry3D)(target));
                return;

            case 10:
                this.matDiffuseMain = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;

            case 11:
                this.slidPeakHeight = ((System.Windows.Controls.Slider)(target));

            #line 53 "..\..\Window1.xaml"
                this.slidPeakHeight.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slidPeakHeight_ValueChanged);

            #line default
            #line hidden
                return;

            case 12:
                this.lblDropDepth = ((System.Windows.Controls.Label)(target));
                return;

            case 13:
                this.slidNumDrops = ((System.Windows.Controls.Slider)(target));

            #line 55 "..\..\Window1.xaml"
                this.slidNumDrops.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slidNumDrops_ValueChanged);

            #line default
            #line hidden
                return;

            case 14:
                this.label1 = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }
Example #44
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.my_viewport = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 2:
                this.dirLightMain = ((System.Windows.Media.Media3D.DirectionalLight)(target));
                return;

            case 3:
                this.Wedge = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;

            case 4:
                this.geometry_model_3d = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;

            case 5:
                this.matDiffuseMain = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;

            case 6:
                this.rotate_x = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 7:
                this.rotate_y = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 8:
                this.rotate_z = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 9:
                this.slider_x = ((System.Windows.Controls.Slider)(target));
                return;

            case 10:
                this.slider_y = ((System.Windows.Controls.Slider)(target));
                return;

            case 11:
                this.slider_z = ((System.Windows.Controls.Slider)(target));
                return;

            case 12:
                this.textbox_b = ((System.Windows.Controls.TextBox)(target));
                return;

            case 13:
                this.textbox_a = ((System.Windows.Controls.TextBox)(target));
                return;

            case 14:
                this.textbox_c = ((System.Windows.Controls.TextBox)(target));
                return;

            case 15:
                this.textbox_d = ((System.Windows.Controls.TextBox)(target));
                return;

            case 16:
                this.build_perspective = ((System.Windows.Controls.Button)(target));

            #line 90 "..\..\MainWindow.xaml"
                this.build_perspective.Click += new System.Windows.RoutedEventHandler(this.Build_perspective_Click);

            #line default
            #line hidden
                return;

            case 17:
                this.Build_ortogonal = ((System.Windows.Controls.Button)(target));

            #line 91 "..\..\MainWindow.xaml"
                this.Build_ortogonal.Click += new System.Windows.RoutedEventHandler(this.Build_ortogonal_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.MainGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 2:

            #line 30 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.CreateCustom3D);

            #line default
            #line hidden
                return;

            case 3:

            #line 33 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.RectCreate);

            #line default
            #line hidden
                return;

            case 4:

            #line 34 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.TriangleCreate);

            #line default
            #line hidden
                return;

            case 5:

            #line 35 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.CircleCreate);

            #line default
            #line hidden
                return;

            case 6:
                this.ligthsComboBox = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 7:
                this.drl = ((System.Windows.Controls.ComboBoxItem)(target));

            #line 39 "..\..\MainWindow.xaml"
                this.drl.Selected += new System.Windows.RoutedEventHandler(this.LightSelected);

            #line default
            #line hidden
                return;

            case 8:
                this.aml = ((System.Windows.Controls.ComboBoxItem)(target));

            #line 40 "..\..\MainWindow.xaml"
                this.aml.Selected += new System.Windows.RoutedEventHandler(this.LightSelected);

            #line default
            #line hidden
                return;

            case 9:
                this.ptl = ((System.Windows.Controls.ComboBoxItem)(target));

            #line 41 "..\..\MainWindow.xaml"
                this.ptl.Selected += new System.Windows.RoutedEventHandler(this.LightSelected);

            #line default
            #line hidden
                return;

            case 10:
                this.spl = ((System.Windows.Controls.ComboBoxItem)(target));

            #line 42 "..\..\MainWindow.xaml"
                this.spl.Selected += new System.Windows.RoutedEventHandler(this.LightSelected);

            #line default
            #line hidden
                return;

            case 11:
                this.cameraBoxer = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 12:
                this.pers = ((System.Windows.Controls.ComboBoxItem)(target));

            #line 46 "..\..\MainWindow.xaml"
                this.pers.Selected += new System.Windows.RoutedEventHandler(this.CameraSelected);

            #line default
            #line hidden
                return;

            case 13:
                this.orth = ((System.Windows.Controls.ComboBoxItem)(target));

            #line 47 "..\..\MainWindow.xaml"
                this.orth.Selected += new System.Windows.RoutedEventHandler(this.CameraSelected);

            #line default
            #line hidden
                return;

            case 14:
                this.DB_Enter_Button = ((System.Windows.Controls.MenuItem)(target));

            #line 49 "..\..\MainWindow.xaml"
                this.DB_Enter_Button.Click += new System.Windows.RoutedEventHandler(this.MenuItem_Click);

            #line default
            #line hidden
                return;

            case 15:
                this.mainViewport = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 16:
                this.perspectiveCameraEditor = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

            case 17:
                this.LightGroup = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 18:
                this.Figures = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;

            case 19:
                this.Figures3D = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 20:
                this.transformGroup = ((System.Windows.Media.Media3D.Transform3DGroup)(target));
                return;

            case 21:
                this.figureRotateTransformationX = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 22:
                this.figureRotateTransformationY = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 23:
                this.figureRotateTransformationZ = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 24:
                this.osLines = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;

            case 25:
                this.OsXMaterial = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;

            case 26:
                this.OsYMaterial = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;

            case 27:
                this.OsZMaterial = ((System.Windows.Media.Media3D.DiffuseMaterial)(target));
                return;

            case 28:
                this.gridSliderX = ((System.Windows.Controls.Slider)(target));
                return;

            case 29:
                this.gridSliderY = ((System.Windows.Controls.Slider)(target));
                return;

            case 30:
                this.gridSliderZ = ((System.Windows.Controls.Slider)(target));
                return;

            case 31:
                this.objectSliderX = ((System.Windows.Controls.Slider)(target));

            #line 153 "..\..\MainWindow.xaml"
                this.objectSliderX.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.ObjectSliderValueChanged);

            #line default
            #line hidden
                return;

            case 32:
                this.objectSliderY = ((System.Windows.Controls.Slider)(target));

            #line 154 "..\..\MainWindow.xaml"
                this.objectSliderY.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.ObjectSliderValueChanged);

            #line default
            #line hidden
                return;

            case 33:
                this.objectSliderZ = ((System.Windows.Controls.Slider)(target));

            #line 155 "..\..\MainWindow.xaml"
                this.objectSliderZ.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.ObjectSliderValueChanged);

            #line default
            #line hidden
                return;

            case 34:
                this.FiguresList3D = ((System.Windows.Controls.ComboBox)(target));

            #line 159 "..\..\MainWindow.xaml"
                this.FiguresList3D.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.FiguresList3D_SelectionChanged);

            #line default
            #line hidden
                return;

            case 35:
                this.Updater = ((System.Windows.Controls.Button)(target));

            #line 161 "..\..\MainWindow.xaml"
                this.Updater.Click += new System.Windows.RoutedEventHandler(this.UpdateFigure);

            #line default
            #line hidden
                return;

            case 36:
                this.Deleter = ((System.Windows.Controls.Button)(target));

            #line 162 "..\..\MainWindow.xaml"
                this.Deleter.Click += new System.Windows.RoutedEventHandler(this.DeleteFigure);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Example #46
0
        /// <summary>
        /// Replaces any instances of the sentinal brush with the internal brush
        /// </summary>
        /// <param name="material">The material to look through</param>
        private void SwapInCyclicBrush(Material material)
        {
            int numMaterialsSwapped        = 0;
            Stack <Material> materialStack = new Stack <Material>();

            materialStack.Push(material);

            Brush internalBrush = (CacheMode as BitmapCache != null) ? (Brush)InternalBitmapCacheBrush : (Brush)InternalVisualBrush;

            while (materialStack.Count > 0)
            {
                Material currMaterial = materialStack.Pop();

                if (currMaterial is DiffuseMaterial)
                {
                    DiffuseMaterial diffMaterial = (DiffuseMaterial)currMaterial;
                    if ((Boolean)diffMaterial.GetValue(Viewport2DVisual3D.IsVisualHostMaterialProperty))
                    {
                        diffMaterial.Brush = internalBrush;
                        numMaterialsSwapped++;
                    }
                }
                else if (currMaterial is EmissiveMaterial)
                {
                    EmissiveMaterial emmMaterial = (EmissiveMaterial)currMaterial;
                    if ((Boolean)emmMaterial.GetValue(Viewport2DVisual3D.IsVisualHostMaterialProperty))
                    {
                        emmMaterial.Brush = internalBrush;
                        numMaterialsSwapped++;
                    }
                }
                else if (currMaterial is SpecularMaterial)
                {
                    SpecularMaterial specMaterial = (SpecularMaterial)currMaterial;
                    if ((Boolean)specMaterial.GetValue(Viewport2DVisual3D.IsVisualHostMaterialProperty))
                    {
                        specMaterial.Brush = internalBrush;
                        numMaterialsSwapped++;
                    }
                }
                else if (currMaterial is MaterialGroup)
                {
                    MaterialGroup matGroup = (MaterialGroup)currMaterial;

                    // the IsVisualHostMaterialProperty should not be set on a MaterialGroup - verify that
                    if ((Boolean)matGroup.GetValue(Viewport2DVisual3D.IsVisualHostMaterialProperty))
                    {
                        throw new ArgumentException(SR.Get(SRID.Viewport2DVisual3D_MaterialGroupIsInteractiveMaterial), "material");
                    }

                    // iterate over the children and put them on the stack of materials to modify
                    MaterialCollection children = matGroup.Children;

                    if (children != null)
                    {
                        for (int i = 0, count = children.Count; i < count; i++)
                        {
                            Material m = children[i];
                            materialStack.Push(m);
                        }
                    }
                }
                else
                {
                    Invariant.Assert(true, "Unexpected Material type encountered.  V2DV3D handles DiffuseMaterial, EmissiveMaterial, SpecularMaterial, and MaterialGroup.");
                }
            }

            // throw if there is more than 1 interactive material
            if (numMaterialsSwapped > 1)
            {
                throw new ArgumentException(SR.Get(SRID.Viewport2DVisual3D_MultipleInteractiveMaterials), "material");
            }
        }