New Icons and Zoom of graph were added

This commit is contained in:
Evgeny Redikultsev
2023-09-17 11:37:29 +05:00
parent 1ed2ba8cf1
commit 9884a0919c
131 changed files with 714 additions and 216 deletions

View File

@@ -19,7 +19,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces.Logics
public StrainTuple GetSofteningFactors()
{
var strainTuple = new StrainTuple();
var loaderStainMatrix = StrainTupleService.ConvertToLoaderStrainMatrix(StrainTuple);
var loaderStainMatrix = TupleConverter.ConvertToLoaderStrainMatrix(StrainTuple);
var (MxFactor, MyFactor, NzFactor) = GeometryOperations.GetSofteningsFactors(NdmCollection, loaderStainMatrix);
strainTuple.Mx = MxFactor;
strainTuple.My = MyFactor;

View File

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
namespace StructureHelperLogics.NdmCalculations.Analyses
{
public class ExportFrameWorkElementLogic : IExportResultLogic
{
private FrameworkElement visual;
public string FileName { get; set; }
public void Export()
{
var encoder = new PngBitmapEncoder();
EncodeVisual(visual, FileName, encoder);
}
public ExportFrameWorkElementLogic(FrameworkElement visual)
{
this.visual = visual;
}
private static void EncodeVisual(FrameworkElement visual, string fileName, BitmapEncoder encoder)
{
var bitmap = new RenderTargetBitmap((int)visual.ActualWidth, (int)visual.ActualHeight, 96, 96, PixelFormats.Pbgra32);
bitmap.Render(visual);
var frame = BitmapFrame.Create(bitmap);
encoder.Frames.Add(frame);
using (var stream = File.Create(fileName)) encoder.Save(stream);
}
}
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;
namespace StructureHelperLogics.NdmCalculations.Analyses
{
public class ExportResultToBitmapLogic : IExportResultLogic
{
private BitmapImage bitmapImage;
public ExportResultToBitmapLogic(BitmapImage bitmapImage)
{
this.bitmapImage = bitmapImage;
}
public string FileName { get; set; }
public void Export()
{
using (var fileStream = new FileStream(FileName, FileMode.Create))
{
BitmapEncoder encoder = new BmpBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(bitmapImage));
encoder.Save(fileStream);
}
}
}
}