Icons were added

This commit is contained in:
Evgeny Redikultsev
2023-08-12 14:53:38 +05:00
parent ce97586d2b
commit 80302525b3
103 changed files with 1133 additions and 449 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Этот код создан программой.
// Исполняемая версия:4.0.30319.42000
//
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
// повторной генерации кода.
// </auto-generated>
//------------------------------------------------------------------------------
namespace StructureHelper.Properties {
using System;
/// <summary>
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
/// </summary>
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
// с помощью такого средства, как ResGen или Visual Studio.
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
// с параметром /str или перестройте свой проект VS.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("StructureHelper.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -22,6 +22,23 @@
<Page Remove="StructureHelperLogics\**" />
</ItemGroup>
<ItemGroup>
<None Remove="Windows\MainWindow\Add_Circle.png" />
<None Remove="Windows\MainWindow\Add_Rebar.png" />
<None Remove="Windows\MainWindow\Copy.png" />
<None Remove="Windows\MainWindow\Delete.png" />
<None Remove="Windows\MainWindow\Edit.png" />
<None Remove="Windows\MainWindow\Edit_Circle_RC.png" />
<None Remove="Windows\MainWindow\Edit_Concrete beam.png" />
<None Remove="Windows\MainWindow\Edit_Concrete column.png" />
<None Remove="Windows\MainWindow\Edit_Concrete slab.png" />
<None Remove="Windows\MainWindow\Materials.png" />
<None Remove="Windows\MainWindow\Point_Primitive.png" />
<None Remove="Windows\MainWindow\Rectangle_Primitive.png" />
<None Remove="Windows\MainWindow\ToBackground.png" />
<None Remove="Windows\MainWindow\ToForeground.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Autofac" Version="6.5.0" />
<PackageReference Include="LiveCharts.Wpf" Version="0.9.7" />
@@ -51,6 +68,44 @@
<ItemGroup>
<Folder Include="Documentation\Manuals\" />
<Folder Include="Infrastructure\UI\DataContexts\Logics\" />
<Folder Include="Infrastructure\UI\Icons\" />
<Folder Include="Resources\" />
</ItemGroup>
<ItemGroup>
<Resource Include="Windows\MainWindow\Add_Circle.png" />
<Resource Include="Windows\MainWindow\Add_Rebar.png" />
<Resource Include="Windows\MainWindow\Copy.png" />
<Resource Include="Windows\MainWindow\Delete.png" />
<Resource Include="Windows\MainWindow\Edit.png" />
<Resource Include="Windows\MainWindow\Point_Primitive.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Windows\MainWindow\Rectangle_Primitive.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Resource>
<Resource Include="Windows\MainWindow\Edit_Circle_RC.png" />
<Resource Include="Windows\MainWindow\Edit_Concrete beam.png" />
<Resource Include="Windows\MainWindow\Edit_Concrete column.png" />
<Resource Include="Windows\MainWindow\Edit_Concrete slab.png" />
<Resource Include="Windows\MainWindow\Materials.png" />
<Resource Include="Windows\MainWindow\ToBackground.png" />
<Resource Include="Windows\MainWindow\ToForeground.png" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -56,10 +56,7 @@ namespace StructureHelper.Windows.MainWindow
ITriangulationOptions options = new TriangulationOptions { LimiteState = calculationProperty.LimitState, CalcTerm = calculationProperty.CalcTerm };
//Формируем коллекцию элементарных участков для расчета в библитеке (т.е. выполняем триангуляцию)
List<INdm> ndmCollection = new List<INdm>();
ndmCollection.AddRange(Triangulation.GetNdms(ndmPrimitives, options));
return ndmCollection;
return ndmPrimitives.SelectMany(x => x.GetNdms(options));
}
}
}

View File

@@ -15,6 +15,14 @@
d:DataContext="{d:DesignInstance local:MainViewModel}"
Title="StructureHelper" Height="700" Width="1000" MinHeight="400" MinWidth="600">
<Window.Resources>
<Style x:Key="ToolButton" TargetType="Button">
<Setter Property="Width" Value="32"/>
<Setter Property="Height" Value="32"/>
<Setter Property="Margin" Value="2,0,2,0"/>
<Setter Property="Background" Value="#FFA19BC3"/>
<Setter Property="BorderBrush" Value="#FF857AB9"/>
</Style>
<DataTemplate DataType="{x:Type dataContexts:RectangleViewPrimitive}">
<dataTemplates:RectangleTemplate/>
</DataTemplate>
@@ -25,17 +33,55 @@
<dataTemplates:EllipseTemplate/>
</DataTemplate>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
<ContextMenu x:Key="PrimitivesMenu">
<MenuItem Header="Add" DataContext="{Binding PrimitiveLogic}">
<MenuItem Header="Rectangle" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Rectangle}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Rectangle_Primitive.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Circle" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Circle}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Add_Circle.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Rebar" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Reinforcement}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Add_Rebar.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Point" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Point}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Point_primitive.png" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
<MenuItem Header="Templates">
<MenuItem Header="Add Rectangle RC Column" Command="{Binding AddColumnCase}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit_Concrete column.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Add Circle RC Column" Command="{Binding AddRCCircleCase}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit_Circle_RC.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Add RC Beam" Command="{Binding AddBeamCase}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit_Concrete beam.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Add RC slab" Command="{Binding AddSlabCase}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit_Concrete slab.png" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
</ContextMenu>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="20"/>
<RowDefinition Height="*"/>
<RowDefinition Height="25"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Menu x:Name="menu">
<DockPanel>
<Menu DockPanel.Dock="Top" x:Name="menu">
<MenuItem Header="File">
</MenuItem>
<MenuItem Header="Edit">
@@ -65,211 +111,269 @@
<Button Content="About..." Command="{Binding HelpLogic.ShowAbout}"/>
</MenuItem>
</Menu>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel>
<Expander Header="Actions" MinWidth="20" DataContext="{Binding CombinationsLogic}">
<Expander.ContextMenu>
<ContextMenu>
<MenuItem Header="Add">
<Button Content="Combination" Command="{Binding Add}" CommandParameter="{x:Static enums:ActionType.ForceCombination}"/>
<Button Content="Combination By Factors" Command="{Binding Add}" CommandParameter="{x:Static enums:ActionType.ForceCombinationByFactor}"/>
</MenuItem>
</ContextMenu>
</Expander.ContextMenu>
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}">
<ListBox.ContextMenu>
<ToolBarTray DockPanel.Dock="Top">
<ToolBar DataContext="{Binding CombinationsLogic}" ToolTip="Actions">
<Button Style="{StaticResource ToolButton}"
Command="{Binding Add}"
CommandParameter="{x:Static enums:ActionType.ForceCombination}"
Content="Full" ToolTip="Add Full Combination"/>
<Button Style="{StaticResource ToolButton}"
Command="{Binding Add}"
CommandParameter="{x:Static enums:ActionType.ForceCombinationByFactor}"
Content="Fact" ToolTip="Add Factored Combination"/>
</ToolBar>
<ToolBar DataContext="{Binding MaterialsLogic}" ToolTip="Materials">
<Button Style="{StaticResource ToolButton}"
Command="{Binding Add}"
CommandParameter="{x:Static enums:MaterialType.Concrete}"
Content="Con" ToolTip="Add Concrete Material"/>
<Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Reinforcement}" Content="RF" ToolTip="Add Reinforcement Material"/>
<Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Elastic}" Content="Elast" ToolTip="Add Elastic Material"/>
<Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.CarbonFiber}" Content="CFR" ToolTip="Add Carbon Fiber Material"/>
<Button Style="{StaticResource ToolButton}" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.GlassFiber}" Content="GFR" ToolTip="Add Glass Fiber Material"/>
<Button Command="{Binding EditMaterialsCommand}" ToolTip="Show Materials">
<Image Width="32" Height="32" Source="/Windows/MainWindow/Materials.png"/>
</Button>
</ToolBar>
<ToolBar ToolTip="Base Primitives" DataContext="{Binding PrimitiveLogic}">
<Button Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Rectangle}" ToolTip="Add Rectangle Primitive">
<Image Width="32" Height="32" Source="/Windows/MainWindow/Rectangle_Primitive.png"/>
</Button>
<Button Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Circle}" ToolTip="Add Circle Primitive">
<Image Width="32" Height="32" Source="/Windows/MainWindow/Add_Circle.png"/>
</Button>
<Button Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Reinforcement}" ToolTip="Add Rebar Primitive">
<Image Width="32" Height="32" Source="/Windows/MainWindow/Add_Rebar.png"/>
</Button>
<Button Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Point}" ToolTip="Add Point Primitive">
<Image Width="32" Height="32" Source="/Windows/MainWindow/Point_primitive.png"/>
</Button>
</ToolBar>
<ToolBar ToolTip="RC Templates">
<Button Command="{Binding AddColumnCase}" ToolTip="Add Rectangle RC Column">
<Image Width="32" Height="32" Source="/Windows/MainWindow/Edit_Concrete column.png"/>
</Button>
<Button Command="{Binding AddRCCircleCase}" ToolTip="Add Circle RC Column">
<Image Width="32" Height="32" Source="/Windows/MainWindow/Edit_Circle_RC.png"/>
</Button>
<Button Command="{Binding AddBeamCase}" ToolTip="Add RC Beam">
<Image Width="32" Height="32" Source="/Windows/MainWindow/Edit_Concrete beam.png"/>
</Button>
<Button Command="{Binding AddSlabCase}" ToolTip="Add RC Slab">
<Image Width="32" Height="32" Source="/Windows/MainWindow/Edit_Concrete slab.png"/>
</Button>
</ToolBar>
</ToolBarTray>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="25"/>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<StackPanel>
<Expander Header="Actions" MinWidth="20" DataContext="{Binding CombinationsLogic}">
<Expander.ContextMenu>
<ContextMenu>
<Button Content="Edit" Command="{Binding Edit}"/>
<Button Content="Copy" Command="{Binding Copy}"/>
<Button Content="Delete" Command="{Binding Delete}"/>
<MenuItem Header="Add">
<Button Content="Combination" Command="{Binding Add}" CommandParameter="{x:Static enums:ActionType.ForceCombination}"/>
<Button Content="Combination By Factors" Command="{Binding Add}" CommandParameter="{x:Static enums:ActionType.ForceCombinationByFactor}"/>
</MenuItem>
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding Name}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Expander>
<Expander Header="Materials" MinWidth="20" DataContext="{Binding MaterialsLogic}">
<Expander.ContextMenu>
<ContextMenu>
<Button Content="Materials" Command="{Binding EditMaterialsCommand}"/>
<MenuItem Header="Add">
<Button Content="Concrete" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Concrete}"/>
<Button Content="Reinforcement" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Reinforcement}"/>
<Button Content="Elastic" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Elastic}"/>
<Button Content="CarbonFiber" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.CarbonFiber}"/>
<Button Content="GlassFiber" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.GlassFiber}"/>
</MenuItem>
</ContextMenu>
</Expander.ContextMenu>
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}" ItemTemplate="{StaticResource ColoredItemTemplate}">
<ListBox.ContextMenu>
</Expander.ContextMenu>
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}">
<ListBox.ContextMenu>
<ContextMenu>
<Button Content="Edit" Command="{Binding Edit}"/>
<Button Content="Copy" Command="{Binding Copy}"/>
<Button Content="Delete" Command="{Binding Delete}"/>
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding Name}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Expander>
<Expander Header="Materials" MinWidth="20" DataContext="{Binding MaterialsLogic}">
<Expander.ContextMenu>
<ContextMenu>
<Button Content="Edit" Command="{Binding Edit}"/>
<Button Content="Copy" Command="{Binding Copy}"/>
<Button Content="Delete" Command="{Binding Delete}"/>
<Button Content="Materials" Command="{Binding EditMaterialsCommand}"/>
<MenuItem Header="Add">
<Button Content="Concrete" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Concrete}"/>
<Button Content="Reinforcement" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Reinforcement}"/>
<Button Content="Elastic" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.Elastic}"/>
<Button Content="CarbonFiber" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.CarbonFiber}"/>
<Button Content="GlassFiber" Command="{Binding Add}" CommandParameter="{x:Static enums:MaterialType.GlassFiber}"/>
</MenuItem>
</ContextMenu>
</ListBox.ContextMenu>
</ListBox>
</Expander>
<Expander Header="Geometry" MinWidth="20" DataContext="{Binding PrimitiveLogic}">
<Expander.ContextMenu>
<ContextMenu>
<MenuItem Header="Add">
<Button Content="Rectangle" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Rectangle}"/>
<Button Content="Circle" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Circle}"/>
<Button Content="Rebar" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Reinforcement}"/>
<Button Content="Point" Command="{Binding Add}" CommandParameter="{x:Static enums:PrimitiveType.Point}"/>
</MenuItem>
</ContextMenu>
</Expander.ContextMenu>
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}" ItemTemplate="{StaticResource ColoredItemTemplate}">
<ListBox.ContextMenu>
</Expander.ContextMenu>
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}" ItemTemplate="{StaticResource ColoredItemTemplate}">
<ListBox.ContextMenu>
<ContextMenu>
<Button Content="Edit" Command="{Binding Edit}"/>
<Button Content="Copy" Command="{Binding Copy}"/>
<Button Content="Delete" Command="{Binding Delete}"/>
</ContextMenu>
</ListBox.ContextMenu>
</ListBox>
</Expander>
<Expander Header="Geometry" MinWidth="20" ContextMenu="{StaticResource PrimitivesMenu}">
<ListBox DataContext="{Binding PrimitiveLogic}" ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}" ItemTemplate="{StaticResource ColoredItemTemplate}">
<ListBox.ContextMenu>
<ContextMenu>
<Button Content="Edit" Command="{Binding Edit}"/>
<Button Content="Copy" Command="{Binding Copy}"/>
<Button Content="Delete" Command="{Binding Delete}"/>
<Button Content="To Foreground" Command="{Binding SetToFront}"/>
<Button Content="To Background" Command="{Binding SetToBack}"/>
</ContextMenu>
</ListBox.ContextMenu>
</ListBox>
</Expander>
<Expander Header="Analyses" MinWidth="20" DataContext="{Binding CalculatorsLogic}">
<Expander.ContextMenu>
<ContextMenu>
<Button Content="Edit" Command="{Binding Edit}"/>
<Button Content="Copy" Command="{Binding Copy}"/>
<Button Content="Delete" Command="{Binding Delete}"/>
<Button Content="To Foreground" Command="{Binding SetToFront}"/>
<Button Content="To Background" Command="{Binding SetToBack}"/>
<Button Content="Add Calculator" Command="{Binding Add}"/>
</ContextMenu>
</ListBox.ContextMenu>
</ListBox>
</Expander>
<Expander Header="Analyses" MinWidth="20" DataContext="{Binding CalculatorsLogic}">
<Expander.ContextMenu>
<ContextMenu>
<Button Content="Add Calculator" Command="{Binding Add}"/>
</ContextMenu>
</Expander.ContextMenu>
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}">
<ListBox.ContextMenu>
<ContextMenu>
<Button Content="Run" Command="{Binding Run}"/>
<Button Content="Edit" Command="{Binding Edit}"/>
<Button Content="Copy" Command="{Binding Copy}"/>
<Button Content="Delete" Command="{Binding Delete}"/>
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding Name}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Expander>
</StackPanel>
</ScrollViewer>
<Border BorderBrush="Black" Background="White" BorderThickness="1" Margin="5" Grid.Column="1">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseDown">
<i:InvokeCommandAction Command="{Binding ClearSelection}" CommandParameter="{Binding}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible">
<Canvas Name="WorkPlane" ClipToBounds="True" Width="{Binding CanvasWidth}" Height="{Binding CanvasHeight}">
<Canvas.ContextMenu>
<ContextMenu>
<MenuItem Header="Add">
<Button Content="Rectangle" Command="{Binding PrimitiveLogic.Add}" CommandParameter="{x:Static enums:PrimitiveType.Rectangle}"/>
<Button Content="Circle" Command="{Binding PrimitiveLogic.Add}" CommandParameter="{x:Static enums:PrimitiveType.Circle}"/>
<Button Content="Rebar" Command="{Binding PrimitiveLogic.Add}" CommandParameter="{x:Static enums:PrimitiveType.Reinforcement}"/>
<Button Content="Point" Command="{Binding PrimitiveLogic.Add}" CommandParameter="{x:Static enums:PrimitiveType.Point}"/>
</MenuItem>
<MenuItem Header="Templates">
<Button Content="Concrete beam" Command="{Binding AddBeamCase}"/>
<Button Content="Concrete column" Command="{Binding AddColumnCase}"/>
<Button Content="Concrete slab" Command="{Binding AddSlabCase}"/>
<Button Content="Concrete circle" Command="{Binding AddRCCircleCase}"/>
</MenuItem>
</ContextMenu>
</Canvas.ContextMenu>
<i:Interaction.Behaviors>
<infrastructure:MouseBehaviour MouseX="{Binding PanelX, Mode=OneWayToSource}" MouseY="{Binding PanelY, Mode=OneWayToSource}"/>
</i:Interaction.Behaviors>
<i:Interaction.Triggers>
<mouseEventTriggers:MouseWheelDownEventTrigger EventName="PreviewMouseWheel">
<i:InvokeCommandAction Command="{Binding ScaleCanvasDown}"/>
</mouseEventTriggers:MouseWheelDownEventTrigger>
<mouseEventTriggers:MouseWheelUpEventTrigger EventName="PreviewMouseWheel">
<i:InvokeCommandAction Command="{Binding ScaleCanvasUp}"/>
</mouseEventTriggers:MouseWheelUpEventTrigger>
</i:Interaction.Triggers>
<Canvas.LayoutTransform>
<TransformGroup>
<ScaleTransform ScaleX="{Binding ScaleValue}" ScaleY="{Binding ScaleValue}"
</Expander.ContextMenu>
<ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}">
<ListBox.ContextMenu>
<ContextMenu>
<Button Content="Run" Command="{Binding Run}"/>
<Button Content="Edit" Command="{Binding Edit}"/>
<Button Content="Copy" Command="{Binding Copy}"/>
<Button Content="Delete" Command="{Binding Delete}"/>
</ContextMenu>
</ListBox.ContextMenu>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="{Binding Name}"/>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Expander>
</StackPanel>
</ScrollViewer>
<Border BorderBrush="Black" Background="White" BorderThickness="1" Margin="5" Grid.Column="1">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PreviewMouseDown">
<i:InvokeCommandAction Command="{Binding ClearSelection}" CommandParameter="{Binding}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible">
<Canvas Name="WorkPlane" ClipToBounds="True" Width="{Binding CanvasWidth}" Height="{Binding CanvasHeight}" ContextMenu="{StaticResource PrimitivesMenu}">
<i:Interaction.Behaviors>
<infrastructure:MouseBehaviour MouseX="{Binding PanelX, Mode=OneWayToSource}" MouseY="{Binding PanelY, Mode=OneWayToSource}"/>
</i:Interaction.Behaviors>
<i:Interaction.Triggers>
<mouseEventTriggers:MouseWheelDownEventTrigger EventName="PreviewMouseWheel">
<i:InvokeCommandAction Command="{Binding ScaleCanvasDown}"/>
</mouseEventTriggers:MouseWheelDownEventTrigger>
<mouseEventTriggers:MouseWheelUpEventTrigger EventName="PreviewMouseWheel">
<i:InvokeCommandAction Command="{Binding ScaleCanvasUp}"/>
</mouseEventTriggers:MouseWheelUpEventTrigger>
</i:Interaction.Triggers>
<Canvas.LayoutTransform>
<TransformGroup>
<ScaleTransform ScaleX="{Binding ScaleValue}" ScaleY="{Binding ScaleValue}"
CenterX="{Binding ScrollPanelX}" CenterY="{Binding ScrollPanelY}"/>
</TransformGroup>
</Canvas.LayoutTransform>
<Canvas.Background>
<VisualBrush TileMode="Tile"
</TransformGroup>
</Canvas.LayoutTransform>
<Canvas.Background>
<VisualBrush TileMode="Tile"
Viewport="{Binding CanvasViewportSize}" ViewportUnits="Absolute"
Viewbox="{Binding CanvasViewportSize}" ViewboxUnits="Absolute">
<VisualBrush.Visual>
<Rectangle StrokeThickness="{Binding GridLineThickness}" Height="{Binding GridSize}" Width="{Binding GridSize}" Stroke="Darkgray"/>
</VisualBrush.Visual>
</VisualBrush>
</Canvas.Background>
<Line X1="0" X2="{Binding XX2}" Y1="{Binding XY1}" Y2="{Binding XY1}" Stroke="Red" StrokeThickness="{Binding AxisLineThickness}"/>
<Line X1="{Binding YX1}" X2="{Binding YX1}" Y1="0" Y2="{Binding YY2}" Stroke="ForestGreen" StrokeThickness="{Binding AxisLineThickness}"/>
<ItemsControl ItemsSource="{Binding PrimitiveLogic.Items}" d:DataContext="{d:DesignInstance vm:MainViewModel}">
<ItemsControl.ItemsPanel>
<VisualBrush.Visual>
<Rectangle StrokeThickness="{Binding GridLineThickness}" Height="{Binding GridSize}" Width="{Binding GridSize}" Stroke="Darkgray"/>
</VisualBrush.Visual>
</VisualBrush>
</Canvas.Background>
<Line X1="0" X2="{Binding XX2}" Y1="{Binding XY1}" Y2="{Binding XY1}" Stroke="Red" StrokeThickness="{Binding AxisLineThickness}"/>
<Line X1="{Binding YX1}" X2="{Binding YX1}" Y1="0" Y2="{Binding YY2}" Stroke="ForestGreen" StrokeThickness="{Binding AxisLineThickness}"/>
<ItemsControl ItemsSource="{Binding PrimitiveLogic.Items}" d:DataContext="{d:DesignInstance vm:MainViewModel}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerStyle>
<Style TargetType="ContentPresenter">
<Setter Property="Canvas.ZIndex" Value="{Binding ZIndex}"/>
<Setter Property="Canvas.Left" Value="{Binding PrimitiveLeft}"/>
<Setter Property="Canvas.Top" Value="{Binding PrimitiveTop}"/>
<Setter Property="Visibility" Value="{Binding IsVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
<EventSetter Event="MouseDown" Handler="ContentPresenter_MouseLeftButtonDown"/>
</Style>
</ItemsControl.ItemContainerStyle>
<ItemsControl.ContextMenu>
<ContextMenu>
<Button Content="Edit primitive" Command="{Binding PrimitiveLogic.Edit}"/>
<Button Content="Copy" Command="{Binding PrimitiveLogic.Copy}"/>
<Button Content="Delete" Command="{Binding PrimitiveLogic.Delete}"/>
<Button Content="To Foreground" Command="{Binding PrimitiveLogic.SetToFront}"/>
<Button Content="To Background" Command="{Binding PrimitiveLogic.SetToBack}"/>
</ContextMenu>
</ItemsControl.ContextMenu>
</ItemsControl>
</Canvas>
</ScrollViewer>
</Border>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerStyle>
<Style TargetType="ContentPresenter">
<Setter Property="Canvas.ZIndex" Value="{Binding ZIndex}"/>
<Setter Property="Canvas.Left" Value="{Binding PrimitiveLeft}"/>
<Setter Property="Canvas.Top" Value="{Binding PrimitiveTop}"/>
<Setter Property="Visibility" Value="{Binding IsVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
<EventSetter Event="MouseDown" Handler="ContentPresenter_MouseLeftButtonDown"/>
</Style>
</ItemsControl.ItemContainerStyle>
<ItemsControl.ContextMenu>
<ContextMenu>
<MenuItem Header="Edit" Command="{Binding PrimitiveLogic.Edit}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Edit.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Copy" Command="{Binding PrimitiveLogic.Copy}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Copy.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Delete" Command="{Binding PrimitiveLogic.Delete}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/Delete.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="To Foreground" Command="{Binding PrimitiveLogic.SetToFront}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/ToForeground.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="To Background" Command="{Binding PrimitiveLogic.SetToBack}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="/Windows/MainWindow/ToBackground.png" />
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</ItemsControl.ContextMenu>
</ItemsControl>
</Canvas>
</ScrollViewer>
</Border>
</Grid>
<StatusBar Grid.Row="1">
<StatusBarItem>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Zoom: "/>
<TextBlock Text="{Binding ScaleValue}"/>
</StackPanel>
</StatusBarItem>
<StatusBarItem>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Number of primitives: "/>
<TextBlock Text="{Binding PrimitiveLogic.PrimitivesCount}"/>
</StackPanel>
</StatusBarItem>
<StatusBarItem>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Grid size: "/>
<TextBlock Text="{Binding GridSize, Converter={StaticResource LengthConverter}}"/>
</StackPanel>
</StatusBarItem>
</StatusBar>
</Grid>
<StatusBar Grid.Row="2">
<StatusBarItem>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Zoom: "/>
<TextBlock Text="{Binding ScaleValue}"/>
</StackPanel>
</StatusBarItem>
<StatusBarItem>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Number of primitives: "/>
<TextBlock Text="{Binding PrimitiveLogic.PrimitivesCount}"/>
</StackPanel>
</StatusBarItem>
<StatusBarItem>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Grid size: "/>
<TextBlock Text="{Binding GridSize, Converter={StaticResource LengthConverter}}"/>
</StackPanel>
</StatusBarItem>
</StatusBar>
</Grid>
</DockPanel>
</Window>

View File

@@ -306,8 +306,8 @@ namespace StructureHelper.Windows.MainWindow
var center = GeometryOperations.GetGravityCenter(ndms);
foreach (var item in PrimitiveLogic.Items)
{
item.CenterX -= center.CenterX;
item.CenterY -= center.CenterY;
item.CenterX -= center.Cx;
item.CenterY -= center.Cy;
}
},
o => repository.Primitives.Count() > 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -19,11 +19,11 @@ namespace StructureHelper.Windows.ViewModels.Calculations.CalculationProperies
{
get
{
return calculationProperty.IterationProperty.Accuracy;
return calculationProperty.Accuracy.IterationAccuracy;
}
set
{
calculationProperty.IterationProperty.Accuracy = value;
calculationProperty.Accuracy.IterationAccuracy = value;
OnPropertyChanged(nameof(IterationAccuracy));
}
}
@@ -31,11 +31,11 @@ namespace StructureHelper.Windows.ViewModels.Calculations.CalculationProperies
{
get
{
return calculationProperty.IterationProperty.MaxIterationCount;
return calculationProperty.Accuracy.MaxIterationCount;
}
set
{
calculationProperty.IterationProperty.MaxIterationCount = value;
calculationProperty.Accuracy.MaxIterationCount = value;
OnPropertyChanged(nameof(MaxIterationCount));
}
}

