Пример #1
1
        public Model3DGroup Create(Color modelColor,string pictureName, Point3D startPos, double maxHigh)
        {
            try
            {
                Uri inpuri = new Uri(@pictureName, UriKind.Relative);
                BitmapImage bi = new BitmapImage();
                bi.BeginInit();
                bi.UriSource = inpuri;
                bi.EndInit();
                ImageBrush imagebrush = new ImageBrush(bi);
                imagebrush.Opacity = 100;
                imagebrush.Freeze();

                Point[] ptexture0 = { new Point(0, 0), new Point(0, 1), new Point(1, 0) };
                Point[] ptexture1 = { new Point(1, 0), new Point(0, 1), new Point(1, 1) };

                SolidColorBrush modelbrush = new SolidColorBrush(modelColor);
                Model3DGroup cube = new Model3DGroup();
                Point3D uppercircle = startPos;
                modelbrush.Freeze();
                uppercircle.Y = startPos.Y + maxHigh;
                cube.Children.Add(CreateEllipse2D(modelbrush, uppercircle, _EllipseHigh, new Vector3D(0, 1, 0)));
                cube.Children.Add(CreateEllipse2D(modelbrush, startPos, _EllipseHigh, new Vector3D(0, -1, 0)));
                cube.Children.Add(CreateEllipse3D(imagebrush, startPos, _EllipseHigh, maxHigh, ptexture0));
                return cube;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #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;           
        }
Пример #3
0
        static public PortalObject createPortalObject(PortalObjectType objectType,
                                                      string objectName, 
                                                      Point3D points,
                                                      ref Model3DGroup modelGroup)
        {
            PortalObject portalObject = null;

            switch (objectType)
            {
                case PortalObjectType.E_STOP:
                    portalObject = new EStopSensor(objectName, points, ref modelGroup);
                    break;
                case PortalObjectType.LIGHT_CURTAIN_INTERLOCKS:
                    portalObject = new LightCurtainInterlock(objectName, points, ref modelGroup);
                    break;
                case PortalObjectType.MOTION_DETECTOR_SENSORS:
                    portalObject = new MotionDetector(objectName, points, ref modelGroup);
                    break;
                case PortalObjectType.TRAFFIC_LIGHTS:
                    portalObject = new TrafficLight(objectName, points, ref modelGroup);
                    break;
                case PortalObjectType.VEHICLE_SENSORS:
                    portalObject = new VehicleSensor(objectName, points, ref modelGroup);
                    break;
                default:
                    break;
            }

            return portalObject;
        }
 /// <summary>
 /// Loads a model from a (WPF-) ResourceDictionary
 /// </summary>
 /// <param name="resourceDictionary">A (WPF-)  ResourceDictionary to load the model from</param>
 /// <param name="index">the name/key/index of the model to load</param>
 public BlenderModel(ResourceDictionary resourceDictionary, String index)
 {
     model3DGroup = resourceDictionary[index] as Model3DGroup;
     modelVisual3D = new ModelVisual3D();
     modelVisual3D.Content = model3DGroup;
     this.index = index;
 }
Пример #5
0
        public Skeleton3d(Model3DGroup environment)
        {
            if (environment == null)
                throw new NullReferenceException("No 3d environment for skeleton given!");

            _environment = environment;
        }
        public void UpdateModel()
        {
            CreateGeometry();
            var c = new Model3DGroup();
            var mat = MaterialHelper.CreateMaterial(Fill);
            double l = HeadLength * Diameter;

            for (int i = 0; i < Positions.Count; i++)
            {
                var p = Positions[i];
                var d = Directions[i];
                var headModel = new GeometryModel3D
                                    {
                                        Geometry = _head,
                                        Material = mat,
                                        Transform = CreateHeadTransform(p + d, d)
                                    };
                c.Children.Add(headModel);

                var u = d;
                u.Normalize();
                var bodyModel = new GeometryModel3D
                                    {
                                        Geometry = _body,
                                        Material = mat,
                                        Transform = CreateBodyTransform(p, u*(1.0 - l/d.Length))
                                    };
                c.Children.Add(bodyModel);

            }

            _element.Content = c;
        }
        public VisualisationWindow(Interferometry.math_classes.ZArrayDescriptor array)
        {
            InitializeComponent();

            // prepare points
            Point3D[,] points = new Point3D[array.width, array.height];
            for (int i = 0; i < array.width; ++i)
                for (int j = 0; j < array.height; ++j)
                    points[i, j] = new Point3D(i, array.array[i][j], j);

            // build model
            Model3DGroup surface = new Model3DGroup();
            for (int i = 0; i < array.width - 1; ++i)
            {
                for (int j = 0; j < array.height - 1; ++j)
                {
                    surface.Children.Add(createTriangle(points[i, j], points[i + 1, j], points[i, j + 1]));
                    surface.Children.Add(createTriangle(points[i, j + 1], points[i + 1, j], points[i, j]));

                    surface.Children.Add(createTriangle(points[i, j + 1], points[i + 1, j], points[i + 1, j + 1]));
                    surface.Children.Add(createTriangle(points[i + 1, j + 1], points[i + 1, j], points[i, j + 1]));
                }
                System.Console.WriteLine("buidling on row: " + i + "/" + array.width);
            }
            System.Console.WriteLine("model building done");

            ModelVisual3D model = new ModelVisual3D();
            model.Content = surface;
            this.mainViewport.Children.Add(model);
        }
Пример #8
0
        ///////////////////////////////////////////////////////////////
        // Create switch command for various sections, split code into separate objects / function of 3D drawing for each type
        /////////////////////////////////////////////////
        // Tutorial
        /// http://kindohm.com/technical/WPF3DTutorial.htm  ScreenSpaceLines3D
        /// <summary>
        /// ///////////////////////////////////////////////////////
        /// MAIN CONSTRUCTOR
        /// ///////////////////////////////////////////////////////
        /// </summary>
        //---------------------------------------------------------------------------------------------
        //---------------------------------------------------------------------------------------------
        //---------------------------------------------------------------------------------------------
        public Window2(bool bDebugging)
        {
            InitializeComponent();

              Model3DGroup gr = new Model3DGroup();
              //gr.Children.Add(new AmbientLight());

              GeometryModel3D SolidModel3D = new GeometryModel3D();
              MeshGeometry3D mesh = new MeshGeometry3D();
              mesh.Positions = new Point3DCollection();

              //ScreenSpaceLines3D line = new ScreenSpaceLines3D();
              //line.Color = Color.FromRgb(0,255,0);
              //line.Points.Add(mesh.Positions[0]);
              //line.Points.Add(mesh.Positions[1]);

              //Viewport3D view = new Viewport3D();
              //view.Children.Add(line);

              //gr.Children.Add(new AmbientLight());
              SolidModel3D.Geometry = mesh;
              SolidColorBrush br = new SolidColorBrush(Color.FromRgb(255, 0, 0));
              SolidModel3D.Material = new DiffuseMaterial(br);

              gr.Children.Add(SolidModel3D); // Add solid to model group

              _trackport.Model = (Model3D)gr; //CreateRectangle(p3, p2, p6, p7, Brushes.Red);

              _trackport.Trackball.TranslateScale = 1000;   //step for moving object (panning)

              _trackport.SetupScene();
        }
Пример #9
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;
        }
Пример #10
0
        public GeometryModel3D[] render()
        {
            Model3DGroup modelGroup     = new Model3DGroup();
            Viewport3D visualisation    = new Viewport3D();
            ModelVisual3D modelsVisual  = new ModelVisual3D();
            int depthPoint              = 0;

            //Setup viewport environment
            init = new ViewportCalibrator(this.cp);
            visualisation = init.setupViewport(init.setupCamera(), this.cp.ActualHeight, this.cp.ActualWidth);

            //Create triangle mesh
            for (int y = 0; y < 480; y += pos)
            {
                for (int x = 0; x < 640; x += pos)
                {
                    pts[depthPoint] = Triangle(x, y, pos);
                    pts[depthPoint].Transform = new TranslateTransform3D(0, 0, 0);
                    modelGroup.Children.Add(pts[depthPoint]);
                    depthPoint++;
                }
            }

            //Add mesh to visualisation and viewport/canvas
            modelGroup.Children.Add(init.setupDirectionalLights(Colors.White));
            modelsVisual.Content = modelGroup;
            visualisation.Children.Add(modelsVisual);
            cp.Children.Add(visualisation);

            Canvas.SetTop(visualisation, 0);
            Canvas.SetLeft(visualisation, 0);

            return pts;
        }
