private void DefaultsSetup()
 {
     DefaultInterpreters.Setup();
     _actionsGraph = new ActionsGraph();
     _actionsGraph.Register(new FunctionFactoryInput());
     _actionsGraph.Register(new OptionsSetupInput());
     DefaultFunctions.Setup(_actionsGraph);
 }
Esempio n. 2
0
        public void Setup()
        {
            DefaultInterpreters.Setup();
            _actionsGraph = new ActionsGraph();
            _actionsGraph.Register(new FunctionFactoryInput());
            _actionsGraph.Register(new OptionsSetupInput());
            _document = TestUtils.DefaultsSetup();
            DefaultFunctions.Setup(_actionsGraph);
            var documentInput = new DocumentInput(_document);

            documentInput.OnConnect();
            _actionsGraph.Register(documentInput);
            _document.Transact();
        }
        public void BuildForm(int width, int height)
        {
            var form = new OccVisualForm
            {
                Width  = width,
                Height = height
            };

            var multiview = form.multiviewTableLayoutPanel;

            SetupUtils = new SetupUtils {
                AttachedView = multiview
            };
            SetupUtils.InitializeModifiersSetup();
            SetupUtils.ResetSetupEnvironment();

            Viewer = SetupUtils.Viewer;
            View   = SetupUtils.View;

            Form         = form;
            Form.Paint  += FormPaint;
            Form.Resize += FormResize;

            DefaultInterpreters.Setup();
            var actionsGraph = new ActionsGraph();

            actionsGraph.Register(new FunctionFactoryInput());
            DefaultFunctions.Setup(actionsGraph);

            InitializeSetupUtils();
        }
        private static void Setup()
        {
            DefaultInterpreters.Setup();
            var actionsGraph = new ActionsGraph();

            actionsGraph.Register(new FunctionFactoryInput());
            DefaultFunctions.Setup(actionsGraph);
        }
        public ActionsGraph AddNewChildGraph()
        {
            var childGraph = new ActionsGraph();

            childGraph.Register(new ParentActionGraphInput(ActionsGraph));
            _documents.Add(childGraph);
            return(childGraph);
        }
        public void Init()
        {
            DefaultsSetup();
            _actionsGraph = new ActionsGraph();
            var documentInput = new DocumentInput(new Document());

            documentInput.OnConnect();
            _actionsGraph.Register(documentInput);
        }
Esempio n. 7
0
        public void TestProducerConsumerTest()
        {
            var factory         = new ActionsGraph();
            var sourceGenerator = new ConsecutiveNumberInput();

            factory.Register(sourceGenerator);
            factory.Register(new DecrementPipeToFloat());

            var consumer = new ModifierConsumer();

            factory.ModifierContainer.RegisterAction(consumer);
            consumer.ActionsGraph = factory;
            consumer.Setup();
            consumer.OnActivate();

            sourceGenerator.Tick();
            Assert.AreEqual(-1, consumer.Value, "Invalid data was sent");
            sourceGenerator.Tick();
            Assert.AreEqual(0, consumer.Value, "Invalid data was sent");
        }
Esempio n. 8
0
        public static Document DefaultsSetup()
        {
            DefaultInterpreters.Setup();
            AttributeInterpreterFactory.Register <ActionGraphInterpreter>();
            var actionsGraph = new ActionsGraph();

            actionsGraph.Register(new FunctionFactoryInput());
            actionsGraph.Register(new OptionsSetupInput());
            DefaultFunctions.Setup(actionsGraph);
            var constraintsFunctionsSetup = new DefaultConstraintFunctions();

            constraintsFunctionsSetup.Setup(actionsGraph);

            QosCreate();

            var document = new Document();

            document.Transact();
            document.Root.Set <ActionGraphInterpreter>().ActionsGraph = actionsGraph;
            document.Root.Set <DocumentContextInterpreter>().Document = document;
            document.Commit("document setup");
            return(document);
        }
        public void InitializeModifiersSetup()
        {
            ActionGraph            = new ActionsGraph();
            _metaModifierContainer = new CommandList(ActionGraph);
            if (AttachedView == null)
            {
                AttachedView = new MultiViewStub(null);
            }
            InitializeViews();
            InitializeDocument();
            ActionGraph.Register(new FunctionFactoryInput());
            ActionGraph.Register(new OptionsSetupInput());
            ActionGraph.Register(new UiBuilderInputFake());
            DefaultFunctions.Setup(ActionGraph);

            InitializeInputs();
            InitializeActions();


            var sketchCreator = new SketchCreator(Document);

            sketchCreator.BuildSketchNode();
        }
