Exemplo n.º 1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.hxViewport3D = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

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

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

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

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

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

            case 7:
                this.debugOutput = ((System.Windows.Controls.RichTextBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 2
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 4 "..\..\Carousel.xaml"
                ((Bornander.UI.TabCarousel.Carousel)(target)).SizeChanged += new System.Windows.SizeChangedEventHandler(this.HandleSizeChanged);

            #line default
            #line hidden
                return;

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

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

            case 4:
                this.Ambient = ((System.Windows.Media.Media3D.AmbientLight)(target));
                return;

            case 5:
                this.Directional = ((System.Windows.Media.Media3D.DirectionalLight)(target));
                return;

            case 6:
                this.CarouselContainer = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.window = ((CrossBeam.Window1)(target));
                return;

            case 2:

            #line 25 "..\..\Window1.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.StartPointSelect);

            #line default
            #line hidden
                return;

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

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

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

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

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

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

            case 9:

            #line 54 "..\..\Window1.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.DoneClick);

            #line default
            #line hidden
                return;

            case 10:
                this.helixviewport = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

            case 11:
                this.MV3D = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.main = ((_3DHelixToolKitApp.MainWindow)(target));
                return;

            case 2:
                this.tasksList = ((System.Windows.Controls.ListBox)(target));
                return;

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

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

            case 5:
                this.hVp3D = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

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

            case 7:
                this.translate = ((System.Windows.Media.Media3D.TranslateTransform3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
        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;
        }
Exemplo n.º 6
0
        public PhotoAlbum()
        {
            InitializeComponent();
            dt.Interval = TimeSpan.FromSeconds(2);
            dt.Tick += new EventHandler(dt_Tick);
            for (int i = 0; i < 16; i++)
            {
                ImageBrush ib = new ImageBrush(new BitmapImage(new Uri("pack://application:,,,/images/albums/im" + i + ".jpg")));
                ib.Stretch = Stretch.Uniform;

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

            pa = new Point3DAnimation(p3s[0], TimeSpan.FromMilliseconds(300));
            pa.AccelerationRatio = 0.3;
            pa.DecelerationRatio = 0.3;
            pa.Completed += new EventHandler(pa_Completed);
            cam.BeginAnimation(PerspectiveCamera.PositionProperty, pa);
        }
 /// <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;
 }
Exemplo n.º 8
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);
		}
Exemplo n.º 9
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.listBox = ((System.Windows.Controls.ListBox)(target));

            #line 18 "..\..\..\3DControl.xaml"
                this.listBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.listBox_SelectionChanged);

            #line default
            #line hidden
                return;

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

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

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

            case 5:
                this.SenceGrid = ((System.Windows.Controls.Grid)(target));
                return;

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

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

            case 8:
                this.FurnitureContainer = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
                return;

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

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

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

            case 12:
                this.spotLight = ((System.Windows.Media.Media3D.SpotLight)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 10
0
		public Visual3DBodyBase(World world, ModelVisual3D visual)
		{
			if (visual == null) throw new ArgumentNullException("visual");

			_visual = visual;
			Initialise(world);
		}
Exemplo n.º 11
0
Arquivo: Cell.cs Projeto: babaq/Soul
        public Cell(INeuron neuron, ModelVisual3D mophology, Imaging imager)
        {
            this.neuron = neuron;
            this.mophology = mophology;
            this.imager = imager;
            neuron.Updated += OnUpdated;
            neuron.Hillock.Spike += OnSpike;
            IsPushing = true;

            var transforms = new Transform3DGroup();
            Rotate = new RotateTransform3D(new QuaternionRotation3D());
            Translate = new TranslateTransform3D(neuron.Position.X, neuron.Position.Y, neuron.Position.Z);
            Scale = new ScaleTransform3D();
            transforms.Children.Add(Rotate);
            transforms.Children.Add(Translate);
            transforms.Children.Add(Scale);
            Mophology.Transform = transforms;

            var binding = new Binding()
            {
                Source = neuron,
                Path = new PropertyPath("Position"),
                Mode = BindingMode.OneWay
            };
            BindingOperations.SetBinding(this, Cell.PositionProperty, binding);
        }
        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);
        }
Exemplo n.º 13
0
        private void WindowLoaded(object sender, EventArgs e)
        {
            //Set camera viewpoint and properties.
            myPCamera.FarPlaneDistance = 20;
            myPCamera.NearPlaneDistance = 1;
            myPCamera.FieldOfView = 45;
            myPCamera.Position = new Point3D(-5, 2, 3);
            myPCamera.LookDirection = new Vector3D(5, -2, -3);
            myPCamera.UpDirection = new Vector3D(0, 1, 0);

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

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

            teapotModel.Material = teapotMaterial;

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

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

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

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

            mainWindow.Content = myViewport;
        }
        public static ModelVisual3D Load(string path)
        {
            if (path == null)
            {
                return null;
            }
            ModelVisual3D model= new ModelVisual3D();
            string ext = Path.GetExtension(path).ToLower();
            switch (ext)
            {
                case ".obj":
                    {
                        var r = new SmileObjReader();
                        model = r.Read(path);
                        break;
                    }

                case ".objz":
                    {
                        var r = new SmileObjReader();
                        model = r.ReadZ(path);
                        break;
                    }                

                default:
                    throw new InvalidOperationException("File format not supported.");
            }
           return model;
        }
Exemplo n.º 15
0
        public ConvexBody3D(World world, ModelVisual3D model, CollisionShape collisionShape, double radius, double height)
            : base(world, model)
        {
            // Validate
            switch (collisionShape)
            {
                case CollisionShape.Capsule:
                case CollisionShape.ChamferCylinder:
                case CollisionShape.Cone:
                case CollisionShape.Cylinder:
                    break;

                default:
                    throw new ArgumentException("This constructor overload only supports collision shapes of cone, cylinder, capsule, chamfer cylinder");
            }

            // Store the definition of the collision shape
            _collisionShape = collisionShape;
            _collisionShapeRatio1 = radius;
            _collisionShapeRatio2 = height;
            _collisionShapeRatio3 = -1d;

            // Calculate the collision mask
            RecalculateCollisionMask();
        }
Exemplo n.º 16
0
 public Neuron(Point3D position, ModelVisual3D visual, DiffuseMaterial material)
 {
     _position = position;
     this.Visual = visual;
     this.Material = material;
     this.Value = 0d;
 }
Exemplo n.º 17
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.myStoryboard = ((System.Windows.Media.Animation.BeginStoryboard)(target));
                return;

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

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

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

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

            case 6:
                this.rotation2 = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 18
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;
        }
        public TerrianCollisionMask3D(World world, ModelVisual3D visual)
        {
            if (visual == null) throw new ArgumentNullException("visual");

            _visual = visual;
            Initialise(world);
        }
        private void simpleButtonClick(object sender, RoutedEventArgs e)
        {
            MeshGeometry3D triagleMesh = new MeshGeometry3D();
            Point3D p0 = new Point3D(0, 0, 0);
            Point3D p1 = new Point3D(5, 0, 0);
            Point3D p2 = new Point3D(0, 0, 5);

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

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

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

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

            ModelVisual3D model = new ModelVisual3D();
            model.Content = triangleModel;
            this.mainViewport.Children.Add(model);
        }
Exemplo n.º 21
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;
        }
Exemplo n.º 22
0
        public CellNet(INetwork network, ModelVisual3D mophology, Dictionary<Guid, ICell> cells, Dictionary<Guid, ICellNet> childcellnet)
        {
            this.network = network;
            this.mophology = mophology;
            this.cells = cells;
            this.childcellnet = childcellnet;
            IsPushing = true;

            var transforms = new Transform3DGroup();
            Rotate = new RotateTransform3D(new QuaternionRotation3D());
            Translate = new TranslateTransform3D(network.Position.X, network.Position.Y, network.Position.Z);
            Scale = new ScaleTransform3D();
            transforms.Children.Add(Rotate);
            transforms.Children.Add(Translate);
            transforms.Children.Add(Scale);
            Mophology.Transform = transforms;

            var binding = new Binding()
            {
                Source = network,
                Path = new PropertyPath("Position"),
                Mode = BindingMode.OneWay
            };
            BindingOperations.SetBinding(this, CellNet.PositionProperty, binding);
        }
        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;
        }
