-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMain.xaml
192 lines (187 loc) · 10.8 KB
/
Main.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<!--
Copyright 2020 Pietro Vitelli
This file is part of OriFlagTess program.
OriFlagTess is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version.
OriFlagTess is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OriFlagTess. If not, see<http://www.gnu.org/licenses/> -->
<Window xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:System="clr-namespace:System;assembly=mscorlib" x:Class="Flagstone_Tessellation___Molecule_construction.Main"
mc:Ignorable="d"
x:Name="mainWindow"
Title="OriFlagTess :: Molecule construction" ResizeMode="NoResize" SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterScreen">
<Grid x:Name="mainGrid" Margin="30">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="350" />
<ColumnDefinition Width="150" />
<ColumnDefinition Width="225" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="80" />
<RowDefinition Height="80" />
<RowDefinition Height="80" />
<RowDefinition Height="80" />
<RowDefinition Height="80" />
<RowDefinition Height="300" />
<RowDefinition Height="100" />
</Grid.RowDefinitions>
<GroupBox Grid.Row="0" Grid.Column="0" Header="Input Molecule type" Margin="0,0,10,0">
<Grid x:Name="inputMoleculeTypeGrid" Margin="5,5,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Content="MoleculeType" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center"/>
<ComboBox x:Name="inputMoleculeTypeComboBox" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" Height="25" Width="200" SelectionChanged="inputMoleculeTypeComboBox_SelectionChanged"/>
</Grid>
</GroupBox>
<GroupBox Grid.Row="0" Grid.Column="1" Header="Input Flags" Margin="0,0,10,0">
<Grid x:Name="inputFlagGrid" Margin="5,5,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="125" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right">
<TextBlock TextWrapping="Wrap">
Center double pleats
</TextBlock>
</Label>
<CheckBox x:Name="pleatCenterManualCheckBox" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Left" Checked="pleatCenterManualCheckBox_Checked" Unchecked="pleatCenterManualCheckBox_Unchecked"/>
</Grid>
</GroupBox>
<GroupBox Grid.Row="0" Grid.Column="2" Header="Input Spacing" Margin="0,0,0,0">
<Grid x:Name="inputSpacingGrid" Margin="5,5,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Label Content="Spacing" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center"/>
<xctk:DecimalUpDown x:Name="spacing" Grid.Row="0" Grid.Column="1" Width="50" Margin="0,10,10,10" Minimum="0.0" Maximum="1000" Increment="0.1" Text="0" ValueChanged="spacing_ValueChanged"/>
</Grid>
</GroupBox>
<GroupBox Grid.Row="1" Grid.ColumnSpan="3" Header="Input Angles" Margin="0,0,0,0">
<Grid x:Name="inputAnglesGrid" Margin="5,5,5,5" Height="50">
</Grid>
</GroupBox>
<GroupBox Grid.Row="2" Grid.ColumnSpan="3" Header="Input Sides" Margin="0,0,0,0">
<Grid x:Name="inputSidesGrid" Margin="5,5,5,5" Height="50">
</Grid>
</GroupBox>
<GroupBox Grid.Row="3" Grid.ColumnSpan="3" Header="Input Pleat center" Margin="0,0,0,0">
<Grid x:Name="inputPleatCenterGrid" Margin="5,5,5,5" Height="50">
</Grid>
</GroupBox>
<GroupBox Grid.Row="4" Grid.Column="0" Header="Input Center" Margin="0,0,10,0">
<Grid x:Name="inputCenterGrid" Margin="5,5,5,5" Height="50">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Button x:Name="autoCenter" Grid.Row="0" Grid.Column="0" Width="40" Height="40" HorizontalAlignment="Center" Click="autoCenter_Click" ToolTip="Auto center">
<StackPanel Margin="10,10,10,10">
<Image Source="images/center.png"/>
</StackPanel>
</Button>
<Label Content="CenterX" Grid.Row="0" Grid.Column="1" VerticalAlignment="Center"/>
<xctk:DecimalUpDown x:Name="centerX" Grid.Row="0" Grid.Column="2" Width="50" Margin="0,10,10,10" Minimum="0.01" Maximum="1000" Increment="0.1" Text="25" ValueChanged="centerX_ValueChanged" KeyUp="centerX_KeyUp" KeyDown="centerX_KeyDown"/>
<Label Content="CenterY" Grid.Row="0" Grid.Column="3" VerticalAlignment="Center"/>
<xctk:DecimalUpDown x:Name="centerY" Grid.Row="0" Grid.Column="4" Width="50" Margin="0,10,10,10" Minimum="0.01" Maximum="1000" Increment="0.1" Text="25" ValueChanged="centerY_ValueChanged"/>
</Grid>
</GroupBox>
<GroupBox Grid.Row="5" Grid.Column="0" Header="Sample Node" Margin="0,0,10,0" VerticalAlignment="Top">
<Viewbox Width="300" Height="300" Stretch="Fill" ClipToBounds="True" VerticalAlignment="Top">
<Canvas x:Name="inputNodeCanvas" Width="1500" Height="1500" MouseWheel="inputNodeCanvas_MouseWheel">
<Canvas.RenderTransform>
<TransformGroup>
<ScaleTransform x:Name="inputNodeScaleCanvas" ScaleX="4" ScaleY="4" CenterX="750" CenterY="750"/>
</TransformGroup>
</Canvas.RenderTransform>
</Canvas>
</Viewbox>
</GroupBox>
<GroupBox Grid.Column="1" Grid.Row="4" Grid.RowSpan="3" Grid.ColumnSpan="2" Header="Crease Pattern">
<Viewbox Width="500" Height="500" Stretch="Fill" ClipToBounds="True">
<Canvas x:Name="creasePatternCanvas" Width="1500" Height="1500" MouseWheel="creasePatternCanvas_MouseWheel">
<Canvas.RenderTransform>
<TransformGroup>
<ScaleTransform x:Name="scaleCanvas" ScaleX="2" ScaleY="2" CenterX="750" CenterY="750"/>
</TransformGroup>
</Canvas.RenderTransform>
</Canvas>
</Viewbox>
</GroupBox>
<GroupBox Grid.Row="6" Grid.Column="0" Header="Controls" Margin="0,0,10,0">
<Grid x:Name="controlGrid" Margin="10,10,10,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Button x:Name="Reset" Grid.Column="0" Width="48" Height="48" HorizontalAlignment="Center" Click="Reset_Click" ToolTip="Reset values">
<StackPanel Margin="10,10,10,10">
<Image Source="images/undo.png" />
</StackPanel>
</Button>
<Button x:Name="ZoomIn" Grid.Column="1" Width="48" Height="48" HorizontalAlignment="Center" Click="ZoomIn_Click" ToolTip="Zoom in crease pattern">
<StackPanel Margin="10,10,10,10">
<Image Source="images/zoom_in.png" />
</StackPanel>
</Button>
<Button x:Name="ZoomOut" Grid.Column="2" Width="48" Height="48" HorizontalAlignment="Center" Click="ZoomOut_Click" ToolTip="Zoom out crease pattern">
<StackPanel Margin="10,10,10,10">
<Image Source="images/zoom_out.png" />
</StackPanel>
</Button>
<Button x:Name="Save" Grid.Column="3" Width="48" Height="48" HorizontalAlignment="Center" Click="Save_Click" ToolTip="Save crease pattern">
<StackPanel Margin="5,5,5,5">
<Image Source="images/save.png" />
</StackPanel>
</Button>
<Button x:Name="Settings" Grid.Column="4" Width="48" Height="48" HorizontalAlignment="Center" ToolTip="Settings" Click="Settings_Click">
<StackPanel Margin="5,5,5,5">
<Image Source="images/settings.png" />
</StackPanel>
</Button>
</Grid>
</GroupBox>
<GroupBox Grid.Row="0" Grid.RowSpan="7" Grid.Column="3" Header="Log" Margin="10,0,0,0">
<ScrollViewer Background="#eee">
<TextBlock x:Name="Log" Margin="5,5,5,5" HorizontalAlignment="Left"/>
</ScrollViewer>
</GroupBox>
</Grid>
</Window>