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); }
private static void CreateView(WNTGraphicDevice device, V3dViewer viewer, out V3dView view, Control attachedView) { // Assign to each Custom control an OpenCascade View view = null; for (var i = 0; i < 1; 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; 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.Window = 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(); } }
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); }