Exemplo n.º 24
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;
        }
Exemplo n.º 25
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StructureControl"/> class and sets up visual elements for rendering.
        /// </summary>
        /// <param name="pdbViewer">The PDB viewer.</param>
        internal StructureControl(PdbViewer pdbViewer)
        {
            this.pdbViewer = pdbViewer;

            NameScope.SetNameScope(this, new NameScope());

            this.viewport = new Viewport3D();
            this.viewport.ClipToBounds = true;
            this.Children.Add(this.viewport);

            this.camera = new PerspectiveCamera();
            this.camera.Position = new Point3D(0, 0, cameraOffset);
            this.viewport.Camera = this.camera;

            ModelVisual3D lightingVisual = new ModelVisual3D();
            this.viewport.Children.Add(lightingVisual);

            Model3DGroup lightingModel = new Model3DGroup();
            lightingVisual.Content = lightingModel;

            PointLight pointLight = new PointLight(Colors.White, new Point3D(-4, 4, 8));
            lightingModel.Children.Add(pointLight);

            AmbientLight ambientLight = new AmbientLight(Color.FromRgb(32, 32, 32));
            lightingModel.Children.Add(ambientLight);

            this.moleculeVisual = new ModelVisual3D();
            viewport.Children.Add(this.moleculeVisual);

            Transform3DGroup transformGroup = new Transform3DGroup();
            this.moleculeVisual.Transform = transformGroup;

            this.translateTransform = new TranslateTransform3D();
            transformGroup.Children.Add(this.translateTransform);

            this.scaleTransform = new ScaleTransform3D();
            transformGroup.Children.Add(this.scaleTransform);

            this.rotateTransform = new RotateTransform3D();
            this.rotateTransform.Rotation = new QuaternionRotation3D();
            transformGroup.Children.Add(this.rotateTransform);

            this.selectionRectangle = new Rectangle();
            this.selectionRectangle.Stroke = Brushes.White;
            this.selectionRectangle.Fill = new SolidColorBrush(Color.FromArgb(32, 255, 255, 255));
            this.selectionRectangle.Visibility = Visibility.Hidden;
            this.Children.Add(this.selectionRectangle);

            this.testLabel = new Label();
            this.testLabel.Foreground = Brushes.White;
            this.testLabel.FontSize = 20;
            this.testLabel.HorizontalAlignment = HorizontalAlignment.Left;
            this.testLabel.VerticalAlignment = VerticalAlignment.Center;
            this.Children.Add(this.testLabel);

            this.clip = 1;
            this.slab = 0;
            this.UpdateClipping();
        }
Exemplo n.º 26
0
 public override Visual3D ToAvalonObj()
 {
     ModelVisual3D model = new ModelVisual3D();
     DirectionalLight light = new DirectionalLight(System.Windows.Media.Color.FromArgb(clr.A, clr.R, clr.G, clr.B),
                                                   new Vector3D(direction.X, direction.Y, direction.Z));
     model.Content = light;
     return model;
 }
Exemplo n.º 27
0
 public PUMA(HelixViewport3D viewport, ModelVisual3D start, ModelVisual3D end)
 {
     startFrame = start;
     endFrame = end;
     converter = Singleton<EulerToQuaternionConverter>.Instance;
     mathHelper = Singleton<MathHelper>.Instance;
     Initialize(viewport);
 }
