예제 #1
0
        public ExampleForm(ExportProvider exportProvider)
        {
            _shaderFragments = exportProvider.GetExport <ShaderFragmentArchive.Archive>().Value;
            _nodeCreator     = exportProvider.GetExport <NodeEditorCore.IShaderFragmentNodeCreator>().Value;
            _modelConversion = exportProvider.GetExport <NodeEditorCore.IModelConversion>().Value;

            InitializeComponent();

            _hyperGraphModel = new HyperGraph.GraphModel();
            _hyperGraphModel.CompatibilityStrategy = _nodeCreator.CreateCompatibilityStrategy();

            _graphAdapter = new HyperGraph.GraphControl();
            _graphAdapter.Attach(graphControl);
            _graphAdapter.HighlightCompatible = true;
            _graphAdapter.LargeGridStep       = 160F;
            _graphAdapter.LargeStepGridColor  = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90)))));
            _graphAdapter.ShowLabels          = false;
            _graphAdapter.SmallGridStep       = 20F;
            _graphAdapter.SmallStepGridColor  = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(80)))), ((int)(((byte)(80)))));

            _graphAdapter.Model     = _hyperGraphModel;
            _graphAdapter.Selection = new GraphSelection();
            _graphAdapter.Selection.SelectionChanged += OnFocusChanged;

            graphControl.MouseEnter += OnGraphMouseEnter;
            graphControl.Paint      += graphControl_Paint;

            _tabGroupTextureNode = new RibbonTabGroup(_ribbon, (uint)RibbonMarkupCommands.cmdTabGroupTextureNode);

            _showLabels = new RibbonLib.Controls.RibbonCheckBox(_ribbon, (uint)RibbonMarkupCommands.cmdShowLabels);
            _showLabels.ExecuteEvent += new EventHandler <ExecuteEventArgs>(OnShowLabelsChanged);

            _generateTestScript = new RibbonLib.Controls.RibbonButton(_ribbon, (uint)RibbonMarkupCommands.cmdButtonTestScript);
            _generateTestScript.ExecuteEvent += new EventHandler <ExecuteEventArgs>(OnGenerateTestScript);

            _saveAsButton = new RibbonLib.Controls.RibbonButton(_ribbon, (uint)RibbonMarkupCommands.cmdSaveAs);
            _saveAsButton.ExecuteEvent += new EventHandler <ExecuteEventArgs>(OnSaveAs);

            _loadButton = new RibbonLib.Controls.RibbonButton(_ribbon, (uint)RibbonMarkupCommands.cmdLoad);
            _loadButton.ExecuteEvent += new EventHandler <ExecuteEventArgs>(OnLoad);

            var fragmentTreeModel = exportProvider.GetExport <NodeEditorCore.ShaderFragmentArchiveModel>().Value;

            _fragmentTree.Model                 = new Aga.Controls.Tree.SortedTreeModel(fragmentTreeModel);
            _fragmentTree.ItemDrag             += new ItemDragEventHandler(OnFragmentTreeItemDrag);
            _fragmentTree.NodeMouseDoubleClick += new EventHandler <Aga.Controls.Tree.TreeNodeAdvMouseEventArgs>(OnFragmentTreeItemDoubleClick);

            // _materialParametersGrid.SelectedObject = new DictionaryPropertyGridAdapter(_document.PreviewMaterialState);

            try
            {
                LoadFile("defaultload.sh");
            }
            catch (System.Exception) {}
        }
예제 #2
0
		public ExampleForm(ExportProvider exportProvider)
		{
            _shaderFragments = exportProvider.GetExport<ShaderFragmentArchive.Archive>().Value;
            _nodeCreator = exportProvider.GetExport<NodeEditorCore.IShaderFragmentNodeCreator>().Value;
            _modelConversion = exportProvider.GetExport<NodeEditorCore.IModelConversion>().Value;

			InitializeComponent();

            _hyperGraphModel = new HyperGraph.GraphModel();
            _hyperGraphModel.CompatibilityStrategy = _nodeCreator.CreateCompatibilityStrategy();

            _graphAdapter = new HyperGraph.GraphControl();
            _graphAdapter.Attach(graphControl);
            _graphAdapter.HighlightCompatible = true;
            _graphAdapter.LargeGridStep = 160F;
            _graphAdapter.LargeStepGridColor = System.Drawing.Color.FromArgb(((int)(((byte)(90)))), ((int)(((byte)(90)))), ((int)(((byte)(90)))));
            _graphAdapter.ShowLabels = false;
            _graphAdapter.SmallGridStep = 20F;
            _graphAdapter.SmallStepGridColor = System.Drawing.Color.FromArgb(((int)(((byte)(80)))), ((int)(((byte)(80)))), ((int)(((byte)(80)))));

            _graphAdapter.Model = _hyperGraphModel;
            _graphAdapter.Selection = new GraphSelection();
            _graphAdapter.Selection.SelectionChanged += OnFocusChanged;

            graphControl.MouseEnter += OnGraphMouseEnter;
            graphControl.Paint += graphControl_Paint;

            _tabGroupTextureNode = new RibbonTabGroup(_ribbon, (uint)RibbonMarkupCommands.cmdTabGroupTextureNode);

            _showLabels = new RibbonLib.Controls.RibbonCheckBox(_ribbon, (uint)RibbonMarkupCommands.cmdShowLabels);
            _showLabels.ExecuteEvent += new EventHandler<ExecuteEventArgs>(OnShowLabelsChanged);

            _generateTestScript = new RibbonLib.Controls.RibbonButton(_ribbon, (uint)RibbonMarkupCommands.cmdButtonTestScript);
            _generateTestScript.ExecuteEvent += new EventHandler<ExecuteEventArgs>(OnGenerateTestScript);

            _saveAsButton = new RibbonLib.Controls.RibbonButton(_ribbon, (uint)RibbonMarkupCommands.cmdSaveAs);
            _saveAsButton.ExecuteEvent += new EventHandler<ExecuteEventArgs>(OnSaveAs);

            _loadButton = new RibbonLib.Controls.RibbonButton(_ribbon, (uint)RibbonMarkupCommands.cmdLoad);
            _loadButton.ExecuteEvent += new EventHandler<ExecuteEventArgs>(OnLoad);

            var fragmentTreeModel = exportProvider.GetExport<NodeEditorCore.ShaderFragmentArchiveModel>().Value;
            _fragmentTree.Model = new Aga.Controls.Tree.SortedTreeModel(fragmentTreeModel);
            _fragmentTree.ItemDrag += new ItemDragEventHandler(OnFragmentTreeItemDrag);
            _fragmentTree.NodeMouseDoubleClick += new EventHandler<Aga.Controls.Tree.TreeNodeAdvMouseEventArgs>(OnFragmentTreeItemDoubleClick);

            // _materialParametersGrid.SelectedObject = new DictionaryPropertyGridAdapter(_document.PreviewMaterialState);

            try
            {
                LoadFile("defaultload.sh");
            }
            catch(System.Exception) {}
		}