예제 #1
0
        //--------------------------------------------------------------------------------------------------

        void _ShowTriedron(bool visible)
        {
            if (visible)
            {
                V3dView.TriedronDisplay(Aspect_TypeOfTriedronPosition.Aspect_TOTP_LEFT_LOWER, Quantity_NameOfColor.Quantity_NOC_ALICEBLUE.ToColor(), 0.1, V3d_TypeOfVisualization.V3d_ZBUFFER);
            }
            else
            {
                V3dView.TriedronErase();
            }
        }
예제 #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();
            }
        }
예제 #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);
        }