示例#1
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;
        }
        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();
        }
        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;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.PerspectiveCamera = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

            case 2:
                this.containerUIElement3D = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
                return;

            case 3:
                this.FrontViewport2DVisual3D = ((System.Windows.Media.Media3D.Viewport2DVisual3D)(target));
                return;

            case 4:
                this.newS = ((System.Windows.Controls.Button)(target));

            #line 169 "..\..\..\Transform\Viewport3DTransform.xaml"
                this.newS.Click += new System.Windows.RoutedEventHandler(this.newS_Click);

            #line default
            #line hidden
                return;

            case 5:
                this.BackViewport2DVisual3D = ((System.Windows.Media.Media3D.Viewport2DVisual3D)(target));
                return;

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

            #line 215 "..\..\..\Transform\Viewport3DTransform.xaml"
                this.setS.Click += new System.Windows.RoutedEventHandler(this.setS_Click);

            #line default
            #line hidden
                return;

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

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

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

            // var geometry = e.Result as List<Geometryhandler.MeshIdandGeometry>;

            var viewport = new ModelVisual3D();
            ViewPort3D.Children.Add(viewport);
            ViewPort3D.Children.Add(container);
            ViewPort3D.ShowFrameRate = true;
            ViewPort3D.ZoomExtents();
        }
        public MainWindow()
        {
            InitializeComponent();

            var container = new ContainerUIElement3D();
            var element = new ModelUIElement3D();
            var geometry = new GeometryModel3D();
            var meshBuilder = new MeshBuilder();
            meshBuilder.AddSphere(new Point3D(0, 0, 0), 2, 100, 50);
            geometry.Geometry = meshBuilder.ToMesh();
            geometry.Material = Materials.Green;
            element.Model = geometry;
            element.Transform = new TranslateTransform3D(5, 0, 0);
            element.MouseDown += this.ContainerElementMouseDown;
            container.Children.Add(element);
            view1.Children.Add(container);
        }
        public MainWindow()
        {
            InitializeComponent();

            var c = new ContainerUIElement3D();
            var e = new ModelUIElement3D();
            var gm = new GeometryModel3D();
            var mb = new MeshBuilder();
            mb.AddSphere(new Point3D(0, 0, 0), 2, 100, 50);
            gm.Geometry = mb.ToMesh();
            gm.Material = Materials.Red;
            e.Model = gm;
            e.Transform = new TranslateTransform3D(5, 0, 0);
            e.MouseDown += (sender, args) => gm.Material = Materials.Yellow;
            c.Children.Add(e);
            view1.Children.Add(c);

            //e.Visibility = Visibility.Hidden;
            //this.Dispatcher.BeginInvoke(DispatcherPriority.Send, new ThreadStart(delegate
            //{
            //    e.Visibility = Visibility.Visible;
            //}));
        }
示例#8
0
        /// <summary>
        ///     OnElementMouseDown: Click Event for each geometric element
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <param name="watch3DNode"></param>
        protected void OnElementMouseDown(object sender, MouseButtonEventArgs e, Watch3DNode watch3DNode)
        {
            // Check null expression
            // if (e == null) throw new ArgumentNullException(nameof(e));

            // 1-CLick event
            if (e.LeftButton != MouseButtonState.Pressed)
                return;

            // Get sender
            var element = sender as ModelUIElement3D;

            // Check Type
            if (element != null)
            {
                var geometryModel3D = element.Model as GeometryModel3D;
                if (geometryModel3D == null)
                    return;

                // If it is already selected ... Deselect
                if (SelectedModels.Contains(geometryModel3D))
                {
                    geometryModel3D.Material = geometryModel3D.BackMaterial;
                    SelectedModels.Remove(geometryModel3D);
                }
                // If not ... Select!
                else
                {
                    SelectedModels.Add(geometryModel3D);
                    geometryModel3D.Material = _selectionMaterial;
                }
            }

            // Set selected models to Output ...  
            if (SelectedModels != null && SelectedModels.Count != 0)
            {
                var container = new ContainerUIElement3D();
                foreach (var geom in SelectedModels)
                    container.Children.Add(new ModelUIElement3D {Model = geom});

                OutputPorts[0].Data = container;
            }

            e.Handled = true;
        }
示例#9
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.addserver = ((GloryView.RFID.DeviceMigrations.Addserver)(target));
                return;

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

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

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

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

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

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

            case 8:
                this.spotLight = ((System.Windows.Media.Media3D.SpotLight)(target));
                return;

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

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

            #line 61 "..\..\..\..\DeviceMigrations\Addserver.xaml"
                this.label2.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.upclick);

            #line default
            #line hidden
                return;

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

            #line 66 "..\..\..\..\DeviceMigrations\Addserver.xaml"
                this.label3.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.downclick);

            #line default
            #line hidden
                return;

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

            #line 74 "..\..\..\..\DeviceMigrations\Addserver.xaml"
                this.button1.Click += new System.Windows.RoutedEventHandler(this.button1_Click_1);

            #line default
            #line hidden
                return;

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

            #line 75 "..\..\..\..\DeviceMigrations\Addserver.xaml"
                this.button2.Click += new System.Windows.RoutedEventHandler(this.button2_Click);

            #line default
            #line hidden
                return;

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

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

            case 16:
                this.textBox3 = ((System.Windows.Controls.TextBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#10
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;
 }
        private void WorkerOnRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs runWorkerCompletedEventArgs)
        {
            if (runWorkerCompletedEventArgs.Result == null)
            {
                Dispatcher.BeginInvoke((Action)delegate ()
                {
                    ProgressBar.Visibility = Visibility.Collapsed;
                    ProgressLabel.Visibility = Visibility.Collapsed;
                });
                return;
            }

            Dispatcher.BeginInvoke((Action)delegate ()
            {
                ProgressBar.Visibility = Visibility.Collapsed;
                ProgressLabel.Visibility = Visibility.Collapsed;
            });

            var container = new ContainerUIElement3D();

            // BimPlusData
            if (runWorkerCompletedEventArgs.Result.GetType() == typeof(List<MeshIdandGeometry>))
            {
                var geometry = runWorkerCompletedEventArgs.Result as List<MeshIdandGeometry>;

                // Set it globally 
                MyGeometry = geometry;

                if (MyGeometry != null)
                    foreach (var mygeometry in MyGeometry)
                    {
                        var newgeometry = mygeometry.Model3D.Clone();
                        var element = new ModelUIElement3D { Model = newgeometry };
                        element.MouseDown += (sender1, e1) => OnElementMouseDown(sender1, e1, this);
                        container.Children.Add(element);
                    }

                // First of all clear the view 
                HelixViewport3D.Children.Clear();
                HelixViewport3D.Children.Add(container);
                HelixViewport3D.CameraController.ZoomExtents();
                HelixViewport3D.Children.Add(new SunLight());
                // HelixViewport3D.Children.Add(new DefaultLights());
            }
            // Other File Data
            else if (runWorkerCompletedEventArgs.Result is ModelVisual3D)
            {
                var model = runWorkerCompletedEventArgs.Result as ModelVisual3D;

                HelixViewport3D.Children.Clear();
                HelixViewport3D.Children.Add(model);
                HelixViewport3D.CameraController.ZoomExtents();
                HelixViewport3D.Children.Add(new DefaultLights());
            }
        }
示例#12
0
        private void LoadViewport()
        {
            _viewport =
                Application.LoadComponent(new Uri("/FluidKit;component/Controls/ElementFlow/Viewport.xaml", UriKind.Relative)) as
                Viewport3D;
            InternalResources = _viewport.Resources;

            // Container for containing the mesh models of elements
            _modelContainer = _viewport.FindName("ModelContainer") as ContainerUIElement3D;
        }
示例#13
0
        private ContainerUIElement3D CreateMarker(double length, double width)
        {
            length /= m_scale;
            width /= m_scale;

            ContainerUIElement3D visual = new ContainerUIElement3D();
            visual.Children.Add(new ModelUIElement3D()
            {
                Model = new GeometryModel3D()
                {
                    Geometry = new MeshGeometry3D()
                    {
                        Positions = new Point3DCollection(){
                            new Point3D(length, 0, 0),
                            new Point3D(0, width, 0),
                            new Point3D(0, -width, 0),
                            new Point3D(length, 0, 0),
                            new Point3D(0, 0, width),
                            new Point3D(0, 0, -width),
                        },
                    },
                    Material = new DiffuseMaterial()
                    {
                        Brush = new SolidColorBrush(Colors.Red),
                    },
                    BackMaterial = new DiffuseMaterial()
                    {
                        Brush = new SolidColorBrush(Colors.Red),
                    },
                },
            });
            visual.Children.Add(new ModelUIElement3D()
            {
                Model = new GeometryModel3D()
                {
                    Geometry = new MeshGeometry3D()
                    {
                        Positions = new Point3DCollection(){
                            new Point3D(0, length, 0),
                            new Point3D(width, 0, 0),
                            new Point3D(-width, 0, 0),
                            new Point3D(0, length, 0),
                            new Point3D(0, 0, width),
                            new Point3D(0, 0, -width),
                        },
                    },
                    Material = new DiffuseMaterial()
                    {
                        Brush = new SolidColorBrush(Colors.Lime),
                    },
                    BackMaterial = new DiffuseMaterial()
                    {
                        Brush = new SolidColorBrush(Colors.Lime),
                    },
                },
            });
            visual.Children.Add(new ModelUIElement3D()
            {
                Model = new GeometryModel3D()
                {
                    Geometry = new MeshGeometry3D()
                    {
                        Positions = new Point3DCollection(){
                            new Point3D(0, 0, length),
                            new Point3D(width, 0, 0),
                            new Point3D(-width, 0, 0),
                            new Point3D(0, 0, length),
                            new Point3D(0, width, 0),
                            new Point3D(0, -width, 0),
                        },
                    },
                    Material = new DiffuseMaterial()
                    {
                        Brush = new SolidColorBrush(Colors.Blue),
                    },
                    BackMaterial = new DiffuseMaterial()
                    {
                        Brush = new SolidColorBrush(Colors.Blue),
                    },
                },
            });

            return visual;
        }