Exemplo n.º 28
0
        protected override void BeginTransition3D(TransitionElement transitionElement, ContentPresenter oldContent, ContentPresenter newContent, Viewport3D viewport)
        {
            Brush clone = CreateBrush(oldContent);

            Size size = transitionElement.RenderSize;
            MeshGeometry3D leftDoor = CreateMesh(new Point3D(),
               new Vector3D(size.Width / 2, 0, 0),
               new Vector3D(0, size.Height, 0),
               1,
               1,
               new Rect(0, 0, 0.5, 1));

            GeometryModel3D leftDoorGeometry = new GeometryModel3D();
            leftDoorGeometry.Geometry = leftDoor;
            leftDoorGeometry.Material = new DiffuseMaterial(clone);

            AxisAngleRotation3D leftRotation = new AxisAngleRotation3D(new Vector3D(0, 1, 0), 0);
            leftDoorGeometry.Transform = new RotateTransform3D(leftRotation);

            GeometryModel3D rightDoorGeometry = new GeometryModel3D();
            MeshGeometry3D rightDoor = CreateMesh(new Point3D(size.Width / 2, 0, 0),
                 new Vector3D(size.Width / 2, 0, 0),
                 new Vector3D(0, size.Height, 0),
                 1,
                 1,
                 new Rect(0.5, 0, 0.5, 1));

            rightDoorGeometry.Geometry = rightDoor;
            rightDoorGeometry.Material = new DiffuseMaterial(clone);

            AxisAngleRotation3D rightRotation = new AxisAngleRotation3D(new Vector3D(0, 1, 0), 0);
            rightDoorGeometry.Transform = new RotateTransform3D(rightRotation, size.Width, 0, 0);


            Model3DGroup doors = new Model3DGroup();
            doors.Children.Add(leftDoorGeometry);
            doors.Children.Add(rightDoorGeometry);

            ModelVisual3D model = new ModelVisual3D();
            model.Content = doors;

            // Replace old content in visual tree with new 3d model
            transitionElement.HideContent(oldContent);
            viewport.Children.Add(model);

            DoubleAnimation da = new DoubleAnimation(90 - 0.5 * FieldOfView, Duration);
            leftRotation.BeginAnimation(AxisAngleRotation3D.AngleProperty, da);

            da = new DoubleAnimation(-(90 - 0.5 * FieldOfView), Duration);
            rightRotation.BeginAnimation(AxisAngleRotation3D.AngleProperty, da);

            da = new DoubleAnimation(0, Duration);
            da.Completed += delegate
            {
                EndTransition(transitionElement, oldContent, newContent);
            };
            clone.BeginAnimation(Brush.OpacityProperty, da);
        }
Exemplo n.º 29
0
        // Create new ImageSlice
        public ImageSlice(CTSliceInfo ct, ModelVisual3D the3DModel)
        {
            _ct = ct;

            _FileName  = ct.FileName;
            _ZValue    = ct.UpperLeft_Z.ToString();

            _3DModel = the3DModel;
        }
Exemplo n.º 30
0
 public VisualObjectData HitTest(ModelVisual3D hitResult)
 {
     foreach (var vod in _visualObjects)
     {
         if (HitTestModel(vod.Model, hitResult))
             return vod;
     }
     return null;
 }
Exemplo n.º 31
0
        protected override void BeginTransition3D(TransitionElement transitionElement, ContentPresenter oldContent, ContentPresenter newContent, Viewport3D viewport)
        {
            Size size = transitionElement.RenderSize;

            // Create a rectangle
            MeshGeometry3D mesh = CreateMesh(new Point3D(),
                new Vector3D(size.Width, 0, 0),
                new Vector3D(0, size.Height, 0),
                1,
                1,
                new Rect(0, 0, 1, 1));
            
            GeometryModel3D geometry = new GeometryModel3D();
            geometry.Geometry = mesh;
            VisualBrush clone = new VisualBrush(oldContent);
            geometry.Material = new DiffuseMaterial(clone);

            ModelVisual3D model = new ModelVisual3D();
            model.Content = geometry;

            // Replace old content in visual tree with new 3d model
            transitionElement.HideContent(oldContent);
            viewport.Children.Add(model);

            Vector3D axis;
            Point3D center = new Point3D();
            switch (Direction)
            {
                case RotateDirection.Left:
                    axis = new Vector3D(0, 1, 0);
                    break;
                case RotateDirection.Right:
                    axis = new Vector3D(0, -1, 0);
                    center = new Point3D(size.Width, 0, 0);
                    break;
                case RotateDirection.Up:
                    axis = new Vector3D(-1, 0, 0);
                    break;
                default:
                    axis = new Vector3D(1, 0, 0);
                    center = new Point3D(0, size.Height, 0);
                    break;
            }
            AxisAngleRotation3D rotation = new AxisAngleRotation3D(axis, 0);
            model.Transform = new RotateTransform3D(rotation, center);

            DoubleAnimation da = new DoubleAnimation(0, Duration);
            clone.BeginAnimation(Brush.OpacityProperty, da);

            da = new DoubleAnimation(90, Duration);
            da.Completed += delegate
            {
                EndTransition(transitionElement, oldContent, newContent);
            };
            rotation.BeginAnimation(AxisAngleRotation3D.AngleProperty, da);
        }
Exemplo n.º 32
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.tbValues = ((System.Windows.Controls.TextBlock)(target));
                return;

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

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

            #line default
            #line hidden
                return;

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

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

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

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

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

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

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

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

            case 11:
                this.slider1 = ((System.Windows.Controls.Slider)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 33
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 16 "..\..\MainWindow.xaml"
                ((task_DI.MainWindow)(target)).MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Window_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

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

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

            case 10:
                this.PART_MaxButton_Path = ((System.Windows.Shapes.Path)(target));
                return;

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

            case 12:

            #line 177 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.ListBox)(target)).SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.MyListItemSelected);

            #line default
            #line hidden
                return;

            case 13:
                this.helix_view = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

            case 14:
                this.MyView = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;

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

            case 16:
                this.panel = ((System.Windows.Controls.ListView)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 34
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.viewPort3d = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

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

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

            #line 18 "..\..\MainWindow.xaml"
                this.btnConnect.Click += new System.Windows.RoutedEventHandler(this.BtnConnect_Click);

            #line default
            #line hidden
                return;

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

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

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

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

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

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

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

            case 11:
                this.chkReverseY = ((System.Windows.Controls.CheckBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
        private void ShowGeometry(MeshGeometry3D geometry)
        {
            var container = new ContainerUIElement3D();

            var viewport = new ModelVisual3D();
            ViewPort3D.Children.Add(viewport);
            ViewPort3D.Children.Add(container);
            ViewPort3D.ShowFrameRate = true;
            ViewPort3D.ZoomExtents();
        }
Exemplo n.º 36
0
 private void LoadGeometries()
 {
     // Add geometries
     foreach (GeometryModel3D model in Template.Model.Geometries.Values)
     {
         ModelVisual3D m = new ModelVisual3D();
         m.Content = model;
         Children.Add(m);
     }
 }
Exemplo n.º 37
0
        void AddTube(List<Point3D> path, Color color)
        {
            var mb = new MeshBuilder();

            mb.AddTube(path, 0.1, 3, false);
            var geom = new GeometryModel3D { Geometry = mb.ToMesh(true), Material = MaterialHelper.CreateMaterial(color) };          // create a model
            var model = new ModelVisual3D();
            model.Content = geom;
            _Helix.Children.Add(model);
        }
Exemplo n.º 38
0
 private ModelVisual3D BuildSlideMV3D()
 {
     var mv3d = new ModelVisual3D();
     var gm3d = new GeometryModel3D();
     gm3d.Geometry = BuildTextSlideGeometry3D();
     gm3d.BackMaterial = new DiffuseMaterial(Brushes.Red);
     gm3d.Material = new DiffuseMaterial(Brushes.DarkGreen);
     mv3d.Content = gm3d;
     return mv3d;
 }
Exemplo n.º 39
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
 {
     switch (connectionId)
     {
     case 1:
         this.KinectModel = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
         return;
     }
     this._contentLoaded = true;
 }
Exemplo n.º 40
0
        public Cube(Viewport3D myViewport3D, float obesity)
        {

            this.up = ((PerspectiveCamera)myViewport3D.Camera).UpDirection;
            this.trans = new Transform3DGroup();
            this.scale = new ScaleTransform3D();
            this.translation = new TranslateTransform3D();
            this.rotation = new RotateTransform3D();
            this.axis = new AxisAngleRotation3D();

            this.obesity = obesity;   
            this.cube = new Model3DGroup();

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

            //front side triangles
            cube.Children.Add(CreateTriangleModel(p3, p2, p6));
            cube.Children.Add(CreateTriangleModel(p3, p6, p7));
            //right side triangles
            cube.Children.Add(CreateTriangleModel(p2, p1, p5));
            cube.Children.Add(CreateTriangleModel(p2, p5, p6));
            //back side triangles
            cube.Children.Add(CreateTriangleModel(p1, p0, p4));
            cube.Children.Add(CreateTriangleModel(p1, p4, p5));
            //left side triangles
            cube.Children.Add(CreateTriangleModel(p0, p3, p7));
            cube.Children.Add(CreateTriangleModel(p0, p7, p4));
            //top side triangles
            cube.Children.Add(CreateTriangleModel(p7, p6, p5));
            cube.Children.Add(CreateTriangleModel(p7, p5, p4));
            //bottom side triangles
            cube.Children.Add(CreateTriangleModel(p2, p3, p0));
            cube.Children.Add(CreateTriangleModel(p2, p0, p1));

            this.model = new ModelVisual3D();
            this.model.Content = cube;
            this.myDirectionalLight = new DirectionalLight();
            this.myDirectionalLight.Color = Colors.Green;
            this.myDirectionalLight.Direction = new Vector3D(-2, -3, 1);
            this.cube.Children.Add(myDirectionalLight);
            myViewport3D.Children.Add(model);

            trans.Children.Add(scale);
            trans.Children.Add(rotation);
            trans.Children.Add(translation);

            this.cube.Transform = trans;
        }
Exemplo n.º 41
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:
                this.Window = ((Opdracht1.MainWindow)(target));
                return;

            case 2:
                this.Slider1 = ((System.Windows.Controls.Slider)(target));

            #line 19 "..\..\MainWindow.xaml"
                this.Slider1.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.Slider1_ValueChanged);

            #line default
            #line hidden
                return;

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

            #line 22 "..\..\MainWindow.xaml"
                this.Slider2.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.Slider2_ValueChanged);

            #line default
            #line hidden
                return;

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

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

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

            case 7:
                this.WallContainer = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
                return;

            case 8:
                this.SphereContainer = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
                return;

            case 9:
                this.Light = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 43
0
        public SurfacePlotVisual3D()
        {
            IntervalX = 1;
            IntervalY = 1;
            IntervalZ = 0.25;
            FontSize = 0.06;
            LineThickness = 0.01;

            visualChild = new ModelVisual3D();
            Children.Add(visualChild);
        }
Exemplo n.º 44
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.window = ((RevitArc.Window1)(target));
                return;

            case 2:

            #line 27 "..\..\Window1.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ArcStartPointSelect);

            #line default
            #line hidden
                return;

            case 3:

            #line 32 "..\..\Window1.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.ArcEndPointSelect);

            #line default
            #line hidden
                return;

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

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

            case 6:

            #line 45 "..\..\Window1.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.DoneClick);

            #line default
            #line hidden
                return;

            case 7:
                this.helixviewport = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

            case 8:
                this.MV3D = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.viewPort3d = ((HelixToolkit.Wpf.HelixViewport3D)(target));
     return;
     case 2:
     this.p = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
     return;
     }
     this._contentLoaded = true;
 }
Exemplo n.º 46
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 6 "..\..\..\MainWindow.xaml"
                ((GlyphStartup.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.Window_Closing);

            #line default
            #line hidden
                return;

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

            case 3:
                this.viewPort3d = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

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

            case 5:
                this.model1 = ((HelixToolkit.Wpf.FileModelVisual3D)(target));
                return;

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

            #line 20 "..\..\..\MainWindow.xaml"
                this.button1.Click += new System.Windows.RoutedEventHandler(this.button1_Click);

            #line default
            #line hidden
                return;

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

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

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 47
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;
        }
Exemplo n.º 48
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 9 "..\..\..\..\Views\ProductSlideGallery.xaml"
                ((MagicMirror.Views.ProductSlideGallery)(target)).MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.UserControl_MouseDown);

            #line default
            #line hidden
                return;

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

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

            #line 12 "..\..\..\..\Views\ProductSlideGallery.xaml"
                this.viewport3D.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.viewport3D_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

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

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

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

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

            case 8:
                this.viewLoading = ((MagicMirror.Views.LoadingWait)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 49
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.window = ((PrestressedTendon.Window1)(target));
                return;

            case 2:

            #line 28 "..\..\Window1.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.FlatCurveSelection);

            #line default
            #line hidden
                return;

            case 3:

            #line 33 "..\..\Window1.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.VerticalCurveSelection);

            #line default
            #line hidden
                return;

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

            case 5:

            #line 48 "..\..\Window1.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.DoneClick);

            #line default
            #line hidden
                return;

            case 6:
                this.helixviewport = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

            case 7:
                this.MV3D = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 50
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ctrlPatient = ((TouchlessSurgeonAssistant.ctrlPatientInfo)(target));
                return;

            case 2:
                this.viewPort3d = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

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

            case 4:
                this.Gauze = ((MahApps.Metro.Controls.NumericUpDown)(target));
                return;

            case 5:
                this.Towels = ((MahApps.Metro.Controls.NumericUpDown)(target));
                return;

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

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

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

            case 9:
                this.Screws = ((MahApps.Metro.Controls.NumericUpDown)(target));
                return;

            case 10:
                this.label1 = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 51
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.printGrid = ((System.Windows.Controls.Grid)(target));
                return;

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

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

            #line 77 "..\..\..\Window1.xaml"
                this.btnAction.Click += new System.Windows.RoutedEventHandler(this.btnAction_Click);

            #line default
            #line hidden
                return;

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

            case 5:

            #line 97 "..\..\..\Window1.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Print_Click);

            #line default
            #line hidden
                return;

            case 6:

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

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 52
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;
        }
Exemplo n.º 53
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.myViewport = ((System.Windows.Controls.Viewport3D)(target));
                return;

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

            case 3:
                this.myAngleRotation = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 54
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.BlokContent3D = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

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

            case 3:
                this.ResizeMenu = ((System.Windows.Controls.StackPanel)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.stackPanel = ((System.Windows.Controls.StackPanel)(target));
                return;

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

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

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

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

            case 6:
                this.Ambient = ((System.Windows.Media.Media3D.AmbientLight)(target));
                return;

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

            case 8:
                this.Directional = ((System.Windows.Media.Media3D.DirectionalLight)(target));
                return;

            case 9:
                this.listBox = ((System.Windows.Controls.ListBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 56
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.PanelAll = ((System.Windows.Controls.DockPanel)(target));
                return;

            case 2:
                this.ViewPort3DStackPanel = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 3:
                this.view1 = ((HelixToolkit.Wpf.HelixViewport3D)(target));

            #line 55 "..\..\Window1.xaml"
                this.view1.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.view1_MouseWheel);

            #line default
            #line hidden
                return;

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

            case 5:
                this.view2 = ((HelixToolkit.Wpf.HelixViewport3D)(target));

            #line 70 "..\..\Window1.xaml"
                this.view2.MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.view2_MouseWheel);

            #line default
            #line hidden
                return;

            case 6:
                this.root2 = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 57
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

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

            #line default
            #line hidden
                return;

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

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

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

            case 5:
                this.LightMain = ((System.Windows.Media.Media3D.DirectionalLight)(target));
                return;

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

            #line 53 "..\..\preMain.xaml"
                this.slider1.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slider1_ValueChanged);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 58
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;
        }
Exemplo n.º 59
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 21 "..\..\Trackport3D.xaml"
                ((_3DTools.Trackport3D)(target)).Loaded += new System.Windows.RoutedEventHandler(this.OnLoaded);

            #line default
            #line hidden
                return;

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

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

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

            case 5:
                this.Headlight = ((System.Windows.Media.Media3D.DirectionalLight)(target));
                return;

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

            case 7:
                this.CaptureBorder = ((System.Windows.Controls.Border)(target));
                return;
            }
            this._contentLoaded = true;
        }
Exemplo n.º 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;
        }