Пример #11
0
 //Creates a cube centred about the origin with the specified diameter.
 public static Model3DGroup makeCube(double diameter, Color colour)
 {
     Model3DGroup cube = new Model3DGroup();
     Point3D p0 = new Point3D(-diameter / 2, -diameter / 2, -diameter / 2);
     Point3D p1 = new Point3D(diameter / 2, -diameter / 2, -diameter / 2);
     Point3D p2 = new Point3D(diameter / 2, -diameter / 2, diameter / 2);
     Point3D p3 = new Point3D(-diameter / 2, -diameter / 2, diameter / 2);
     Point3D p4 = new Point3D(-diameter / 2, diameter / 2, -diameter / 2);
     Point3D p5 = new Point3D(diameter / 2, diameter / 2, -diameter / 2);
     Point3D p6 = new Point3D(diameter / 2, diameter / 2, diameter / 2);
     Point3D p7 = new Point3D(-diameter / 2, diameter / 2, diameter / 2);
     //front side triangles
     cube.Children.Add(Shapes.makeTriangle(p3, p2, p6, colour));
     cube.Children.Add(Shapes.makeTriangle(p3, p6, p7, colour));
     //right side triangles
     cube.Children.Add(Shapes.makeTriangle(p2, p1, p5, colour));
     cube.Children.Add(Shapes.makeTriangle(p2, p5, p6, colour));
     //back side triangles
     cube.Children.Add(Shapes.makeTriangle(p1, p0, p4, colour));
     cube.Children.Add(Shapes.makeTriangle(p1, p4, p5, colour));
     //left side triangles
     cube.Children.Add(Shapes.makeTriangle(p0, p3, p7, colour));
     cube.Children.Add(Shapes.makeTriangle(p0, p7, p4, colour));
     //top side triangles
     cube.Children.Add(Shapes.makeTriangle(p7, p6, p5, colour));
     cube.Children.Add(Shapes.makeTriangle(p7, p5, p4, colour));
     //bottom side triangles
     cube.Children.Add(Shapes.makeTriangle(p2, p3, p0, colour));
     cube.Children.Add(Shapes.makeTriangle(p2, p0, p1, colour));
     return cube;
 }
        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;
        }
Пример #13
0
    /// <summary>
    /// Show the Editor UI
    /// </summary>
    public void ShowEditor()
    {
      // Collision stuff for highlights during testing
      CollisionTimes = new List<List<DateTime>>();
      CollisionStates = new List<JointCollisionStates[]>();
      CollisionHighlights_3D = new Model3DGroup();
      foreach (Gesture gg in GestureCollection)
      {
        CollisionTimes.Add(new List<DateTime>());
        foreach (GestureFrame f in gg.Frames) CollisionTimes.Last().Add(new DateTime());
        CollisionStates.Add(new JointCollisionStates[2] { JointCollisionStates.OutThere, JointCollisionStates.OutThere });
        CollisionHighlights_3D.Children.Add(new Model3DGroup());
      }
      HotspotCellsModelVisual3D_Hit_Editor.Content = CollisionHighlights_3D;

      // Initialize variable to store the initial state of the Gesture.Command being set
      CommandBackup = new ObservableCollection<Key>();

      EnableKinect_Editor();

      EditorVisible = true;

      FramesListBox.SelectedIndex = 0; // Reset Frame selection

      // Kill keyboard control on 3D grid
      EventLogic.RemoveRoutedEventHandlers(ViewPort3D_Editor.CameraController, HelixToolkit.Wpf.CameraController.KeyDownEvent);
    }
Пример #14
0
 //Join two shapes together to form one combined shape (AKA group):
 //Note that both shapes are children of the returned shape:
 public static Model3DGroup combine(Model3DGroup shape1, Model3DGroup shape2)
 {
     Model3DGroup parent = new Model3DGroup();
     parent.Children.Add(shape1);
     parent.Children.Add(shape2);
     return parent;
 }
Пример #15
0
		public VisualTree3DView(Visual visual)
		{
			DirectionalLight directionalLight1 = new DirectionalLight(Colors.White, new Vector3D(0, 0, 1));
			DirectionalLight directionalLight2 = new DirectionalLight(Colors.White, new Vector3D(0, 0, -1));

			double z = 0;
			Model3D model = this.ConvertVisualToModel3D(visual, ref z);

			Model3DGroup group = new Model3DGroup();
			group.Children.Add(directionalLight1);
			group.Children.Add(directionalLight2);
			group.Children.Add(model);
			this.zScaleTransform = new ScaleTransform3D();
			group.Transform = this.zScaleTransform;

			ModelVisual3D modelVisual = new ModelVisual3D();
			modelVisual.Content = group;

			Rect3D bounds = model.Bounds;
			double fieldOfView = 45;
			Point3D lookAtPoint = new Point3D(bounds.X + bounds.SizeX / 2, bounds.Y + bounds.SizeY / 2, bounds.Z + bounds.SizeZ / 2);
			double cameraDistance = 0.5 * bounds.SizeX / Math.Tan(0.5 * fieldOfView * Math.PI / 180);
			Point3D position = lookAtPoint - new Vector3D(0, 0, cameraDistance);
			Camera camera = new PerspectiveCamera(position, new Vector3D(0, 0, 1), new Vector3D(0, -1, 0), fieldOfView);

			this.zScaleTransform.CenterZ = lookAtPoint.Z;

			this.Children.Add(modelVisual);
			this.Camera = camera;
			this.ClipToBounds = false;
			this.Width = 500;
			this.Height = 500;

			this.trackballBehavior = new TrackballBehavior(this, lookAtPoint);
		}
Пример #16
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);
        }
Пример #17
0
        public FlipTransition()
        {
            _viewport = TransitionResources["3DCube"] as Viewport3D;

            _rootModel = (_viewport.Children[0] as ModelVisual3D).Content as Model3DGroup;
            _cubeModelContainer = _rootModel.Children[1] as Model3DGroup;
        }
        public ModelVisual3D dibujaCubo(Point3D[] puntos)
        {
            if (puntos.Length == 8)
            {
                Model3DGroup cube = new Model3DGroup();
                cube.Children.Add(CreateTriangleModel(puntos[3], puntos[2], puntos[6]));
                cube.Children.Add(CreateTriangleModel(puntos[3], puntos[6], puntos[7]));

                cube.Children.Add(CreateTriangleModel(puntos[2], puntos[1], puntos[5]));
                cube.Children.Add(CreateTriangleModel(puntos[2], puntos[5], puntos[6]));

                cube.Children.Add(CreateTriangleModel(puntos[1], puntos[0], puntos[4]));
                cube.Children.Add(CreateTriangleModel(puntos[1], puntos[4], puntos[5]));

                cube.Children.Add(CreateTriangleModel(puntos[0], puntos[3], puntos[7]));
                cube.Children.Add(CreateTriangleModel(puntos[0], puntos[7], puntos[4]));

                cube.Children.Add(CreateTriangleModel(puntos[7], puntos[6], puntos[5]));
                cube.Children.Add(CreateTriangleModel(puntos[7], puntos[5], puntos[4]));

                cube.Children.Add(CreateTriangleModel(puntos[2], puntos[3], puntos[0]));
                cube.Children.Add(CreateTriangleModel(puntos[2], puntos[0], puntos[1]));
                ModelVisual3D modelo = new ModelVisual3D();
                modelo.Content = cube;
                return modelo;
            }
            return null;
        }
