Add dictionary of IObject3D -> TreeNode
This commit is contained in:
parent
47c42c44c8
commit
da1e7a7b1e
3 changed files with 9 additions and 5 deletions
|
|
@ -45,12 +45,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
{
|
||||
public static class Object3DTreeBuilder
|
||||
{
|
||||
public static TreeNode BuildTree(IObject3D rootItem, ThemeConfig theme)
|
||||
public static TreeNode BuildTree(IObject3D rootItem, Dictionary<IObject3D, TreeNode> keyValues, ThemeConfig theme)
|
||||
{
|
||||
return AddTree(BuildItemView(rootItem), null, theme);
|
||||
return AddTree(BuildItemView(rootItem), null, keyValues, theme);
|
||||
}
|
||||
|
||||
private static TreeNode AddTree(ObjectView item, TreeNode parent, ThemeConfig theme)
|
||||
private static TreeNode AddTree(ObjectView item, TreeNode parent, Dictionary<IObject3D, TreeNode> keyValues, ThemeConfig theme)
|
||||
{
|
||||
// Suppress MeshWrapper and OperationSource nodes in tree
|
||||
bool shouldCollapseToParent = item.Source is ModifiedMeshObject3D || item.Source is OperationSourceObject3D;
|
||||
|
|
@ -67,7 +67,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
{
|
||||
if (child != null)
|
||||
{
|
||||
AddTree(BuildItemView(child), contextNode, theme);
|
||||
var newNode = AddTree(BuildItemView(child), contextNode, keyValues, theme);
|
||||
|
||||
keyValues?.Add(child, newNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -330,6 +330,8 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
WorkspaceActions = this.InitWorkspaceActions();
|
||||
}
|
||||
|
||||
private Dictionary<IObject3D, TreeNode> keyValues = new Dictionary<IObject3D, TreeNode>();
|
||||
|
||||
private void RebuildTree()
|
||||
{
|
||||
// Top level selection only - rebuild tree
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
|
||||
treeView.ScrollArea.CloseAllChildren();
|
||||
|
||||
var rootNode = Object3DTreeBuilder.BuildTree(selectedItem, theme);
|
||||
var rootNode = Object3DTreeBuilder.BuildTree(selectedItem, null, theme);
|
||||
treeView.AddChild(rootNode);
|
||||
rootNode.TreeView = treeView;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue