Inheritance: System.Windows.Controls.ItemsControl, IHelixViewport3D
        private void Create3DViewPort()
        {
            var hvp3d = new HelixViewport3D();
            Viewport3D vp3d = new Viewport3D();
            var lights = new DefaultLights();
            var tp = new Teapot();

            hvp3d.Children.Add(lights);
            hvp3d.Children.Add(tp);

            vp3d = hvp3d.Viewport;
            tata.Children.Add(vp3d); // comenter ca pour test

            /* MEGA TEST DE L'ESPACE SUBSAHARIEN */

            RenderTargetBitmap bmp = new RenderTargetBitmap(800, 800, 96, 96, PixelFormats.Pbgra32);
            var rect = new Rect(0, 0, 800, 800);
            vp3d.Measure(new Size(800, 800));
            vp3d.Arrange(rect);
            vp3d.InvalidateVisual();
            
            bmp.Render(vp3d);

            PngBitmapEncoder png = new PngBitmapEncoder();
            png.Frames.Add(BitmapFrame.Create(bmp));

            String filepath = "C:\\Users\\Remi\\Desktop\\canardmasque.png";
            using (Stream stm = File.Create(filepath))
            {
                png.Save(stm);
            }
        }
示例#2
0
            public Body(HelixViewport3D viewport, MotionBodyData.Body bodyData)
            {
                this.viewport = viewport;
                this.bodyData = bodyData;

                CreateJoints();
                CreateBones(bodyData);
            }
        public void Test_Level5_AddsEnemies()
        {
            var view = new HelixToolkit.Wpf.HelixViewport3D();
            var manager = new LanguageBoosterGame.LevelManager(view);

            bool AddsEnemies = LevelAddsEnemies(manager.LoadLevel5, view);
            Assert.IsTrue(AddsEnemies);
        }
示例#4
0
文件: Robot.cs 项目: Arkady92/PUSN
 public PUMA(HelixViewport3D viewport, ModelVisual3D start, ModelVisual3D end)
 {
     startFrame = start;
     endFrame = end;
     converter = Singleton<EulerToQuaternionConverter>.Instance;
     mathHelper = Singleton<MathHelper>.Instance;
     Initialize(viewport);
 }
        public void Test_Initialization()
        {
            var view = new HelixToolkit.Wpf.HelixViewport3D();
            var manager = new LanguageBoosterGame.LevelManager(view);

            var generators = manager.LevelGenertorsReadOnly;

            Assert.Greater(generators.Count, 0);
        }
示例#6
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
 {
     switch (connectionId)
     {
     case 1:
         this.viewPort3d = ((HelixToolkit.Wpf.HelixViewport3D)(target));
         return;
     }
     this._contentLoaded = true;
 }
        // TODO : Update MVVM Logic for ViewPort and ModelVisual3D
        public Display3DModelGridViewModel(HelixViewport3D helixViewPort, ModelVisual3D visual3D)
        {
            viewPortModelGetter = new ViewPortModelGetter();

            Session.CurrentSession.ModelVisual = visual3D;
            Session.CurrentSession.Viewport = helixViewPort;
            //Session.CurrentSession.Viewport.Camera.NearPlaneDistance = double.NegativeInfinity;
            Session.CurrentSession.PropertyChanged += CurrentSession_PropertyChanged;
            OnMouseMoveCommand = new RelayCommand(OnMouseMove);
            OnMouseDownCommand = new RelayCommand(OnMouseDown);
        }
示例#8
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

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

            #line default
            #line hidden
                return;

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

            #line 12 "..\..\MainWindow.xaml"
                this.start_button.Click += new System.Windows.RoutedEventHandler(this.button);

            #line default
            #line hidden
                return;

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

            #line 17 "..\..\MainWindow.xaml"
                this.connection_button.Click += new System.Windows.RoutedEventHandler(this.connect);

            #line default
            #line hidden
                return;

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

            #line 22 "..\..\MainWindow.xaml"
                this.stream_button.Click += new System.Windows.RoutedEventHandler(this.stream);

            #line default
            #line hidden
                return;

            case 5:
                this.Avatar = ((System.Windows.Controls.Border)(target));
                return;

            case 6:
                this.m_helix_viewport = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#9
0
        public MainViewModel(HelixViewport3D viewport)
        {
            if (viewport == null)
            {
                throw new ArgumentNullException("viewport");
            }

            this.dispatcher = Dispatcher.CurrentDispatcher;
            this.viewport = viewport;

            this.currentModelPath = shirtList[0];
        }
示例#10
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.window = ((RevitArc.Window1)(target));
                return;

            case 2:

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

            #line default
            #line hidden
                return;

            case 3:

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

            #line default
            #line hidden
                return;

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

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

            case 6:

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

            #line default
            #line hidden
                return;

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

            case 8:
                this.MV3D = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#11
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.viewPort3d = ((HelixToolkit.Wpf.HelixViewport3D)(target));

            #line 11 "..\..\Window1.xaml"
                this.viewPort3d.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(this.ViewPort3D_OnMouseLeftButtonUp);

            #line default
            #line hidden

            #line 11 "..\..\Window1.xaml"
                this.viewPort3d.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.ViewPort3D_OnMouseLeftButtonDown);

            #line default
            #line hidden
                return;

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

            #line 23 "..\..\Window1.xaml"
                this.sliderX.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slider_ValueChanged);

            #line default
            #line hidden
                return;

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

            #line 24 "..\..\Window1.xaml"
                this.sliderY.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slider_ValueChanged);

            #line default
            #line hidden
                return;

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

            #line 25 "..\..\Window1.xaml"
                this.sliderZ.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.slider_ValueChanged);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
示例#12
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

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

            #line default
            #line hidden
                return;

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

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

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

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

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

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

            #line default
            #line hidden
                return;

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

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

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
示例#13
0
        /// <summary>
        /// Draws a skeleton's bones and joints
        /// </summary>
        /// <param name="skeleton">skeleton to draw</param>
        /// <param name="drawingContext">drawing context to draw to</param>
        private void DrawBonesAndJoints(Skeleton skeleton, HelixToolkit.Wpf.HelixViewport3D viewport)
        {
            viewport.Children.Clear();
            viewport.Children.Add(new SunLight());
            viewport.Children.Add(new GridLinesVisual3D());

            if (!isAligned)
            {
                originalCenter = getOriginalCenter(skeleton);
            }

            // Render Torso
            this.DrawBone3D(skeleton, viewport, JointType.Head, JointType.ShoulderCenter);
            this.DrawBone3D(skeleton, viewport, JointType.ShoulderCenter, JointType.ShoulderLeft);
            this.DrawBone3D(skeleton, viewport, JointType.ShoulderCenter, JointType.ShoulderRight);
            this.DrawBone3D(skeleton, viewport, JointType.ShoulderCenter, JointType.Spine);
            this.DrawBone3D(skeleton, viewport, JointType.Spine, JointType.HipCenter);
            this.DrawBone3D(skeleton, viewport, JointType.HipCenter, JointType.HipLeft);
            this.DrawBone3D(skeleton, viewport, JointType.HipCenter, JointType.HipRight);

            // Left Arm
            this.DrawBone3D(skeleton, viewport, JointType.ShoulderLeft, JointType.ElbowLeft);
            this.DrawBone3D(skeleton, viewport, JointType.ElbowLeft, JointType.WristLeft);
            this.DrawBone3D(skeleton, viewport, JointType.WristLeft, JointType.HandLeft);

            // Right Arm
            this.DrawBone3D(skeleton, viewport, JointType.ShoulderRight, JointType.ElbowRight);
            this.DrawBone3D(skeleton, viewport, JointType.ElbowRight, JointType.WristRight);
            this.DrawBone3D(skeleton, viewport, JointType.WristRight, JointType.HandRight);

            // Left Leg
            this.DrawBone3D(skeleton, viewport, JointType.HipLeft, JointType.KneeLeft);
            this.DrawBone3D(skeleton, viewport, JointType.KneeLeft, JointType.AnkleLeft);
            this.DrawBone3D(skeleton, viewport, JointType.AnkleLeft, JointType.FootLeft);

            // Right Leg
            this.DrawBone3D(skeleton, viewport, JointType.HipRight, JointType.KneeRight);
            this.DrawBone3D(skeleton, viewport, JointType.KneeRight, JointType.AnkleRight);
            this.DrawBone3D(skeleton, viewport, JointType.AnkleRight, JointType.FootRight);

            // Render joints
            foreach (Joint joint in skeleton.Joints)
            {
                //this.DrawJoint3D(joint, viewport);
            }

            this.DrawHand3D(skeleton.Joints[JointType.HandRight], viewport);
            this.DrawHand3D(skeleton.Joints[JointType.HandLeft], viewport);

            this.DrawJoint3D(skeleton.Joints[JointType.Head], viewport);
        }
