Esempio n. 1
0
        public MainViewModel(IFileDialogService fds, HelixViewport3D viewport, HelixViewport3D viewport2)
        {
            if (viewport == null || viewport2 == null)
            {
                throw new ArgumentNullException("Neither viewport nor viewport2 is NULL!");
            }

            this.dispatcher             = Dispatcher.CurrentDispatcher;
            this.Expansion              = 1;
            this.fileDialogService      = fds;
            this.viewport               = viewport;
            this.viewport2              = viewport2;
            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       = "Medical 3D Model viewer";
            this.Elements               = new List <VisualViewModel>();
            foreach (var c in viewport.Children)
            {
                this.Elements.Add(new VisualViewModel(c));
            }
            foreach (var c in viewport2.Children)
            {
                this.Elements.Add(new VisualViewModel(c));
            }
            this.Info1 = "This is a test";
        }
        public MainViewModel(IHelixViewport3D viewPort)
        {
            _viewport = viewPort;

            _traslateTrasform  = new TranslateTransform3D();
            _traslateTrasform2 = new TranslateTransform3D();
        }
        public MainViewModel(IHelixViewport3D viewport)
        {
            _viewport = viewport;

            var tt = new TranslateTransform3D();
            //var tt2 = new TranslateTransform3D();
            var ar = new AxisAngleRotation3D(new Vector3D(0, 0, 1), 0.0);
            var tr = new RotateTransform3D(ar);
            var t  = new Transform3DGroup();
            //var m = HelixToolkit.Wpf.Materials.Orange.Clone();
            //var m = MaterialHelper.CreateMaterial(new System.Windows.Media.SolidColorBrush(System.Windows.Media.Colors.DarkCyan), _opacity, 255, false);
            var m = MaterialHelper.CreateMaterial(System.Windows.Media.Colors.DarkCyan, _opacity).Clone();



            t.Children.Add(tr);
            t.Children.Add(tt);

            Models.Add(new SphereVisual3D()
            {
                Radius = 1
            });
            Models.Add(new CubeVisual3D()
            {
                SideLength   = 5,
                Transform    = t,
                Material     = m,
                BackMaterial = m
            });

            _traslateTrasform = tt;
            _angleRotation    = ar;
            _material         = m;
        }
Esempio n. 4
0
 public MyTask3(string name, int number, IFileDialog dialog, HelixViewport3D viewport)
 {
     _viewport   = viewport ?? throw new ArgumentNullException(nameof(viewport));
     Name        = name;
     Number      = number;
     _dialog     = dialog;
     _dispatcher = Dispatcher.CurrentDispatcher;
     Load        = new DelegateCommand(LoadFile);
     Clear       = new DelegateCommand(ClearContent);
 }
Esempio n. 5
0
        public MainViewModel2(IHelixViewport3D viewPort)
        {
            _viewport = viewPort;

            _traslateTrasform  = new TranslateTransform3D();
            _traslateTrasform2 = new TranslateTransform3D();
            _trasformGroup     = new Transform3DGroup();

            _trasformGroup.Children.Add(_traslateTrasform);
            _trasformGroup.Children.Add(_traslateTrasform2);
        }
Esempio n. 6
0
        public MainViewModel(HelixViewport3D viewport)
        {
            if (viewport == null)
            {
                throw new ArgumentNullException("viewport");
            }
            this.viewport   = viewport;
            this.dispatcher = Dispatcher.CurrentDispatcher;
            var mi = new ModelImporter();

            currentModel = mi.Load(@"Resources\06L.STL", this.dispatcher);
            this.viewport.ZoomExtents(1000000);
        }
Esempio n. 7
0
        public MainViewModel(IFileDialogService fds, HelixViewport3D viewport, RotateManipulator rmX, RotateManipulator rmY, RotateManipulator rmZ, TranslateManipulator scaleXYZ, PrintConfiguration PrintConfig)
        {
            if (viewport == null)
            {
                throw new ArgumentNullException("viewport");
            }

            this.printConfig            = PrintConfig;
            ScaleFactor                 = 100;
            SizeX                       = SizeY = SizeZ = 0;
            this.rotatorManipulatorX    = rmX;
            this.rotatorManipulatorY    = rmY;
            this.rotatorManipulatorZ    = rmZ;
            this.ScaleXYZ               = scaleXYZ;
            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.ViewRotateCommand      = new DelegateCommand(this.ViewRotate);
            this.ViewScaleCommand       = new DelegateCommand(this.ViewScale);
            this.ResetSolidCommand      = new DelegateCommand(this.ResetSolid);
            this.PrintCommand           = new DelegateCommand(this.GenerateGCODE);
            this.PronterfaceCommand     = new DelegateCommand(this.Prontercae);
            this.AbortCommand           = new DelegateCommand(this.Abort);
            this.ApplicationTitle       = "Fracktory";
            ModelLoaded                 = Visibility.Collapsed;
            ModelNotLoaded              = Visibility.Visible;
            ModelPrint                  = Visibility.Collapsed;
            ModelPrintDone              = Visibility.Collapsed;
            this.Elements               = new List <VisualViewModel>();

            foreach (var c in viewport.Children)
            {
                this.Elements.Add(new VisualViewModel(c));
            }
        }
Esempio n. 8
0
        public ThrDmod(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));
            }
        }
Esempio n. 9
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));
            }
        }
 public Machine3DModelsViewModelBase(IHelixViewport3D viewport)
 {
     _viewport = viewport;
 }
Esempio n. 11
0
        public MainViewModel(HelixViewport3D viewport)
        {
            if (viewport == null)
            {
                throw new ArgumentNullException("viewport");
            }

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

            this.currentModelPath = shirtList[0];
        }
Esempio n. 12
0
        public TransformViewModel(HelixViewport3D viewport, int id)
        {
            if (viewport == null)
            {
                throw new ArgumentNullException("viewport");
            }

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

            this.currentModelPath = shirtList[id];
        }
Esempio n. 13
0
        public MainViewModel(HelixViewport3D viewport)
        {
            if (viewport == null)
            {
                throw new ArgumentNullException("viewport");
            }

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

            this.currentModelPath = @"singlet.stl";

            //Damping = 0.98;
            //integrator = new VerletIntegrator() { Iterations = 4, Damping = this.Damping };
            //WindSpeed = 6;
            //WindDirection = 180;
            //Mass = 0.8;

            texture1 = @"D:\Projects\FlagOfNorway.png";
            texture2 = @"D:\Projects\Cloth_Texture.jpg";

        }
Esempio n. 14
0
 public MyTask4(string name, int number, IFileDialog dialog, HelixViewport3D viewport) : base(name, number, dialog, viewport)
 {
     _viewport = viewport;
 }