Working on a rebuild selection operation
This commit is contained in:
parent
f8153190fe
commit
c25ba86b68
4 changed files with 54 additions and 11 deletions
|
|
@ -754,6 +754,9 @@ namespace MatterHackers.MatterControl
|
|||
ArrangeAllPartsOperation(),
|
||||
new SceneSelectionSeparator(),
|
||||
LayFlatOperation(),
|
||||
#if DEBUG
|
||||
RebuildOperation(),
|
||||
#endif
|
||||
GroupOperation(),
|
||||
UngroupOperation(),
|
||||
new SceneSelectionSeparator(),
|
||||
|
|
@ -1174,6 +1177,42 @@ namespace MatterHackers.MatterControl
|
|||
};
|
||||
}
|
||||
|
||||
private static SceneOperation RebuildOperation()
|
||||
{
|
||||
return new SceneOperation("Rebuild")
|
||||
{
|
||||
TitleGetter = () => "Rebuild".Localize(),
|
||||
Action = (sceneContext) =>
|
||||
{
|
||||
var scene = sceneContext.Scene;
|
||||
var selectedItem = scene.SelectedItem;
|
||||
if (selectedItem != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var updateItems = SheetObject3D.SortAndLockUpdateItems(selectedItem.Parent, (item) =>
|
||||
{
|
||||
if (item == selectedItem || item.Parent == selectedItem)
|
||||
{
|
||||
// don't process this
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}, false);
|
||||
|
||||
SheetObject3D.SendInvalidateInRebuildOrder(updateItems, InvalidateType.Properties, null);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}
|
||||
},
|
||||
HelpTextGetter = () => "At least 1 part must be selected".Localize().Stars(),
|
||||
IsEnabled = (sceneContext) => sceneContext.Scene.SelectedItem != null,
|
||||
Icon = (theme) => StaticData.Instance.LoadIcon("update.png", 16, 16).SetToColor(theme.TextColor).SetPreMultiply(),
|
||||
};
|
||||
}
|
||||
|
||||
private static SceneOperation LinearArrayOperation()
|
||||
{
|
||||
return new SceneOperation("Linear Array")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue