コード例 #1
0
ファイル: ViewModel.cs プロジェクト: cokemal/IfcEngineCS
 public ViewModel(Viewport3DX viewport,TreeView _treeview)
 {
     Viewport3D = viewport;
     viewController = new ViewController();
     Model = new Element3DCollection();
     viewController.InitGraphics(Viewport3D, Model,_treeview);
 }
コード例 #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            elementHost = new ElementHost
            {
                Dock = DockStyle.Fill
            };
            panel1.Controls.Add(elementHost);
            viewport3DX       = new HelixToolkit.Wpf.SharpDX.Viewport3DX( );
            elementHost.Child = viewport3DX;
            var b1 = new MeshBuilder();

            b1.AddSphere(new Vector3(0, 0, 0), 0.5);
            b1.AddBox(new Vector3(0, 0, 0), 1, 0.5, 2, BoxFaces.All);
            MeshGeometry3D      model = b1.ToMeshGeometry3D();
            MeshGeometryModel3D test  = new MeshGeometryModel3D
            {
                Material = PhongMaterials.Gold,
                Geometry = model
            };
            var ambientLight = new AmbientLight3D
            {
                Color = new Color4(0.1f, 0.1f, 0.1f, 1.0f)
            };
            var directionalLight = new DirectionalLight3D
            {
                Color     = SharpDX.Color.White,
                Direction = new Vector3(-2, -5, -2)
            };

            viewport3DX.Items.Add(ambientLight);
            viewport3DX.Items.Add(directionalLight);
            //test.Attach( viewport3DX );
            viewport3DX.Items.Add(test);
        }
コード例 #3
0
ファイル: ViewModel.cs プロジェクト: LinJiarui/IfcEngineCS
        public MainViewModel(Viewport3DX viewport, TreeView treeview)
        {
            // ----------------------------------------------
            // titles
            this.Title = "Ifc Viewer";
            this.SubTitle = "By LinJiarui";

            // ----------------------------------------------
            // camera setup
            this.Camera = new PerspectiveCamera { Position = new Point3D(8, 9, 7), LookDirection = new Vector3D(-5, -12, -5), UpDirection = new Vector3D(0, 0, 1) };

            // ----------------------------------------------
            // setup scene
            this.AmbientLightColor = new Color4(0.2f, 0.2f, 0.2f, 1.0f);

            this.RenderLight1 = true;
            this.RenderLight2 = false;
            this.RenderLight3 = false;
            this.RenderLight4 = true;

            this.Light1Color = (Color4)Color.White;
            this.Light2Color = (Color4)Color.Red;
            this.Light3Color = (Color4)Color.LightYellow;
            this.Light4Color = (Color4)Color.LightBlue;

            this.Light2Attenuation = new Vector3(1.0f, 0.5f, 0.10f);
            this.Light3Attenuation = new Vector3(1.0f, 0.1f, 0.05f);
            this.Light4Attenuation = new Vector3(1.0f, 0.2f, 0.0f);

            this.Light1Direction = new Vector3(0, -10, -10);
            this.Light1Transform = new TranslateTransform3D(-Light1Direction.ToVector3D());
            //            this.Light1DirectionTransform = CreateAnimatedTransform2(-Light1Direction.ToVector3D(), new Vector3D(0, 1, -1), 24);

            //            this.Light2Transform = CreateAnimatedTransform1(new Vector3D(-4, 0, 0), new Vector3D(0, 0, 1), 3);
            //            this.Light3Transform = CreateAnimatedTransform1(new Vector3D(0, 0, 4), new Vector3D(0, 1, 0), 5);

            this.Light4Direction = new Vector3(0, -5, 0);
            this.Light4Transform = new TranslateTransform3D(-Light4Direction.ToVector3D());
            //            this.Light4DirectionTransform = CreateAnimatedTransform2(-Light4Direction.ToVector3D(), new Vector3D(1, 0, 0), 12);

            // ----------------------------------------------
            // light model3d
            var sphere = new MeshBuilder();
            sphere.AddSphere(new Vector3(0, 0, 0), 0.2);
            Sphere = sphere.ToMeshGeometry3D();
            this.LightModelMaterial = new PhongMaterial {
                AmbientColor = Color.Gray,
                DiffuseColor = Color.Gray,
                EmissiveColor = Color.Yellow,
                SpecularColor = Color.Black,
            };

            viewController = new ViewController();
            Model = new Element3DCollection();
            viewController.InitGraphics(viewport, Model, treeview);
        }