Пример #19
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainViewModel"/> class.
        /// </summary>
        public MainViewModel()
        {
            // Create a model group
            var modelGroup = new Model3DGroup();

            // Create a mesh builder and add a box to it
            var meshBuilder = new MeshBuilder(false, false);
            meshBuilder.AddBox(new Point3D(0, 0, 1), 1, 2, 0.5);
            meshBuilder.AddBox(new Rect3D(0, 0, 1.2, 0.5, 1, 0.4));

            // Create a mesh from the builder (and freeze it)
            var mesh = meshBuilder.ToMesh(true);

            // Create some materials
            var greenMaterial = MaterialHelper.CreateMaterial(Colors.Green);
            var redMaterial = MaterialHelper.CreateMaterial(Colors.Red);
            var blueMaterial = MaterialHelper.CreateMaterial(Colors.Blue);
            var insideMaterial = MaterialHelper.CreateMaterial(Colors.Yellow);

            // Add 3 models to the group (using the same mesh, that's why we had to freeze it)
            modelGroup.Children.Add(new GeometryModel3D { Geometry = mesh, Material = greenMaterial, BackMaterial = insideMaterial });
            modelGroup.Children.Add(new GeometryModel3D { Geometry = mesh, Transform = new TranslateTransform3D(-2, 0, 0), Material = redMaterial, BackMaterial = insideMaterial });
            modelGroup.Children.Add(new GeometryModel3D { Geometry = mesh, Transform = new TranslateTransform3D(2, 0, 0), Material = blueMaterial, BackMaterial = insideMaterial });

            //// Set the property, which will be bound to the Content property of the ModelVisual3D (see MainWindow.xaml)
            //AxisAngleRotation3D rotateAxis = new AxisAngleRotation3D(new Vector3D(0, 1, 0), 180/*or 360*/);
            //Rotation3DAnimation rotateAnimation = new Rotation3DAnimation(rotateAxis, TimeSpan.FromSeconds(2));

            //var rotateTransform = new RotateTransform3D();
            //rotateTransform.BeginAnimation(RotateTransform3D.RotationProperty, rotateAnimation);

            //modelGroup.Transform = rotateTransform;

            this.Model = modelGroup;
        }
 public OpacitySortingVisual3D()
 {
     opaqueChildren = new Model3DGroup();
     transparentChildren = new Model3DGroup();
     Children.Add(new ModelVisual3D { Content = opaqueChildren });
     Children.Add(new ModelVisual3D { Content = transparentChildren });
 }
Пример #21
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;  
        }
Пример #22
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MainViewModel"/> class.
        /// </summary>
        public MainViewModel()
        {
            // Create a model group
            var modelGroup = new Model3DGroup();

            // Create a mesh builder and add a box to it
            var meshBuilder = new MeshBuilder(false, false);
            meshBuilder.AddBox(new Point3D(0, 0, 1), 1, 2, 0.5);
            meshBuilder.AddBox(new Rect3D(0, 0, 1.2, 0.5, 1, 0.4));

            // Create a mesh from the builder (and freeze it)
            var mesh = meshBuilder.ToMesh(true);

            // Create some materials
            var greenMaterial = MaterialHelper.CreateMaterial(Colors.Green);
            var redMaterial = MaterialHelper.CreateMaterial(Colors.Red);
            var blueMaterial = MaterialHelper.CreateMaterial(Colors.Blue);
            var insideMaterial = MaterialHelper.CreateMaterial(Colors.Yellow);

            // Add 3 models to the group (using the same mesh, that's why we had to freeze it)
            modelGroup.Children.Add(new GeometryModel3D { Geometry = mesh, Material = greenMaterial, BackMaterial = insideMaterial });
            modelGroup.Children.Add(new GeometryModel3D { Geometry = mesh, Transform = new TranslateTransform3D(-2, 0, 0), Material = redMaterial, BackMaterial = insideMaterial });
            modelGroup.Children.Add(new GeometryModel3D { Geometry = mesh, Transform = new TranslateTransform3D(2, 0, 0), Material = blueMaterial, BackMaterial = insideMaterial });

            // Set the property, which will be bound to the Content property of the ModelVisual3D (see MainWindow.xaml)
            this.Model = modelGroup;
        }
        public static GeometryModel3D CreateNormalizedCube(Material material)
        {
            MeshGeometry3D geometry = new MeshGeometry3D();

            var farPoint = new Point3D(-0.5, -0.5, -0.5);
            var nearPoint = new Point3D(0.5, 0.5, 0.5);

            var cube = new Model3DGroup();
            var p0 = new Point3D(farPoint.X, farPoint.Y, farPoint.Z);
            var p1 = new Point3D(nearPoint.X, farPoint.Y, farPoint.Z);
            var p2 = new Point3D(nearPoint.X, farPoint.Y, nearPoint.Z);
            var p3 = new Point3D(farPoint.X, farPoint.Y, nearPoint.Z);
            var p4 = new Point3D(farPoint.X, nearPoint.Y, farPoint.Z);
            var p5 = new Point3D(nearPoint.X, nearPoint.Y, farPoint.Z);
            var p6 = new Point3D(nearPoint.X, nearPoint.Y, nearPoint.Z);
            var p7 = new Point3D(farPoint.X, nearPoint.Y, nearPoint.Z);
            int startIndex = 0;
            startIndex = AddTriangleFace(geometry, p3, p2, p6, startIndex);
            startIndex = AddTriangleFace(geometry, p3, p6, p7, startIndex);
            startIndex = AddTriangleFace(geometry, p2, p1, p5, startIndex);
            startIndex = AddTriangleFace(geometry, p2, p5, p6, startIndex);
            startIndex = AddTriangleFace(geometry, p1, p0, p4, startIndex);
            startIndex = AddTriangleFace(geometry, p1, p4, p5, startIndex);
            startIndex = AddTriangleFace(geometry, p0, p3, p7, startIndex);
            startIndex = AddTriangleFace(geometry, p0, p7, p4, startIndex);
            startIndex = AddTriangleFace(geometry, p7, p6, p5, startIndex);
            startIndex = AddTriangleFace(geometry, p7, p5, p4, startIndex);
            startIndex = AddTriangleFace(geometry, p2, p3, p0, startIndex);
            startIndex = AddTriangleFace(geometry, p2, p0, p1, startIndex);

            return new GeometryModel3D(geometry, material);
        }
Пример #24
0
        private static Model3DGroup CreateCubeGroup(int width, int height, int depth)
        {
            Model3DGroup cube = new Model3DGroup();
            Point3D p0 = new Point3D(width / -2.0, height / -2.0, depth / -2.0);
            Point3D p1 = new Point3D(p0.X + width, p0.Y, p0.Z);
            Point3D p2 = new Point3D(p0.X + width, p0.Y, p0.Z + depth);
            Point3D p3 = new Point3D(p0.X, p0.Y, p0.Z + depth);
            Point3D p4 = new Point3D(p0.X, p0.Y + height, p0.Z);
            Point3D p5 = new Point3D(p0.X + width, p0.Y + height, p0.Z);
            Point3D p6 = new Point3D(p0.X + width, p0.Y + height, p0.Z + depth);
            Point3D p7 = new Point3D(p0.X, p0.Y + height, p0.Z + depth);
            //front side triangles
            cube.Children.Add(CreateTriangleModel(p3, p2, p6, Colors.Red));
            cube.Children.Add(CreateTriangleModel(p3, p6, p7, Colors.Red));
            //right side triangles
            cube.Children.Add(CreateTriangleModel(p2, p1, p5, Colors.Green));
            cube.Children.Add(CreateTriangleModel(p2, p5, p6, Colors.Green));
            //back side triangles
            cube.Children.Add(CreateTriangleModel(p1, p0, p4, Colors.Blue));
            cube.Children.Add(CreateTriangleModel(p1, p4, p5, Colors.Blue));
            //left side triangles
            cube.Children.Add(CreateTriangleModel(p0, p3, p7, Colors.Yellow));
            cube.Children.Add(CreateTriangleModel(p0, p7, p4, Colors.Yellow));
            //top side triangles
            cube.Children.Add(CreateTriangleModel(p7, p6, p5, Colors.Cyan));
            cube.Children.Add(CreateTriangleModel(p7, p5, p4, Colors.Cyan));
            //bottom side triangles
            cube.Children.Add(CreateTriangleModel(p2, p3, p0, Colors.Magenta));
            cube.Children.Add(CreateTriangleModel(p2, p0, p1, Colors.Magenta));

            return cube;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 4 "..\..\MainWindow.xaml"
                ((Ch15_Triangulation_3DViewer.MainWindow)(target)).KeyDown += new System.Windows.Input.KeyEventHandler(this.KeyDownEventHandler);

            #line default
            #line hidden
                return;

            case 2:
                this.info = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 3:
                this.viewport = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 4:
                this.camera = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

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

            case 6:
                this.group = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #26
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;
        }
