mind的拷贝完成

This commit is contained in:
艾竹
2023-03-25 22:10:49 +08:00
parent b36bd4b228
commit 5e5da021ab
13 changed files with 189 additions and 103 deletions

View File

@@ -63,10 +63,10 @@ namespace AIStudio.Wpf.DiagramDesigner
this.ShapeViewModel.PropertyChanged += ConnectorViewModel_PropertyChanged;
this.PropertyChanged += ConnectorViewModel_PropertyChanged;
var routetype = GlobalType.AllTypes.Where(p => typeof(IRouter).IsAssignableFrom(p)).FirstOrDefault(p => p.Name == RouterMode);
var routetype = TypeHelper.GetType(RouterMode);
Router = routetype != null ? (System.Activator.CreateInstance(routetype) as IRouter) : new RouterNormal();
var pathGeneratortype = GlobalType.AllTypes.Where(p => typeof(IPathGenerator).IsAssignableFrom(p)).FirstOrDefault(p => p.Name == PathMode);
var pathGeneratortype = TypeHelper.GetType(PathMode);
PathGenerator = pathGeneratortype != null ? (System.Activator.CreateInstance(pathGeneratortype) as IPathGenerator) : new ConnectingLineSmooth();
this.SourceConnectorInfo = sourceConnectorInfo;
@@ -497,12 +497,12 @@ namespace AIStudio.Wpf.DiagramDesigner
}
break;
case nameof(RouterMode):
var routetype = GlobalType.AllTypes.Where(p => typeof(IRouter).IsAssignableFrom(p)).FirstOrDefault(p => p.Name == RouterMode);
var routetype = TypeHelper.GetType(RouterMode);
Router = routetype != null ? (System.Activator.CreateInstance(routetype) as IRouter) : new RouterNormal();
UpdatePathGeneratorResult();
break;
case nameof(PathMode):
var pathGeneratortype = GlobalType.AllTypes.Where(p => typeof(IPathGenerator).IsAssignableFrom(p)).FirstOrDefault(p => p.Name == PathMode);
var pathGeneratortype = TypeHelper.GetType(PathMode);
PathGenerator = pathGeneratortype != null ? (System.Activator.CreateInstance(pathGeneratortype) as IPathGenerator) : new ConnectingLineSmooth();
UpdatePathGeneratorResult();
break;
@@ -729,6 +729,35 @@ namespace AIStudio.Wpf.DiagramDesigner
SinkConnectorInfo = sink;
}
public void SetPathGeneratorParameter(double smoothMargin, double smoothAutoSlope, double orthogonalShapeMargin, double orthogonalGlobalBoundsMargin)
{
bool hasChanged = false;
if (SmoothMargin != smoothMargin)
{
hasChanged = true;
SmoothMargin = smoothMargin;
}
if (SmoothAutoSlope != smoothAutoSlope)
{
hasChanged = true;
SmoothAutoSlope = smoothAutoSlope;
}
if (OrthogonalShapeMargin != orthogonalShapeMargin)
{
hasChanged = true;
OrthogonalShapeMargin = orthogonalShapeMargin;
}
if (OrthogonalGlobalBoundsMargin != orthogonalGlobalBoundsMargin)
{
hasChanged = true;
OrthogonalGlobalBoundsMargin = orthogonalGlobalBoundsMargin;
}
if (hasChanged)
{
UpdatePathGeneratorResult();
}
}
public void SetVisible(bool visible)
{
Visible = visible;