Merge pull request #3357 from larsbrubaker/design_tools
Added group object
This commit is contained in:
commit
371498bcd8
5 changed files with 54 additions and 9 deletions
|
|
@ -402,17 +402,15 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
new SceneSelectionOperation()
|
||||
{
|
||||
OperationType = typeof(Group3D),
|
||||
|
||||
TitleResolver = () => "Group".Localize(),
|
||||
Action = (scene) =>
|
||||
{
|
||||
var selectedItem = scene.SelectedItem;
|
||||
scene.SelectedItem = null;
|
||||
|
||||
var newGroup = new Object3D()
|
||||
{
|
||||
Name = "Group".Localize()
|
||||
};
|
||||
|
||||
var newGroup = new Group3D();
|
||||
// When grouping items, move them to be centered on their bounding box
|
||||
newGroup.Children.Modify((gChildren) =>
|
||||
{
|
||||
|
|
@ -435,7 +433,6 @@ namespace MatterHackers.MatterControl
|
|||
newGroup.MakeNameNonColliding();
|
||||
|
||||
scene.SelectedItem = newGroup;
|
||||
|
||||
},
|
||||
IsEnabled = (scene) => scene.HasSelection
|
||||
&& scene.SelectedItem is SelectionGroup
|
||||
|
|
|
|||
47
DesignTools/Operations/Group3D.cs
Normal file
47
DesignTools/Operations/Group3D.cs
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
Copyright (c) 2018, Lars Brubaker, John Lewin
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
The views and conclusions contained in the software and documentation are those
|
||||
of the authors and should not be interpreted as representing official policies,
|
||||
either expressed or implied, of the FreeBSD Project.
|
||||
*/
|
||||
|
||||
using System.Linq;
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.DataConverters3D;
|
||||
using MatterHackers.Localizations;
|
||||
using MatterHackers.VectorMath;
|
||||
|
||||
namespace MatterHackers.MatterControl.DesignTools.Operations
|
||||
{
|
||||
public class Group3D : Object3D, IPublicPropertyObject
|
||||
{
|
||||
public Group3D()
|
||||
{
|
||||
Name = "Group".Localize();
|
||||
}
|
||||
|
||||
public override bool CanRemove => true;
|
||||
}
|
||||
}
|
||||
|
|
@ -89,7 +89,9 @@
|
|||
<Compile Include="CustomWidgets\TreeView\TreeView.cs" />
|
||||
<Compile Include="DesignTools\Attributes\ShowSearchFieldAttribute.cs" />
|
||||
<Compile Include="DesignTools\Interfaces\IPublicPropertyObject.cs" />
|
||||
<Compile Include="DesignTools\Operations\Group3D.cs" />
|
||||
<Compile Include="DesignTools\Operations\PinchObject3D.cs" />
|
||||
<Compile Include="DesignTools\Primitives\CubeObject3D.cs" />
|
||||
<Compile Include="DesignTools\Primitives\HalfCylinderObject3D.cs" />
|
||||
<Compile Include="DesignTools\Primitives\HalfWedgeObject3D.cs" />
|
||||
<Compile Include="Library\Providers\MatterControl\LibraryCollectionContainer.cs" />
|
||||
|
|
@ -154,7 +156,6 @@
|
|||
<Compile Include="DesignTools\Primitives\TorusObject3D.cs" />
|
||||
<Compile Include="DesignTools\PublicPropertyEditor.cs" />
|
||||
<Compile Include="DesignTools\Primitives\ConeObject3D.cs" />
|
||||
<Compile Include="DesignTools\Primitives\CubeObject3D.cs" />
|
||||
<Compile Include="DesignTools\Operations\SetCenter.cs" />
|
||||
<Compile Include="DesignTools\Operations\Translate.cs" />
|
||||
<Compile Include="DesignTools\Attributes\SortableAttribute.cs" />
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
string nameToWrite = "";
|
||||
if (!string.IsNullOrEmpty(item.Name))
|
||||
{
|
||||
nameToWrite += $"{item.GetType().Name} - {item.Name}";
|
||||
nameToWrite += $"{item.Name}";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit ffa51299d57405e5ee73204d4f295dcd29b680ea
|
||||
Subproject commit 24dc7d09604fdf65a5ce995f2d2eec0cba6d7716
|
||||
Loading…
Add table
Add a link
Reference in a new issue