示例#14
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.TASK5 = ((DITask.TaskVews.Task5)(target));
                return;

            case 2:
                this.helix_view = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#15
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.helixviewport = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

            case 2:
                this.MV3D = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#16
0
        private Session()
        {
            applicationFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), SessionConstants.ApplicationFolderName);
            if (!Directory.Exists(applicationFolder))
                CreateApplicationFolder();

            systemPreferences = new SystemPreferences(Path.Combine(applicationFolder, SessionConstants.SystemPreferencesFolderName));
            applicationFolder = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            LoadSystemPreferences();
            workspace = new Workspace(systemPreferences.GetSettingValue("Software", "Workspace path"));
            currentProject = null;
            capture = new Capture();
            viewport = null;
        }
示例#17
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.V3D = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

            case 2:
                this.MaskedColor = ((System.Windows.Media.ImageBrush)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#18
0
        public Leg3dRender(HelixViewport3D viewport,Leg legModel) {
            this.legModel = legModel;

            this.viewport = viewport;

            this.bodyCoxaLen = legModel.BodyCoxaLength;
            this.femurLen = legModel.FemurLength;
            this.tibiaLen = legModel.TibiaLength;

            this.jointDiameter = bodyCoxaLen * 0.7;
            this.jointHeight = jointDiameter;
            this.linkDiameter = jointDiameter * 0.7;
            this.footRadius = linkDiameter * 0.6;

            Model = buildLegModel();


            coxaAngleLabel.Text = "";
            coxaAngleLabel.FontSize = FONT_SIZE;
            coxaAngleLabel.FontFamily = new FontFamily("Arial");
            coxaAngleLabel.Foreground = textColor;
            coxaAngleLabel.BorderBrush = textColor;
            coxaAngleLabel.Padding = new System.Windows.Thickness(5);
            coxaAngleLabel.BorderThickness = new System.Windows.Thickness(1);

            femurAngleLabel.Text = "";
            femurAngleLabel.FontSize = FONT_SIZE;
            femurAngleLabel.FontFamily = new FontFamily("Arial");
            femurAngleLabel.Foreground = textColor;
            femurAngleLabel.BorderBrush = textColor;
            femurAngleLabel.Padding = new System.Windows.Thickness(5);
            femurAngleLabel.BorderThickness = new System.Windows.Thickness(1);

            tibiaAngleLabel.Text = "";
            tibiaAngleLabel.FontSize = FONT_SIZE;
            tibiaAngleLabel.FontFamily = new FontFamily("Arial");
            tibiaAngleLabel.Foreground = textColor;
            tibiaAngleLabel.BorderBrush = textColor;
            tibiaAngleLabel.Padding = new System.Windows.Thickness(5);
            tibiaAngleLabel.BorderThickness = new System.Windows.Thickness(1);

            viewport.Children.Add(coxaAngleLabel);
            viewport.Children.Add(femurAngleLabel);
            viewport.Children.Add(tibiaAngleLabel);

            
            viewport.Children.Add(buildBody());

            updateLeg();
        }
示例#19
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.overall_grid = ((System.Windows.Controls.Grid)(target));
                return;

            case 2:
                this.m_helix_viewport = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#20
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ModelTypes = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 2:
                this.ModelName = ((System.Windows.Controls.TextBox)(target));
                return;

            case 3:
                this.FilePath = ((System.Windows.Controls.TextBlock)(target));
                return;

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

            #line 25 "..\..\ImportModel.xaml"
                this.Browse.Click += new System.Windows.RoutedEventHandler(this.Browse_Click);

            #line default
            #line hidden
                return;

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

            case 6:
                this.Mesh = ((HelixToolkit.Wpf.MeshGeometryVisual3D)(target));
                return;

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

            #line 30 "..\..\ImportModel.xaml"
                this.Ok.Click += new System.Windows.RoutedEventHandler(this.Ok_Click);

            #line default
            #line hidden
                return;

            case 8:
                this.Cancel = ((System.Windows.Controls.Button)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#21
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.window = ((PrestressedTendon.Window1)(target));
                return;

            case 2:

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

            #line default
            #line hidden
                return;

            case 3:

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

            #line default
            #line hidden
                return;

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

            case 5:

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

            #line default
            #line hidden
                return;

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

            case 7:
                this.MV3D = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#22
0
        private void DrawLine3D(Point3D p0, Point3D p1, HelixToolkit.Wpf.HelixViewport3D viewport)
        {
            double tubeDiameter = 0.1;

            TubeVisual3D tube = new TubeVisual3D();

            tube.Path = new Point3DCollection();
            tube.Path.Add(p0);
            tube.Path.Add(p1);
            tube.Diameter     = tubeDiameter;
            tube.Fill         = Brushes.Black;
            tube.IsPathClosed = true;

            viewport.Children.Add(tube);
        }
示例#23
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ctrlPatient = ((TouchlessSurgeonAssistant.ctrlPatientInfo)(target));
                return;

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

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

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

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

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

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

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

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

            case 10:
                this.label1 = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#24
0
        /// <summary>
        /// Constructs an engine that tracks the first skeletons' arms with the default transform settings
        /// </summary>
        public Engine() {
            // Initialise objects
            DenotifyQueue = new Dictionary<int, Dictionary<JointType, List<Cube>>>();
            JointsToTrack = new List<JointType>();
            Cubes = new List<Cube>();
            Joint3DGeometry = new Dictionary<int, Dictionary<JointType, CubeVisual3D>>();

            // setup our viewport
            Viewport3D = new HelixViewport3D() {
                ClipToBounds = true,
                Orthographic = true,
                ShowCameraInfo = true,
                ShowCoordinateSystem = true,
                ShowFieldOfView = true,
                ShowFrameRate = true,
                CameraRotationMode = CameraRotationMode.Trackball,
                MinHeight = 400,
                MinWidth = 800,
                TouchMode = TouchMode.Rotating,
                RotateAroundMouseDownPoint = true,
                Camera = new PerspectiveCamera() {
                    Position = new Point3D(18.5, 13.5, -12.2),
                    LookDirection = new Vector3D(-14.9, -10.4, 11.1),
                    FieldOfView = 57
                    //Width = 5.5
                },
            };
            Viewport3D.Lights.Children.Add(new DirectionalLight(Colors.White, new Vector3D(0.5, -0.5, 0.5)));

            // register the camera move property on our viewer, stop us from doing lots of repetitive crap
            Viewport3D.CameraChanged += new RoutedEventHandler(Viewport3D_CameraChanged);

            // setup our world
            World = new World();
            Viewport3D.Children.Add(World.WorldObjects);
            Viewport3D.Children.Add(World.JointObjects);
            Viewport3D.Children.Add(World.Cubes);
            //Viewport3D.Children.Add(World.Kinect);

            // set the default kinect settings
            SmoothParameters = _Constants.SmoothParameters;

            // fire off the engine mode event
            Mode = EngineMode.NormalInteractive;
        }
示例#25
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.viewport = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

            case 2:
                this.camera = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
                return;

            case 3:
                this.Tool3D = ((HelixToolkit.Wpf.PipeVisual3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#26
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.BlokContent3D = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

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

            case 3:
                this.ResizeMenu = ((System.Windows.Controls.StackPanel)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#27
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ControlGrid = ((System.Windows.Controls.Grid)(target));
                return;

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

            #line 27 "..\..\DesignControl.xaml"
                this.Border.MouseEnter += new System.Windows.Input.MouseEventHandler(this.ControlGrid_MouseEnter);

            #line default
            #line hidden

            #line 27 "..\..\DesignControl.xaml"
                this.Border.MouseLeave += new System.Windows.Input.MouseEventHandler(this.ControlGrid_MouseLeave);

            #line default
            #line hidden

            #line 27 "..\..\DesignControl.xaml"
                this.Border.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.ControlGrid_MouseLeftButtonDown);

            #line default
            #line hidden
                return;

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

            case 4:
                this.ScoreText = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 5:
                this.Selection = ((System.Windows.Controls.CheckBox)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#28
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.viewPort3d = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

            case 2:

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

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
示例#29
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.PanelAll = ((System.Windows.Controls.DockPanel)(target));
                return;

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

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

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

            #line default
            #line hidden
                return;

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

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

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

            #line default
            #line hidden
                return;

            case 6:
                this.root2 = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
        public LevelManager(HelixViewport3D view)
        {
            this.view = view;

            LevelGenerators.Add(LoadLevel3);
            LevelGenerators.Add(LoadLevel5);
            LevelGenerators.Add(LoadLevel1);
            LevelGenerators.Add(LoadLevel6);
            LevelGenerators.Add(LoadLevel2);
            LevelGenerators.Add(LoadLevel4);
            LevelGenerators.Add(LoadLevel5);
            LevelGenerators.Add(LoadLevel5);
            LevelGenerators.Add(LoadLevel4);
            LevelGenerators.Add(LoadLevel1);
            LevelGenerators.Add(LoadLevel2);
            LevelGenerators.Add(LoadLevel5);
            LevelGenerators.Add(LoadLevel4);
            LevelGenerators.Add(LoadLevel6);
            LevelGenerators.Add(LoadLevel5);
        }
示例#31
0
        private void DrawBone3D(Skeleton skeleton, HelixToolkit.Wpf.HelixViewport3D viewport, JointType jointType0, JointType jointType1)
        {
            Joint joint0 = skeleton.Joints[jointType0];
            Joint joint1 = skeleton.Joints[jointType1];

            // If we can't find either of these joints, exit
            if (joint0.TrackingState == JointTrackingState.NotTracked ||
                joint1.TrackingState == JointTrackingState.NotTracked)
            {
                return;
            }

            // Don't draw if both points are inferred
            if (joint0.TrackingState == JointTrackingState.Inferred &&
                joint1.TrackingState == JointTrackingState.Inferred)
            {
                return;
            }

            this.DrawLine3D(this.SkeletonPointTo3D(joint0.Position), this.SkeletonPointTo3D(joint1.Position), viewport);
        }
示例#32
0
        public MainViewModel(Dispatcher dispatcher, HelixViewport3D view)
        {
            this.dispatcher = dispatcher;
            this.view = view;

            Heel = 0;
            Trim = 0;
            Heave = 0;
            Length = 200;
            HullBrush = Brushes.Red;

            try
            {
                wm = new Wiimote();
                wm.WiimoteChanged += WiimoteChanged;
            }
            catch
            {
                wm = null;
            }
        }
示例#33
0
文件: Robot.cs 项目: Arkady92/PUSN
        public void Initialize(HelixViewport3D viewport)
        {
            components = new Element[componentsCount];
            for (int i = 0; i < componentsCount; i++)
                components[i] = new Element();
            joints = new Joint[componentsCount + 1];
            for (int i = 0; i < componentsCount + 1; i++)
                joints[i] = new Joint();
            for (int i = 0; i < componentsCount; i++)
            {
                components[i].Begin = joints[i];
                components[i].End = joints[i + 1];
                viewport.Children.Add(components[i].Tube);
                viewport.Children.Add(components[i].Sphere);
            }

            components[0].Length = 0.0f;
            components[1].Length = 5.0f;
            components[3].Length = 2.0f;
            components[4].Length = 1.0f;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.AxisAngle = ((System.Windows.Controls.TextBox)(target));
                return;

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

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

            case 4:
                this.Arrows = ((BluetoothController.WPFUserControls.KinectCoordinateSystemVisual3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#35
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.viewPort3d = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

            case 2:

            #line 30 "..\..\..\Result\ResultView.xaml"
                ((SharpGL.WPF.OpenGLControl)(target)).OpenGLInitialized += new SharpGL.SceneGraph.OpenGLEventHandler(this.OpenGLControl_OpenGLInitialized);

            #line default
            #line hidden
                return;

            case 3:
                this.enabledSwitch = ((MahApps.Metro.Controls.ToggleSwitch)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#36
0
        public MainViewModel(IFileDialogService fds, HelixViewport3D viewport)
        {
            if (viewport == null)
            {
                throw new ArgumentNullException("viewport");
            }

            this.dispatcher = Dispatcher.CurrentDispatcher;
            this.Expansion = 1;
            this.fileDialogService = fds;
            this.viewport = viewport;
            this.FileOpenCommand = new DelegateCommand(this.FileOpen);
            this.FileExportCommand = new DelegateCommand(this.FileExport);
            this.FileExitCommand = new DelegateCommand(FileExit);
            this.ViewZoomExtentsCommand = new DelegateCommand(this.ViewZoomExtents);
            this.EditCopyXamlCommand = new DelegateCommand(this.CopyXaml);
            this.ApplicationTitle = "3D Model viewer";
            this.Elements = new List<VisualViewModel>();
            foreach (var c in viewport.Children)
            {
                this.Elements.Add(new VisualViewModel(c));
            }
        }
示例#37
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 5 "..\..\MainWindow.xaml"
                ((Microsoft.Samples.Kinect.SkeletonBasics.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.WindowLoaded);

            #line default
            #line hidden

            #line 5 "..\..\MainWindow.xaml"
                ((Microsoft.Samples.Kinect.SkeletonBasics.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.WindowClosing);

            #line default
            #line hidden
                return;

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

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

            case 4:
                this.DataLogWindow = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 5:
                this.txtBlkCombo = ((System.Windows.Controls.TextBlock)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#38
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.view1 = ((HelixToolkit.Wpf.HelixViewport3D)(target));

            #line 7 "..\..\..\Option\ModelWindow.xaml"
                this.view1.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.view1_MouseDoubleClick);

            #line default
            #line hidden
                return;

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

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

            case 4:
                this.RollValue = ((System.Windows.Controls.Label)(target));
                return;

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

            case 6:
                this.YawValue = ((System.Windows.Controls.Label)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#39
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 20 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Ribbon.RibbonButton)(target)).Click += new System.Windows.RoutedEventHandler(this.Add_Click);

            #line default
            #line hidden
                return;

            case 2:

            #line 21 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.Ribbon.RibbonButton)(target)).Click += new System.Windows.RoutedEventHandler(this.Load_Click);

            #line default
            #line hidden
                return;

            case 3:
                this.PG = ((Xceed.Wpf.Toolkit.PropertyGrid.PropertyGrid)(target));
                return;

            case 4:
                this.DGV = ((Xceed.Wpf.DataGrid.DataGridControl)(target));
                return;

            case 6:
                this.HelixView = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#40
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.window = ((hangerRod.Window1)(target));
                return;

            case 2:

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

            #line default
            #line hidden
                return;

            case 3:

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

            #line default
            #line hidden
                return;

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

            case 5:
                this.MV3D = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#41
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.view1 = ((HelixToolkit.Wpf.HelixViewport3D)(target));

            #line 10 "..\..\View3D.xaml"
                this.view1.SizeChanged += new System.Windows.SizeChangedEventHandler(this.view1_SizeChanged);

            #line default
            #line hidden
                return;

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

            case 3:
                this.qRotation = ((System.Windows.Media.Media3D.QuaternionRotation3D)(target));
                return;
            }
            this._contentLoaded = true;
        }
示例#42
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     
     #line 12 "..\..\ModelTransform.xaml"
     ((Battlehack.ModelTransform)(target)).Loaded += new System.Windows.RoutedEventHandler(this.ModelTransformLoaded);
     
     #line default
     #line hidden
     return;
     case 2:
     this.layoutGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 3:
     this.sensorChooserUi = ((Microsoft.Kinect.Toolkit.KinectSensorChooserUI)(target));
     return;
     case 4:
     this.EntireGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 5:
     this.SmsText = ((System.Windows.Controls.TextBlock)(target));
     return;
     case 6:
     this.Backdrop = ((System.Windows.Controls.Image)(target));
     return;
     case 7:
     this.Macklemore = ((System.Windows.Controls.Image)(target));
     return;
     case 8:
     this.SpaceNeedle = ((System.Windows.Controls.Image)(target));
     return;
     case 9:
     this.MaskedColor = ((System.Windows.Controls.Image)(target));
     return;
     case 10:
     this.MaskedColor2 = ((System.Windows.Controls.Image)(target));
     return;
     case 11:
     this.MaskedColor3 = ((System.Windows.Controls.Image)(target));
     return;
     case 12:
     this.view1 = ((HelixToolkit.Wpf.HelixViewport3D)(target));
     return;
     case 13:
     this.Dress = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
     return;
     case 14:
     this.buttonScreenshot = ((System.Windows.Controls.Button)(target));
     
     #line 148 "..\..\ModelTransform.xaml"
     this.buttonScreenshot.Click += new System.Windows.RoutedEventHandler(this.ButtonScreenshotClick);
     
     #line default
     #line hidden
     return;
     case 15:
     this.statusBar = ((System.Windows.Controls.Primitives.StatusBar)(target));
     return;
     }
     this._contentLoaded = true;
 }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.SCWindow = ((StormCloud.StormCloudWindow)(target));
                return;

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

            case 3:
                this.autoGenerateCheck = ((System.Windows.Controls.CheckBox)(target));
                return;

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

            case 5:
                this.Pop = ((System.Windows.Controls.Slider)(target));
                return;

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

            case 7:
                this.myScroll = ((System.Windows.Controls.ScrollViewer)(target));
                return;

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

            case 9:

            #line 105 "..\..\StormCloudWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_Generate);

            #line default
            #line hidden
                return;

            case 10:

            #line 110 "..\..\StormCloudWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click_Build);

            #line default
            #line hidden

            #line 110 "..\..\StormCloudWindow.xaml"
                ((System.Windows.Controls.Button)(target)).MouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.Button_MouseRightButtonDown_Build);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
        // Draw the shed in the drawing window thing
        public void DrawShed(HelixViewport3D view, Data data)
        {
            double toRadians = Math.PI/180;
            double apex = data.eaveHeight + ((data.span/2) * Math.Tan(data.roofPitch * toRadians));
            double highEave = data.eaveHeight + (data.span * Math.Tan(data.roofPitch * toRadians));
            double length = -data.baySpacing * data.numberOfBays;
            double z = 0;

            LinesVisual3D lines = new LinesVisual3D();
            
            lines.Thickness = 4;
            view.Children.Clear();
            view.Children.Add(new SunLight());

            // Draw portals
            for (int i = 0; i < (data.numberOfBays + 1); i++)
            {
                z = -data.baySpacing * i;

                lines.Points.Add(new Point3D(z, 0, 0));
                lines.Points.Add(new Point3D(z, 0, data.eaveHeight));

                if (data.roofType == "Gable")
                {
                    lines.Points.Add(new Point3D(z, 0, data.eaveHeight));
                    lines.Points.Add(new Point3D(z, (data.span / 2), apex));

                    lines.Points.Add(new Point3D(z, (data.span / 2), apex));
                    lines.Points.Add(new Point3D(z, data.span, data.eaveHeight));

                    lines.Points.Add(new Point3D(z, data.span, data.eaveHeight));
                    lines.Points.Add(new Point3D(z, data.span, 0));
                }
                else
                {
                    lines.Points.Add(new Point3D(z, 0, data.eaveHeight));
                    lines.Points.Add(new Point3D(z, data.span, highEave));

                    lines.Points.Add(new Point3D(z, data.span, highEave));
                    lines.Points.Add(new Point3D(z, data.span, 0));
                }
            }

            // Draw ridge and eave elements along building
            lines.Points.Add(new Point3D(0, 0, data.eaveHeight));
            lines.Points.Add(new Point3D(length, 0, data.eaveHeight));

            if (data.roofType == "Gable")
            {
                if (data.numberOfMullions == 0 || data.numberOfMullions == 2 || data.numberOfMullions == 4)
                {
                    lines.Points.Add(new Point3D(0, (data.span / 2), apex));
                    lines.Points.Add(new Point3D(length, (data.span / 2), apex));
                }

                lines.Points.Add(new Point3D(0, data.span, data.eaveHeight));
                lines.Points.Add(new Point3D(length, data.span, data.eaveHeight));
            }
            else
            {
                lines.Points.Add(new Point3D(0, data.span, highEave));
                lines.Points.Add(new Point3D(length, data.span, highEave));
            }


            // Draw knee braces
            double kneeX1 = 0, kneeY1 = 0, kneeX2 = 0, kneeY2 = 0, kneeX3 = 0, kneeY3 = 0, kneeX4 = 0, kneeY4 = 0;

            if (data.endKneeBraceType != "None" || data.midKneeBraceType != "None")
            {
                kneeX1 = 0;
                kneeY1 = data.eaveHeight - (data.eaveHeight * (data.kneeBracePercentEave / 100));
                kneeX2 = data.span * data.kneeBracePercentSpan / 100;
                kneeY2 = data.eaveHeight + (Math.Tan(data.roofPitch * toRadians) * (data.kneeBracePercentSpan / 100) * data.span);
                kneeX3 = data.span - kneeX2;
                kneeY3 = data.roofType == "Gable" ? kneeY2 : highEave - ((data.kneeBracePercentSpan / 100) * data.span * Math.Tan(data.roofPitch * toRadians));
                kneeX4 = data.span;
                kneeY4 = data.roofType == "Gable" ? kneeY1 : highEave - (highEave * (data.kneeBracePercentEave / 100));
            }

            if (data.endKneeBraceType != "None")
            {
                lines.Points.Add(new Point3D(0, kneeX1, kneeY1));
                lines.Points.Add(new Point3D(0, kneeX2, kneeY2));
                lines.Points.Add(new Point3D(0, kneeX3, kneeY3));
                lines.Points.Add(new Point3D(0, kneeX4, kneeY4));
                lines.Points.Add(new Point3D(length, kneeX1, kneeY1));
                lines.Points.Add(new Point3D(length, kneeX2, kneeY2));
                lines.Points.Add(new Point3D(length, kneeX3, kneeY3));
                lines.Points.Add(new Point3D(length, kneeX4, kneeY4));
                
            }

            if (data.midKneeBraceType != "None")
            {
                for (int i = 1; i < data.numberOfBays; i++)
                {
                    lines.Points.Add(new Point3D(-i * data.baySpacing, kneeX1, kneeY1));
                    lines.Points.Add(new Point3D(-i * data.baySpacing, kneeX2, kneeY2));
                    lines.Points.Add(new Point3D(-i * data.baySpacing, kneeX3, kneeY3));
                    lines.Points.Add(new Point3D(-i * data.baySpacing, kneeX4, kneeY4));
                    lines.Points.Add(new Point3D(-i * data.baySpacing, kneeX1, kneeY1));
                    lines.Points.Add(new Point3D(-i * data.baySpacing, kneeX2, kneeY2));
                    lines.Points.Add(new Point3D(-i * data.baySpacing, kneeX3, kneeY3));
                    lines.Points.Add(new Point3D(-i * data.baySpacing, kneeX4, kneeY4));
                }
            }

            // Draw apex braces
            if (data.roofType == "Gable")
            {
                double apexX1 = 0, apexY1 = 0, apexX2 = 0, apexY2 = 0;

                if (data.endApexBraceType != "None" || data.midApexBraceType != "None")
                {
                    apexX1 = data.span * (1.0 / 3.0);
                    apexY1 = data.eaveHeight + ((data.span / 3) * Math.Tan(data.roofPitch * toRadians));
                    apexX2 = data.span * (2.0 / 3.0);
                    apexY2 = apexY1;
                }

                if (data.endApexBraceType != "None")
                {
                    lines.Points.Add(new Point3D(0, apexX1, apexY1));
                    lines.Points.Add(new Point3D(0, apexX2, apexY2));
                    lines.Points.Add(new Point3D(length, apexX1, apexY1));
                    lines.Points.Add(new Point3D(length, apexX2, apexY2));
                }

                if (data.midApexBraceType != "None")
                {
                    for (int i = 1; i < data.numberOfBays; i++)
                    {
                        lines.Points.Add(new Point3D(-i * data.baySpacing, apexX1, apexY1));
                        lines.Points.Add(new Point3D(-i * data.baySpacing, apexX2, apexY2));
                    }
                }
            }


            // Draw Mullions & compression struts
            if (data.numberOfMullions > 0)
            {
                double[] xCoords = new double[data.numberOfMullions];
                double[] yCoords = new double[data.numberOfMullions];

                // Get x, y coords
                for (int i = 0; i < data.numberOfMullions; i++)
                    xCoords[i] = (data.span / (data.numberOfMullions + 1)) * (i + 1);

                if (data.roofType == "Skillion")
                {
                    for (int i = 0; i < data.numberOfMullions; i++)
                        yCoords[i] = data.eaveHeight + (xCoords[i] * Math.Tan(data.roofPitch * toRadians));
                }
                else
                {
                    for (int i = 0; i < data.numberOfMullions; i++)
                    {
                        if (xCoords[i] <= (data.span / 2))
                            yCoords[i] = data.eaveHeight + (xCoords[i] * Math.Tan(data.roofPitch * toRadians));
                        else
                            yCoords[i] = (data.eaveHeight + (xCoords[i] * Math.Tan(data.roofPitch * toRadians))) - ((2 * Math.Tan(data.roofPitch * toRadians)) * ((data.span / 2) - (data.span - xCoords[i])));
                    }
                }

                // Draw mullions
                for (int i = 0; i < data.numberOfMullions; i++)
                {
                    lines.Points.Add(new Point3D(0, xCoords[i], 0));
                    lines.Points.Add(new Point3D(0, xCoords[i], yCoords[i]));
                    lines.Points.Add(new Point3D(length, xCoords[i], 0));
                    lines.Points.Add(new Point3D(length, xCoords[i], yCoords[i]));
                }

                // Draw Compression Struts
                for (int i = 0; i < data.numberOfMullions; i++)
                {
                    for (int j = 0; j < data.numberOfBays; j++)
                    {
                        lines.Points.Add(new Point3D(-data.baySpacing * j, xCoords[i], yCoords[i]));
                        lines.Points.Add(new Point3D(-data.baySpacing * (j + 1), xCoords[i], yCoords[i]));
                    }
                }
            }
            
            

            // Add lines to view and update default camera
            view.Children.Add(lines);
        }
示例#45
0
        public dyn3DPreview()
        {
            InPortData.Add(new PortData("IN", "Incoming geometry objects.", typeof(object)));
            OutPortData.Add(new PortData("OUT", "Watch contents, passed through", typeof(object)));

            NodeUI.RegisterAllPorts();

            //get rid of right click delete
            //this.MainContextMenu.Items.Clear();

            MenuItem mi = new MenuItem();
            mi.Header = "Zoom to Fit";
            mi.Click +=new RoutedEventHandler(mi_Click);

            NodeUI.MainContextMenu.Items.Add(mi);

            //take out the left and right margins
            //and make this so it's not so wide
            NodeUI.inputGrid.Margin = new Thickness(10, 10, 10, 10);

            isScreenShot = true;

            if (isScreenShot)
            {
                NodeUI.topControl.Width = 800;
                NodeUI.topControl.Height = 500;
            }
            else
            {
                NodeUI.topControl.Width = 400;
                NodeUI.topControl.Height = 300;
            }

            //this.elementShine.Visibility = System.Windows.Visibility.Hidden;
            //this.elementRectangle.Visibility = System.Windows.Visibility.Hidden;

            //add a 3D viewport to the input grid
            //http://helixtoolkit.codeplex.com/wikipage?title=HelixViewport3D&referringTitle=Documentation
            view = new HelixViewport3D();
            view.DataContext = this;
            view.CameraRotationMode = CameraRotationMode.Turntable;
            view.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            view.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
            //RenderOptions.SetEdgeMode(view,EdgeMode.Aliased);
            RenderOptions.SetEdgeMode(view, EdgeMode.Unspecified);
            view.ShowViewCube = false;

            //view.IsHitTestVisible = true;
            view.ShowFrameRate = true;

            view.MouseRightButtonUp += new System.Windows.Input.MouseButtonEventHandler(view_MouseRightButtonUp);
            view.PreviewMouseRightButtonDown += new System.Windows.Input.MouseButtonEventHandler(view_PreviewMouseRightButtonDown);

            fixedPoints = new PointsVisual3D { Color = Colors.Red, Size = 8 };
            view.Children.Add(fixedPoints);

            points = new PointsVisual3D { Color = Colors.Black, Size = 4 };
            view.Children.Add(points);

            // a list of 10 colors to be used for
            // mapping analysis results
            colors.Add(Colors.Black); //01
            colors.Add(Colors.LightBlue); //02
            colors.Add(Colors.Blue); //03
            colors.Add(Colors.Purple); //04
            colors.Add(Colors.LightGreen); //05
            colors.Add(Colors.GreenYellow); //06
            colors.Add(Colors.Yellow); //07
            colors.Add(Colors.Orange); //08
            colors.Add(Colors.OrangeRed); //09
            colors.Add(Colors.Red); //10
            colors.Add(Colors.Black);//11 for naked lines and curves

            FixedPoints = new Point3DCollection();
            Points = new List<Point3DCollection>();
            for (int i = 0; i < colors.Count(); i++)
            {
                Points.Add(new Point3DCollection());
            }

            linesList = new List<LinesVisual3D>();
            for (int i = 0; i < colors.Count(); i++)
            {
                LinesVisual3D lines = new LinesVisual3D { Color = colors[i], Thickness = 1 };

                linesList.Add(lines);
                view.Children.Add(lines);
            }

            System.Windows.Shapes.Rectangle backgroundRect = new System.Windows.Shapes.Rectangle();
            backgroundRect.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            backgroundRect.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
            backgroundRect.RadiusX = 10;
            backgroundRect.RadiusY = 10;
            backgroundRect.IsHitTestVisible = false;
            BrushConverter bc = new BrushConverter();
            Brush strokeBrush = (Brush)bc.ConvertFrom("#313131");
            backgroundRect.Stroke = strokeBrush;
            backgroundRect.StrokeThickness = 1;
            SolidColorBrush backgroundBrush = new SolidColorBrush(System.Windows.Media.Color.FromRgb(250,250,216));
            backgroundRect.Fill = backgroundBrush;
            NodeUI.inputGrid.Children.Add(backgroundRect);
            NodeUI.inputGrid.Children.Add(view);

            CompositionTarget.Rendering += new EventHandler(CompositionTarget_Rendering);
        }
示例#46
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     
     #line 7 "..\..\MainWindow.xaml"
     ((Microsoft.Samples.Kinect.BackgroundRemovalBasics.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.WindowClosing);
     
     #line default
     #line hidden
     return;
     case 2:
     this.layoutGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 3:
     this.sensorChooserUi = ((Microsoft.Kinect.Toolkit.KinectSensorChooserUI)(target));
     return;
     case 4:
     this.Backdrop = ((System.Windows.Controls.Image)(target));
     return;
     case 5:
     this.MaskedColor = ((System.Windows.Controls.Image)(target));
     return;
     case 6:
     this.MaskedColor2 = ((System.Windows.Controls.Image)(target));
     return;
     case 7:
     this.MaskedColor3 = ((System.Windows.Controls.Image)(target));
     return;
     case 8:
     this.view1 = ((HelixToolkit.Wpf.HelixViewport3D)(target));
     return;
     case 9:
     this.Dress = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
     return;
     case 10:
     this.buttonScreenshot = ((System.Windows.Controls.Button)(target));
     
     #line 114 "..\..\MainWindow.xaml"
     this.buttonScreenshot.Click += new System.Windows.RoutedEventHandler(this.ButtonScreenshotClick);
     
     #line default
     #line hidden
     return;
     case 11:
     this.statusBar = ((System.Windows.Controls.Primitives.StatusBar)(target));
     return;
     case 12:
     
     #line 118 "..\..\MainWindow.xaml"
     ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Button_Click);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.graph3DWindow = ((IMPressive.Graph3DWindow)(target));
     
     #line 9 "..\..\Param3DGraphWindow.xaml"
     this.graph3DWindow.Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);
     
     #line default
     #line hidden
     return;
     case 2:
     this.mainViewport = ((HelixToolkit.Wpf.HelixViewport3D)(target));
     return;
     case 3:
     this.camera = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
     return;
     case 4:
     this.model3D = ((IMPressive.SurfacePlotVisual3D)(target));
     return;
     case 5:
     this.btnLoad = ((System.Windows.Controls.Button)(target));
     
     #line 37 "..\..\Param3DGraphWindow.xaml"
     this.btnLoad.Click += new System.Windows.RoutedEventHandler(this.btnLoad_Click);
     
     #line default
     #line hidden
     return;
     case 6:
     this.txtOperation = ((System.Windows.Controls.AutoCompleteBox)(target));
     
     #line 43 "..\..\Param3DGraphWindow.xaml"
     this.txtOperation.KeyUp += new System.Windows.Input.KeyEventHandler(this.txtOperation_KeyUp);
     
     #line default
     #line hidden
     return;
     case 7:
     this.btnClear = ((System.Windows.Controls.Button)(target));
     
     #line 55 "..\..\Param3DGraphWindow.xaml"
     this.btnClear.Click += new System.Windows.RoutedEventHandler(this.btnClear_Click);
     
     #line default
     #line hidden
     return;
     case 8:
     this.txtFromX = ((System.Windows.Controls.TextBox)(target));
     
     #line 62 "..\..\Param3DGraphWindow.xaml"
     this.txtFromX.KeyUp += new System.Windows.Input.KeyEventHandler(this.txtOperation_KeyUp);
     
     #line default
     #line hidden
     return;
     case 9:
     this.txtToX = ((System.Windows.Controls.TextBox)(target));
     
     #line 76 "..\..\Param3DGraphWindow.xaml"
     this.txtToX.KeyUp += new System.Windows.Input.KeyEventHandler(this.txtOperation_KeyUp);
     
     #line default
     #line hidden
     return;
     case 10:
     this.txtPasX = ((System.Windows.Controls.TextBox)(target));
     
     #line 90 "..\..\Param3DGraphWindow.xaml"
     this.txtPasX.KeyUp += new System.Windows.Input.KeyEventHandler(this.txtOperation_KeyUp);
     
     #line default
     #line hidden
     return;
     case 11:
     this.txtFromY = ((System.Windows.Controls.TextBox)(target));
     
     #line 108 "..\..\Param3DGraphWindow.xaml"
     this.txtFromY.KeyUp += new System.Windows.Input.KeyEventHandler(this.txtOperation_KeyUp);
     
     #line default
     #line hidden
     return;
     case 12:
     this.txtToY = ((System.Windows.Controls.TextBox)(target));
     
     #line 122 "..\..\Param3DGraphWindow.xaml"
     this.txtToY.KeyUp += new System.Windows.Input.KeyEventHandler(this.txtOperation_KeyUp);
     
     #line default
     #line hidden
     return;
     case 13:
     this.txtPasY = ((System.Windows.Controls.TextBox)(target));
     
     #line 136 "..\..\Param3DGraphWindow.xaml"
     this.txtPasY.KeyUp += new System.Windows.Input.KeyEventHandler(this.txtOperation_KeyUp);
     
     #line default
     #line hidden
     return;
     }
     this._contentLoaded = true;
 }
示例#48
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     
     #line 5 "..\..\MainWindow.xaml"
     ((Microsoft.Samples.Kinect.SkeletonBasics.MainWindow)(target)).Loaded += new System.Windows.RoutedEventHandler(this.WindowLoaded);
     
     #line default
     #line hidden
     
     #line 5 "..\..\MainWindow.xaml"
     ((Microsoft.Samples.Kinect.SkeletonBasics.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.WindowClosing);
     
     #line default
     #line hidden
     return;
     case 2:
     this.layoutGrid = ((System.Windows.Controls.Grid)(target));
     return;
     case 3:
     this.MaskColor = ((System.Windows.Controls.Image)(target));
     return;
     case 4:
     this.Image = ((System.Windows.Controls.Image)(target));
     return;
     case 5:
     this.view1 = ((HelixToolkit.Wpf.HelixViewport3D)(target));
     return;
     case 6:
     this.root1 = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
     return;
     case 7:
     this.BingX = ((System.Windows.Controls.Slider)(target));
     return;
     case 8:
     this.BingY = ((System.Windows.Controls.Slider)(target));
     return;
     case 9:
     this.BingZ = ((System.Windows.Controls.Slider)(target));
     return;
     case 10:
     this.BingScaleX = ((System.Windows.Controls.Slider)(target));
     return;
     case 11:
     this.BingScaleY = ((System.Windows.Controls.Slider)(target));
     return;
     case 12:
     this.BingScaleZ = ((System.Windows.Controls.Slider)(target));
     return;
     case 13:
     this.checkBoxSeatedMode = ((System.Windows.Controls.CheckBox)(target));
     
     #line 95 "..\..\MainWindow.xaml"
     this.checkBoxSeatedMode.Checked += new System.Windows.RoutedEventHandler(this.CheckBoxSeatedModeChanged);
     
     #line default
     #line hidden
     
     #line 95 "..\..\MainWindow.xaml"
     this.checkBoxSeatedMode.Unchecked += new System.Windows.RoutedEventHandler(this.CheckBoxSeatedModeChanged);
     
     #line default
     #line hidden
     return;
     case 14:
     this.statusBar = ((System.Windows.Controls.Primitives.StatusBar)(target));
     return;
     case 15:
     this.statusBarText = ((System.Windows.Controls.TextBlock)(target));
     return;
     }
     this._contentLoaded = true;
 }
        private bool LevelAddsEnemies(Action level, HelixViewport3D view)
        {
            level();

            return view.Children.Count > 0;
        }
示例#50
0
//        public MainViewModel(IFileDialogService fds, HelixViewport3D hv, ModelVisual3D rootModel)
        public MainViewModel(IFileDialogService fds, HelixViewport3D hv, MainWindow window)
        {
            Expansion = 1;
            FileDialogService = fds;
            HelixView = hv;
            FileOpenCommand = new DelegateCommand(FileOpen);
            FileOpenRawCommand = new DelegateCommand(FileOpenRaw);
            FileExportCommand = new DelegateCommand(FileExport);
            FileExportRawCommand = new DelegateCommand(FileExportRaw);
            FileExitCommand = new DelegateCommand(FileExit);
            ViewZoomExtentsCommand = new DelegateCommand(ViewZoomExtents);
            EditCopyXamlCommand = new DelegateCommand(CopyXaml);
            EditClearAreaCommand = new DelegateCommand(ClearArea);
            FileExportStlCommand = new DelegateCommand(StlFileExport);            


            ApplicationTitle = "Dental.Smile - 3D Viewer";

            ModelToBaseMarker = new Dictionary<Model3D, BaseMarker>();
            OriginalMaterial = new Dictionary<Model3D, Material>();

            //Elements = new List<VisualElement>();
            //foreach (var c in hv.Children) Elements.Add(new VisualElement(c));

            DB = DentalSmileDBFactory.GetInstance();
            Treatment = new Treatment();
            SmileFile = new SmileFile();
            Patient = new Patient();
            JawVisual = new JawVisual3D(Patient);
            RootVisual = window.vmodel;
            app = Application.Current as App;

            RootVisual.Children.Add(JawVisual);
            this.window = window;

        }
示例#51
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.viewPort3d = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

            case 2:

            #line 15 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.OpenFile);

            #line default
            #line hidden
                return;

            case 3:

            #line 16 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.Quit);

            #line default
            #line hidden
                return;

            case 4:
                this.Count = ((System.Windows.Controls.MenuItem)(target));
                return;

            case 5:

            #line 19 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.showCounter);

            #line default
            #line hidden
                return;

            case 6:

            #line 20 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.showModel);

            #line default
            #line hidden
                return;

            case 7:

            #line 21 "..\..\MainWindow.xaml"
                ((System.Windows.Controls.MenuItem)(target)).Click += new System.Windows.RoutedEventHandler(this.showModelCounter);

            #line default
            #line hidden
                return;

            case 8:
                this.Cutt = ((System.Windows.Controls.MenuItem)(target));

            #line 23 "..\..\MainWindow.xaml"
                this.Cutt.Click += new System.Windows.RoutedEventHandler(this.cutModel);

            #line default
            #line hidden
                return;

            case 9:
                this.slider = ((System.Windows.Controls.Slider)(target));

            #line 26 "..\..\MainWindow.xaml"
                this.slider.ValueChanged += new System.Windows.RoutedPropertyChangedEventHandler <double>(this.Slider_ValueChanged);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.ExportModelMenuItem = ((System.Windows.Controls.MenuItem)(target));
     return;
     case 2:
     this.Export3DViewMenuItem = ((System.Windows.Controls.MenuItem)(target));
     return;
     case 3:
     this.SelectionModeMenuItem = ((System.Windows.Controls.MenuItem)(target));
     return;
     case 4:
     this.ViewPort3D = ((HelixToolkit.Wpf.HelixViewport3D)(target));
     return;
     case 5:
     this.progBar = ((System.Windows.Controls.ProgressBar)(target));
     return;
     case 6:
     this.progLabel = ((System.Windows.Controls.Label)(target));
     return;
     }
     this._contentLoaded = true;
 }
        public void Test_Next_Level_WorksFor15Levels()
        {
            for(int i = 1; i <= 15; i ++)
            {
                var view = new HelixToolkit.Wpf.HelixViewport3D();
                var manager = new LanguageBoosterGame.LevelManager(view);

                manager.LoadLevel(i);

                Assert.IsTrue(view.Children.Count > 0);
            }
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.LayoutRoot = ((System.Windows.Controls.Grid)(target));

            #line 110 "..\..\MainWindow.xaml"
                this.LayoutRoot.MouseLeftButtonDown += new System.Windows.Input.MouseButtonEventHandler(this.LayoutRootMouseLeft);

            #line default
            #line hidden
                return;

            case 2:
                this.Title = ((System.Windows.Controls.TextBlock)(target));
                return;

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

            #line 116 "..\..\MainWindow.xaml"
                this.BtnMinimize.Click += new System.Windows.RoutedEventHandler(this.BtnMinimize_Click);

            #line default
            #line hidden
                return;

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

            #line 118 "..\..\MainWindow.xaml"
                this.BtnMaximize.Click += new System.Windows.RoutedEventHandler(this.BtnMaximize_Click);

            #line default
            #line hidden
                return;

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

            #line 120 "..\..\MainWindow.xaml"
                this.BtnClose.Click += new System.Windows.RoutedEventHandler(this.BtnClose_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.ListTasks = ((System.Windows.Controls.ItemsControl)(target));
                return;

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

            case 9:
                this.Viewport = ((HelixToolkit.Wpf.HelixViewport3D)(target));
                return;

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

            case 11:
                this.Z = ((System.Windows.Media.Media3D.AxisAngleRotation3D)(target));
                return;

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

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

            #line 186 "..\..\MainWindow.xaml"
                this.load.Click += new System.Windows.RoutedEventHandler(this.BtnLoad_Click);

            #line default
            #line hidden
                return;

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

            #line 187 "..\..\MainWindow.xaml"
                this.clear.Click += new System.Windows.RoutedEventHandler(this.BtnClear_Click);

            #line default
            #line hidden
                return;

            case 15:
                this.minZ = ((System.Windows.Controls.Slider)(target));
                return;

            case 16:
                this.maxZ = ((System.Windows.Controls.Slider)(target));
                return;

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

            #line 196 "..\..\MainWindow.xaml"
                this.start.Click += new System.Windows.RoutedEventHandler(this.BtnStart_Click);

            #line default
            #line hidden
                return;

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

            #line 197 "..\..\MainWindow.xaml"
                this.stop.Click += new System.Windows.RoutedEventHandler(this.BtnStop_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.myViewPort3D = ((HelixToolkit.Wpf.HelixViewport3D)(target));
     return;
     case 2:
     this.StlModel = ((System.Windows.Media.Media3D.ModelVisual3D)(target));
     return;
     }
     this._contentLoaded = true;
 }
示例#56
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     this.graph3DWindow = ((IMPressive.Graph3DWindow)(target));
     
     #line 9 "..\..\Graph3DWindow.xaml"
     this.graph3DWindow.Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);
     
     #line default
     #line hidden
     return;
     case 2:
     this.mainViewport = ((HelixToolkit.Wpf.HelixViewport3D)(target));
     return;
     case 3:
     this.camera = ((System.Windows.Media.Media3D.PerspectiveCamera)(target));
     return;
     case 4:
     this.model3D = ((IMPressive.SurfacePlotVisual3D)(target));
     return;
     case 5:
     this.btnLoad = ((System.Windows.Controls.Button)(target));
     
     #line 31 "..\..\Graph3DWindow.xaml"
     this.btnLoad.Click += new System.Windows.RoutedEventHandler(this.btnLoad_Click);
     
     #line default
     #line hidden
     return;
     case 6:
     this.btnClear = ((System.Windows.Controls.Button)(target));
     
     #line 35 "..\..\Graph3DWindow.xaml"
     this.btnClear.Click += new System.Windows.RoutedEventHandler(this.btnClear_Click);
     
     #line default
     #line hidden
     return;
     case 7:
     this.label = ((System.Windows.Controls.Label)(target));
     return;
     case 8:
     this.txtOperation = ((System.Windows.Controls.AutoCompleteBox)(target));
     return;
     case 9:
     this.label3 = ((System.Windows.Controls.Label)(target));
     return;
     case 10:
     this.txtFromX = ((System.Windows.Controls.AutoCompleteBox)(target));
     return;
     case 11:
     this.label4 = ((System.Windows.Controls.Label)(target));
     return;
     case 12:
     this.txtToX = ((System.Windows.Controls.AutoCompleteBox)(target));
     return;
     case 13:
     this.label5 = ((System.Windows.Controls.Label)(target));
     return;
     case 14:
     this.txtPasX = ((System.Windows.Controls.AutoCompleteBox)(target));
     return;
     case 15:
     this.label6 = ((System.Windows.Controls.Label)(target));
     return;
     case 16:
     this.txtFromY = ((System.Windows.Controls.AutoCompleteBox)(target));
     return;
     case 17:
     this.label7 = ((System.Windows.Controls.Label)(target));
     return;
     case 18:
     this.txtToY = ((System.Windows.Controls.AutoCompleteBox)(target));
     return;
     case 19:
     this.label8 = ((System.Windows.Controls.Label)(target));
     return;
     case 20:
     this.txtPasY = ((System.Windows.Controls.AutoCompleteBox)(target));
     return;
     }
     this._contentLoaded = true;
 }