View File

@@ -29,6 +29,7 @@ using StructureHelperLogics.NdmCalculations.Analyses.ByForces;
using StructureHelperLogics.NdmCalculations.Analyses.Geometry;
using StructureHelperLogics.NdmCalculations.Cracking;
using StructureHelperLogics.NdmCalculations.Primitives;
using StructureHelperLogics.NdmCalculations.Triangulations;
using StructureHelperLogics.Services.NdmCalculations;
using StructureHelperLogics.Services.NdmPrimitives;
using System;
@@ -264,6 +265,7 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
{
var limitState = SelectedResult.DesignForceTuple.LimitState;
var calcTerm = SelectedResult.DesignForceTuple.CalcTerm;
var triangulationOptions = new TriangulationOptions() { LimiteState = limitState, CalcTerm = calcTerm };
var orderedNdmPrimitives = ndmPrimitives.OrderBy(x => x.VisualProperty.ZIndex);
var ndmRange = new List<INdm>();
foreach (var item in orderedNdmPrimitives)
@@ -278,7 +280,8 @@ namespace StructureHelper.Windows.ViewModels.Calculations.Calculators
}
if (selectedNdmPrimitives.Contains(item) & item.Triangulate == true)
{
ndmRange.AddRange(NdmPrimitivesService.GetNdms(item, limitState, calcTerm));
ndmRange.AddRange(item.GetNdms(triangulationOptions));
}
}
ndms = ndmRange;