/// <summary>
        ///
        /// </summary>
        public UICompositeManipulator3D()
        {
            this.translateX = new UITranslateManipulator3D {
                Direction = new Vector3(1, 0, 0), Material = PhongMaterials.Red
            };
            this.translateY = new UITranslateManipulator3D {
                Direction = new Vector3(0, 1, 0), Material = PhongMaterials.Green
            };
            this.translateZ = new UITranslateManipulator3D {
                Direction = new Vector3(0, 0, 1), Material = PhongMaterials.Blue
            };
            this.rotateX = new UIRotateManipulator3D {
                Axis = new Vector3(1, 0, 0), Length = 0.05, Material = PhongMaterials.Red,
            };
            this.rotateY = new UIRotateManipulator3D {
                Axis = new Vector3(0, 1, 0), Length = 0.05, Material = PhongMaterials.Green
            };
            this.rotateZ = new UIRotateManipulator3D {
                Axis = new Vector3(0, 0, 1), Length = 0.05, Material = PhongMaterials.Blue
            };

            // bind UITranslateManipulators3D.TargetTransform to this.Transform
            BindingOperations.SetBinding(this.translateX, UIManipulator3D.TargetTransformProperty, new Binding("TargetTransform")
            {
                Source = this
            });
            BindingOperations.SetBinding(this.translateY, UIManipulator3D.TargetTransformProperty, new Binding("TargetTransform")
            {
                Source = this
            });
            BindingOperations.SetBinding(this.translateZ, UIManipulator3D.TargetTransformProperty, new Binding("TargetTransform")
            {
                Source = this
            });

            BindingOperations.SetBinding(this.rotateX, UIManipulator3D.TargetTransformProperty, new Binding("TargetTransform")
            {
                Source = this
            });
            BindingOperations.SetBinding(this.rotateY, UIManipulator3D.TargetTransformProperty, new Binding("TargetTransform")
            {
                Source = this
            });
            BindingOperations.SetBinding(this.rotateZ, UIManipulator3D.TargetTransformProperty, new Binding("TargetTransform")
            {
                Source = this
            });

            //BindingOperations.SetBinding(this.translateX, UIManipulator3D.TransformProperty, new Binding("TargetTransform") { Source = this });
            //BindingOperations.SetBinding(this.translateY, UIManipulator3D.TransformProperty, new Binding("TargetTransform") { Source = this });
            //BindingOperations.SetBinding(this.translateZ, UIManipulator3D.TransformProperty, new Binding("TargetTransform") { Source = this });

            //BindingOperations.SetBinding(this.rotateX, UIManipulator3D.TransformProperty, new Binding("TargetTransform") { Source = this });
            //BindingOperations.SetBinding(this.rotateY, UIManipulator3D.TransformProperty, new Binding("TargetTransform") { Source = this });
            //BindingOperations.SetBinding(this.rotateZ, UIManipulator3D.TransformProperty, new Binding("TargetTransform") { Source = this });

            // bind this.Transform to this.TargetTransform (TwoWay)
            BindingOperations.SetBinding(this, TransformProperty, new Binding("TargetTransform")
            {
                Source = this, Mode = BindingMode.TwoWay,
            });

            this.OnChildrenChanged();
        }
        /// <summary>
        /// 
        /// </summary>
        public UICompositeManipulator3D()
        {
            this.translateX = new UITranslateManipulator3D { Direction = new Vector3(1, 0, 0), Material = PhongMaterials.Red };
            this.translateY = new UITranslateManipulator3D { Direction = new Vector3(0, 1, 0), Material = PhongMaterials.Green };
            this.translateZ = new UITranslateManipulator3D { Direction = new Vector3(0, 0, 1), Material = PhongMaterials.Blue };
            this.rotateX = new UIRotateManipulator3D { Axis = new Vector3(1, 0, 0), Length = 0.05, Material = PhongMaterials.Red, };
            this.rotateY = new UIRotateManipulator3D { Axis = new Vector3(0, 1, 0), Length = 0.05, Material = PhongMaterials.Green };
            this.rotateZ = new UIRotateManipulator3D { Axis = new Vector3(0, 0, 1), Length = 0.05, Material = PhongMaterials.Blue };

            // bind UITranslateManipulators3D.TargetTransform to this.Transform            
            BindingOperations.SetBinding(this.translateX, UIManipulator3D.TargetTransformProperty, new Binding("TargetTransform") { Source = this });
            BindingOperations.SetBinding(this.translateY, UIManipulator3D.TargetTransformProperty, new Binding("TargetTransform") { Source = this });
            BindingOperations.SetBinding(this.translateZ, UIManipulator3D.TargetTransformProperty, new Binding("TargetTransform") { Source = this });

            BindingOperations.SetBinding(this.rotateX, UIManipulator3D.TargetTransformProperty, new Binding("TargetTransform") { Source = this });
            BindingOperations.SetBinding(this.rotateY, UIManipulator3D.TargetTransformProperty, new Binding("TargetTransform") { Source = this });
            BindingOperations.SetBinding(this.rotateZ, UIManipulator3D.TargetTransformProperty, new Binding("TargetTransform") { Source = this });

            //BindingOperations.SetBinding(this.translateX, UIManipulator3D.TransformProperty, new Binding("TargetTransform") { Source = this });
            //BindingOperations.SetBinding(this.translateY, UIManipulator3D.TransformProperty, new Binding("TargetTransform") { Source = this });
            //BindingOperations.SetBinding(this.translateZ, UIManipulator3D.TransformProperty, new Binding("TargetTransform") { Source = this });

            //BindingOperations.SetBinding(this.rotateX, UIManipulator3D.TransformProperty, new Binding("TargetTransform") { Source = this });
            //BindingOperations.SetBinding(this.rotateY, UIManipulator3D.TransformProperty, new Binding("TargetTransform") { Source = this });
            //BindingOperations.SetBinding(this.rotateZ, UIManipulator3D.TransformProperty, new Binding("TargetTransform") { Source = this });

            // bind this.Transform to this.TargetTransform (TwoWay)
            BindingOperations.SetBinding(this, TransformProperty, new Binding("TargetTransform") { Source = this, Mode = BindingMode.TwoWay, });            

            this.OnChildrenChanged();
        }