Esempio n. 10
0
        private void InitializeInputs()
        {
            _viewInfo.Context = _context;
            var defaultInputs = new DefaultInputs(_actionGraph);

            defaultInputs.InitializeInputs(_viewInfo,
                                           _attachedView.GetActiveView(),
                                           _solver,
                                           _metaModifierContainer);
            _mouseInput = GetInput <MouseEventsInput>(InputNames.MouseEventsInput);
            GetInput <Mouse3DEventsPipe>(InputNames.Mouse3DEventsPipe);
            _nodeSelectInput = GetInput <NodeSelectInput>(InputNames.NodeSelect);
            GetInput <FacePickerPipe>(InputNames.FacePickerPlane);
            _actionGraph.Register(new CommandParser(_metaModifierContainer));
        }
        private ActionsGraph CreateMainGraph(ViewInfo viewInfo, ITreeViewControl treeView,
                                             PropertyGridView wpfPropertyGrid, CommandLineView commandLineView,
                                             LayerView layerView, IHelpView helpView, BooView booView)
        {
            var result = new ActionsGraph();

            ActionsGraph = result;
            result.Register(this);

            var defaultAppInputs = new DefaultAppInputs(ActionsGraph);

            defaultAppInputs.InitializeInputs(viewInfo, treeView, wpfPropertyGrid, commandLineView, layerView, helpView,
                                              booView);

            return(result);
        }
Esempio n. 12
0
        public void Run(IOccContainerMultiView sceneWorkspace, ActionsGraph actionsGraph, PartModelingView newView,
                        ViewInfo viewInfo)
        {
            _attachedView = sceneWorkspace;
            _actionGraph  = actionsGraph;
            var uiItems =
                _actionGraph[InputNames.UiElementsItem].GetData(NotificationNames.GetValue).Get
                <UiElementsItem.Items>();

            _treeView        = uiItems.TreeView;
            _wpfPropertyView = (PropertyGridView)uiItems.WpfPropertyView;
            _wpfLayerView    = (LayerView)uiItems.LayerView;
            _helpView        = uiItems.HelpView;
            _commandLineView =
                _actionGraph[InputNames.CommandLineView].GetData(NotificationNames.GetValue).Get
                <CommandLineView>();
            _metaModifierContainer = new CommandList(_actionGraph);

            _actionGraph.OnSwitchAction += UpdateSwitchAction;

            Application.DoEvents();
            _actionGraph.Register(new FunctionFactoryInput());
            DefaultFunctions.Setup(_actionGraph);
            var defaultConstraintFunctions = new DefaultConstraintFunctions();

            defaultConstraintFunctions.Setup(_actionGraph);

            OccInitialize.Setup(ref _device, ref _viewer, ref _context, out _view, _attachedView);

            InitDocument();

            _solver = new Solver(_document);
            UpdateSolverOptions();
            ViewInfoSetup(viewInfo);
            RegisterModifiers();
            InitializeInputs();
            DefineShapeConcepts();
            SetupChangedShapeEvent();
            ViewInfoPostSetup();
            UserInterfaceSetup();

            SwitchUserAction(ModifierNames.StartUp);
            var optionsSetup = actionsGraph[InputNames.OptionsSetupInput].Get <OptionsSetup>();

            optionsSetup.Register(new AutoSaveOptionsItem());

            var occSection = optionsSetup.UpdateSectionNode(OptionSectionNames.Background);
            var color      = occSection.GetColorValue(0);

            _viewer.SetDefaultBackgroundColor((ShapeUtils.GetOccColor(color)));
            //SetGradientBackground();


            ForceStartupViewUpdate();

            OptionsEventMapping(optionsSetup);

            var presenter = newView.GetPresenter();

            presenter.OnMouseMoveHandler  += MouseMoveHandler;
            presenter.OnMouseDownHandler  += MouseDownHandler;
            presenter.OnMouseUpHandler    += MouseUpHandler;
            presenter.OnMouseWheelHandler += MouseWheelHandler;

            presenter.OnResizeEvent += ResizeView;

            ApplicationNotificationUtils.Instance.ExitingApplication += () => SwitchUserAction(ModifierNames.NaroExit);

            _view.SurfaceDetail = V3dTypeOfSurfaceDetail.V3d_TEX_ALL;
            new SketchSolveUpdater(_document);


            SetOriginalGradientBackground();

            ResumeRunning();
        }