Exemple #1
0
        void InitializeInputs()
        {
            // Build the inputs and pipes
            inputFactory = new InputFactory();

            var viewInput = new View2dInput(view2d, viewer2d);

            inputFactory.Register(viewInput);
            mouseInput = new MouseEventsInput();
            inputFactory.Register(mouseInput);
            var mousePipe = new OCCMouseEventsPipe(view2d, viewer2d);

            inputFactory.RegisterPipe(mouseInput.Name, mousePipe);
            inputFactory.Register(mousePipe);

            var solverDrawerPipe = new SolverDrawerPipe(context2d, view2d, _solver, _solverDrawer);

            inputFactory.RegisterPipe(mousePipe.Name, solverDrawerPipe);
            inputFactory.Register(solverDrawerPipe);

            _editDetectionPipe = new EditDetectionPipe(context2d, view2d, _solver);
            inputFactory.RegisterPipe(solverDrawerPipe.Name, _editDetectionPipe);
            inputFactory.Register(_editDetectionPipe);
            _editDetectionPipe.ActivateActionHandler += new ActionActivatedEventHandler(EditDetectionPipe_ActivateActionHandler);

            var docInput = new DocumentInput(WorkItem.Services.Get <ILocalContextService>().CurrentOcafDocument);

            inputFactory.Register(docInput);

            var contextInput = new Context2dInput(context2d);

            inputFactory.Register(contextInput);

            OCTopoDS_Shape topoShape = WorkItem.Services.Get <ILocalContextService>().CurrentSelectedShape;

            workingPlaneInput = new WorkingPlaneInput(GeomUtils.ExtractAxis(topoShape));
            inputFactory.Register(workingPlaneInput);
        }