/// <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();
        }
Esempio n. 2
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.view1 = ((HelixToolkit.SharpDX.Wpf.Viewport3DX)(target));
     return;
     case 2:
     this.model1 = ((HelixToolkit.SharpDX.Wpf.MeshGeometryModel3D)(target));
     return;
     case 3:
     this.model2 = ((HelixToolkit.SharpDX.Wpf.MeshGeometryModel3D)(target));
     return;
     case 4:
     this.model3 = ((HelixToolkit.SharpDX.Wpf.DraggableGeometryModel3D)(target));
     return;
     case 5:
     this.lines = ((HelixToolkit.SharpDX.Wpf.LineGeometryModel3D)(target));
     return;
     case 6:
     this.translateX = ((HelixToolkit.SharpDX.Wpf.UITranslateManipulator3D)(target));
     return;
     case 7:
     this.translateY = ((HelixToolkit.SharpDX.Wpf.UITranslateManipulator3D)(target));
     return;
     case 8:
     this.translateZ = ((HelixToolkit.SharpDX.Wpf.UITranslateManipulator3D)(target));
     return;
     case 9:
     this.rotateX = ((HelixToolkit.SharpDX.Wpf.UIRotateManipulator3D)(target));
     return;
     case 10:
     this.rotateY = ((HelixToolkit.SharpDX.Wpf.UIRotateManipulator3D)(target));
     return;
     case 11:
     this.rotateZ = ((HelixToolkit.SharpDX.Wpf.UIRotateManipulator3D)(target));
     return;
     case 12:
     this.composit = ((HelixToolkit.SharpDX.Wpf.UICompositeManipulator3D)(target));
     return;
     case 13:
     this.grid = ((HelixToolkit.SharpDX.Wpf.LineGeometryModel3D)(target));
     return;
     case 14:
     this.shadingPanel = ((System.Windows.Controls.Expander)(target));
     return;
     }
     this._contentLoaded = true;
 }
Esempio n. 3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.view1 = ((HelixToolkit.SharpDX.Wpf.Viewport3DX)(target));
                return;

            case 2:
                this.model1 = ((HelixToolkit.SharpDX.Wpf.MeshGeometryModel3D)(target));
                return;

            case 3:
                this.model2 = ((HelixToolkit.SharpDX.Wpf.MeshGeometryModel3D)(target));
                return;

            case 4:
                this.model3 = ((HelixToolkit.SharpDX.Wpf.DraggableGeometryModel3D)(target));
                return;

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

            case 6:
                this.translateX = ((HelixToolkit.SharpDX.Wpf.UITranslateManipulator3D)(target));
                return;

            case 7:
                this.translateY = ((HelixToolkit.SharpDX.Wpf.UITranslateManipulator3D)(target));
                return;

            case 8:
                this.translateZ = ((HelixToolkit.SharpDX.Wpf.UITranslateManipulator3D)(target));
                return;

            case 9:
                this.rotateX = ((HelixToolkit.SharpDX.Wpf.UIRotateManipulator3D)(target));
                return;

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

            case 11:
                this.rotateZ = ((HelixToolkit.SharpDX.Wpf.UIRotateManipulator3D)(target));
                return;

            case 12:
                this.composit = ((HelixToolkit.SharpDX.Wpf.UICompositeManipulator3D)(target));
                return;

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

            case 14:
                this.shadingPanel = ((System.Windows.Controls.Expander)(target));
                return;
            }
            this._contentLoaded = true;
        }
        /// <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();
        }