Exemple #1
0
 public SolverDrawerPipe(OCAIS2D_InteractiveContext context2d, OCV2d_View view2d, Solver.Solver solver, SolverDrawer solverDrawer) : base(ActionNames.SolverDrawerPipe)
 {
     _solver       = solver;
     _solverDrawer = solverDrawer;
     _context2d    = context2d;
     _view2d       = view2d;
 }
Exemple #2
0
 public EditDetectionPipe(OCAIS2D_InteractiveContext context2d, OCV2d_View view2d, Solver.Solver solver) : base(ActionNames.EditDetectionPipe)
 {
     _context2d = context2d;
     _solver    = solver;
     _view2d    = view2d;
 }
Exemple #3
0
        /// <summary>
        /// Initializes the OpenCascade views and assigns them View handles.
        /// </summary>
        private void InitializeOpenCascade2D()
        {
            // Initialize the Device
            try
            {
                device2d = new OCWNT_GraphicDevice(false, 0);
                Debug.Assert(device2d != null);
            }
            catch (Exception ex)
            {
                Debug.Assert(false, ex.Message);
                throw;                          //re-throw exception
            }

            // Create the 2D viewer
            try
            {
                viewer2d = new OCV2d_Viewer(device2d, "Visu2D", "");
                Debug.Assert(viewer2d != null);
                if (viewer2d != null)
                {
                    viewer2d.SetCircularGridValues(0, 0, 10, 8, 0);
                    viewer2d.SetRectangularGridValues(0, 0, 10, 10, 0);

                    //viewer2d.SetGridColor(new OCQuantity_Color(OCQuantity_NameOfColor.Quantity_NOC_LIGHTSLATEGRAY), new OCQuantity_Color(OCQuantity_NameOfColor.Quantity_NOC_WHITE));
                    viewer2d.ActivateGrid(OCAspect_GridType.Aspect_GT_Rectangular, OCAspect_GridDrawMode.Aspect_GDM_Lines);
                }
            }
            catch (Exception ex)
            {
                Debug.Assert(false, ex.Message);
                throw;                          //re-throw exception
            }

            // Create the 2D interactive context
            try
            {
                context2d = new OCAIS2D_InteractiveContext(this.viewer2d);
                Debug.Assert(context2d != null);
            }
            catch (Exception ex)
            {
                Debug.Assert(false, ex.Message);
                throw;                                  // re-throw exception
            }

            // Create the 2D View
            OCWNT_Window aWNTWindow = new OCWNT_Window(device2d, attachedView.GetView().Handle, OCQuantity_NameOfColor.Quantity_NOC_MATRAGRAY);

            //int w = 1000, h = 1000;
            //aWNTWindow.Size(w, h);
            if (!aWNTWindow.IsMapped())
            {
                aWNTWindow.Map();
            }

            OCWNT_WDriver aDriver = new OCWNT_WDriver(aWNTWindow);

            view2d = new OCV2d_View(aDriver, viewer2d, 0, 0, 200);
            // Reset the mapping
            view2d.Reset();
            view2d.Update();
        }
Exemple #4
0
 public View2dInput(OCV2d_View view, OCV2d_Viewer viewer)
     : base(ActionNames.View2dInput)
 {
     _view   = view;
     _viewer = viewer;
 }
Exemple #5
0
 public OCCMouseEventsPipe(OCV2d_View view, OCV2d_Viewer viewer)
     : base(ActionNames.OCCMouseCoordinates)
 {
     _view2d   = view;
     _viewer2d = viewer;
 }