Esempio n. 1
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();
            }
        }
Esempio n. 2
0
        private static V3dPerspectiveView CreateView(WNTGraphicDevice device,
                                                     V3dViewer viewer,
                                                     Control control)
        {
            // Assign to each Custom control an OpenCascade View

            var view = new V3dPerspectiveView(viewer);

            view.SetDegenerateModeOn();
            view.Transparency = true;

            view.SurfaceDetail = V3dTypeOfSurfaceDetail.V3d_TEX_ALL;

            // Attach to the OpenCascade view a Custom control

            //IntPtr attachedViewHandle = (attachedView as Form).Handle;
            var aWntWindow = new WNTWindow(device, control.Handle, QuantityNameOfColor.Quantity_NOC_MATRAGRAY);

            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.SetAntialiasingOn();
            view.Redraw();
            view.MustBeResized();
            view.Reset(true);

            return(view);
        }