示例#57
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
     switch (connectionId)
     {
     case 1:
     
     #line 20 "..\..\MainWindow.xaml"
     ((System.Windows.Controls.Ribbon.RibbonButton)(target)).Click += new System.Windows.RoutedEventHandler(this.Add_Click);
     
     #line default
     #line hidden
     return;
     case 2:
     
     #line 21 "..\..\MainWindow.xaml"
     ((System.Windows.Controls.Ribbon.RibbonButton)(target)).Click += new System.Windows.RoutedEventHandler(this.Load_Click);
     
     #line default
     #line hidden
     return;
     case 3:
     this.PG = ((Xceed.Wpf.Toolkit.PropertyGrid.PropertyGrid)(target));
     return;
     case 4:
     this.DGV = ((Xceed.Wpf.DataGrid.DataGridControl)(target));
     return;
     case 6:
     this.HelixView = ((HelixToolkit.Wpf.HelixViewport3D)(target));
     return;
     }
     this._contentLoaded = true;
 }
示例#58
0
        //INTEGRATION
        public MainViewModel(IFileDialogService fds, HelixViewport3D hv, Treatment treatment, SmileFile file, bool duplicate, MainWindow window)
        {
            Expansion = 1;
            FileDialogService = fds;
            HelixView = hv;
            FileOpenCommand = new DelegateCommand(FileOpen);
            FileOpenRawCommand = new DelegateCommand(FileOpenRaw);
            //FileExportCommand = new DelegateCommand(FileExport);
            FileExportCommand = new DelegateCommand(ConfirmDirectFileExport);            
            FileExportRawCommand = new DelegateCommand(FileExportRaw);
            FileExitCommand = new DelegateCommand(FileExit);
            ViewZoomExtentsCommand = new DelegateCommand(ViewZoomExtents);
            EditCopyXamlCommand = new DelegateCommand(CopyXaml);
            EditClearAreaCommand = new DelegateCommand(ClearArea);
            FileExportStlCommand = new DelegateCommand(StlFileExport);            

            
            ApplicationTitle = "Dental Smile - 3D Viewer";

            ModelToBaseMarker = new Dictionary<Model3D, BaseMarker>();
            OriginalMaterial = new Dictionary<Model3D, Material>();

            //Elements = new List<VisualElement>();
            //foreach (var c in hv.Children) Elements.Add(new VisualElement(c));

            this.window = window;
            RootVisual = window.vmodel;
            
            handleManipulationData(treatment, file, duplicate);
            
            //JawVisual = new JawVisual3D(Patient);
            //RootVisual.Children.Add(JawVisual);
        }
        public PerspectiveCamera GetNewCamera(HelixViewport3D view, double span, double eaveHeight, double length)
        {
            PerspectiveCamera cam = new PerspectiveCamera();

            double factor = 8 * ((span / 6) + (length / 6)) / 2;

            cam.Position = new Point3D(factor - (length / 2), factor + (span / 2), factor + (eaveHeight / 2));            
            cam.LookDirection = new Vector3D(-factor, -factor, -factor);
            cam.UpDirection = new Vector3D(0, 0, 1);
            cam.FieldOfView = 61;

            return cam;
        }
示例#60
0
        public void InitGraphics(Control destControl, TreeView destTreeControl)
        {
            _destControl = destControl;
            _treeControl = destTreeControl;
            hVp3D = new HelixViewport3D();
            var host = new ElementHost();
            host.Dock = DockStyle.Fill;
            host.Child = hVp3D;
            _destControl.Controls.Add(host);

            BindMouseHandler();

            var lights = new DefaultLights();
            hVp3D.Children.Add(lights);

            var teaPot = new Teapot();
            hVp3D.Children.Add(teaPot);
        }