コード例 #4
0
 public override void OnMouse3DUp(object sender, RoutedEventArgs e)
 {
     base.OnMouse3DUp(sender, e);
     if (this.isCaptured)
     {
         this.isCaptured = false;
         this.camera = null;
         this.viewport = null;
     }
 }
コード例 #5
0
        public override void OnMouse3DDown(object sender, RoutedEventArgs e)
        {
            base.OnMouse3DDown(sender, e);

            var args = e as Mouse3DEventArgs;
            if (args == null) return;
            if (args.Viewport == null) return;

            this.isCaptured = true;
            this.viewport = args.Viewport;
            this.camera = args.Viewport.Camera;
            this.lastHitPos = args.HitTestResult.PointHit;
        }
コード例 #6
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.view1 = ((HelixToolkit.Wpf.SharpDX.Viewport3DX)(target));
                return;

            case 2:
                this.grid = ((HelixToolkit.Wpf.SharpDX.LineGeometryModel3D)(target));
                return;

            case 3:
                this.arrows = ((HelixToolkit.Wpf.SharpDX.LineGeometryModel3D)(target));
                return;

            case 4:
                this.points = ((HelixToolkit.Wpf.SharpDX.PointGeometryModel3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
コード例 #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZoomRectangleHandler"/> class.
 /// </summary>
 /// <param name="viewport">
 /// The viewport.
 /// </param>
 public ZoomRectangleHandler(Viewport3DX viewport)
     : base(viewport)
 {
 }
コード例 #8
0
ファイル: ViewModel.cs プロジェクト: cokemal/IfcEngineCS
        public void ZoomExtents(Viewport3DX viewport, Rect3D bounds)
        {
            var diagonal = new Vector3D(bounds.SizeX, bounds.SizeY, bounds.SizeZ);
            var center = bounds.Location + (diagonal * 0.5);
            double radius = diagonal.Length * 0.5;
            HelixToolkit.Wpf.SharpDX.PerspectiveCamera Camera = new HelixToolkit.Wpf.SharpDX.PerspectiveCamera()
            {

                Position = new Point3D(center.X + 30, center.Y + 30, center.Z + 50),
                LookDirection = new Vector3D(-30, -30, -50),
                UpDirection = new Vector3D(0, 0, 1),
                FarPlaneDistance = 5000000,
                FieldOfView = 45,
                NearPlaneDistance = 0.1,

            };
            viewport.Camera.Reset();
            viewport.Camera = Camera;
        }
コード例 #9
0
ファイル: ZoomHandler.cs プロジェクト: ORRNY66/helix-toolkit
 /// <summary>
 /// Initializes a new instance of the <see cref="ZoomHandler"/> class.
 /// </summary>
 /// <param name="viewport">
 /// The viewport.
 /// </param>
 /// <param name="changeFieldOfView">
 /// if set to <c>true</c> [change field of view].
 /// </param>
 public ZoomHandler(Viewport3DX viewport, bool changeFieldOfView = false)
     : base(viewport)
 {
     this.changeFieldOfView = changeFieldOfView;
 }
コード例 #10
0
        /// <summary>
        /// Zooms the camera to the specified rectangle.
        /// </summary>
        /// <param name="camera">
        /// The camera.
        /// </param>
        /// <param name="viewport">
        /// The viewport.
        /// </param>
        /// <param name="zoomRectangle">
        /// The zoom rectangle.
        /// </param>
        public static void ZoomToRectangle(this Camera camera, Viewport3DX viewport, Rect zoomRectangle)
        {
            var pcam = camera as ProjectionCamera;
            if (pcam == null)
            {
                return;
            }

            var topLeftRay = viewport.UnProjectToRay(zoomRectangle.TopLeft);
            var topRightRay = viewport.UnProjectToRay(zoomRectangle.TopRight);
            var centerRay =
                viewport.UnProjectToRay(
                    new Point(
                        (zoomRectangle.Left + zoomRectangle.Right) * 0.5,
                        (zoomRectangle.Top + zoomRectangle.Bottom) * 0.5));

            if (topLeftRay == null || topRightRay == null || centerRay == null)
            {
                // could not invert camera matrix
                return;
            }

            var u = topLeftRay.Direction;
            var v = topRightRay.Direction;
            var w = centerRay.Direction;
            u.Normalize();
            v.Normalize();
            w.Normalize();
            var perspectiveCamera = camera as PerspectiveCamera;
            if (perspectiveCamera != null)
            {
                var distance = pcam.LookDirection.Length;

                // option 1: change distance
                var newDistance = distance * zoomRectangle.Width / viewport.ActualWidth;
                var newLookDirection = newDistance * w;
                var newPosition = perspectiveCamera.Position + ((distance - newDistance) * w);
                var newTarget = newPosition + newLookDirection;
                LookAt(pcam, newTarget, newLookDirection, 200);

                // option 2: change fov
                // double newFieldOfView = Math.Acos(Vector3D.DotProduct(u, v));
                // var newTarget = camera.Position + distance * w;
                // pcamera.FieldOfView = newFieldOfView * 180 / Math.PI;
                // LookAt(camera, newTarget, distance * w, 0);
            }

            var orthographicCamera = camera as OrthographicCamera;
            if (orthographicCamera != null)
            {
                orthographicCamera.Width *= zoomRectangle.Width / viewport.ActualWidth;
                var oldTarget = pcam.Position + pcam.LookDirection;
                var distance = pcam.LookDirection.Length;
                var newTarget = centerRay.PlaneIntersection(oldTarget, w);
                if (newTarget != null)
                {
                    orthographicCamera.LookDirection = w * distance;
                    orthographicCamera.Position = newTarget.Value - orthographicCamera.LookDirection;
                }
            }
        }
コード例 #11
0
        /// <summary>
        /// Zooms to fit the specified sphere.
        /// </summary>
        /// <param name="camera">
        /// The camera.
        /// </param>
        /// <param name="viewport">
        /// The viewport.
        /// </param>
        /// <param name="center">
        /// The center of the sphere.
        /// </param>
        /// <param name="radius">
        /// The radius of the sphere.
        /// </param>
        /// <param name="animationTime">
        /// The animation time.
        /// </param>
        public static void ZoomExtents(
            this Camera camera, Viewport3DX viewport, Point3D center, double radius, double animationTime = 0)
        {
            var projectionCamera = camera as ProjectionCamera;
            if (projectionCamera == null)
            {
                return;
            }

            // var target = Camera.Position + Camera.LookDirection;
            if (camera is PerspectiveCamera)
            {
                var pcam = camera as PerspectiveCamera;
                double disth = radius / Math.Tan(0.5 * pcam.FieldOfView * Math.PI / 180);
                double vfov = pcam.FieldOfView / viewport.ActualWidth * viewport.ActualHeight;
                double distv = radius / Math.Tan(0.5 * vfov * Math.PI / 180);

                double dist = Math.Max(disth, distv);
                var dir = projectionCamera.LookDirection;
                dir.Normalize();
                LookAt(projectionCamera, center, dir * dist, animationTime);
            }

            if (camera is OrthographicCamera)
            {
                LookAt(projectionCamera, center, projectionCamera.LookDirection, animationTime);
                double newWidth = radius * 2;

                if (viewport.ActualWidth > viewport.ActualHeight)
                {
                    newWidth = radius * 2 * viewport.ActualWidth / viewport.ActualHeight;
                }

                AnimateWidth(camera as OrthographicCamera, newWidth, animationTime);
            }
        }
コード例 #12
0
ファイル: ViewModel.cs プロジェクト: cokemal/IfcEngineCS
        /// <summary>
        /// Zooms to the extents of the specified bounding sphere.
        /// </summary>
        /// <param name="viewport">The viewport.</param>
        /// <param name="center">The center of the sphere.</param>
        /// <param name="radius">The radius of the sphere.</param>
        /// <param name="animationTime">The animation time.</param>
        public static void ZoomExtent(Viewport3DX viewport, Point3D center, double radius, double animationTime = 0)
        {
            var camera = viewport.Camera;
            var pcam = camera as HelixToolkit.Wpf.SharpDX.PerspectiveCamera;
            if (pcam != null)
            {
                double disth = radius / Math.Tan(0.5 * pcam.FieldOfView * Math.PI / 180);
                double vfov = pcam.FieldOfView / viewport.ActualWidth * viewport.ActualHeight;
                double distv = radius / Math.Tan(0.5 * vfov * Math.PI / 180);

                double dist = Math.Max(disth, distv);
                var dir = pcam.LookDirection;
                dir.Normalize();
                pcam.LookAt(center, dir * dist, animationTime);
            }

            var ocam = camera as HelixToolkit.Wpf.SharpDX.OrthographicCamera;
            if (ocam != null)
            {
                ocam.LookAt(center, ocam.LookDirection, animationTime);
                double newWidth = radius * 2;

                if (viewport.ActualWidth > viewport.ActualHeight)
                {
                    newWidth = radius * 2 * viewport.ActualWidth / viewport.ActualHeight;
                }

                ocam.AnimateWidth(newWidth, animationTime);
            }
        }
コード例 #13
0
 public Mouse3DEventArgs(RoutedEvent routedEvent, object source, HitTestResult hitTestResult, Point position, Viewport3DX viewport = null)
     : base(routedEvent, source)
 {
     this.HitTestResult = hitTestResult;
     this.Position = position;
     this.Viewport = viewport;
 }
コード例 #14
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnMouse3DDown(object sender, RoutedEventArgs e)
        {
            base.OnMouse3DDown(sender, e);

            var args = e as Mouse3DEventArgs;
            if (args == null) return;
            if (args.Viewport == null) return;

            this.isMouseCaptured = true;
            this.viewport = args.Viewport;
            this.cameraNormal = args.Viewport.Camera.LookDirection.ToVector3();
            this.lastHitPosWS = args.HitTestResult.PointHit.ToVector3();
        }
コード例 #15
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.gridDropArea = ((System.Windows.Controls.Grid)(target));
                return;

            case 2:
                this.cbCalculation = ((System.Windows.Controls.ComboBox)(target));
                return;

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

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

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

            case 6:
                this.nudTaxRate = ((MahApps.Metro.Controls.NumericUpDown)(target));
                return;

            case 7:
                this.ExpanderMultipleGcodeParserView = ((System.Windows.Controls.Expander)(target));
                return;

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

            case 9:
                this.mslbStl = ((PrintCostCalculator3d.Controls.MultiSelectListBox)(target));
                return;

            case 10:

            #line 1018 "..\..\..\..\Views\3dPrinting\3dPrintingCalculationView.xaml"
                ((System.Windows.Controls.ContextMenu)(target)).Opened += new System.Windows.RoutedEventHandler(this.ContextMenu_Opened);

            #line default
            #line hidden
                return;

            case 11:

            #line 1032 "..\..\..\..\Views\3dPrinting\3dPrintingCalculationView.xaml"
                ((System.Windows.Controls.ContextMenu)(target)).Opened += new System.Windows.RoutedEventHandler(this.ContextMenu_Opened);

            #line default
            #line hidden
                return;

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

            case 13:
                this.mslbGCode = ((PrintCostCalculator3d.Controls.MultiSelectListBox)(target));
                return;

            case 14:

            #line 1251 "..\..\..\..\Views\3dPrinting\3dPrintingCalculationView.xaml"
                ((System.Windows.Controls.ContextMenu)(target)).Opened += new System.Windows.RoutedEventHandler(this.ContextMenu_Opened);

            #line default
            #line hidden
                return;

            case 15:

            #line 1265 "..\..\..\..\Views\3dPrinting\3dPrintingCalculationView.xaml"
                ((System.Windows.Controls.ContextMenu)(target)).Opened += new System.Windows.RoutedEventHandler(this.ContextMenu_Opened);

            #line default
            #line hidden
                return;

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

            case 17:
                this.lbPrinters = ((PrintCostCalculator3d.Controls.MultiSelectListBox)(target));
                return;

            case 18:
                this.TextBoxSearchMaterial = ((System.Windows.Controls.TextBox)(target));
                return;

            case 19:
                this.lbMaterials = ((PrintCostCalculator3d.Controls.MultiSelectListBox)(target));
                return;

            case 20:
                this.ExpanderAdvancedView = ((System.Windows.Controls.Expander)(target));
                return;

            case 21:
                this.TextBoxSearchOffers = ((System.Windows.Controls.TextBox)(target));
                return;

            case 22:
                this.lbOffers = ((PrintCostCalculator3d.Controls.MultiSelectListBox)(target));
                return;

            case 23:
                this.view3d = ((HelixToolkit.Wpf.SharpDX.Viewport3DX)(target));
                return;

            case 24:
                this.cbGcode = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 25:
                this.view2dGcode = ((HelixToolkit.Wpf.SharpDX.Viewport3DX)(target));
                return;

            case 26:
                this.view3dGcode = ((HelixToolkit.Wpf.SharpDX.Viewport3DX)(target));
                return;

            case 27:
                this.group = ((HelixToolkit.Wpf.SharpDX.GroupModel3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
コード例 #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MouseGestureHandler"/> class.
 /// </summary>
 /// <param name="viewport">
 /// The viewport.
 /// </param>
 protected MouseGestureHandler(Viewport3DX viewport)
 {
     this.Viewport = viewport;
     this.ManipulationWatch = new Stopwatch();
 }
コード例 #17
0
ファイル: PanHandler.cs プロジェクト: ORRNY66/helix-toolkit
 /// <summary>
 /// Initializes a new instance of the <see cref="PanHandler"/> class.
 /// </summary>
 /// <param name="viewport">
 /// The viewport.
 /// </param>
 public PanHandler(Viewport3DX viewport)
     : base(viewport)
 {
 }
コード例 #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RotateHandler"/> class.
 /// </summary>
 /// <param name="controller">
 /// The controller.
 /// </param>
 /// <param name="changeLookAt">
 /// The change look at.
 /// </param>
 public RotateHandler(Viewport3DX controller, bool changeLookAt = false)
     : base(controller)
 {
     this.changeLookAt = changeLookAt;
 }
コード例 #19
0
ファイル: Exporter.cs プロジェクト: dermeister0/helix-toolkit
        /// <summary>
        /// Exports the specified viewport.
        /// Exports model, camera and lights.
        /// </summary>
        /// <param name="viewport">
        /// The viewport.
        /// </param>
        public virtual void Export(Viewport3DX viewport)
        {
            this.ExportHeader();
            this.ExportViewport(viewport);

            // Export objects
            viewport.Traverse<GeometryModel3D>(this.ExportModel);

            // Export camera
            //this.ExportCamera(viewport.Camera);

            // Export lights
            //viewport.Children.Traverse<Light>(this.ExportLight);
        }
コード例 #20
0
ファイル: Exporter.cs プロジェクト: dermeister0/helix-toolkit
 /// <summary>
 /// Exports the viewport.
 /// </summary>
 /// <param name="viewport">
 /// The viewport.
 /// </param>
 protected virtual void ExportViewport(Viewport3DX viewport)
 {
 }
コード例 #21
0
        private void OnEdgeMouse3DDown(object sender, RoutedEventArgs e)
        {
            var args = e as Mouse3DEventArgs;
            if (args == null) return;
            if (args.Viewport == null) return;

            this.isCaptured = true;
            this.viewport = args.Viewport;
            this.camera = args.Viewport.Camera;
            this.lastHitPos = args.HitTestResult.PointHit;
        }
コード例 #22
0
 private void OnEdgeMouse3DUp(object sender, RoutedEventArgs e)
 {            
     if (this.isCaptured)
     {
         Application.Current.MainWindow.Cursor = Cursors.Arrow;
         this.isCaptured = false;
         this.camera = null;
         this.viewport = null;
     }
 }
コード例 #23
0
        /// <summary>
        /// Zooms to fit the specified bounding rectangle.
        /// </summary>
        /// <param name="camera">
        /// The actual camera.
        /// </param>
        /// <param name="viewport">
        /// The viewport.
        /// </param>
        /// <param name="bounds">
        /// The bounding rectangle.
        /// </param>
        /// <param name="animationTime">
        /// The animation time.
        /// </param>
        public static void ZoomExtents(
            this Camera camera, Viewport3DX viewport, Rect3D bounds, double animationTime = 0)
        {
            var projectionCamera = camera as ProjectionCamera;
            if (projectionCamera == null)
            {
                return;
            }

            var diagonal = new Vector3D(bounds.SizeX, bounds.SizeY, bounds.SizeZ);
            var center = bounds.Location + (diagonal * 0.5);
            double radius = diagonal.Length * 0.5;
            ZoomExtents(projectionCamera, viewport, center, radius, animationTime);
        }
コード例 #24
0
 public MouseMove3DEventArgs(object source, HitTestResult hitTestResult, Point position, Viewport3DX viewport = null)
     : base(GeometryModel3D.MouseMove3DEvent, source, hitTestResult, position, viewport)
 { }
コード例 #25
0
ファイル: ViewModel.cs プロジェクト: LinJiarui/IfcEngineCS
        public void ZoomExtent(Viewport3DX viewport, double animationTime = 200)
        {
            var c = viewController.Center;
            var center = new Point3D(c.X, c.Y, c.Z);
            var radius = (viewController.Max - viewController.Min).Length() * 0.5;
            var camera = this.Camera;

            var pcam = camera as HelixToolkit.Wpf.SharpDX.PerspectiveCamera;
            if (pcam != null) {
                pcam.FarPlaneDistance = radius * 100;
                pcam.NearPlaneDistance = radius * 0.02;

                double disth = radius / Math.Tan(0.5 * pcam.FieldOfView * Math.PI / 180);
                double vfov = pcam.FieldOfView / viewport.ActualWidth * viewport.ActualHeight;
                double distv = radius / Math.Tan(0.5 * vfov * Math.PI / 180);

                double dist = Math.Max(disth, distv);
                var dir = pcam.LookDirection;
                dir.Normalize();
                pcam.LookAt(center, dir * dist, animationTime);
            }

            var ocam = camera as HelixToolkit.Wpf.SharpDX.OrthographicCamera;
            if (ocam != null) {
                ocam.LookAt(center, ocam.LookDirection, animationTime);
                double newWidth = radius * 2;

                if (viewport.ActualWidth > viewport.ActualHeight) {
                    newWidth = radius * 2 * viewport.ActualWidth / viewport.ActualHeight;
                }

                ocam.AnimateWidth(newWidth, animationTime);
            }
        }
コード例 #26
0
 public void InitGraphics(Viewport3DX viewport,Element3DCollection model,TreeView _treeview)
 {
     this.model = model;
     hVp3D = viewport;
     _treeControl = _treeview;
     BindMouseHandler();
 }
コード例 #27
0
        /// <summary>
        /// Zooms to fit the extents of the specified viewport.
        /// </summary>
        /// <param name="camera">
        /// The actual camera.
        /// </param>
        /// <param name="viewport">
        /// The viewport.
        /// </param>
        /// <param name="animationTime">
        /// The animation time.
        /// </param>
        public static void ZoomExtents(
            this Camera camera, Viewport3DX viewport, double animationTime = 0)
        {
            var bounds = viewport.FindBounds();
            var diagonal = new Vector3D(bounds.SizeX, bounds.SizeY, bounds.SizeZ);

            if (bounds.IsEmpty || diagonal.LengthSquared.Equals(0))
            {
                return;
            }

            ZoomExtents(camera as ProjectionCamera, viewport, bounds, animationTime);
        }
コード例 #28
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.ViewPort3D = ((HelixToolkit.Wpf.SharpDX.Viewport3DX)(target));
     return;
     case 2:
     this.shadingPanel = ((System.Windows.Controls.Expander)(target));
     return;
     case 3:
     this.RenderTechnqiueComboBox = ((System.Windows.Controls.ComboBox)(target));
     
     #line 56 "..\..\..\Controls\Watch3DxControl.xaml"
     this.RenderTechnqiueComboBox.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.Selector_OnSelectionChanged);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }
コード例 #29
0
ファイル: MainWindow.g.i.cs プロジェクト: bangush/AIBot
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.view1 = ((HelixToolkit.Wpf.SharpDX.Viewport3DX)(target));
                return;

            case 2:
                this.bodyline = ((HelixToolkit.Wpf.SharpDX.LineGeometryModel3D)(target));
                return;

            case 3:
                this.leg1 = ((HelixToolkit.Wpf.SharpDX.LineGeometryModel3D)(target));
                return;

            case 4:
                this.leg2 = ((HelixToolkit.Wpf.SharpDX.LineGeometryModel3D)(target));
                return;

            case 5:
                this.leg3 = ((HelixToolkit.Wpf.SharpDX.LineGeometryModel3D)(target));
                return;

            case 6:
                this.leg4 = ((HelixToolkit.Wpf.SharpDX.LineGeometryModel3D)(target));
                return;

            case 7:
                this.leg5 = ((HelixToolkit.Wpf.SharpDX.LineGeometryModel3D)(target));
                return;

            case 8:
                this.leg6 = ((HelixToolkit.Wpf.SharpDX.LineGeometryModel3D)(target));
                return;

            case 9:
                this.grid = ((HelixToolkit.Wpf.SharpDX.LineGeometryModel3D)(target));
                return;

            case 10:
                this.rotateY = ((HelixToolkit.Wpf.SharpDX.UIRotateManipulator3D)(target));
                return;

            case 11:
                this.groupBox = ((System.Windows.Controls.GroupBox)(target));
                return;

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

            #line 80 "..\..\MainWindow.xaml"
                this.btForward.Click += new System.Windows.RoutedEventHandler(this.btForward_Click);

            #line default
            #line hidden
                return;

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

            #line 81 "..\..\MainWindow.xaml"
                this.btBack.Click += new System.Windows.RoutedEventHandler(this.btBack_Click);

            #line default
            #line hidden
                return;

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

            #line 82 "..\..\MainWindow.xaml"
                this.btLeft.Click += new System.Windows.RoutedEventHandler(this.btLeft_Click);

            #line default
            #line hidden
                return;

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

            #line 83 "..\..\MainWindow.xaml"
                this.btRight.Click += new System.Windows.RoutedEventHandler(this.btRight_Click);

            #line default
            #line hidden
                return;

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

            #line 84 "..\..\MainWindow.xaml"
                this.btBodyUp.Click += new System.Windows.RoutedEventHandler(this.btBodyUp_Click);

            #line default
            #line hidden
                return;

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

            #line 85 "..\..\MainWindow.xaml"
                this.btBodyDown.Click += new System.Windows.RoutedEventHandler(this.btBodyDown_Click);

            #line default
            #line hidden
                return;

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

            #line 86 "..\..\MainWindow.xaml"
                this.btEndWalk.Click += new System.Windows.RoutedEventHandler(this.btEndWalk_Click);

            #line default
            #line hidden
                return;

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

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

            #line 88 "..\..\MainWindow.xaml"
                this.button8.Click += new System.Windows.RoutedEventHandler(this.button8_Click);

            #line default
            #line hidden
                return;

            case 21:
                this.shadingPanel = ((System.Windows.Controls.Expander)(target));
                return;

            case 22:
                this.comboPortName = ((System.Windows.Controls.ComboBox)(target));
                return;

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

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

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }