Exemplo n.º 1
0
        private void SetNewGradientBackground()
        {
            var backgroundFileName = NaroAppConstantNames.InstallDirectory + @"\background2.bmp";

            Ensure.IsTrue(File.Exists(backgroundFileName));
            _view.SetBackgroundImage(backgroundFileName, AspectFillMethod.Aspect_FM_STRETCH, true);
            _view.MustBeResized();
        }
Exemplo n.º 2
0
        private static void CreateView(WNTGraphicDevice device, V3dViewer viewer, out V3dView view,
                                       IOccContainerMultiView attachedView)
        {
            // Assign to each Custom control an OpenCascade View

            view = null;
            Ensure.AreEqual(attachedView.VisibleViewCount, 1);
            for (var i = 0; i < attachedView.VisibleViewCount; i++)
            {
                view = viewer.CreateView;
                Debug.Assert(view != null);
                view.SetDegenerateModeOn();
                view.Transparency = true;

                view.SurfaceDetail = V3dTypeOfSurfaceDetail.V3d_TEX_ALL;

                // Attach to the OpenCascade view a Custom control
                var control = attachedView.GetView(i);
                if (control == null)
                {
                    continue;
                }
                //IntPtr attachedViewHandle = (attachedView as Form).Handle;
                var aWntWindow = new WNTWindow(device, control.Handle, QuantityNameOfColor.Quantity_NOC_MATRAGRAY);
                Debug.Assert(aWntWindow != null);

                view.SetWindow(aWntWindow);
                view.TriedronDisplay(AspectTypeOfTriedronPosition.Aspect_TOTP_LEFT_LOWER,
                                     QuantityNameOfColor.Quantity_NOC_WHITE, 0.02,
                                     V3dTypeOfVisualization.V3d_WIREFRAME);

                if (!aWntWindow.IsMapped)
                {
                    aWntWindow.Map();
                }
                //view[i].SetAntialiasingOn();
                //view[i].Redraw();
                view.MustBeResized();
            }
        }
Exemplo n.º 3
0
        private bool CreateView3D()
        {
            if (viewer3d != null)
            {
                view3d = viewer3d.CreateView;
                Debug.Assert(view3d != null);
                if (view3d != null)
                {
                    //view3d.SetDegenerateModeOn();
                    //view3d.SetTransparency(true);

                    //view3d.SetSurfaceDetail(OCV3d_TypeOfSurfaceDetail.V3d_TEX_ALL);

                    // Attach to the OpenCascade view a Custom control
                    Control control = ocView;    // attachedView.GetView(i);
                    if (control != null)
                    {
                        //IntPtr attachedViewHandle = (attachedView as Form).Handle;
                        var aWNTWindow = new WNTWindow(device3d, control.Handle, QuantityNameOfColor.Quantity_NOC_MATRAGRAY);     // manual default
                        Debug.Assert(aWNTWindow != null);
                        if (aWNTWindow != null)
                        {
                            view3d.Window = aWNTWindow;
                            view3d.TriedronDisplay(AspectTypeOfTriedronPosition.Aspect_TOTP_LEFT_LOWER, QuantityNameOfColor.Quantity_NOC_WHITE, 0.02, V3dTypeOfVisualization.V3d_WIREFRAME);     // manual default

                            if (!aWNTWindow.IsMapped)
                            {
                                aWNTWindow.Map();
                            }
                        }
                        view3d.Redraw();
                        view3d.MustBeResized();
                    }
                }
                return(true);
            }

            return(false);
        }
Exemplo n.º 4
0
        //--------------------------------------------------------------------------------------------------

        public void Resize()
        {
            V3dView.MustBeResized();
            RaisePropertyChanged(nameof(PixelSize));
            RaisePropertyChanged(nameof(GizmoScale));
        }
Exemplo n.º 5
0
 private void OnResize(DataPackage data)
 {
     _view.MustBeResized();
 }