Пример #27
0
        public static IPrimaryModel FromIDictionary(IDictionary source, IFactory factory)
        {
            if (source == null) return null;

            var itypeName = factory.Create<ITypeName>(source,null);
            if (itypeName != null)
            {
                var typeName = itypeName.TypeName;
                if (!IgnoreTypes.Contains(typeName))
                {
                    var model3D = factory.Create<Model3D>(typeName, null);
                    if (model3D != null)
                    {
                        var material = GetMaterial(source, factory);
                        if (material != null)
                        {
                            var geoModel = model3D as GeometryModel3D;
                            if (geoModel != null)
                            {
                                geoModel.Material = material;
                            }
                        }
                        var model3DGroup = new Model3DGroup { Transform = GetTransform(source, factory) };
                        model3DGroup.Children.Add(model3D);
                        return new PrimaryModel { Model3D = model3DGroup };
                    }
                }
            }
            return null;
        }
Пример #28
0
        public static void drawTor(Point3D center, double R, double r, int N, int n, Color color, Viewport3D mainViewport)
        {
            if (n < 2 || N < 2)
              {
            return;
              }

              Model3DGroup tor = new Model3DGroup();
              Point3D[,] points = new Point3D[N, n];

              for (int i = 0; i < N; i++)
              {
            for (int j = 0; j < n; j++)
            {
              points[i, j] = getPositionTor(R, r, i * 360 / (N - 1), j * 360 / (n - 1));
              points[i, j] += (Vector3D)center;
            }
              }

              Point3D[] p = new Point3D[4];
              for (int i = 0; i < N - 1; i++)
              {
            for (int j = 0; j < n - 1; j++)
            {
              p[0] = points[i, j];
              p[1] = points[i + 1, j];
              p[2] = points[i + 1, j + 1];
              p[3] = points[i, j + 1];
              drawTriangle(p[0], p[1], p[2], color, mainViewport);
              drawTriangle(p[2], p[3], p[0], color, mainViewport);

            }
              }
        }
Пример #29
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;
        }
Пример #30
0
 //Given a 3d object, it will apply the transform to it and return the new object. Note that it will not
 //overwrite the objects current transformation:
 public static Model3DGroup applyTransform(Model3DGroup obj, Transform3D transform)
 {
     Model3DGroup newObj = new Model3DGroup();
     newObj.Children.Add(obj);
     newObj.Transform = transform;
     return newObj;
 }
Пример #31
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.UserControl = ((VIDGS配置软件.Viewport3DControl)(target));
                return;

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

            case 3:
                this.viewPort3D = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 4:
                this.model3DGroup = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 5:
                this.contentView = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #32
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 10 "..\..\Window3D.xaml"
                ((System.Windows.Controls.Grid)(target)).MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.Grid_MouseWheel);

            #line default
            #line hidden

            #line 11 "..\..\Window3D.xaml"
                ((System.Windows.Controls.Grid)(target)).MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseDown);

            #line default
            #line hidden

            #line 11 "..\..\Window3D.xaml"
                ((System.Windows.Controls.Grid)(target)).MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseUp);

            #line default
            #line hidden

            #line 12 "..\..\Window3D.xaml"
                ((System.Windows.Controls.Grid)(target)).MouseMove += new System.Windows.Input.MouseEventHandler(this.Grid_MouseMove);

            #line default
            #line hidden
                return;

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

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

            #line default
            #line hidden
                return;

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

            case 4:
                this.camera = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

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

            case 6:
                this.group = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #33
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 9 "..\..\Visualizer.xaml"
                ((VisualizerControl.Visualizer)(target)).MouseMove += new System.Windows.Input.MouseEventHandler(this.MyViewport_MouseMove);

            #line default
            #line hidden

            #line 10 "..\..\Visualizer.xaml"
                ((VisualizerControl.Visualizer)(target)).MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.MyViewport_MouseLeftButtonUp);

            #line default
            #line hidden

            #line 10 "..\..\Visualizer.xaml"
                ((VisualizerControl.Visualizer)(target)).MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.MyViewport_MouseWheel);

            #line default
            #line hidden

            #line 11 "..\..\Visualizer.xaml"
                ((VisualizerControl.Visualizer)(target)).KeyDown += new System.Windows.Input.KeyEventHandler(this.UserControl_KeyDown);

            #line default
            #line hidden
                return;

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

            #line 17 "..\..\Visualizer.xaml"
                this.myViewport.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.MyViewport_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

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

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

            case 5:
                this.Group = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 25 "..\..\Materials.xaml"
                ((System.Windows.Controls.StackPanel)(target)).AddHandler(System.Windows.Controls.Primitives.ButtonBase.ClickEvent, new System.Windows.RoutedEventHandler(this.chk_Click));

            #line default
            #line hidden
                return;

            case 2:
                this.chkBackground = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 3:
                this.chkDiffuse = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 4:
                this.chkSpecular = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 5:
                this.chkEmissive = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 6:
                this.rect = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 7:
                this.camera = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

            case 8:
                this.Scene = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

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

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

            case 11:
                this.materialsGroup = ((System.Windows.Media.Media3D.MaterialGroup)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #35
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 9 "..\..\..\View\ShapePreview3D.xaml"
                ((JsdEditor.ShapePreview3D)(target)).Loaded += new System.Windows.RoutedEventHandler(this.UserControl_Loaded);

            #line default
            #line hidden

            #line 10 "..\..\..\View\ShapePreview3D.xaml"
                ((JsdEditor.ShapePreview3D)(target)).MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.UserControl_MouseWheel);

            #line default
            #line hidden
                return;

            case 2:

            #line 46 "..\..\..\View\ShapePreview3D.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);

            #line default
            #line hidden
                return;

            case 3:
                this.b = ((System.Windows.Controls.Border)(target));
                return;

            case 4:
                this.mgRoot = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 5:
                this.mgShape = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

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

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

            case 8:
                this.anrZ = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #36
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.World = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 2:
                this.WorldModels = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #37
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 9 "..\..\..\View\ShapeView3D.xaml"
                ((JsdEditor.ShapeView3D)(target)).MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.UserControl_MouseWheel);

            #line default
            #line hidden
                return;

            case 2:
                this.mgRoot = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 3:
                this.mgShape = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 4:
                this.anrX = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

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

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

            case 7:

            #line 140 "..\..\..\View\ShapeView3D.xaml"
                ((System.Windows.Controls.CheckBox)(target)).Checked += new System.Windows.RoutedEventHandler(this.TransparencyCheckBox_Checked);

            #line default
            #line hidden

            #line 141 "..\..\..\View\ShapeView3D.xaml"
                ((System.Windows.Controls.CheckBox)(target)).Unchecked += new System.Windows.RoutedEventHandler(this.TransparencyCheckBox_Checked);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Пример #38
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mainViewport = ((System.Windows.Controls.Viewport3D)(target));
                return;

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

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

            case 4:
                this.scale = ((System.Windows.Media.Media3D.ScaleTransform3D)(target));
                return;

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

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

            case 7:
                this.translate = ((System.Windows.Media.Media3D.TranslateTransform3D)(target));
                return;

            case 8:
                this.model3DGroup = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 9:
                this.geometryModel = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;

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

            case 11:
                this.meshBack = ((System.Windows.Media.Media3D.MeshGeometry3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #39
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.camera = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

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

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

            case 4:
                this.cube = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 5:
                this.F1 = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;

            case 6:
                this.F2 = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;

            case 7:
                this.F3 = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;

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

            case 9:
                this.F5 = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;

            case 10:
                this.F6 = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #40
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.AboutY = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

            case 2:
                this.House = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 3:
                this.Roof = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #41
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.AboutBox = ((AccountingKernel.Forms.Login.AbouteBox)(target));

            #line 6 "..\..\..\..\Forms\Login\AbouteBox.xaml"
                this.AboutBox.Loaded += new System.Windows.RoutedEventHandler(this.AboutBox_Loaded);

            #line default
            #line hidden
                return;

            case 2:
                this.GasketModel = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #42
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 17 "..\..\..\..\src\scenes\MainWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.createSphere);

            #line default
            #line hidden
                return;

            case 2:

            #line 30 "..\..\..\..\src\scenes\MainWindow.xaml"
                ((System.Windows.Controls.Grid)(target)).MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.Grid_MouseWheel);

            #line default
            #line hidden
                return;

            case 3:
                this.viewport = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 4:
                this.camera = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

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

            case 6:
                this.group = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #43
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.viewport = ((System.Windows.Controls.Viewport3D)(target));
                return;

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

            case 3:
                this.ringVisual = ((System.Windows.Media.Media3D.ModelUIElement3D)(target));

            #line 16 "..\..\HitTesting.xaml"
                this.ringVisual.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.ringVisual_MouseDown);

            #line default
            #line hidden
                return;

            case 4:
                this.Scene = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 5:
                this.ringModel = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;

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

            case 7:
                this.axisRotation = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.camera = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

            case 2:
                this.Scene = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 3:
                this.ring = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 4:
                this.Torus01OR9GR10 = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #45
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 8 "..\..\..\View\ShapeView3D.xaml"
                ((MapViewer.ShapeView3D)(target)).KeyDown += new System.Windows.Input.KeyEventHandler(this.Viewport_KeyDown);

            #line default
            #line hidden
                return;

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

            #line 53 "..\..\..\View\ShapeView3D.xaml"
                this.vp.MouseMove += new System.Windows.Input.MouseEventHandler(this.Viewport_MouseMove);

            #line default
            #line hidden

            #line 54 "..\..\..\View\ShapeView3D.xaml"
                this.vp.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.Viewport_MouseWheel);

            #line default
            #line hidden

            #line 55 "..\..\..\View\ShapeView3D.xaml"
                this.vp.KeyDown += new System.Windows.Input.KeyEventHandler(this.Viewport_KeyDown);

            #line default
            #line hidden
                return;

            case 3:
                this.mgRoot = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 4:
                this.mgShape = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

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

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

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

            case 8:

            #line 92 "..\..\..\View\ShapeView3D.xaml"
                ((System.Windows.Controls.CheckBox)(target)).Checked += new System.Windows.RoutedEventHandler(this.TransparencyCheckBox_Checked);

            #line default
            #line hidden

            #line 93 "..\..\..\View\ShapeView3D.xaml"
                ((System.Windows.Controls.CheckBox)(target)).Unchecked += new System.Windows.RoutedEventHandler(this.TransparencyCheckBox_Checked);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Пример #46
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

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

            #line default
            #line hidden
                return;

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

            case 3:
                this.Yaw = ((System.Windows.Controls.Slider)(target));

            #line 27 "..\..\..\MainWindow.xaml"
                this.Yaw.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slider1_ValueChanged);

            #line default
            #line hidden
                return;

            case 4:
                this.Pitch = ((System.Windows.Controls.Slider)(target));

            #line 28 "..\..\..\MainWindow.xaml"
                this.Pitch.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slider2_ValueChanged);

            #line default
            #line hidden
                return;

            case 5:
                this.Roll = ((System.Windows.Controls.Slider)(target));

            #line 29 "..\..\..\MainWindow.xaml"
                this.Roll.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slider3_ValueChanged);

            #line default
            #line hidden
                return;

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

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

            case 8:
                this.label3 = ((System.Windows.Controls.Label)(target));
                return;

            case 9:
                this.chartbox = ((System.Windows.Controls.GroupBox)(target));
                return;

            case 10:
                this.display = ((Microsoft.Research.DynamicDataDisplay.ChartPlotter)(target));
                return;

            case 11:
                this.test = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 12:
                this.MyCamera = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

            case 13:
                this.my = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 14:
                this.rotate = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #47
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.myVlcControl = ((Vlc.DotNet.Wpf.VlcControl)(target));
                return;

            case 2:
                this.textBlockOpen = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 3:
                this.Cube = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

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

            case 5:
                this.Right = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;

            case 6:
                this.Top = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;

            case 7:
                this.sliderVolume = ((System.Windows.Controls.Slider)(target));

            #line 82 "..\..\VlcPlayer.xaml"
                this.sliderVolume.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.SliderVolumeValueChanged);

            #line default
            #line hidden
                return;

            case 8:
                this.checkboxMute = ((System.Windows.Controls.CheckBox)(target));

            #line 83 "..\..\VlcPlayer.xaml"
                this.checkboxMute.Checked += new System.Windows.RoutedEventHandler(this.CheckboxMuteCheckedChanged);

            #line default
            #line hidden

            #line 83 "..\..\VlcPlayer.xaml"
                this.checkboxMute.Unchecked += new System.Windows.RoutedEventHandler(this.CheckboxMuteCheckedChanged);

            #line default
            #line hidden
                return;

            case 9:
                this.buttonPlay = ((System.Windows.Controls.Button)(target));

            #line 84 "..\..\VlcPlayer.xaml"
                this.buttonPlay.Click += new System.Windows.RoutedEventHandler(this.ButtonPlayClick);

            #line default
            #line hidden
                return;

            case 10:
                this.buttonPause = ((System.Windows.Controls.Button)(target));

            #line 85 "..\..\VlcPlayer.xaml"
                this.buttonPause.Click += new System.Windows.RoutedEventHandler(this.ButtonPauseClick);

            #line default
            #line hidden
                return;

            case 11:
                this.buttonStop = ((System.Windows.Controls.Button)(target));

            #line 86 "..\..\VlcPlayer.xaml"
                this.buttonStop.Click += new System.Windows.RoutedEventHandler(this.ButtonStopClick);

            #line default
            #line hidden
                return;

            case 12:
                this.buttonPrevious = ((System.Windows.Controls.Button)(target));

            #line 87 "..\..\VlcPlayer.xaml"
                this.buttonPrevious.Click += new System.Windows.RoutedEventHandler(this.ButtonPreviousClick);

            #line default
            #line hidden
                return;

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

            #line 88 "..\..\VlcPlayer.xaml"
                this.buttonNext.Click += new System.Windows.RoutedEventHandler(this.ButtonNextClick);

            #line default
            #line hidden
                return;

            case 14:
                this.buttonOpen = ((System.Windows.Controls.Button)(target));

            #line 89 "..\..\VlcPlayer.xaml"
                this.buttonOpen.Click += new System.Windows.RoutedEventHandler(this.ButtonOpenClick);

            #line default
            #line hidden
                return;

            case 15:
                this.buttonPlayYoutubeSample = ((System.Windows.Controls.Button)(target));

            #line 90 "..\..\VlcPlayer.xaml"
                this.buttonPlayYoutubeSample.Click += new System.Windows.RoutedEventHandler(this.ButtonPlayYoutubeSample);

            #line default
            #line hidden
                return;

            case 16:
                this.textBlock = ((System.Windows.Controls.TextBlock)(target));
                return;

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

            #line 94 "..\..\VlcPlayer.xaml"
                this.sliderPosition.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.SliderValueChanged);

            #line default
            #line hidden

            #line 94 "..\..\VlcPlayer.xaml"
                this.sliderPosition.PreviewMouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.SliderMouseLeftButtonDown);

            #line default
            #line hidden

            #line 94 "..\..\VlcPlayer.xaml"
                this.sliderPosition.PreviewMouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.SliderMouseLeftButtonUp);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Пример #48
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 12 "..\..\MainWindow.xaml"
                ((Spherification.MainWindow)(target)).KeyUp += new System.Windows.Input.KeyEventHandler(this.keyUp);

            #line default
            #line hidden
                return;

            case 2:

            #line 36 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Grid)(target)).MouseMove += new System.Windows.Input.MouseEventHandler(this.Grid_MouseMove);

            #line default
            #line hidden

            #line 36 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Grid)(target)).MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseDown);

            #line default
            #line hidden

            #line 36 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Grid)(target)).MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseUp);

            #line default
            #line hidden
                return;

            case 3:
                this.details_viewport = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 4:
                this.details_camera = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

            case 5:
                this.details_group = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 6:
                this.descriptionDatagr = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 7:
                this.FlipViewTest = ((MahApps.Metro.Controls.FlipView)(target));
                return;

            case 8:

            #line 118 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Grid)(target)).MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.Grid_MouseWheel);

            #line default
            #line hidden

            #line 118 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Grid)(target)).MouseMove += new System.Windows.Input.MouseEventHandler(this.Grid_MouseMove);

            #line default
            #line hidden
                return;

            case 9:
                this.viewport = ((System.Windows.Controls.Viewport3D)(target));
                return;

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

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

            case 12:
                this.group = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 13:
                this.dataGrid = ((System.Windows.Controls.DataGrid)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #49
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 8 "..\..\3DGraph.xaml"
                ((kursOptimiz._3DGraph)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden

            #line 8 "..\..\3DGraph.xaml"
                ((kursOptimiz._3DGraph)(target)).MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.Grid_MouseWheel);

            #line default
            #line hidden

            #line 8 "..\..\3DGraph.xaml"
                ((kursOptimiz._3DGraph)(target)).MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Window_MouseDown);

            #line default
            #line hidden

            #line 8 "..\..\3DGraph.xaml"
                ((kursOptimiz._3DGraph)(target)).MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Window_MouseUp);

            #line default
            #line hidden

            #line 8 "..\..\3DGraph.xaml"
                ((kursOptimiz._3DGraph)(target)).MouseMove += new System.Windows.Input.MouseEventHandler(this.Window_MouseMove);

            #line default
            #line hidden
                return;

            case 2:
                this.labelXMin = ((System.Windows.Controls.Label)(target));
                return;

            case 3:
                this.labelXMax = ((System.Windows.Controls.Label)(target));
                return;

            case 4:
                this.labelYMin = ((System.Windows.Controls.Label)(target));
                return;

            case 5:
                this.labelYMax = ((System.Windows.Controls.Label)(target));
                return;

            case 6:
                this.labelZMin = ((System.Windows.Controls.Label)(target));
                return;

            case 7:
                this.labelZMax = ((System.Windows.Controls.Label)(target));
                return;

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

            #line 37 "..\..\3DGraph.xaml"
                this.buttonExportImage.Click += new System.Windows.RoutedEventHandler(this.buttonExportImage_Click);

            #line default
            #line hidden
                return;

            case 9:
                this.Viewport = ((System.Windows.Controls.Viewport3D)(target));
                return;

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

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

            case 12:
                this.group = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #50
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Light = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;

            case 2:
                this.House = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

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

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

            case 5:
                this.Ends = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;

            case 6:
                this.paintSurface = ((System.Windows.Controls.Canvas)(target));
                return;

            case 7:
                this.drawbox = ((System.Windows.Controls.Viewbox)(target));
                return;

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

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

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

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

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

            case 13:
                this.ellipse = ((System.Windows.Shapes.Ellipse)(target));
                return;

            case 14:

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

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

            #line 7 "..\..\MainWindow.xaml"
                ((Wpf3D.MainWindow)(target)).MouseMove += new System.Windows.Input.MouseEventHandler(this.Viewport3D_MouseMove);

            #line default
            #line hidden

            #line 8 "..\..\MainWindow.xaml"
                ((Wpf3D.MainWindow)(target)).MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Viewport3D_MouseLeftButtonDown);

            #line default
            #line hidden

            #line 9 "..\..\MainWindow.xaml"
                ((Wpf3D.MainWindow)(target)).MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.Viewport3D_MouseWheel);

            #line default
            #line hidden
                return;

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

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

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

            case 5:
                this.cube = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 6:
                this.F1 = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;

            case 7:
                this.F2 = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;

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

            case 9:
                this.F4 = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;

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

            case 11:
                this.F6 = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #52
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.viewport = ((System.Windows.Controls.Viewport3D)(target));
                return;

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

            case 3:
                this.group1 = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 4:
                this.translacija1 = ((System.Windows.Media.Media3D.TranslateTransform3D)(target));
                return;

            case 5:
                this.group2 = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 6:
                this.translacija2 = ((System.Windows.Media.Media3D.TranslateTransform3D)(target));
                return;

            case 7:
                this.group3 = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 8:
                this.translacija3 = ((System.Windows.Media.Media3D.TranslateTransform3D)(target));
                return;

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

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

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

            case 12:
                this.translacija0 = ((System.Windows.Media.Media3D.TranslateTransform3D)(target));
                return;

            case 13:
                this.canvas = ((System.Windows.Controls.Canvas)(target));

            #line 121 "..\..\MainWindow.xaml"
                this.canvas.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseDown);

            #line default
            #line hidden

            #line 121 "..\..\MainWindow.xaml"
                this.canvas.MouseMove += new System.Windows.Input.MouseEventHandler(this.Grid_MouseMove);

            #line default
            #line hidden

            #line 121 "..\..\MainWindow.xaml"
                this.canvas.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Grid_MouseUp);

            #line default
            #line hidden

            #line 121 "..\..\MainWindow.xaml"
                this.canvas.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.Grid_MouseWheel);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Пример #53
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.grid = ((System.Windows.Controls.Grid)(target));
                return;

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

            #line 13 "..\..\MainWindow.xaml"
                this.ViewPort.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.ViewPort_MouseLeftButtonDown);

            #line default
            #line hidden

            #line 14 "..\..\MainWindow.xaml"
                this.ViewPort.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.ViewPort_MouseLeftButtonUp);

            #line default
            #line hidden

            #line 14 "..\..\MainWindow.xaml"
                this.ViewPort.MouseMove += new System.Windows.Input.MouseEventHandler(this.ViewPort_MouseMove);

            #line default
            #line hidden

            #line 15 "..\..\MainWindow.xaml"
                this.ViewPort.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.ViewPort_MouseWheel);

            #line default
            #line hidden

            #line 15 "..\..\MainWindow.xaml"
                this.ViewPort.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.ViewPort_MouseDown);

            #line default
            #line hidden

            #line 15 "..\..\MainWindow.xaml"
                this.ViewPort.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.ViewPort_MouseUp);

            #line default
            #line hidden

            #line 15 "..\..\MainWindow.xaml"
                this.ViewPort.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.ViewPort_MouseRightButtonDown);

            #line default
            #line hidden
                return;

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

            case 4:
                this.translacija = ((System.Windows.Media.Media3D.TranslateTransform3D)(target));
                return;

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

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

            case 7:
                this.model3dGroup = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 8:
                this.Rotate = ((System.Windows.Media.Media3D.RotateTransform3D)(target));
                return;

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

            case 10:

            #line 80 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.CheckBox)(target)).Unchecked += new System.Windows.RoutedEventHandler(this.CheckBox_Unchecked);

            #line default
            #line hidden

            #line 80 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.CheckBox)(target)).Checked += new System.Windows.RoutedEventHandler(this.CheckBox_Checked);

            #line default
            #line hidden
                return;

            case 11:

            #line 81 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.CheckBox)(target)).Unchecked += new System.Windows.RoutedEventHandler(this.CheckBox_Unchecked);

            #line default
            #line hidden

            #line 81 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.CheckBox)(target)).Checked += new System.Windows.RoutedEventHandler(this.CheckBox_Checked);

            #line default
            #line hidden
                return;

            case 12:

            #line 82 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.CheckBox)(target)).Unchecked += new System.Windows.RoutedEventHandler(this.CheckBox_Unchecked);

            #line default
            #line hidden

            #line 82 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.CheckBox)(target)).Checked += new System.Windows.RoutedEventHandler(this.CheckBox_Checked);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Пример #54
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

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

            #line default
            #line hidden
                return;

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

            #line 21 "..\..\MainWindow.xaml"
                this.buttonexit.Click += new System.Windows.RoutedEventHandler(this.Buttonexit_Click);

            #line default
            #line hidden
                return;

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

            #line 22 "..\..\MainWindow.xaml"
                this.buttonMinimize.Click += new System.Windows.RoutedEventHandler(this.ButtonMinimize_Click);

            #line default
            #line hidden
                return;

            case 4:
                this.comboBox = ((System.Windows.Controls.ComboBox)(target));

            #line 26 "..\..\MainWindow.xaml"
                this.comboBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.OnSelectionChanged);

            #line default
            #line hidden
                return;

            case 5:
                this.comboPicture = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 6:
                this.startButton = ((System.Windows.Controls.Button)(target));

            #line 43 "..\..\MainWindow.xaml"
                this.startButton.Click += new System.Windows.RoutedEventHandler(this.OnStartButtonClick);

            #line default
            #line hidden
                return;

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

            #line 44 "..\..\MainWindow.xaml"
                this.stopButton.Click += new System.Windows.RoutedEventHandler(this.OnStopButtonClick);

            #line default
            #line hidden
                return;

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

            #line 45 "..\..\MainWindow.xaml"
                this.imageButton.Click += new System.Windows.RoutedEventHandler(this.OnImageButtonClick);

            #line default
            #line hidden
                return;

            case 9:
                this.webCameraControl = ((WebEye.Controls.Wpf.WebCameraControl)(target));
                return;

            case 10:
                this.MyMap = ((Microsoft.Maps.MapControl.WPF.Map)(target));
                return;

            case 11:
                this.DefaultPin = ((Microsoft.Maps.MapControl.WPF.Pushpin)(target));
                return;

            case 12:
                this.MyPushPin = ((Microsoft.Maps.MapControl.WPF.Pushpin)(target));
                return;

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

            #line 56 "..\..\MainWindow.xaml"
                this.defaultlocbtn.Click += new System.Windows.RoutedEventHandler(this.defaultlocbtn_Click);

            #line default
            #line hidden
                return;

            case 14:
                this.GridGrafik = ((System.Windows.Controls.Grid)(target));
                return;

            case 15:
                this.grafikLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 16:
                this.TinggiPlot = ((Microsoft.Research.DynamicDataDisplay.ChartPlotter)(target));
                return;

            case 17:
                this.AccPlot = ((Microsoft.Research.DynamicDataDisplay.ChartPlotter)(target));
                return;

            case 18:
                this.GyroPlot = ((Microsoft.Research.DynamicDataDisplay.ChartPlotter)(target));
                return;

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

            #line 98 "..\..\MainWindow.xaml"
                this.yprButton.Click += new System.Windows.RoutedEventHandler(this.yprButton_Click);

            #line default
            #line hidden
                return;

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

            #line 99 "..\..\MainWindow.xaml"
                this.elevasiButton.Click += new System.Windows.RoutedEventHandler(this.elevasiButton_Click);

            #line default
            #line hidden
                return;

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

            #line 100 "..\..\MainWindow.xaml"
                this.ketinggianButton.Click += new System.Windows.RoutedEventHandler(this.ketinggianButton_Click);

            #line default
            #line hidden
                return;

            case 22:
                this.GridTerminal = ((System.Windows.Controls.Grid)(target));
                return;

            case 23:
                this.terminalText = ((System.Windows.Controls.TextBox)(target));

            #line 106 "..\..\MainWindow.xaml"
                this.terminalText.PreviewKeyDown += new System.Windows.Input.KeyEventHandler(this.terminalText_PreviewKeyDown);

            #line default
            #line hidden
                return;

            case 24:
                this.visualButton = ((System.Windows.Controls.Button)(target));

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

            #line default
            #line hidden
                return;

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

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

            #line default
            #line hidden
                return;

            case 26:
                this.tabVisual = ((System.Windows.Controls.Grid)(target));
                return;

            case 27:
                this.gridKoneksi = ((System.Windows.Controls.Grid)(target));
                return;

            case 28:
                this.portCombo = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 29:
                this.baudCombo = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 30:
                this.databitCombo = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 31:
                this.stopbitCombo = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 32:
                this.parityCombo = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 33:
                this.handshakeCombo = ((System.Windows.Controls.ComboBox)(target));
                return;

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

            case 35:
                this.portLauncher = ((System.Windows.Controls.ComboBox)(target));
                return;

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

            #line 155 "..\..\MainWindow.xaml"
                this.konekButton.Click += new System.Windows.RoutedEventHandler(this.konekButton_Click);

            #line default
            #line hidden
                return;

            case 37:
                this.gridUtama = ((System.Windows.Controls.Grid)(target));
                return;

            case 38:
                this.barKetinggian = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 39:
                this.barElevasi = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 40:
                this.barTemperatur = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 41:
                this.barTekanan = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 42:
                this.barYaw = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 43:
                this.barPitch = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 44:
                this.barRoll = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 45:
                this.lblLatitude = ((System.Windows.Controls.Label)(target));
                return;

            case 46:
                this.lblLongitude = ((System.Windows.Controls.Label)(target));
                return;

            case 47:
                this.lblKetinggian = ((System.Windows.Controls.Label)(target));
                return;

            case 48:
                this.lblElevasi = ((System.Windows.Controls.Label)(target));
                return;

            case 49:
                this.lblTemperatur = ((System.Windows.Controls.Label)(target));
                return;

            case 50:
                this.lblTekanan = ((System.Windows.Controls.Label)(target));
                return;

            case 51:
                this.lblYaw = ((System.Windows.Controls.Label)(target));
                return;

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

            case 53:
                this.lblRoll = ((System.Windows.Controls.Label)(target));
                return;

            case 54:
                this.lblTimer = ((System.Windows.Controls.Label)(target));
                return;

            case 55:
                this.btnRefresh = ((System.Windows.Controls.Button)(target));

            #line 225 "..\..\MainWindow.xaml"
                this.btnRefresh.Click += new System.Windows.RoutedEventHandler(this.btnRefresh_Click);

            #line default
            #line hidden
                return;

            case 56:
                this.tabLog = ((System.Windows.Controls.Grid)(target));
                return;

            case 57:
                this.datagridLog = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 58:
                this.Landasan3D = ((System.Windows.Controls.Viewport3D)(target));
                return;

            case 59:
                this.DefaultGroup = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;

            case 60:
                this.group = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 61:
                this.rocket3D = ((System.Windows.Media.Media3D.GeometryModel3D)(target));
                return;

            case 62:
                this.myQuaternionRotation3D = ((System.Windows.Media.Media3D.QuaternionRotation3D)(target));
                return;

            case 63:
                this.btnPutus = ((System.Windows.Controls.Button)(target));

            #line 2195 "..\..\MainWindow.xaml"
                this.btnPutus.Click += new System.Windows.RoutedEventHandler(this.btnPutus_Click);

            #line default
            #line hidden
                return;

            case 64:
                this.btnCapture = ((System.Windows.Controls.Button)(target));

            #line 2197 "..\..\MainWindow.xaml"
                this.btnCapture.Click += new System.Windows.RoutedEventHandler(this.btnCapture_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Пример #55
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.viewport1 = ((System.Windows.Controls.Viewport3D)(target));

            #line 10 "..\..\MainWindow.xaml"
                this.viewport1.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.viewport1_MouseLeftButtonDown);

            #line default
            #line hidden

            #line 11 "..\..\MainWindow.xaml"
                this.viewport1.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.viewport1_MouseLeftButtonUp);

            #line default
            #line hidden

            #line 11 "..\..\MainWindow.xaml"
                this.viewport1.MouseMove += new System.Windows.Input.MouseEventHandler(this.viewport1_MouseMove);

            #line default
            #line hidden

            #line 12 "..\..\MainWindow.xaml"
                this.viewport1.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.viewport1_MouseWheel);

            #line default
            #line hidden

            #line 12 "..\..\MainWindow.xaml"
                this.viewport1.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Viewport1_MouseDown);

            #line default
            #line hidden

            #line 12 "..\..\MainWindow.xaml"
                this.viewport1.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Viewport1_MouseUp);

            #line default
            #line hidden
                return;

            case 2:
                this.modelGroup = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 3:
                this.rotateTransform = ((System.Windows.Media.Media3D.RotateTransform3D)(target));
                return;

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

            case 5:
                this.rotateTransformX = ((System.Windows.Media.Media3D.RotateTransform3D)(target));
                return;

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

            case 7:
                this.translacija = ((System.Windows.Media.Media3D.TranslateTransform3D)(target));
                return;

            case 8:
                this.skaliranje = ((System.Windows.Media.Media3D.ScaleTransform3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #56
0
        //------------------------------------------------------
        //
        //  Public Properties
        //
        //------------------------------------------------------

        private static void ChildrenPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            // The first change to the default value of a mutable collection property (e.g. GeometryGroup.Children)
            // will promote the property value from a default value to a local value. This is technically a sub-property
            // change because the collection was changed and not a new collection set (GeometryGroup.Children.
            // Add versus GeometryGroup.Children = myNewChildrenCollection). However, we never marshalled
            // the default value to the compositor. If the property changes from a default value, the new local value
            // needs to be marshalled to the compositor. We detect this scenario with the second condition
            // e.OldValueSource != e.NewValueSource. Specifically in this scenario the OldValueSource will be
            // Default and the NewValueSource will be Local.
            if (e.IsASubPropertyChange &&
                (e.OldValueSource == e.NewValueSource))
            {
                return;
            }


            Model3DGroup target = ((Model3DGroup)d);


            // If this is both non-null and mutable, we need to unhook the Changed event.
            Model3DCollection oldCollection = null;
            Model3DCollection newCollection = null;

            if ((e.OldValueSource != BaseValueSourceInternal.Default) || e.IsOldValueModified)
            {
                oldCollection = (Model3DCollection)e.OldValue;
                if ((oldCollection != null) && !oldCollection.IsFrozen)
                {
                    oldCollection.ItemRemoved  -= target.ChildrenItemRemoved;
                    oldCollection.ItemInserted -= target.ChildrenItemInserted;
                }
            }

            // If this is both non-null and mutable, we need to hook the Changed event.
            if ((e.NewValueSource != BaseValueSourceInternal.Default) || e.IsNewValueModified)
            {
                newCollection = (Model3DCollection)e.NewValue;
                if ((newCollection != null) && !newCollection.IsFrozen)
                {
                    newCollection.ItemInserted += target.ChildrenItemInserted;
                    newCollection.ItemRemoved  += target.ChildrenItemRemoved;
                }
            }
            if (oldCollection != newCollection && target.Dispatcher != null)
            {
                using (CompositionEngineLock.Acquire())
                {
                    DUCE.IResource targetResource = (DUCE.IResource)target;
                    int            channelCount   = targetResource.GetChannelCount();

                    for (int channelIndex = 0; channelIndex < channelCount; channelIndex++)
                    {
                        DUCE.Channel channel = targetResource.GetChannel(channelIndex);
                        Debug.Assert(!channel.IsOutOfBandChannel);
                        Debug.Assert(!targetResource.GetHandle(channel).IsNull);
                        // resource shouldn't be null because
                        // 1) If the field is one of our collections, we don't allow null elements
                        // 2) Codegen already made sure the collection contains DUCE.IResources
                        // ... so we'll Assert it

                        if (newCollection != null)
                        {
                            int count = newCollection.Count;
                            for (int i = 0; i < count; i++)
                            {
                                DUCE.IResource resource = newCollection.Internal_GetItem(i) as DUCE.IResource;
                                Debug.Assert(resource != null);
                                resource.AddRefOnChannel(channel);
                            }
                        }

                        if (oldCollection != null)
                        {
                            int count = oldCollection.Count;
                            for (int i = 0; i < count; i++)
                            {
                                DUCE.IResource resource = oldCollection.Internal_GetItem(i) as DUCE.IResource;
                                Debug.Assert(resource != null);
                                resource.ReleaseOnChannel(channel);
                            }
                        }
                    }
                }
            }
            target.PropertyChanged(ChildrenProperty);
        }
Пример #57
0
        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;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Start_Button = ((System.Windows.Controls.Button)(target));

            #line 23 "..\..\Visualizer.xaml"
                this.Start_Button.Click += new System.Windows.RoutedEventHandler(this.Start_Button_Click);

            #line default
            #line hidden
                return;

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

            #line 26 "..\..\Visualizer.xaml"
                this.Stop_Button.Click += new System.Windows.RoutedEventHandler(this.Stop_Button_Click);

            #line default
            #line hidden
                return;

            case 3:
                this.CamX = ((System.Windows.Controls.Slider)(target));

            #line 33 "..\..\Visualizer.xaml"
                this.CamX.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.Camera_ValueChanged);

            #line default
            #line hidden
                return;

            case 4:
                this.CamY = ((System.Windows.Controls.Slider)(target));

            #line 39 "..\..\Visualizer.xaml"
                this.CamY.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.Camera_ValueChanged);

            #line default
            #line hidden
                return;

            case 5:
                this.CamZ = ((System.Windows.Controls.Slider)(target));

            #line 45 "..\..\Visualizer.xaml"
                this.CamZ.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.Camera_ValueChanged);

            #line default
            #line hidden
                return;

            case 6:
                this.TimeIncrementSlider = ((System.Windows.Controls.TextBox)(target));

            #line 49 "..\..\Visualizer.xaml"
                this.TimeIncrementSlider.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.TimeIncrement_TextChanged);

            #line default
            #line hidden
                return;

            case 7:
                this.MaxPointsSlider = ((System.Windows.Controls.TextBox)(target));

            #line 52 "..\..\Visualizer.xaml"
                this.MaxPointsSlider.TextChanged += new System.Windows.Controls.TextChangedEventHandler(this.MaxPointsSlider_TextChanged);

            #line default
            #line hidden
                return;

            case 8:
                this.AutoCameraCheck = ((System.Windows.Controls.CheckBox)(target));

            #line 55 "..\..\Visualizer.xaml"
                this.AutoCameraCheck.Checked += new System.Windows.RoutedEventHandler(this.AutoCameraCheck_Checked);

            #line default
            #line hidden
                return;

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

            case 10:
                this.TraceCheck = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 11:
                this.Save_Button = ((System.Windows.Controls.Button)(target));

            #line 63 "..\..\Visualizer.xaml"
                this.Save_Button.Click += new System.Windows.RoutedEventHandler(this.Save_Button_Click);

            #line default
            #line hidden
                return;

            case 12:
                this.ViewportGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 13:
                this.myViewport = ((System.Windows.Controls.Viewport3D)(target));

            #line 74 "..\..\Visualizer.xaml"
                this.myViewport.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.myViewport_MouseLeftButtonDown);

            #line default
            #line hidden

            #line 75 "..\..\Visualizer.xaml"
                this.myViewport.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.myViewport_MouseLeftButtonUp);

            #line default
            #line hidden

            #line 76 "..\..\Visualizer.xaml"
                this.myViewport.MouseMove += new System.Windows.Input.MouseEventHandler(this.myViewport_MouseMove);

            #line default
            #line hidden
                return;

            case 14:
                this.Camera = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

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

            case 16:
                this.Group = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 17:
                this.GraphPanel = ((System.Windows.Controls.Grid)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #59
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 9 "..\..\..\Views\MazeWindow.xaml"
                ((PointManager.Views.MazeWindow)(target)).KeyDown += new System.Windows.Input.KeyEventHandler(this.Window1_KeyDown);

            #line default
            #line hidden

            #line 9 "..\..\..\Views\MazeWindow.xaml"
                ((PointManager.Views.MazeWindow)(target)).KeyUp += new System.Windows.Input.KeyEventHandler(this.Window1_KeyUp);

            #line default
            #line hidden

            #line 9 "..\..\..\Views\MazeWindow.xaml"
                ((PointManager.Views.MazeWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window1_Loaded);

            #line default
            #line hidden

            #line 9 "..\..\..\Views\MazeWindow.xaml"
                ((PointManager.Views.MazeWindow)(target)).MouseMove += new System.Windows.Input.MouseEventHandler(this.Window1_MouseMove);

            #line default
            #line hidden
                return;

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

            case 3:
                this.Model3DGroup_Lights = ((System.Windows.Media.Media3D.Model3DGroup)(target));
                return;

            case 4:
                this.TextBox_X = ((System.Windows.Controls.TextBox)(target));
                return;

            case 5:
                this.TextBox_Y = ((System.Windows.Controls.TextBox)(target));
                return;

            case 6:
                this.TextBox_Z = ((System.Windows.Controls.TextBox)(target));
                return;

            case 7:
                this.TextBox_Vertical = ((System.Windows.Controls.TextBox)(target));
                return;

            case 8:
                this.TextBox_Horizontal = ((System.Windows.Controls.TextBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
Пример #60
-1
        private Robot robot; //the robot to display!

        #endregion Fields

        #region Constructors

        public ViewPlatform(Viewport3D viewport, MotorManager motorManager, Robot robot)
        {
            this.robot = robot;
            robot.intialise(viewport);
            this.motorManager = motorManager;
            //Add myself as a listener for the motor manager:
            this.motorManager.addListener(this);
            //Create a focussed camera to watch the origin:
            focussedCamera = new FocussedCamera(200, 0, 0);
            //Create the perspective camera!
            camera = getCamera(focussedCamera.Location, focussedCamera.Direction);
            viewport.Camera = camera;
            //Now to construct the light:
            light = getLight(Colors.White,focussedCamera.Direction);
            ModelVisual3D visual = new ModelVisual3D();
            visual.Content = light;
            viewport.Children.Add(visual);
            ModelVisual3D visual2 = new ModelVisual3D();
            //Now add in the robot too!
            updateMotors();
            outerModel = new Model3DGroup();
            outerModel.Children.Add(robot.getRobot());
            currentMatTransform = (MatrixTransform3D)MatrixTransform3D.Identity;
            TranslateTransform3D trans = new TranslateTransform3D();
            outerModel.Children[0] = Transforms.applyTransform((Model3DGroup)outerModel.Children[0],currentMatTransform);
            visual2.Content = outerModel;
            viewport.Children.Add(visual2);
            //Phew! That should be it...
            viewport.ClipToBounds = true;
        }