コード例 #1
0
        public void SetScenario(StructureBspModel bspModel)
        {
            this.bspModel = bspModel;

            var fileName = bspModel.StructureBspTag.FileName();

            TabModel.ToolTip = fileName;
            TabModel.Header  = Utils.GetFileName(fileName);
        }
コード例 #2
0
        public IEnumerable <Task> ReadStructureBsp(StructureBspModel bspModel)
        {
            this.bspModel   = bspModel;
            ClusterHolder   = new ObjectHolder("Clusters");
            InstanceHolders = new Dictionary <int, InstanceHolder>();

            yield return(Task.Run(() =>
            {
                factory.LoadTag(bspModel.StructureBspTag, false);
                modelProps = factory.GetProperties(tagId);

                var instanceData = ReadInstanceData();
                foreach (var i in modelProps.InstanceMeshes)
                {
                    InstanceHolders.Add(i, new InstanceHolder(i, modelProps, instanceData));
                }
            }));
        }
コード例 #3
0
 public void SetScenario(StructureBspModel bspModel)
 {
     CurrentItem   = null;
     Visibility    = Visibility.Hidden;
     this.bspModel = bspModel;
 }
コード例 #4
0
 public void ClearScenario()
 {
     CurrentItem = null;
     Visibility  = Visibility.Hidden;
     bspModel    = null;
 }
コード例 #5
0
        public void DisplayModel(ITabContentHost targetWindow, IIndexItem modelTag, string fileName)
        {
            var container = targetWindow.DocumentPanel;

            LogOutput($"Loading tag: {fileName}");

            try
            {
                if (Controls.DXEditor.CanOpenTag(modelTag))
                {
                    var hierarchyView = new Controls.HierarchyView();
                    var propertyView  = new Controls.PropertyView();
                    var renderView    = new Controls.DXEditor();

                    var model = new ScenarioModel(modelTag)
                    {
                        HierarchyView = hierarchyView,
                        PropertyView  = propertyView,
                        RenderView    = renderView,
                        LogOutput     = LogOutput,
                        LogError      = LogError
                    };

                    var existingToolWells = EnumerateChildren(targetWindow.DockContainer)
                                            .OfType <ToolWellModel>()
                                            .ToList();

                    targetWindow.DocumentPanel.AddItem(renderView.TabModel);
                    targetWindow.DockContainer.AddTool(hierarchyView.TabModel, null, System.Windows.Controls.Dock.Right);
                    targetWindow.DockContainer.AddTool(propertyView.TabModel, hierarchyView.TabModel.Parent, System.Windows.Controls.Dock.Bottom);

                    //the panels attempt to size to the contents but since the controls havent loaded yet
                    //they will have no size - we need to set a size for them.
                    hierarchyView.TabModel.Parent.PanelSize        = new System.Windows.GridLength(1, System.Windows.GridUnitType.Star);
                    propertyView.TabModel.Parent.PanelSize         = new System.Windows.GridLength(1, System.Windows.GridUnitType.Star);
                    hierarchyView.TabModel.Parent.Parent.PanelSize = new System.Windows.GridLength(500);

                    foreach (var well in existingToolWells)
                    {
                        well.TogglePinStatusCommand.Execute(null);
                    }

                    renderView.LoadScenario();
                }
                else
                {
                    var propertyView = new Controls.InstancePropertyView();
                    var renderView   = new Controls.BspEditor();

                    var model = new StructureBspModel(modelTag)
                    {
                        PropertyView = propertyView,
                        RenderView   = renderView,
                        LogError     = LogError
                    };

                    var existingToolWells = EnumerateChildren(targetWindow.DockContainer)
                                            .OfType <ToolWellModel>()
                                            .ToList();

                    targetWindow.DocumentPanel.AddItem(renderView.TabModel);
                    targetWindow.DockContainer.AddTool(propertyView.TabModel, null, System.Windows.Controls.Dock.Right);

                    //the panels attempt to size to the contents but since the controls havent loaded yet
                    //they will have no size - we need to set a size for them.
                    propertyView.TabModel.Parent.PanelSize = new System.Windows.GridLength(500);

                    foreach (var well in existingToolWells)
                    {
                        well.TogglePinStatusCommand.Execute(null);
                    }

                    renderView.LoadStructureBsp();
                }

                LogOutput($"Loaded tag: {fileName}");
            }
            catch (Exception e)
            {
                LogError($"Error loading tag: {fileName}", e, true);
            }
        }
コード例 #6
0
 public void ClearScenario()
 {
     bspModel = null;
 }