Beispiel #3
0
        /// <summary>
        ///
        /// </summary>
        public UICompositeManipulator3D()
        {
            OnSceneNodeCreated += (s, e) =>
            {
                e.Node.OnAttached += SceneNode_OnAttached;
            };
            this.translateX = new UITranslateManipulator3D {
                Direction = new Vector3(1, 0, 0), Material = DiffuseMaterials.Red
            };
            this.translateY = new UITranslateManipulator3D {
                Direction = new Vector3(0, 1, 0), Material = DiffuseMaterials.Green
            };
            this.translateZ = new UITranslateManipulator3D {
                Direction = new Vector3(0, 0, 1), Material = DiffuseMaterials.Blue
            };
            this.rotateX = new UIRotateManipulator3D {
                Axis = new Vector3(1, 0, 0), Length = 0.05, Material = DiffuseMaterials.Red,
            };
            this.rotateY = new UIRotateManipulator3D {
                Axis = new Vector3(0, 1, 0), Length = 0.05, Material = DiffuseMaterials.Green
            };
            this.rotateZ = new UIRotateManipulator3D {
                Axis = new Vector3(0, 0, 1), Length = 0.05, Material = DiffuseMaterials.Blue
            };

            // bind UITranslateManipulators3D.TargetTransform to this.Transform
            BindingOperations.SetBinding(this.translateX, UIManipulator3D.TargetTransformProperty, new Binding("TargetTransform")
            {
                Source = this
            });
            BindingOperations.SetBinding(this.translateY, UIManipulator3D.TargetTransformProperty, new Binding("TargetTransform")
            {
                Source = this
            });
            BindingOperations.SetBinding(this.translateZ, UIManipulator3D.TargetTransformProperty, new Binding("TargetTransform")
            {
                Source = this
            });

            BindingOperations.SetBinding(this.rotateX, UIManipulator3D.TargetTransformProperty, new Binding("TargetTransform")
            {
                Source = this
            });
            BindingOperations.SetBinding(this.rotateY, UIManipulator3D.TargetTransformProperty, new Binding("TargetTransform")
            {
                Source = this
            });
            BindingOperations.SetBinding(this.rotateZ, UIManipulator3D.TargetTransformProperty, new Binding("TargetTransform")
            {
                Source = this
            });

            //BindingOperations.SetBinding(this.translateX, UIManipulator3D.TransformProperty, new Binding("TargetTransform") { Source = this });
            //BindingOperations.SetBinding(this.translateY, UIManipulator3D.TransformProperty, new Binding("TargetTransform") { Source = this });
            //BindingOperations.SetBinding(this.translateZ, UIManipulator3D.TransformProperty, new Binding("TargetTransform") { Source = this });

            //BindingOperations.SetBinding(this.rotateX, UIManipulator3D.TransformProperty, new Binding("TargetTransform") { Source = this });
            //BindingOperations.SetBinding(this.rotateY, UIManipulator3D.TransformProperty, new Binding("TargetTransform") { Source = this });
            //BindingOperations.SetBinding(this.rotateZ, UIManipulator3D.TransformProperty, new Binding("TargetTransform") { Source = this });

            // bind this.Transform to this.TargetTransform (TwoWay)
            BindingOperations.SetBinding(this, TransformProperty, new Binding("TargetTransform")
            {
                Source = this, Mode = BindingMode.TwoWay,
            });

            this.Children.Clear();
            this.Children.Add(this.translateX);
            this.Children.Add(this.translateY);
            this.Children.Add(this.translateZ);
            this.Children.Add(this.rotateX);
            this.Children.Add(this.rotateY);
            this.Children.Add(this.rotateZ);
        }
Beispiel #4
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.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;
        }