Making Pro design apps work

fixing warnings
This commit is contained in:
LarsBrubaker 2020-05-24 22:52:43 -07:00
parent 1196ebded4
commit 954865f934
9 changed files with 54 additions and 20 deletions

View file

@ -1818,7 +1818,7 @@ namespace MatterHackers.MatterControl
&& sceneItem.Parent.Parent == null
&& sceneItem is ComponentObject3D componentObject
&& componentObject.Finalized
&& string.IsNullOrWhiteSpace(componentObject.PermissionKey);
&& !componentObject.ProOnly;
},
IconCollector = (invertIcon) => AggContext.StaticData.LoadIcon("scale_32x32.png", 16, 16, invertIcon)
});

View file

@ -30,6 +30,7 @@ either expressed or implied, of the FreeBSD Project.
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using MatterHackers.Agg;
using MatterHackers.Agg.UI;
using MatterHackers.DataConverters3D;
using MatterHackers.DataConverters3D.UndoCommands;
@ -53,7 +54,7 @@ namespace MatterHackers.MatterControl.DesignTools
{
}
public override bool CanFlatten => Finalized;
public override bool CanFlatten => !Finalized || Persistable;
public override bool Persistable => ApplicationController.Instance.UserHasPermission(this);
@ -65,10 +66,7 @@ namespace MatterHackers.MatterControl.DesignTools
public string ComponentID { get; set; } = "";
[Description("MatterHackers Internal Use")]
public string DetailPage { get; set; } = "";
[Description("MatterHackers Internal Use")]
public string PermissionKey { get; set; } = "";
public bool ProOnly { get; set; }
public override void Flatten(UndoBuffer undoBuffer)
{
@ -149,7 +147,34 @@ namespace MatterHackers.MatterControl.DesignTools
}
else
{
base.Remove(undoBuffer);
if (ProOnly)
{
// just delete it
var parent = this.Parent;
using (RebuildLock())
{
if (undoBuffer != null)
{
// and replace us with nothing
undoBuffer.AddAndDo(new ReplaceCommand(new[] { this }, new List<IObject3D>(), false));
}
else
{
parent.Children.Modify(list =>
{
list.Remove(this);
});
}
}
parent.Invalidate(new InvalidateArgs(this, InvalidateType.Children));
}
else
{
// remove the component and leave the inside parts
base.Remove(undoBuffer);
}
}
}
}

View file

@ -61,6 +61,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
scene.SelectedItem = null;
return;
}
bool isGroupItemType = selectedItem.Children.Count > 0;
// If not a Group ItemType, look for mesh volumes and split into distinct objects if found
@ -130,7 +131,6 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
});
}
// leave no selection
scene.SelectedItem = null;
}
@ -267,7 +267,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
// More useful if it creates the part in the exact position and then the user can move it.
// Consistent with other software as well. LBB 2017-12-02
//PlatingHelper.MoveToOpenPositionRelativeGroup(clonedItem, Scene.Children);
// PlatingHelper.MoveToOpenPositionRelativeGroup(clonedItem, Scene.Children);
return clonedItem;
}
@ -295,9 +295,9 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
var center = aabb.Center;
newItem.Matrix *= Matrix4X4.CreateTranslation(
(sceneContext.BedCenter.X - center.X),
(sceneContext.BedCenter.Y - center.Y),
-aabb.MinXYZ.Z);
sceneContext.BedCenter.X - center.X,
sceneContext.BedCenter.Y - center.Y,
-aabb.MinXYZ.Z);
}
// Create and perform a new insert operation
@ -337,7 +337,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
Mesh meshWithLowest = null;
var items = objectToLayFlat.VisibleMeshes().Where(i => i.OutputType != PrintOutputTypes.Support);
if(!items.Any())
if (!items.Any())
{
items = objectToLayFlat.VisibleMeshes();
}
@ -427,6 +427,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
}
}
}
if (largestAreaFound > largestAreaOfAnyFace)
{
largestAreaOfAnyFace = largestAreaFound;
@ -494,7 +495,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
for (int i = 0; i < preArrangeTarnsforms.Count; i++)
{
//allUndoTransforms.Add(new TransformUndoCommand(view3DWidget, i, preArrangeTarnsforms[i], postArrangeTarnsforms[i]));
//a llUndoTransforms.Add(new TransformUndoCommand(view3DWidget, i, preArrangeTarnsforms[i], postArrangeTarnsforms[i]));
}
}

View file

@ -1,4 +1,4 @@
## Reduce is Locked
## "Reduce" feature is locked
To Unlock upgrade to MatterControl Pro:

View file

@ -1,8 +1,8 @@
## Gear is Locked
## "Gear" tool is Locked
To Unlock upgrade to MatterControl Pro:
MatterControl Pro includes:
- Professional support provided by MatterHackers
- Unlimited storage of your designs in Cloud Library
- Expanding set of Pro Design Tools
- Expanding set of Pro Design Tools

View file

@ -0,0 +1,8 @@
## This "Design App" is Locked
To Unlock upgrade to MatterControl Pro:
MatterControl Pro includes:
- Professional support provided by MatterHackers
- Unlimited storage of your designs in Cloud Library
- Expanding set of Pro Design Tools

View file

@ -1,4 +1,4 @@
## Hollow Out is Locked
## "Hollow Out" feature is Locked
To Unlock upgrade to MatterControl Pro:

View file

@ -1,4 +1,4 @@
## Repair is Locked
## "Repair" feature is Locked
To Unlock upgrade to MatterControl Pro:

@ -1 +1 @@
Subproject commit 7f0daf45ce434f7043541ecc001bff93f9822ba1
Subproject commit 707e7b6aa01df5e0faedc71470a524f6c3e32c61