示例#14
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.listBox = ((System.Windows.Controls.ListBox)(target));

            #line 18 "..\..\..\..\DeviceMigrations\motor.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));

            #line 28 "..\..\..\..\DeviceMigrations\motor.xaml"
                this.button5.Click += new System.Windows.RoutedEventHandler(this.button5_Click);

            #line default
            #line hidden
                return;

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

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

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

            #line 31 "..\..\..\..\DeviceMigrations\motor.xaml"
                this.button1.Click += new System.Windows.RoutedEventHandler(this.button1_Click_1);

            #line default
            #line hidden
                return;

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

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

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

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

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

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

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

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

            case 14:
                this.spotLight = ((System.Windows.Media.Media3D.SpotLight)(target));
                return;

            case 15:
                this.canvas1 = ((System.Windows.Controls.Canvas)(target));
                return;

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

            #line 58 "..\..\..\..\DeviceMigrations\motor.xaml"
                this.label2.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.arrowupclick);

            #line default
            #line hidden
                return;

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

            #line 63 "..\..\..\..\DeviceMigrations\motor.xaml"
                this.label3.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.arrowdownclick);

            #line default
            #line hidden
                return;

            case 18:
                this.label4 = ((System.Windows.Controls.Label)(target));

            #line 68 "..\..\..\..\DeviceMigrations\motor.xaml"
                this.label4.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.arrowleftclick);

            #line default
            #line hidden
                return;

            case 19:
                this.label5 = ((System.Windows.Controls.Label)(target));

            #line 73 "..\..\..\..\DeviceMigrations\motor.xaml"
                this.label5.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.arrowrightclick);

            #line default
            #line hidden
                return;

            case 20:
                this.label6 = ((System.Windows.Controls.Label)(target));

            #line 78 "..\..\..\..\DeviceMigrations\motor.xaml"
                this.label6.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.arrowaddclick);

            #line default
            #line hidden
                return;

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

            #line 83 "..\..\..\..\DeviceMigrations\motor.xaml"
                this.label7.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.arrowdelclick);

            #line default
            #line hidden
                return;

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

            #line 88 "..\..\..\..\DeviceMigrations\motor.xaml"
                this.label9.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.rebackclick);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.myGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 2:
     this.viewportGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 3:
     this.myViewport3D = ((System.Windows.Controls.Viewport3D)(target));
     return;
     case 4:
     this.regular = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
     return;
     case 5:
     this.church = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
     return;
     case 6:
     this.apartment = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
     return;
     case 7:
     this.commercial = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
     return;
     case 8:
     this.construction = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
     return;
     case 9:
     this.farmland = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
     return;
     case 10:
     this.forest = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
     return;
     case 11:
     this.garages = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
     return;
     case 12:
     this.grass = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
     return;
     case 13:
     this.industrial = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
     return;
     case 14:
     this.railway = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
     return;
     case 15:
     this.residential = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
     return;
     case 16:
     this.others = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
     return;
     case 17:
     this.grassSurface = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
     return;
     case 18:
     this.myModelVisual3D = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
     return;
     case 19:
     this.selection = ((System.Windows.Controls.TreeView)(target));
     return;
     case 20:
     this.checkBoxRegular = ((System.Windows.Controls.CheckBox)(target));
     
     #line 39 "..\..\..\PresentationLayer\MainWindow.xaml"
     this.checkBoxRegular.Click += new System.Windows.RoutedEventHandler(this.checkBoxRegular_Click);
     
     #line default
     #line hidden
     return;
     case 21:
     this.checkBoxChurch = ((System.Windows.Controls.CheckBox)(target));
     
     #line 40 "..\..\..\PresentationLayer\MainWindow.xaml"
     this.checkBoxChurch.Click += new System.Windows.RoutedEventHandler(this.checkBoxChurch_Click);
     
     #line default
     #line hidden
     return;
     case 22:
     this.checkBoxApartment = ((System.Windows.Controls.CheckBox)(target));
     
     #line 41 "..\..\..\PresentationLayer\MainWindow.xaml"
     this.checkBoxApartment.Click += new System.Windows.RoutedEventHandler(this.checkBoxApartment_Click);
     
     #line default
     #line hidden
     return;
     case 23:
     this.checkBoxCommercial = ((System.Windows.Controls.CheckBox)(target));
     
     #line 45 "..\..\..\PresentationLayer\MainWindow.xaml"
     this.checkBoxCommercial.Click += new System.Windows.RoutedEventHandler(this.checkBoxCommercial_Click);
     
     #line default
     #line hidden
     return;
     case 24:
     this.checkBoxConstruction = ((System.Windows.Controls.CheckBox)(target));
     
     #line 46 "..\..\..\PresentationLayer\MainWindow.xaml"
     this.checkBoxConstruction.Click += new System.Windows.RoutedEventHandler(this.checkBoxConstruction_Click);
     
     #line default
     #line hidden
     return;
     case 25:
     this.checkBoxFarmland = ((System.Windows.Controls.CheckBox)(target));
     
     #line 47 "..\..\..\PresentationLayer\MainWindow.xaml"
     this.checkBoxFarmland.Click += new System.Windows.RoutedEventHandler(this.checkBoxFarmland_Click);
     
     #line default
     #line hidden
     return;
     case 26:
     this.checkBoxForest = ((System.Windows.Controls.CheckBox)(target));
     
     #line 48 "..\..\..\PresentationLayer\MainWindow.xaml"
     this.checkBoxForest.Click += new System.Windows.RoutedEventHandler(this.checkBoxForest_Click);
     
     #line default
     #line hidden
     return;
     case 27:
     this.checkBoxGarages = ((System.Windows.Controls.CheckBox)(target));
     
     #line 49 "..\..\..\PresentationLayer\MainWindow.xaml"
     this.checkBoxGarages.Click += new System.Windows.RoutedEventHandler(this.checkBoxGarages_Click);
     
     #line default
     #line hidden
     return;
     case 28:
     this.checkBoxGrass = ((System.Windows.Controls.CheckBox)(target));
     
     #line 50 "..\..\..\PresentationLayer\MainWindow.xaml"
     this.checkBoxGrass.Click += new System.Windows.RoutedEventHandler(this.checkBoxGrass_Click);
     
     #line default
     #line hidden
     return;
     case 29:
     this.checkBoxIndustrial = ((System.Windows.Controls.CheckBox)(target));
     
     #line 51 "..\..\..\PresentationLayer\MainWindow.xaml"
     this.checkBoxIndustrial.Click += new System.Windows.RoutedEventHandler(this.checkBoxIndustrial_Click);
     
     #line default
     #line hidden
     return;
     case 30:
     this.checkBoxRailway = ((System.Windows.Controls.CheckBox)(target));
     
     #line 52 "..\..\..\PresentationLayer\MainWindow.xaml"
     this.checkBoxRailway.Click += new System.Windows.RoutedEventHandler(this.checkBoxRailway_Click);
     
     #line default
     #line hidden
     return;
     case 31:
     this.checkBoxResidentia = ((System.Windows.Controls.CheckBox)(target));
     
     #line 53 "..\..\..\PresentationLayer\MainWindow.xaml"
     this.checkBoxResidentia.Click += new System.Windows.RoutedEventHandler(this.checkBoxResidentia_Click);
     
     #line default
     #line hidden
     return;
     case 32:
     this.checkBoxOthers = ((System.Windows.Controls.CheckBox)(target));
     
     #line 54 "..\..\..\PresentationLayer\MainWindow.xaml"
     this.checkBoxOthers.Click += new System.Windows.RoutedEventHandler(this.checkBoxOthers_Click);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }
示例#16
0
		public override void OnApplyTemplate ()
		{
			base.OnApplyTemplate();
			Viewport = GetTemplateChild("PART_Viewport") as Viewport3D;
			_modelContainer = GetTemplateChild("PART_ModelContainer") as ContainerUIElement3D;

			SetupEventHandlers();
		}
示例#17
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.Window = ((Opdracht2.MainWindow)(target));

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

            #line default
            #line hidden
                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;

            case 10:

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

            #line default
            #line hidden
                return;

            case 11:

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

            #line default
            #line hidden
                return;

            case 12:

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

            #line default
            #line hidden
                return;

            case 13:

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

            #line default
            #line hidden
                return;

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

            case 15:
                this.BallRadiusTextBox = ((System.Windows.Controls.TextBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#18
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.addusetrol = ((GloryView.RFID.DeviceMigrations.OldEquipment)(target));
                return;

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

            case 3:
                this.oldgrid = ((System.Windows.Controls.Grid)(target));
                return;

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

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

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

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

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

            case 9:
                this.comboBox1 = ((System.Windows.Controls.ComboBox)(target));

            #line 40 "..\..\..\..\DeviceMigrations\OldEquipment.xaml"
                this.comboBox1.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.comboBox1_SelectionChanged);

            #line default
            #line hidden
                return;

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

            #line 49 "..\..\..\..\DeviceMigrations\OldEquipment.xaml"
                this.button3.Click += new System.Windows.RoutedEventHandler(this.button3_Click);

            #line default
            #line hidden
                return;

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

            #line 50 "..\..\..\..\DeviceMigrations\OldEquipment.xaml"
                this.button1.Click += new System.Windows.RoutedEventHandler(this.button1_Click);

            #line default
            #line hidden
                return;

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

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

            #line 60 "..\..\..\..\DeviceMigrations\OldEquipment.xaml"
                this.viewport1.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.rightleftdown);

            #line default
            #line hidden
                return;

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

            case 15:
                this.FurnitureContainer2 = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
                return;

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

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

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

            case 19:
                this.spotLight = ((System.Windows.Media.Media3D.SpotLight)(target));
                return;
            }
            this._contentLoaded = true;
        }
        public List<MeshIdandGeometry> VisualizeBimPlusDataAsGenericElements(List<DtObject> baseElements, object sender, Color Color = default(Color), double transparency = 0)
        {
            if (InputPorts[0].Data == null)
                return null;

            var max = baseElements.Count;
            var m_i = 1;

            // Init some lists and containers
            var container = new ContainerUIElement3D();
            var geometry = new List<MeshIdandGeometry>();

            // Init the MeshBuilde
            var meshBuilder = new MeshBuilder(false, false);

            // Loop the items of each list
            foreach (var item in baseElements)
            {
                var color = item.AttributeGroups["geometry"].GetProperty("color") is System.Drawing.Color ? (System.Drawing.Color) item.AttributeGroups["geometry"].GetProperty("color") : new System.Drawing.Color();

                Color col;
                if (Color != default(Color))
                {
                    col = Color;
                }
                else
                {
                    // Check Color
                    col = new Color{A = color.A,G = color.G,R = color.R,B = color.B};
                }

                var brush = new SolidColorBrush { Color = col, Opacity = 1 - transparency };

                var myGeometryModel = new GeometryModel3D
                {
                    Material = new DiffuseMaterial(brush),
                    BackMaterial = new DiffuseMaterial(brush),
                    Geometry = MeshObject(item, meshBuilder),
                    Transform = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(1, 0, 0), 90))
                };

                myGeometryModel.Freeze();

                // Save the parsed data in the objects
                var meshAndId = new MeshIdandGeometry
                {
                    Id = item.Id,
                    Model3D = myGeometryModel,
                    Material = myGeometryModel.Material
                };

                geometry.Add(meshAndId);
                // Save the parsed information in the elements attribute group
                item.AttributeGroups["geometry"]["parsedGeometry"] = meshAndId;

                // Refresh the builder so that we do not duplicate the meshes 
                meshBuilder = new MeshBuilder(false, false);

                m_i++;
                var progressPercentage = Convert.ToInt32(((double)m_i / max) * 100);
                var backgroundWorker = sender as BackgroundWorker;
                backgroundWorker?.ReportProgress(progressPercentage, item.Id);
            }

            container.Children.Clear();
            return geometry;
        }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     
     #line 8 "..\..\MainWindow.xaml"
     ((WpfApplication2.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.MainWindow_Loaded);
     
     #line default
     #line hidden
     return;
     case 2:
     this.buttonReset = ((System.Windows.Controls.Button)(target));
     
     #line 14 "..\..\MainWindow.xaml"
     this.buttonReset.Click += new System.Windows.RoutedEventHandler(this.buttonReset_Click);
     
     #line default
     #line hidden
     return;
     case 3:
     
     #line 16 "..\..\MainWindow.xaml"
     ((System.Windows.Controls.DockPanel)(target)).MouseWheel += new System.Windows.Input.MouseWheelEventHandler(this.MouseWheelHandler);
     
     #line default
     #line hidden
     
     #line 17 "..\..\MainWindow.xaml"
     ((System.Windows.Controls.DockPanel)(target)).MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.MouseDownHandler);
     
     #line default
     #line hidden
     
     #line 18 "..\..\MainWindow.xaml"
     ((System.Windows.Controls.DockPanel)(target)).MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.MouseUpHandler);
     
     #line default
     #line hidden
     
     #line 19 "..\..\MainWindow.xaml"
     ((System.Windows.Controls.DockPanel)(target)).MouseMove += new System.Windows.Input.MouseEventHandler(this.MouseMoveHandler);
     
     #line default
     #line hidden
     return;
     case 4:
     this.Viewport = ((System.Windows.Controls.Viewport3D)(target));
     return;
     case 5:
     this.camera = ((System.Windows.Media.Media3D.OrthographicCamera)(target));
     return;
     case 6:
     this.UIGroup = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
     return;
     case 7:
     this.Model = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
     return;
     case 8:
     this.ModelGroup = ((System.Windows.Media.Media3D.Model3DGroup)(target));
     return;
     case 9:
     this.Grid = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
     return;
     case 10:
     this.GridGroup = ((System.Windows.Media.Media3D.Model3DGroup)(target));
     return;
     case 11:
     this.FixedLight = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
     return;
     case 12:
     this.FixedLightGroup = ((System.Windows.Media.Media3D.Model3DGroup)(target));
     return;
     }
     this._contentLoaded = true;
 }
示例#21
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.textBox1 = ((System.Windows.Controls.TextBox)(target));
     return;
     case 2:
     this.textBox2 = ((System.Windows.Controls.TextBox)(target));
     return;
     case 3:
     this.textBox3 = ((System.Windows.Controls.TextBox)(target));
     return;
     case 4:
     this.viewport2 = ((System.Windows.Controls.Viewport3D)(target));
     return;
     case 5:
     this.myPerspectiveCamera = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
     return;
     case 6:
     this.FurnitureContainer3 = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
     return;
     case 7:
     this.viewportLightsModelVisual3D = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
     return;
     case 8:
     this.ambientLight = ((System.Windows.Media.Media3D.AmbientLight)(target));
     return;
     case 9:
     this.directionalLight = ((System.Windows.Media.Media3D.DirectionalLight)(target));
     return;
     case 10:
     this.spotLight = ((System.Windows.Media.Media3D.SpotLight)(target));
     return;
     case 11:
     this.canvas = ((System.Windows.Controls.Canvas)(target));
     return;
     case 12:
     this.label2 = ((System.Windows.Controls.Label)(target));
     
     #line 54 "..\..\..\..\DeviceMigrations\addwindow.xaml"
     this.label2.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.upclick);
     
     #line default
     #line hidden
     return;
     case 13:
     this.label3 = ((System.Windows.Controls.Label)(target));
     
     #line 59 "..\..\..\..\DeviceMigrations\addwindow.xaml"
     this.label3.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.downclick);
     
     #line default
     #line hidden
     return;
     case 14:
     this.button2 = ((System.Windows.Controls.Button)(target));
     
     #line 67 "..\..\..\..\DeviceMigrations\addwindow.xaml"
     this.button2.Click += new System.Windows.RoutedEventHandler(this.button2_Click);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }
示例#22
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.listBox = ((System.Windows.Controls.ListBox)(target));
     
     #line 18 "..\..\..\..\DeviceMigrations\motor.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));
     
     #line 28 "..\..\..\..\DeviceMigrations\motor.xaml"
     this.button5.Click += new System.Windows.RoutedEventHandler(this.button5_Click);
     
     #line default
     #line hidden
     return;
     case 3:
     this.label1 = ((System.Windows.Controls.Label)(target));
     return;
     case 4:
     this.textBox1 = ((System.Windows.Controls.TextBox)(target));
     return;
     case 5:
     this.button1 = ((System.Windows.Controls.Button)(target));
     
     #line 31 "..\..\..\..\DeviceMigrations\motor.xaml"
     this.button1.Click += new System.Windows.RoutedEventHandler(this.button1_Click_1);
     
     #line default
     #line hidden
     return;
     case 6:
     this.label8 = ((System.Windows.Controls.Label)(target));
     return;
     case 7:
     this.SenceGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 8:
     this.viewport = ((System.Windows.Controls.Viewport3D)(target));
     return;
     case 9:
     this.myPerspectiveCamera = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
     return;
     case 10:
     this.FurnitureContainer = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
     return;
     case 11:
     this.viewportLightsModelVisual3D = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
     return;
     case 12:
     this.ambientLight = ((System.Windows.Media.Media3D.AmbientLight)(target));
     return;
     case 13:
     this.directionalLight = ((System.Windows.Media.Media3D.DirectionalLight)(target));
     return;
     case 14:
     this.spotLight = ((System.Windows.Media.Media3D.SpotLight)(target));
     return;
     case 15:
     this.canvas1 = ((System.Windows.Controls.Canvas)(target));
     return;
     case 16:
     this.label2 = ((System.Windows.Controls.Label)(target));
     
     #line 58 "..\..\..\..\DeviceMigrations\motor.xaml"
     this.label2.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.arrowupclick);
     
     #line default
     #line hidden
     return;
     case 17:
     this.label3 = ((System.Windows.Controls.Label)(target));
     
     #line 63 "..\..\..\..\DeviceMigrations\motor.xaml"
     this.label3.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.arrowdownclick);
     
     #line default
     #line hidden
     return;
     case 18:
     this.label4 = ((System.Windows.Controls.Label)(target));
     
     #line 68 "..\..\..\..\DeviceMigrations\motor.xaml"
     this.label4.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.arrowleftclick);
     
     #line default
     #line hidden
     return;
     case 19:
     this.label5 = ((System.Windows.Controls.Label)(target));
     
     #line 73 "..\..\..\..\DeviceMigrations\motor.xaml"
     this.label5.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.arrowrightclick);
     
     #line default
     #line hidden
     return;
     case 20:
     this.label6 = ((System.Windows.Controls.Label)(target));
     
     #line 78 "..\..\..\..\DeviceMigrations\motor.xaml"
     this.label6.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.arrowaddclick);
     
     #line default
     #line hidden
     return;
     case 21:
     this.label7 = ((System.Windows.Controls.Label)(target));
     
     #line 83 "..\..\..\..\DeviceMigrations\motor.xaml"
     this.label7.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.arrowdelclick);
     
     #line default
     #line hidden
     return;
     case 22:
     this.label9 = ((System.Windows.Controls.Label)(target));
     
     #line 88 "..\..\..\..\DeviceMigrations\motor.xaml"
     this.label9.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.rebackclick);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }
        public List<MeshIdandGeometry> VisualizeBimPlusDataAsDbGeometry(List<DbGeometry> baseElements, object sender)
        {
            if (InputPorts[0].Data == null)
                return null;

            var max = baseElements.Count;
            var m_i = 1;

            // Init some lists and containers
            var container = new ContainerUIElement3D();
            var geometry = new List<MeshIdandGeometry>();

            // Init the MeshBuilde
            var meshBuilder = new MeshBuilder(false, false);

            // Loop the items of each list
            foreach (var item in baseElements)
            {
                /*
                // Get the geometric data from the AttributeGroups
                var points = (IList<Point3D>) item.Vertices;

                var triangleindices = item.AttributeGroups["geometry"].Attributes["geometryindices"];
                var indices =
                    (from index in triangleindices as IList<uint> select Convert.ToInt32(index)).ToList();

                for (var i = 0; i < indices.Count; i++)
                {
                    if (indices[i] == 0)
                    {
                        meshBuilder.AddTriangle(points[indices[i + 1]], points[indices[i + 2]],
                            points[indices[i + 3]]);

                        i = i + 3;
                    }
                    else if (indices[i] == 1)
                    {
                        meshBuilder.AddQuad(points[indices[i + 1]], points[indices[i + 2]],
                            points[indices[i + 3]],
                            points[indices[i + 4]]);
                        i = i + 4;
                    }
                }

                // Get the color of each representation group
                var color = Convert.ToInt64(item.AttributeGroups["geometry"].Attributes["color"]);
                var tempcolor = Color.FromArgb((int)color);

                var col = new System.Windows.Media.Color
                {
                    A = tempcolor.A,
                    G = tempcolor.G,
                    R = tempcolor.R,
                    B = tempcolor.B
                };

                var myGeometryModel = new GeometryModel3D
                {
                    Material = new DiffuseMaterial(new SolidColorBrush(col)),
                    BackMaterial = new DiffuseMaterial(new SolidColorBrush(col)),
                    Geometry = meshBuilder.ToMesh(true),
                    Transform = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(1, 0, 0), 90))
                };

                myGeometryModel.Freeze();

                var meshAndId = new MeshIdandGeometry
                {
                    Id = item.Id,
                    Model3D = myGeometryModel,
                    Material = myGeometryModel.Material
                };

                geometry.Add(meshAndId);

                // Save the parsed information in the elements attribute group
                item.AttributeGroups["geometry"].Attributes["parsedGeometry"] = meshAndId;

                // Refresh the builder so that we do not duplicate the meshes 
                meshBuilder = new MeshBuilder(false, false);

                m_i++;
                var progressPercentage = Convert.ToInt32(((double)m_i / max) * 100);
                var backgroundWorker = sender as BackgroundWorker;
                backgroundWorker?.ReportProgress(progressPercentage, item.Id);
                */
            }

            container.Children.Clear();
            return geometry;
        }
示例#24
0
        protected void LoadViewport()
        {
            Uri uri = new Uri("/RoDuino.SMS;component/Components/RoApplicationMenu/Viewport3D.xaml", UriKind.Relative);
            _viewport = Application.LoadComponent(uri) as Viewport3D;
            InternalResources = _viewport.Resources;

            // Container for containing the mesh models of elements
            _modelContainer = _viewport.FindName("ModelContainer") as ContainerUIElement3D;
        }
示例#25
0
 private void LoadViewport()
 {
     _viewport = Application.LoadComponent(new Uri("/FluidKit;component/Controls/VirtFlow/Viewport.xaml", UriKind.Relative)) as Viewport3D;
     if (_viewport != null)
     {
         InternalResources = _viewport.Resources;
         RenderOptions.SetEdgeMode(_viewport, EdgeMode.Aliased);
         RenderOptions.SetCachingHint(_viewport, CachingHint.Cache);
         RenderOptions.SetBitmapScalingMode(_viewport, BitmapScalingMode.LowQuality);
         // Container for containing the mesh models of elements
         _modelContainer = _viewport.FindName("ModelContainer") as ContainerUIElement3D;
     }
 }
示例#26
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.oldgrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 2:
     this.grid1 = ((System.Windows.Controls.Grid)(target));
     return;
     case 3:
     this.roomName = ((System.Windows.Controls.Label)(target));
     return;
     case 4:
     this.label2 = ((System.Windows.Controls.Label)(target));
     return;
     case 5:
     this.comboBox1 = ((System.Windows.Controls.ComboBox)(target));
     
     #line 27 "..\..\..\..\DeviceMigrations\addposition.xaml"
     this.comboBox1.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.comboBox1_SelectionChanged);
     
     #line default
     #line hidden
     return;
     case 6:
     this.label1 = ((System.Windows.Controls.Label)(target));
     return;
     case 7:
     this.label3 = ((System.Windows.Controls.Label)(target));
     return;
     case 8:
     this.button3 = ((System.Windows.Controls.Button)(target));
     
     #line 38 "..\..\..\..\DeviceMigrations\addposition.xaml"
     this.button3.Click += new System.Windows.RoutedEventHandler(this.button3_Click);
     
     #line default
     #line hidden
     return;
     case 9:
     this.viewport1 = ((System.Windows.Controls.Viewport3D)(target));
     
     #line 41 "..\..\..\..\DeviceMigrations\addposition.xaml"
     this.viewport1.MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.rightleftdown);
     
     #line default
     #line hidden
     return;
     case 10:
     this.myPerspectiveCamera = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
     return;
     case 11:
     this.FurnitureContainer2 = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
     return;
     case 12:
     this.viewportLightsModelVisual3D = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
     return;
     case 13:
     this.ambientLight = ((System.Windows.Media.Media3D.AmbientLight)(target));
     return;
     case 14:
     this.directionalLight = ((System.Windows.Media.Media3D.DirectionalLight)(target));
     return;
     case 15:
     this.spotLight = ((System.Windows.Media.Media3D.SpotLight)(target));
     return;
     }
     this._contentLoaded = true;
 }
示例#27
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.myGrid = ((System.Windows.Controls.Grid)(target));
                return;

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

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

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

            case 5:
                this.church = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
                return;

            case 6:
                this.apartment = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
                return;

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

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

            case 9:
                this.farmland = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
                return;

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

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

            case 12:
                this.grass = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
                return;

            case 13:
                this.industrial = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
                return;

            case 14:
                this.railway = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
                return;

            case 15:
                this.residential = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
                return;

            case 16:
                this.others = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
                return;

            case 17:
                this.grassSurface = ((System.Windows.Media.Media3D.ContainerUIElement3D)(target));
                return;

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

            case 19:
                this.selection = ((System.Windows.Controls.TreeView)(target));
                return;

            case 20:
                this.checkBoxRegular = ((System.Windows.Controls.CheckBox)(target));

            #line 39 "..\..\..\PresentationLayer\MainWindow.xaml"
                this.checkBoxRegular.Click += new System.Windows.RoutedEventHandler(this.checkBoxRegular_Click);

            #line default
            #line hidden
                return;

            case 21:
                this.checkBoxChurch = ((System.Windows.Controls.CheckBox)(target));

            #line 40 "..\..\..\PresentationLayer\MainWindow.xaml"
                this.checkBoxChurch.Click += new System.Windows.RoutedEventHandler(this.checkBoxChurch_Click);

            #line default
            #line hidden
                return;

            case 22:
                this.checkBoxApartment = ((System.Windows.Controls.CheckBox)(target));

            #line 41 "..\..\..\PresentationLayer\MainWindow.xaml"
                this.checkBoxApartment.Click += new System.Windows.RoutedEventHandler(this.checkBoxApartment_Click);

            #line default
            #line hidden
                return;

            case 23:
                this.checkBoxCommercial = ((System.Windows.Controls.CheckBox)(target));

            #line 45 "..\..\..\PresentationLayer\MainWindow.xaml"
                this.checkBoxCommercial.Click += new System.Windows.RoutedEventHandler(this.checkBoxCommercial_Click);

            #line default
            #line hidden
                return;

            case 24:
                this.checkBoxConstruction = ((System.Windows.Controls.CheckBox)(target));

            #line 46 "..\..\..\PresentationLayer\MainWindow.xaml"
                this.checkBoxConstruction.Click += new System.Windows.RoutedEventHandler(this.checkBoxConstruction_Click);

            #line default
            #line hidden
                return;

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

            #line 47 "..\..\..\PresentationLayer\MainWindow.xaml"
                this.checkBoxFarmland.Click += new System.Windows.RoutedEventHandler(this.checkBoxFarmland_Click);

            #line default
            #line hidden
                return;

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

            #line 48 "..\..\..\PresentationLayer\MainWindow.xaml"
                this.checkBoxForest.Click += new System.Windows.RoutedEventHandler(this.checkBoxForest_Click);

            #line default
            #line hidden
                return;

            case 27:
                this.checkBoxGarages = ((System.Windows.Controls.CheckBox)(target));

            #line 49 "..\..\..\PresentationLayer\MainWindow.xaml"
                this.checkBoxGarages.Click += new System.Windows.RoutedEventHandler(this.checkBoxGarages_Click);

            #line default
            #line hidden
                return;

            case 28:
                this.checkBoxGrass = ((System.Windows.Controls.CheckBox)(target));

            #line 50 "..\..\..\PresentationLayer\MainWindow.xaml"
                this.checkBoxGrass.Click += new System.Windows.RoutedEventHandler(this.checkBoxGrass_Click);

            #line default
            #line hidden
                return;

            case 29:
                this.checkBoxIndustrial = ((System.Windows.Controls.CheckBox)(target));

            #line 51 "..\..\..\PresentationLayer\MainWindow.xaml"
                this.checkBoxIndustrial.Click += new System.Windows.RoutedEventHandler(this.checkBoxIndustrial_Click);

            #line default
            #line hidden
                return;

            case 30:
                this.checkBoxRailway = ((System.Windows.Controls.CheckBox)(target));

            #line 52 "..\..\..\PresentationLayer\MainWindow.xaml"
                this.checkBoxRailway.Click += new System.Windows.RoutedEventHandler(this.checkBoxRailway_Click);

            #line default
            #line hidden
                return;

            case 31:
                this.checkBoxResidentia = ((System.Windows.Controls.CheckBox)(target));

            #line 53 "..\..\..\PresentationLayer\MainWindow.xaml"
                this.checkBoxResidentia.Click += new System.Windows.RoutedEventHandler(this.checkBoxResidentia_Click);

            #line default
            #line hidden
                return;

            case 32:
                this.checkBoxOthers = ((System.Windows.Controls.CheckBox)(target));

            #line 54 "..\..\..\PresentationLayer\MainWindow.xaml"
                this.checkBoxOthers.Click += new System.Windows.RoutedEventHandler(this.checkBoxOthers_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
示例#28
-1
        /// <summary>
        ///     Read FileData
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public ContainerUIElement3D ReadFileData(string path)
        {
            var extension = Path.GetExtension(path);
            // var visModel = new ModelVisual3D();
            var container = new ContainerUIElement3D();

            switch (extension)
            {
                case ".obj":
                    var currentHelixObjReader = new ObjReader();
                    try
                    {
                        var myModel = currentHelixObjReader.Read(path);

                        foreach (var model in myModel.Children)
                        {
                            if (model is GeometryModel3D)
                            {
                                var geom = model as GeometryModel3D;

                                var element = new ModelUIElement3D {Model = geom};
                                element.MouseDown += (sender1, e1) => OnElementMouseDown(sender1, e1, this);
                                container.Children.Add(element);
                            }
                        }
                    }
                    catch (Exception)
                    {
                        // ignore
                    }
                    break;
                case ".stl":
                    var currentHelixStlReader = new StLReader();
                    try
                    {
                        var myModel = currentHelixStlReader.Read(path);

                        foreach (var model in myModel.Children)
                        {
                            if (model is GeometryModel3D)
                            {
                                var geom = model as GeometryModel3D;

                                var element = new ModelUIElement3D {Model = geom};
                                element.MouseDown += (sender1, e1) => OnElementMouseDown(sender1, e1, this);
                                container.Children.Add(element);
                            }
                        }
                    }
                    catch (Exception)
                    {
                        // ignore
                    }
                    break;
            }

            return container;
        }