Icons were added
BIN
StructureHelper/Infrastructure/UI/Icons/32х32/Edit_Add point.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
BIN
StructureHelper/Infrastructure/UI/Icons/32х32/Edit_Materials.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
BIN
StructureHelper/Infrastructure/UI/Icons/32х32/Tools_Settings.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 4.0 KiB |
BIN
StructureHelper/Infrastructure/UI/Icons/32х32_Border/Copy.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
StructureHelper/Infrastructure/UI/Icons/32х32_Border/Delete.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
StructureHelper/Infrastructure/UI/Icons/32х32_Border/Edit.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 6.2 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
63
StructureHelper/Properties/Resources.Designer.cs
generated
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
120
StructureHelper/Properties/Resources.resx
Normal 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>
|
||||
@@ -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>
|
||||
|
||||
BIN
StructureHelper/Windows/MainWindow/Add_Circle.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
StructureHelper/Windows/MainWindow/Add_Rebar.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
StructureHelper/Windows/MainWindow/Copy.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
StructureHelper/Windows/MainWindow/Delete.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
StructureHelper/Windows/MainWindow/Edit.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
StructureHelper/Windows/MainWindow/Edit_Circle_RC.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
StructureHelper/Windows/MainWindow/Edit_Concrete beam.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
StructureHelper/Windows/MainWindow/Edit_Concrete column.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
StructureHelper/Windows/MainWindow/Edit_Concrete slab.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
BIN
StructureHelper/Windows/MainWindow/Materials.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
StructureHelper/Windows/MainWindow/Point_Primitive.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
StructureHelper/Windows/MainWindow/Rectangle_Primitive.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
StructureHelper/Windows/MainWindow/ToBackground.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
StructureHelper/Windows/MainWindow/ToForeground.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -20,5 +20,6 @@
|
||||
public static string ParameterIsNull => "#0015: Parameter is null";
|
||||
public static string ResultIsNotValid => "#0016: Result is not valid";
|
||||
public static string ErrorOfExuting => "#0017: Error of executing";
|
||||
public static string ExpectedWas(System.Type expected, System.Type was) => $"{DataIsInCorrect}: Expected {expected}, but was {was}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StructureHelperLogics.Models.Calculations.CalculationProperties
|
||||
@@ -8,7 +9,7 @@ namespace StructureHelperLogics.Models.Calculations.CalculationProperties
|
||||
public List<IForceCombination> ForceCombinations { get; set; }
|
||||
public LimitStates LimitState { get; set; }
|
||||
public CalcTerms CalcTerm { get; set; }
|
||||
public IIterationProperty IterationProperty { get; }
|
||||
public IAccuracy Accuracy { get; }
|
||||
|
||||
public CalculationProperty()
|
||||
{
|
||||
@@ -18,7 +19,7 @@ namespace StructureHelperLogics.Models.Calculations.CalculationProperties
|
||||
};
|
||||
LimitState = LimitStates.ULS;
|
||||
CalcTerm = CalcTerms.ShortTerm;
|
||||
IterationProperty = new IterationProperty() { Accuracy = 0.001d, MaxIterationCount = 100};
|
||||
Accuracy = new Accuracy () { IterationAccuracy = 0.001d, MaxIterationCount = 100};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Calculators;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace StructureHelperLogics.Models.Calculations.CalculationProperties
|
||||
@@ -8,6 +9,6 @@ namespace StructureHelperLogics.Models.Calculations.CalculationProperties
|
||||
List<IForceCombination> ForceCombinations { get; set; }
|
||||
LimitStates LimitState { get; set; }
|
||||
CalcTerms CalcTerm { get; set; }
|
||||
IIterationProperty IterationProperty {get;}
|
||||
IAccuracy Accuracy {get;}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.ByForces
|
||||
if (combination.SetInGravityCenter == true)
|
||||
{
|
||||
var loaderPoint = LoaderCalculator.Logics.Geometry.GeometryOperations.GetGravityCenter(ndms);
|
||||
point2D = new Point2D() { X = loaderPoint.CenterX, Y = loaderPoint.CenterY };
|
||||
point2D = new Point2D() { X = loaderPoint.Cx, Y = loaderPoint.Cy };
|
||||
}
|
||||
else point2D = combination.ForcePoint;
|
||||
var newTuple = ForceTupleService.MoveTupleIntoPoint(tuple.ForceTuple, point2D) as ForceTuple;
|
||||
|
||||
@@ -4,6 +4,7 @@ using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using StructureHelperLogics.NdmCalculations.Triangulations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -28,8 +29,8 @@ namespace StructureHelperLogics.NdmCalculations.Analyses.RC
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + ": main material is incorrect or null");
|
||||
}
|
||||
var material = ndmPrimitive.HeadMaterial.GetLoaderMaterial(limitState, calcTerm);
|
||||
var ndm = ndmPrimitive.GetNdms(material).Single();
|
||||
var triangulationOptions = new TriangulationOptions() { LimiteState = limitState, CalcTerm = calcTerm };
|
||||
var ndm = ndmPrimitive.GetNdms(triangulationOptions).Single();
|
||||
if (strainMatrix is not null)
|
||||
{
|
||||
inputData.ReinforcementStress = stressLogic.GetStress(strainMatrix, ndm);
|
||||
|
||||
@@ -81,10 +81,10 @@ namespace StructureHelperLogics.NdmCalculations.Buckling
|
||||
var otherInertia = GeometryOperations.GetReducedMomentsOfInertia(otherNdms, gravityCenter);
|
||||
|
||||
var stiffnessX = stiffnessLogicX.GetStiffnessCoeffitients();
|
||||
var dX = stiffnessX.Kc * concreteInertia.MomentX + stiffnessX.Ks * otherInertia.MomentX;
|
||||
var dX = stiffnessX.Kc * concreteInertia.EIx + stiffnessX.Ks * otherInertia.EIx;
|
||||
|
||||
var stiffnessY = stiffnessLogicY.GetStiffnessCoeffitients();
|
||||
var dY = stiffnessY.Kc * concreteInertia.MomentY + stiffnessY.Ks * otherInertia.MomentY;
|
||||
var dY = stiffnessY.Kc * concreteInertia.EIy + stiffnessY.Ks * otherInertia.EIy;
|
||||
|
||||
return (dX, dY);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class AverageDiameterLogic : IAverageDiameterLogic
|
||||
{
|
||||
public IEnumerable<RebarNdm> Rebars { get; set; }
|
||||
|
||||
public double GetAverageDiameter()
|
||||
{
|
||||
Check();
|
||||
var rebarArea = Rebars
|
||||
.Sum(x => x.Area);
|
||||
var rebarCount = Rebars.Count();
|
||||
var averageArea = rebarArea / rebarCount;
|
||||
var diameter = Math.Sqrt(averageArea / Math.PI);
|
||||
return diameter;
|
||||
}
|
||||
private void Check()
|
||||
{
|
||||
if (!Rebars.Any())
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": rebars count must be greater then zero");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class CrackWidthLogicSP63 : ICrackWidthLogic
|
||||
{
|
||||
public double RebarStrain { get; set; }
|
||||
public double ConcreteStrain { get; set; }
|
||||
public double Length { get; set; }
|
||||
public double TermFactor { get; set; }
|
||||
public double BondFactor { get; set; }
|
||||
public double StressStateFactor { get; set; }
|
||||
public double PsiSFactor { get; set; }
|
||||
public double GetCrackWidth()
|
||||
{
|
||||
CheckOptions();
|
||||
//check if strain of concrete greater than strain of rebar
|
||||
if (ConcreteStrain > RebarStrain) { return 0d; }
|
||||
double width = (RebarStrain - ConcreteStrain) * Length;
|
||||
width *= TermFactor * BondFactor * StressStateFactor * PsiSFactor;
|
||||
return width;
|
||||
}
|
||||
|
||||
private void CheckOptions()
|
||||
{
|
||||
if (Length <=0d)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": length between cracks L={Length} must be greate than zero");
|
||||
}
|
||||
if (TermFactor <= 0d)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": Term factor {TermFactor} must be greate than zero");
|
||||
}
|
||||
if (BondFactor <= 0d)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": Bond factor {BondFactor} must be greate than zero");
|
||||
}
|
||||
if (StressStateFactor <= 0d)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": Bond factor {StressStateFactor} must be greate than zero");
|
||||
}
|
||||
if (PsiSFactor <= 0d)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $": PsiS factor {PsiSFactor} must be greate than zero");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public interface IAverageDiameterLogic
|
||||
{
|
||||
IEnumerable<RebarNdm> Rebars { get; set; }
|
||||
double GetAverageDiameter();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <summary>
|
||||
/// Logic for calculating width of crack
|
||||
/// </summary>
|
||||
public interface ICrackWidthLogic
|
||||
{
|
||||
/// <summary>
|
||||
/// strain of rebar, dimensionless
|
||||
/// </summary>
|
||||
double RebarStrain { get; set; }
|
||||
/// <summary>
|
||||
/// strain of concrete, dimensionless
|
||||
/// </summary>
|
||||
double ConcreteStrain { get; set; }
|
||||
/// <summary>
|
||||
/// Length between cracks in meters
|
||||
/// </summary>
|
||||
double Length { get; set; }
|
||||
/// <summary>
|
||||
/// return width of crack in meters
|
||||
/// </summary>
|
||||
double GetCrackWidth();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public interface ILengthBetweenCracksLogic
|
||||
{
|
||||
IEnumerable<INdm> NdmCollection { get; set; }
|
||||
IStrainMatrix StrainMatrix { get; set; }
|
||||
double GetLength();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
/// <summary>
|
||||
/// Logic fo calculating of tensile area of RC crosssection
|
||||
/// </summary>
|
||||
public interface ITensileAreaLogic
|
||||
{
|
||||
IEnumerable<INdm> NdmCollection { get; set; }
|
||||
IStrainMatrix StrainMatrix { get; set; }
|
||||
double GetTensileArea();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class LengthBetweenCracksLogicSP63 : ILengthBetweenCracksLogic
|
||||
{
|
||||
const double minDiameterFactor = 10d;
|
||||
const double maxDiameterFactor = 40d;
|
||||
const double minLength = 0.1d;
|
||||
const double maxLength = 0.4d;
|
||||
|
||||
readonly IAverageDiameterLogic diameterLogic;
|
||||
readonly ITensileAreaLogic tensileAreaLogic;
|
||||
public IEnumerable<INdm> NdmCollection { get; set; }
|
||||
public IStrainMatrix StrainMatrix { get; set; }
|
||||
public LengthBetweenCracksLogicSP63(IAverageDiameterLogic diameterLogic, ITensileAreaLogic tensileAreaLogic)
|
||||
{
|
||||
this.diameterLogic = diameterLogic;
|
||||
this.tensileAreaLogic = tensileAreaLogic;
|
||||
}
|
||||
public LengthBetweenCracksLogicSP63() :
|
||||
this
|
||||
( new AverageDiameterLogic(),
|
||||
new TensileAreaLogicSP63())
|
||||
{ }
|
||||
public double GetLength()
|
||||
{
|
||||
var rebars = NdmCollection
|
||||
.Where(x => x is RebarNdm)
|
||||
.Select(x => x as RebarNdm);
|
||||
var rebarArea = rebars.Sum(x => x.Area * x.StressScale);
|
||||
diameterLogic.Rebars = rebars;
|
||||
var rebarDiameter = diameterLogic.GetAverageDiameter();
|
||||
tensileAreaLogic.NdmCollection = NdmCollection;
|
||||
tensileAreaLogic.StrainMatrix = StrainMatrix;
|
||||
var concreteArea = tensileAreaLogic.GetTensileArea();
|
||||
var length = concreteArea / rebarArea * rebarDiameter;
|
||||
length = new List<double> { length, minDiameterFactor * rebarDiameter, minLength }.Max();
|
||||
length = new List<double> { length, maxDiameterFactor * rebarDiameter, maxLength }.Min();
|
||||
return length;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using LoaderCalculator.Logics;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Cracking
|
||||
{
|
||||
public class TensileAreaLogicSP63 : ITensileAreaLogic
|
||||
{
|
||||
const double maxConcreteFactor = 0.5d;
|
||||
const double minConcreteFactor = 0.1d;
|
||||
const double minRebarFactor = 3d;
|
||||
private static IStressLogic stressLogic => new StressLogic();
|
||||
public IEnumerable<INdm> NdmCollection { get; set; }
|
||||
public IStrainMatrix StrainMatrix { get; set; }
|
||||
|
||||
public double GetTensileArea()
|
||||
{
|
||||
var rebarCollection = NdmCollection
|
||||
.Where(x => x is RebarNdm);
|
||||
var rebarArea = rebarCollection.
|
||||
Sum(x => x.Area * x.StressScale);
|
||||
var concreteCollection = NdmCollection
|
||||
.Where(x => x.Material is ConcreteMaterial);
|
||||
var concreteArea = concreteCollection
|
||||
.Sum(x => x.Area * x.StressScale);
|
||||
var concreteTensileArea = concreteCollection
|
||||
.Where(x => stressLogic.GetTotalStrainWithPresrain(StrainMatrix, x) > 0d)
|
||||
.Sum(x => x.Area * x.StressScale);
|
||||
|
||||
concreteTensileArea = Math.Max(concreteTensileArea, rebarArea * minRebarFactor);
|
||||
concreteTensileArea = Math.Max(concreteTensileArea, concreteArea * minConcreteFactor);
|
||||
concreteTensileArea = Math.Min(concreteTensileArea, concreteArea * maxConcreteFactor);
|
||||
|
||||
return concreteTensileArea;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,12 +52,15 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
return primitive;
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
public IEnumerable<INdm> GetNdms(IMaterial material)
|
||||
public IEnumerable<INdm> GetNdms(ITriangulationOptions triangulationOptions)
|
||||
{
|
||||
var ndms = new List<INdm>();
|
||||
var options = new CircleTriangulationLogicOptions(this);
|
||||
var options = new CircleTriangulationLogicOptions(this)
|
||||
{
|
||||
triangulationOptions = triangulationOptions
|
||||
};
|
||||
var logic = new CircleTriangulationLogic(options);
|
||||
ndms.AddRange(logic.GetNdmCollection(material));
|
||||
ndms.AddRange(logic.GetNdmCollection());
|
||||
return ndms;
|
||||
}
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -9,6 +9,7 @@ using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperLogics.Models.CrossSections;
|
||||
using StructureHelperLogics.NdmCalculations.Triangulations;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
{
|
||||
@@ -26,6 +27,6 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
StrainTuple AutoPrestrain { get; }
|
||||
IVisualProperty VisualProperty {get; }
|
||||
|
||||
IEnumerable<INdm> GetNdms(IMaterial material);
|
||||
IEnumerable<INdm> GetNdms(ITriangulationOptions triangulationOptions);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using StructureHelper.Models.Materials;
|
||||
using System.Collections.Generic;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using System;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperLogics.Models.CrossSections;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using StructureHelperLogics.NdmCalculations.Triangulations;
|
||||
using StructureHelperLogics.Services.NdmPrimitives;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperLogics.Models.CrossSections;
|
||||
|
||||
namespace StructureHelperLogics.Models.Primitives
|
||||
{
|
||||
@@ -47,18 +41,18 @@ namespace StructureHelperLogics.Models.Primitives
|
||||
{}
|
||||
public PointPrimitive(IHeadMaterial material) : this() { HeadMaterial = material; }
|
||||
|
||||
public IEnumerable<INdm> GetNdms(IMaterial material)
|
||||
{
|
||||
var options = new PointTriangulationLogicOptions(this);
|
||||
IPointTriangulationLogic logic = new PointTriangulationLogic(options);
|
||||
return logic.GetNdmCollection(material);
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
var primitive = new PointPrimitive();
|
||||
updateStrategy.Update(primitive, this);
|
||||
return primitive;
|
||||
}
|
||||
|
||||
public IEnumerable<INdm> GetNdms(ITriangulationOptions triangulationOptions)
|
||||
{
|
||||
var options = new PointTriangulationLogicOptions(this) { triangulationOptions = triangulationOptions};
|
||||
var logic = new PointTriangulationLogic(options);
|
||||
return logic.GetNdmCollection();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
public class RebarPrimitive : IPointPrimitive, IHasHostPrimitive
|
||||
{
|
||||
static readonly RebarUpdateStrategy updateStrategy = new();
|
||||
IDataRepository<RebarPrimitive> repository;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string Name { get; set; }
|
||||
/// <inheritdoc/>
|
||||
@@ -66,16 +66,14 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
return primitive;
|
||||
}
|
||||
|
||||
public IEnumerable<INdm> GetNdms(IMaterial material)
|
||||
public IEnumerable<INdm> GetNdms(ITriangulationOptions triangulationOptions)
|
||||
{
|
||||
var options = new PointTriangulationLogicOptions(this);
|
||||
IPointTriangulationLogic logic = new PointTriangulationLogic(options);
|
||||
return logic.GetNdmCollection(material);
|
||||
}
|
||||
|
||||
public void Save()
|
||||
{
|
||||
repository.Create(this);
|
||||
var options = new RebarTriangulationLogicOptions(this)
|
||||
{
|
||||
triangulationOptions = triangulationOptions
|
||||
};
|
||||
var logic = new RebarTriangulationLogic(options);
|
||||
return logic.GetNdmCollection();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,12 +55,15 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
|
||||
return primitive;
|
||||
}
|
||||
|
||||
public IEnumerable<INdm> GetNdms(IMaterial material)
|
||||
public IEnumerable<INdm> GetNdms(ITriangulationOptions triangulationOptions)
|
||||
{
|
||||
var ndms = new List<INdm>();
|
||||
var options = new RectangleTriangulationLogicOptions(this);
|
||||
var options = new RectangleTriangulationLogicOptions(this)
|
||||
{
|
||||
triangulationOptions = triangulationOptions
|
||||
};
|
||||
var logic = new RectangleTriangulationLogic(options);
|
||||
ndms.AddRange(logic.GetNdmCollection(material));
|
||||
ndms.AddRange(logic.GetNdmCollection());
|
||||
return ndms;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,16 +12,14 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
internal class CircleTriangulationLogic : ITriangulationLogic
|
||||
{
|
||||
CircleTriangulationLogicOptions options;
|
||||
public ITriangulationLogicOptions Options { get; private set; }
|
||||
private readonly CircleTriangulationLogicOptions options;
|
||||
public CircleTriangulationLogic(ITriangulationLogicOptions options)
|
||||
{
|
||||
ValidateOptions(options);
|
||||
this.options = options as CircleTriangulationLogicOptions;
|
||||
Options = options;
|
||||
}
|
||||
|
||||
public IEnumerable<INdm> GetNdmCollection(IMaterial material)
|
||||
public IEnumerable<INdm> GetNdmCollection()
|
||||
{
|
||||
|
||||
double diameter = options.Circle.Diameter;
|
||||
@@ -29,7 +27,10 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
int ndmMinDivision = options.NdmMinDivision;
|
||||
var logicOptions = new LoaderCalculator.Triangulations.CircleTriangulationLogicOptions(diameter, ndmMaxSize, ndmMinDivision);
|
||||
var logic = LoaderCalculator.Triangulations.Triangulation.GetLogicInstance(logicOptions);
|
||||
var ndmCollection = logic.GetNdmCollection(new LoaderCalculator.Data.Planes.CirclePlane { Material = material });
|
||||
var ndmCollection = logic.GetNdmCollection(new LoaderCalculator.Data.Planes.CirclePlane
|
||||
{
|
||||
Material = options.HeadMaterial.GetLoaderMaterial(options.triangulationOptions.LimiteState, options.triangulationOptions.CalcTerm)
|
||||
});
|
||||
TriangulationService.CommonTransform(ndmCollection, options);
|
||||
TriangulationService.SetPrestrain(ndmCollection, options.Prestrain);
|
||||
return ndmCollection;
|
||||
@@ -37,9 +38,9 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
|
||||
public void ValidateOptions(ITriangulationLogicOptions options)
|
||||
{
|
||||
if (options is not ICircleTriangulationLogicOptions )
|
||||
if (options is not CircleTriangulationLogicOptions )
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $"\n Expected: {nameof(ICircleTriangulationLogicOptions)}, But was: {nameof(options)}");
|
||||
throw new StructureHelperException(ErrorStrings.ExpectedWas(typeof(CircleTriangulationLogicOptions), options.GetType()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -9,7 +11,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public class CircleTriangulationLogicOptions : ICircleTriangulationLogicOptions
|
||||
public class CircleTriangulationLogicOptions : IShapeTriangulationLogicOptions
|
||||
{
|
||||
public ICircleShape Circle { get; }
|
||||
|
||||
@@ -20,19 +22,17 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
public int NdmMinDivision { get; }
|
||||
|
||||
public StrainTuple Prestrain { get; set; }
|
||||
public ITriangulationOptions triangulationOptions { get; set; }
|
||||
public IHeadMaterial HeadMaterial { get; set; }
|
||||
|
||||
public CircleTriangulationLogicOptions(ICirclePrimitive primitive)
|
||||
{
|
||||
Center = new Point2D() { X = primitive.Center.X, Y = primitive.Center.Y };
|
||||
Center = primitive.Center.Clone() as Point2D;
|
||||
Circle = primitive;
|
||||
NdmMaxSize = primitive.NdmMaxSize;
|
||||
NdmMinDivision = primitive.NdmMinDivision;
|
||||
Prestrain = new StrainTuple
|
||||
{
|
||||
Mx = primitive.UsersPrestrain.Mx + primitive.AutoPrestrain.Mx,
|
||||
My = primitive.UsersPrestrain.My + primitive.AutoPrestrain.My,
|
||||
Nz = primitive.UsersPrestrain.Nz + primitive.AutoPrestrain.Nz
|
||||
};
|
||||
HeadMaterial = primitive.HeadMaterial;
|
||||
Prestrain = ForceTupleService.SumTuples(primitive.UsersPrestrain, primitive.AutoPrestrain) as StrainTuple;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
internal interface ICircleTriangulationLogicOptions : IShapeTriangulationLogicOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Shape
|
||||
/// </summary>
|
||||
ICircleShape Circle { get; }
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
interface IPointTriangulationLogic : ITriangulationLogic
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public interface IPointTriangulationLogicOptions : ITriangulationLogicOptions
|
||||
{
|
||||
IPoint2D Center { get; }
|
||||
double Area { get; }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public interface IRectangleTriangulationLogic : ITriangulationLogic
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
/// <summary>
|
||||
/// Parameter of triangulation of rectangle part of section
|
||||
/// Параметры триангуляции прямоугольного участка сечения
|
||||
/// </summary>
|
||||
public interface IRectangleTriangulationLogicOptions : IShapeTriangulationLogicOptions
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
IRectangleShape Rectangle { get; }
|
||||
}
|
||||
}
|
||||
@@ -6,8 +6,7 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public interface ITriangulationLogic
|
||||
{
|
||||
ITriangulationLogicOptions Options { get; }
|
||||
IEnumerable<INdm> GetNdmCollection(IMaterial material);
|
||||
IEnumerable<INdm> GetNdmCollection();
|
||||
void ValidateOptions(ITriangulationLogicOptions options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelperCommon.Infrastructures.Enums;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public interface ITriangulationLogicOptions
|
||||
{
|
||||
ITriangulationOptions triangulationOptions { get; set; }
|
||||
StrainTuple Prestrain { get; set; }
|
||||
IHeadMaterial HeadMaterial { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +1,40 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using LoaderCalculator.Data.Ndms.Transformations;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public class PointTriangulationLogic : IPointTriangulationLogic
|
||||
public class PointTriangulationLogic : ITriangulationLogic
|
||||
{
|
||||
public ITriangulationLogicOptions Options { get; }
|
||||
private readonly PointTriangulationLogicOptions options;
|
||||
|
||||
public PointTriangulationLogic(ITriangulationLogicOptions options)
|
||||
{
|
||||
Options = options;
|
||||
ValidateOptions(options);
|
||||
this.options = options as PointTriangulationLogicOptions;
|
||||
}
|
||||
|
||||
public IEnumerable<INdm> GetNdmCollection(IMaterial material)
|
||||
public IEnumerable<INdm> GetNdmCollection()
|
||||
{
|
||||
IPointTriangulationLogicOptions options = Options as IPointTriangulationLogicOptions;
|
||||
IPoint2D center = options.Center;
|
||||
double area = options.Area;
|
||||
List<INdm> ndmCollection = new List<INdm>();
|
||||
INdm ndm = new Ndm { CenterX = center.X, CenterY = center.Y, Area = area, Material = material };
|
||||
ndmCollection.Add(ndm);
|
||||
NdmTransform.SetPrestrain(ndmCollection, new StrainMatrix() { Kx = options.Prestrain.Mx, Ky = options.Prestrain.My, EpsZ = options.Prestrain.Nz });
|
||||
var ndm = new Ndm
|
||||
{
|
||||
CenterX = options.Center.X,
|
||||
CenterY = options.Center.Y,
|
||||
Area = options.Area,
|
||||
Material = options.HeadMaterial.GetLoaderMaterial(options.triangulationOptions.LimiteState, options.triangulationOptions.CalcTerm)
|
||||
};
|
||||
List<INdm> ndmCollection = new () { ndm};
|
||||
NdmTransform.SetPrestrain(ndmCollection, StrainTupleService.ConvertToLoaderStrainMatrix(options.Prestrain));
|
||||
return ndmCollection;
|
||||
}
|
||||
|
||||
public void ValidateOptions(ITriangulationLogicOptions options)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
if (options is not PointTriangulationLogicOptions)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ExpectedWas(typeof(PointTriangulationLogicOptions), options.GetType()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
@@ -7,8 +10,9 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class PointTriangulationLogicOptions : IPointTriangulationLogicOptions
|
||||
public class PointTriangulationLogicOptions : ITriangulationLogicOptions
|
||||
{
|
||||
public ITriangulationOptions triangulationOptions { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -16,26 +20,16 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
/// <inheritdoc />
|
||||
public double Area { get; }
|
||||
public StrainTuple Prestrain { get; set; }
|
||||
public IHeadMaterial HeadMaterial { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
public PointTriangulationLogicOptions(IPoint2D center, double area)
|
||||
{
|
||||
Center = center;
|
||||
Area = area;
|
||||
Prestrain = new StrainTuple();
|
||||
}
|
||||
|
||||
public PointTriangulationLogicOptions(IPointPrimitive primitive)
|
||||
{
|
||||
Center = new Point2D() { X = primitive.Center.X, Y = primitive.Center.Y };
|
||||
Center = primitive.Center.Clone() as Point2D;
|
||||
Area = primitive.Area;
|
||||
Prestrain = new StrainTuple
|
||||
{
|
||||
Mx = primitive.UsersPrestrain.Mx + primitive.AutoPrestrain.Mx,
|
||||
My = primitive.UsersPrestrain.My + primitive.AutoPrestrain.My,
|
||||
Nz = primitive.UsersPrestrain.Nz + primitive.AutoPrestrain.Nz
|
||||
};
|
||||
HeadMaterial = primitive.HeadMaterial;
|
||||
Prestrain = ForceTupleService.SumTuples(primitive.UsersPrestrain, primitive.AutoPrestrain) as StrainTuple;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using LoaderCalculator.Data.Ndms.Transformations;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
internal class RebarTriangulationLogic : ITriangulationLogic
|
||||
{
|
||||
private readonly RebarTriangulationLogicOptions options;
|
||||
public RebarTriangulationLogic(ITriangulationLogicOptions options)
|
||||
{
|
||||
ValidateOptions(options);
|
||||
this.options = options as RebarTriangulationLogicOptions;
|
||||
}
|
||||
public IEnumerable<INdm> GetNdmCollection()
|
||||
{
|
||||
var concreteNdm = new Ndm
|
||||
{
|
||||
CenterX = options.Center.X,
|
||||
CenterY = options.Center.Y,
|
||||
Area = options.Area,
|
||||
Material = options.HostMaterial.GetLoaderMaterial(options.triangulationOptions.LimiteState, options.triangulationOptions.CalcTerm),
|
||||
StressScale = -1d
|
||||
};
|
||||
var rebarNdm = new RebarNdm
|
||||
{
|
||||
CenterX = options.Center.X,
|
||||
CenterY = options.Center.Y,
|
||||
Area = options.Area,
|
||||
Material = options.HeadMaterial.GetLoaderMaterial(options.triangulationOptions.LimiteState, options.triangulationOptions.CalcTerm)
|
||||
};
|
||||
List<INdm> ndmCollection = new() { concreteNdm, rebarNdm};
|
||||
//List<INdm> ndmCollection = new() { rebarNdm };
|
||||
NdmTransform.SetPrestrain(ndmCollection, StrainTupleService.ConvertToLoaderStrainMatrix(options.Prestrain));
|
||||
return ndmCollection;
|
||||
}
|
||||
|
||||
public void ValidateOptions(ITriangulationLogicOptions options)
|
||||
{
|
||||
if (options is not RebarTriangulationLogicOptions)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.ExpectedWas(typeof(RebarTriangulationLogicOptions), options.GetType()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public class RebarTriangulationLogicOptions : ITriangulationLogicOptions
|
||||
{
|
||||
public ITriangulationOptions triangulationOptions { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public IPoint2D Center { get; }
|
||||
/// <inheritdoc />
|
||||
public double Area { get; }
|
||||
public StrainTuple Prestrain { get; set; }
|
||||
public IHeadMaterial HeadMaterial { get; set; }
|
||||
public IHeadMaterial HostMaterial { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public RebarTriangulationLogicOptions(RebarPrimitive primitive)
|
||||
{
|
||||
Center = primitive.Center.Clone() as Point2D;
|
||||
Area = primitive.Area;
|
||||
HeadMaterial = primitive.HeadMaterial;
|
||||
HostMaterial = primitive.HostPrimitive.HeadMaterial;
|
||||
Prestrain = ForceTupleService.SumTuples(primitive.UsersPrestrain, primitive.AutoPrestrain) as StrainTuple;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,18 @@
|
||||
using LoaderCalculator.Data.Materials;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using LoaderCalculator.Data.Ndms;
|
||||
using LoaderCalculator.Data.Ndms.Transformations;
|
||||
using LoaderCalculator.Data.Matrix;
|
||||
using StructureHelperCommon.Infrastructures.Exceptions;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public class RectangleTriangulationLogic : IRectangleTriangulationLogic
|
||||
public class RectangleTriangulationLogic : ITriangulationLogic
|
||||
{
|
||||
IRectangleTriangulationLogicOptions options;
|
||||
public ITriangulationLogicOptions Options { get; }
|
||||
|
||||
public IEnumerable<INdm> GetNdmCollection(IMaterial material)
|
||||
private readonly RectangleTriangulationLogicOptions options;
|
||||
public RectangleTriangulationLogic(ITriangulationLogicOptions options)
|
||||
{
|
||||
ValidateOptions(options);
|
||||
this.options = options as RectangleTriangulationLogicOptions;
|
||||
}
|
||||
public IEnumerable<INdm> GetNdmCollection()
|
||||
{
|
||||
double width = options.Rectangle.Width;
|
||||
double height = options.Rectangle.Height;
|
||||
@@ -21,7 +20,10 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
int ndmMinDivision = options.NdmMinDivision;
|
||||
LoaderCalculator.Triangulations.RectangleTriangulationLogicOptions logicOptions = new LoaderCalculator.Triangulations.RectangleTriangulationLogicOptions(width, height, ndmMaxSize, ndmMinDivision);
|
||||
var logic = LoaderCalculator.Triangulations.Triangulation.GetLogicInstance(logicOptions);
|
||||
var ndmCollection = logic.GetNdmCollection(new LoaderCalculator.Data.Planes.RectangularPlane { Material = material });
|
||||
var ndmCollection = logic.GetNdmCollection(new LoaderCalculator.Data.Planes.RectangularPlane
|
||||
{
|
||||
Material = options.HeadMaterial.GetLoaderMaterial(options.triangulationOptions.LimiteState, options.triangulationOptions.CalcTerm)
|
||||
});
|
||||
TriangulationService.CommonTransform(ndmCollection, options);
|
||||
double angle = options.Rectangle.Angle;
|
||||
NdmTransform.Rotate(ndmCollection, angle);
|
||||
@@ -31,17 +33,11 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
|
||||
public void ValidateOptions(ITriangulationLogicOptions options)
|
||||
{
|
||||
if (options is not IRectangleTriangulationLogicOptions)
|
||||
if (options is not RectangleTriangulationLogicOptions)
|
||||
{
|
||||
throw new StructureHelperException(ErrorStrings.DataIsInCorrect + $"\n Expected: {nameof(IRectangleTriangulationLogicOptions)}, But was: {nameof(options)}");
|
||||
throw new StructureHelperException(ErrorStrings.ExpectedWas(typeof(RectangleTriangulationLogicOptions), options.GetType()));
|
||||
}
|
||||
}
|
||||
|
||||
public RectangleTriangulationLogic(ITriangulationLogicOptions options)
|
||||
{
|
||||
ValidateOptions(options);
|
||||
this.options = options as IRectangleTriangulationLogicOptions;
|
||||
Options = options;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelper.Models.Materials;
|
||||
using StructureHelperCommon.Models.Forces;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Services.Forces;
|
||||
using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public class RectangleTriangulationLogicOptions : IRectangleTriangulationLogicOptions
|
||||
public class RectangleTriangulationLogicOptions : IShapeTriangulationLogicOptions
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public IPoint2D Center { get; }
|
||||
@@ -17,6 +19,8 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
public int NdmMinDivision { get; }
|
||||
/// <inheritdoc />
|
||||
public StrainTuple Prestrain { get; set; }
|
||||
public ITriangulationOptions triangulationOptions { get; set; }
|
||||
public IHeadMaterial HeadMaterial { get; set; }
|
||||
|
||||
public RectangleTriangulationLogicOptions(IPoint2D center, IRectangleShape rectangle, double ndmMaxSize, int ndmMinDivision)
|
||||
{
|
||||
@@ -33,12 +37,8 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
Rectangle = primitive;
|
||||
NdmMaxSize = primitive.NdmMaxSize;
|
||||
NdmMinDivision = primitive.NdmMinDivision;
|
||||
Prestrain = new StrainTuple
|
||||
{
|
||||
Mx = primitive.UsersPrestrain.Mx + primitive.AutoPrestrain.Mx,
|
||||
My = primitive.UsersPrestrain.My + primitive.AutoPrestrain.My,
|
||||
Nz = primitive.UsersPrestrain.Nz + primitive.AutoPrestrain.Nz
|
||||
};
|
||||
HeadMaterial = primitive.HeadMaterial;
|
||||
Prestrain = ForceTupleService.SumTuples(primitive.UsersPrestrain, primitive.AutoPrestrain) as StrainTuple;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,22 +6,21 @@ using StructureHelperLogics.NdmCalculations.Primitives;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public static class Triangulation
|
||||
public static class Triangulation1
|
||||
{
|
||||
public static IEnumerable<INdm> GetNdms(IEnumerable<INdmPrimitive> ndmPrimitives, ITriangulationOptions options)
|
||||
{
|
||||
List<INdm> ndms = new List<INdm>();
|
||||
var headMaterials = GetPrimitiveMaterials(ndmPrimitives);
|
||||
Dictionary<Guid, IMaterial> materials = GetMaterials(headMaterials, options);
|
||||
foreach (var ndmPrimitive in ndmPrimitives)
|
||||
{
|
||||
IHeadMaterial headMaterial = ndmPrimitive.HeadMaterial;
|
||||
IMaterial material;
|
||||
if (materials.TryGetValue(headMaterial.Id, out material) == false) { throw new Exception("Material dictionary is not valid"); }
|
||||
IEnumerable<INdm> localNdms = GetNdmsByPrimitive(ndmPrimitive, material);
|
||||
ndms.AddRange(localNdms);
|
||||
}
|
||||
return ndms;
|
||||
return ndmPrimitives.SelectMany(x => x.GetNdms(options));
|
||||
//var headMaterials = GetPrimitiveMaterials(ndmPrimitives);
|
||||
//Dictionary<Guid, IMaterial> materials = GetMaterials(headMaterials, options);
|
||||
//foreach (var ndmPrimitive in ndmPrimitives)
|
||||
//{
|
||||
// IHeadMaterial headMaterial = ndmPrimitive.HeadMaterial;
|
||||
// IMaterial material;
|
||||
// if (materials.TryGetValue(headMaterial.Id, out material) == false) { throw new Exception("Material dictionary is not valid"); }
|
||||
// IEnumerable<INdm> localNdms = GetNdmsByPrimitive(ndmPrimitive, options);
|
||||
// ndms.AddRange(localNdms);
|
||||
//}
|
||||
}
|
||||
/// <summary>
|
||||
/// Returns dictionary of unique materials by collection of primitives
|
||||
@@ -60,10 +59,10 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
return materials;
|
||||
}
|
||||
|
||||
private static IEnumerable<INdm> GetNdmsByPrimitive(INdmPrimitive primitive, IMaterial material)
|
||||
private static IEnumerable<INdm> GetNdmsByPrimitive(INdmPrimitive primitive, ITriangulationOptions options)
|
||||
{
|
||||
List<INdm> ndms = new List<INdm>();
|
||||
ndms.AddRange(primitive.GetNdms(material));
|
||||
List<INdm> ndms = new ();
|
||||
ndms.AddRange(primitive.GetNdms(options));
|
||||
return ndms;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,13 +25,13 @@ namespace StructureHelperLogics.Services.NdmCalculations
|
||||
{
|
||||
var ndmCollection = new List<INdm>();
|
||||
ITriangulationOptions options = new TriangulationOptions { LimiteState = calculationProperty.LimitState, CalcTerm = calculationProperty.CalcTerm };
|
||||
ndmCollection.AddRange(Triangulation.GetNdms(ndmPrimitives, options));
|
||||
ndmCollection.AddRange(ndmPrimitives.SelectMany(x => x.GetNdms(options)));
|
||||
var loaderData = new LoaderOptions
|
||||
{
|
||||
Preconditions = new Preconditions
|
||||
{
|
||||
ConditionRate = calculationProperty.IterationProperty.Accuracy,
|
||||
MaxIterationCount = calculationProperty.IterationProperty.MaxIterationCount,
|
||||
ConditionRate = calculationProperty.Accuracy.IterationAccuracy,
|
||||
MaxIterationCount = calculationProperty.Accuracy.MaxIterationCount,
|
||||
StartForceMatrix = new ForceMatrix { Mx = mx, My = my, Nz = nz }
|
||||
},
|
||||
NdmCollection = ndmCollection
|
||||
@@ -47,7 +47,7 @@ namespace StructureHelperLogics.Services.NdmCalculations
|
||||
foreach (var forceCombinations in calculationProperty.ForceCombinations)
|
||||
{
|
||||
var forceMatrix = forceCombinations.ForceMatrix;
|
||||
results.Add(GetCalculationResult(forceMatrix, ndms, calculationProperty.IterationProperty.Accuracy, calculationProperty.IterationProperty.MaxIterationCount));
|
||||
results.Add(GetCalculationResult(forceMatrix, ndms, calculationProperty.Accuracy.IterationAccuracy, calculationProperty.Accuracy.MaxIterationCount));
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
@@ -19,18 +19,11 @@ namespace StructureHelperLogics.Services.NdmPrimitives
|
||||
{
|
||||
public static class NdmPrimitivesService
|
||||
{
|
||||
public static List<INdm> GetNdms(INdmPrimitive primitive, LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
//Формируем коллекцию элементарных участков для расчета в библитеке (т.е. выполняем триангуляцию)
|
||||
List<INdm> ndmCollection = new List<INdm>();
|
||||
var material = primitive.HeadMaterial.GetLoaderMaterial(limitState, calcTerm);
|
||||
ndmCollection.AddRange(primitive.GetNdms(material));
|
||||
return ndmCollection;
|
||||
}
|
||||
public static List<INdm> GetNdms(IEnumerable<INdmPrimitive> primitives, LimitStates limitState, CalcTerms calcTerm)
|
||||
{
|
||||
var orderedNdmPrimitives = primitives.OrderBy(x => x.VisualProperty.ZIndex);
|
||||
var ndms = new List<INdm>();
|
||||
var triangulationOptions = new TriangulationOptions() { LimiteState = limitState, CalcTerm = calcTerm };
|
||||
foreach (var item in orderedNdmPrimitives)
|
||||
{
|
||||
if (item is IHasDivisionSize)
|
||||
@@ -43,7 +36,7 @@ namespace StructureHelperLogics.Services.NdmPrimitives
|
||||
}
|
||||
if (item.Triangulate == true)
|
||||
{
|
||||
ndms.AddRange(GetNdms(item, limitState, calcTerm));
|
||||
ndms.AddRange(item.GetNdms(triangulationOptions));
|
||||
}
|
||||
}
|
||||
return ndms;
|
||||
|
||||
@@ -94,8 +94,8 @@ namespace StructureHelperLogics.Services.NdmPrimitives
|
||||
try
|
||||
{
|
||||
var gravityCenter = GeometryOperations.GetReducedMomentsOfInertia(locNdms, locStrainMatrix);
|
||||
firstParameter.Value = (gravityCenter.MomentX * unitMultiPlayer).ToString();
|
||||
secondParameter.Value = (gravityCenter.MomentY * unitMultiPlayer).ToString();
|
||||
firstParameter.Value = (gravityCenter.EIx * unitMultiPlayer).ToString();
|
||||
secondParameter.Value = (gravityCenter.EIy * unitMultiPlayer).ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -134,8 +134,8 @@ namespace StructureHelperLogics.Services.NdmPrimitives
|
||||
try
|
||||
{
|
||||
var actualMoments = GeometryOperations.GetSofteningsFactors(locNdms, locStrainMatrix);
|
||||
firstParameter.Value = actualMoments.MxFactor.ToString();
|
||||
secondParameter.Value = actualMoments.MyFactor.ToString();
|
||||
firstParameter.Value = actualMoments.EIxFactor.ToString();
|
||||
secondParameter.Value = actualMoments.EIy.ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -196,7 +196,7 @@ namespace StructureHelperLogics.Services.NdmPrimitives
|
||||
try
|
||||
{
|
||||
var actual = GeometryOperations.GetSofteningsFactors(locNdms, locStrainMatrix);
|
||||
firstParameter.Value = actual.NzFactor.ToString();
|
||||
firstParameter.Value = actual.EAFactor.ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -238,8 +238,8 @@ namespace StructureHelperLogics.Services.NdmPrimitives
|
||||
try
|
||||
{
|
||||
var gravityCenter = GeometryOperations.GetGravityCenter(locNdms, locStrainMatrix);
|
||||
firstParameter.Value = (gravityCenter.CenterX * unitMultiPlayer).ToString();
|
||||
secondParameter.Value = (gravityCenter.CenterY * unitMultiPlayer).ToString();
|
||||
firstParameter.Value = (gravityCenter.Cx * unitMultiPlayer).ToString();
|
||||
secondParameter.Value = (gravityCenter.Cy * unitMultiPlayer).ToString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.CrackCalculatorT
|
||||
var newSection = new SectionTemplate(new RectGeometryLogic(template)).GetCrossSection();
|
||||
var ndmPrimitives = newSection.SectionRepository.Primitives;
|
||||
ITriangulationOptions options = new TriangulationOptions { LimiteState = LimitStates.SLS, CalcTerm = CalcTerms.ShortTerm };
|
||||
var ndms = Triangulation.GetNdms(ndmPrimitives, options);
|
||||
var ndms = ndmPrimitives.SelectMany(x => x.GetNdms(options));
|
||||
var calculator = new CrackForceCalculator();
|
||||
calculator.EndTuple = new ForceTuple() { Mx = -50e3d, My = -50e3d, Nz = 0d };
|
||||
calculator.NdmCollection = ndms;
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace StructureHelperTests.FunctionalTests.Ndms.Calculators.ForceCalculatorT
|
||||
{
|
||||
public class RCSectionsTest
|
||||
{
|
||||
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 2, 2, false, -0.00062544561815463693d, -0.0029292919541166911d, 0.00035383082501577246d)]
|
||||
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 3, 2, false, -0.00046762265275279838d, -0.0025101896869558888d, 0.00027185795017719519d)]
|
||||
[TestCase(0.5d, 0.5d, 0.025d, 0.025d, 3, 3, false, -0.00080914991212906239d, -0.00080914991212906184d, 0.00011900072665826425d)]
|
||||
[TestCase(0.5d, 0.5d, 0.025d, 0.025d, 3, 3, true, -0.0008126213321004612d, -0.00081262133210046055d, 0.00011963568117586145d)]
|
||||
[TestCase(0.5d, 0.6d, 0.025d, 0.025d, 3, 3, true, -0.00047720148631058529d, -0.00077269031816753532d, 0.00010610472872420363d)]
|
||||
[TestCase(0.6d, 0.5d, 0.025d, 0.025d, 3, 3, true, -0.00077269031816753478d, -0.00047720148631058437d, 0.00010610472872420363d)]
|
||||
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 2, 2, false, -0.00062729176929923703d, -0.0029292919541166911d, 0.00035383082501577246d)]
|
||||
[TestCase(0.4d, 0.6d, 0.012d, 0.025d, 3, 2, false, -0.00046857734823565632d, -0.0025101896869558888d, 0.00027185795017719519d)]
|
||||
[TestCase(0.5d, 0.5d, 0.025d, 0.025d, 3, 3, false, -0.00081656737668168479d, -0.00081656737668168414d, 0.00011865117209051567d)]
|
||||
[TestCase(0.5d, 0.5d, 0.025d, 0.025d, 3, 3, true, -0.00081971887286298598d, -0.00081971887286298544d, 0.00011922273439756063d)]
|
||||
[TestCase(0.5d, 0.6d, 0.025d, 0.025d, 3, 3, true, -0.00048146233319312662d, -0.00077822315770951882d, 0.00010599549196849429d)]
|
||||
[TestCase(0.6d, 0.5d, 0.025d, 0.025d, 3, 3, true, -0.00077822315770951947d, -0.00048146233319312478d, 0.00010599549196849413d)]
|
||||
public void Run_ShouldPass(double width, double height, double topDiametr, double bottomDiametr, int widthCount, int heightCount, bool isBuckling, double expectedKx, double expectedKy, double expectedEpsZ)
|
||||
{
|
||||
//Arrange
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace StructureHelperTests.FunctionalTests.Ndms.RCSections
|
||||
var primitives = new List<INdmPrimitive>();
|
||||
primitives.AddRange(GetConcreteNdms(width, height));
|
||||
primitives.AddRange(GetReinforcementNdms(width, height, topArea, bottomArea));
|
||||
ndmCollection.AddRange(Triangulation.GetNdms(primitives, options));
|
||||
ndmCollection.AddRange(primitives.SelectMany(x => x.GetNdms(options)));
|
||||
var loaderData = new LoaderOptions
|
||||
{
|
||||
Preconditions = new Preconditions
|
||||
|
||||