forked from MontagueM/Phonon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
289 lines (270 loc) · 25 KB
/
MainWindow.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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<Window x:Class="Phonon.MainWindow"
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:HelixToolkit="clr-namespace:HelixToolkit.Wpf;assembly=HelixToolkit.Wpf"
xmlns:local="clr-namespace:Phonon"
mc:Ignorable="d"
Title="Phonon" Height="1080" Width="1920" WindowState="Maximized" Name="Wind">
<Window.Resources>
<local:MainViewModel x:Key="MVM"/>
</Window.Resources>
<Window.DataContext>
<Binding Source="{StaticResource MVM}"/>
</Window.DataContext>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="41*" />
<ColumnDefinition Width="39*"/>
<ColumnDefinition Width="400*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="21*" />
<RowDefinition Height="523*" />
<RowDefinition Height="520*"/>
</Grid.RowDefinitions>
<Menu x:Name="menu" Grid.ColumnSpan="1" Grid.Column="2" Background="#3d3d3d" Foreground="#FFE6E6E6" BorderBrush="#3d3d3d">
<MenuItem Header="_Viewer">
<MenuItem Header="G_rid" IsCheckable="True" IsChecked="True" Checked="Grid_Checked" Unchecked="Grid_Unchecked" Background="#3d3d3d" Foreground="#FFE6E6E6"/>
</MenuItem>
<MenuItem Header="E_xport">
<!-- <MenuItem Header="Set export path" Click="SetExportPath_Clicked" Background="#3d3d3d" Foreground="White"/> -->
<MenuItem Header="Export Textures" IsCheckable="True" IsChecked="True" Checked="ExportTextures_Checked" Unchecked="ExportTextures_Unchecked" Background="#3d3d3d" Foreground="#FFE6E6E6"/>
<MenuItem Header="Export current model" Click="Export_Clicked" Background="#3d3d3d" Foreground="#FFE6E6E6"/>
<MenuItem Header="Export All" Click="ExportAll_Clicked" Background="#3d3d3d" Foreground="#FFE6E6E6"/>
</MenuItem>
<MenuItem Header="Version" Background="#3d3d3d" Foreground="#FFE6E6E6">
<!-- cant customize radio buttons? -->
<RadioButton GroupName="Mode" x:Name="Destiny1" Margin="5" Checked="HandleVersionCheck" Content="Destiny 1" />
<RadioButton GroupName="Mode" x:Name="Destiny2BL" Margin="5" Checked="HandleVersionCheck" Content="D2 Beyond Light"/>
<RadioButton GroupName="Mode" x:Name="Destiny2PreBL" Margin="5" Checked="HandleVersionCheck" Content="D2 Pre-Beyond Light"/>
</MenuItem>
</Menu>
<Menu x:Name="modesmenu" Grid.ColumnSpan="2" Grid.Column="0" Background="#3d3d3d" Foreground="#FFE6E6E6" BorderBrush="#3d3d3d" >
<MenuItem Header="PKGs" Focusable="False" IsCheckable="True" IsChecked="False" BorderThickness="1" BorderBrush="#FFE6E6E6" Background="#3d3d3d" Foreground="#FFE6E6E6" Height="21" Width="90"/>
<MenuItem Header="API" Focusable="False" IsCheckable="True" IsChecked="False" BorderThickness="1" BorderBrush="#FFE6E6E6" Background="#3d3d3d" Foreground="#FFE6E6E6" Height="21" Width="90"/>
<MenuItem Header="Maps" Focusable="False" IsCheckable="True" IsChecked="False" BorderThickness="1" BorderBrush="#FFE6E6E6" Background="#3d3d3d" Foreground="#FFE6E6E6" Height="21" Width="90"/>
</Menu>
<Menu x:Name="searchbar" Grid.ColumnSpan="1" Grid.Column="2" Background="#3d3d3d" Foreground="#FFE6E6E6" BorderBrush="#3d3d3d" Margin="160,0,0,0" >
</Menu>
<ScrollViewer Background="#3d3d3d" Name="ScrollView" Grid.RowSpan="2" HorizontalAlignment="Center" Width="320" Grid.ColumnSpan="2" Focusable="False" Grid.Row="1" >
<StackPanel x:Name="PrimaryList" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Focusable="false">
<ToggleButton x:Name="SelectPkgsDirectoryButton" Style="{StaticResource ButtonStyle}" Content="Select Packages Directory" VerticalAlignment="Center" HorizontalAlignment="Center" Click="SelectPkgsDirectoryButton_Click" Margin="0,512,0,0" Height="30" Width="150"/>
</StackPanel>
</ScrollViewer>
<HelixToolkit:HelixViewport3D ShowFrameRate="True" ZoomExtentsWhenLoaded="True" ZoomAroundMouseDownPoint="False" CameraRotationMode="Turntable" RotateAroundMouseDownPoint="False" IsTopBottomViewOrientedToFrontBack="True" IsViewCubeEdgeClicksEnabled="True" Grid.Row="1" Grid.Column="2" Grid.RowSpan="2">
<HelixToolkit:SunLight/>
<ModelVisual3D x:Name="Yoo" Content="{Binding Model, UpdateSourceTrigger=PropertyChanged}" />
<HelixToolkit:GridLinesVisual3D x:Name="HelixGrid" Width="8" Length="8" MinorDistance="1" MajorDistance="1" Thickness="0.01"/>
</HelixToolkit:HelixViewport3D>
<Grid.Resources>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<HelixToolkit:NotNullToVisibilityConverter x:Key="NotNullToVisibilityConverter" />
<Style TargetType="{x:Type HelixToolkit:HelixViewport3D}">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type HelixToolkit:HelixViewport3D}">
<Border
Background="#121212"
BorderBrush="#121212"
BorderThickness="0">
<Grid FocusVisualStyle="{x:Null}">
<HelixToolkit:CameraController
x:Name="PART_CameraController"
CameraMode="{TemplateBinding CameraMode}"
CameraRotationMode="{TemplateBinding CameraRotationMode}"
ChangeFieldOfViewCursor="{TemplateBinding ChangeFieldOfViewCursor}"
DefaultCamera="{TemplateBinding DefaultCamera}"
InertiaFactor="{TemplateBinding CameraInertiaFactor}"
InfiniteSpin="{TemplateBinding InfiniteSpin}"
IsChangeFieldOfViewEnabled="{TemplateBinding IsChangeFieldOfViewEnabled}"
IsInertiaEnabled="{TemplateBinding IsInertiaEnabled}"
IsMoveEnabled="{TemplateBinding IsMoveEnabled}"
IsPanEnabled="{TemplateBinding IsPanEnabled}"
IsRotationEnabled="{TemplateBinding IsRotationEnabled}"
IsTouchZoomEnabled="{TemplateBinding IsTouchZoomEnabled}"
IsZoomEnabled="{TemplateBinding IsZoomEnabled}"
LeftRightPanSensitivity="{TemplateBinding LeftRightPanSensitivity}"
LeftRightRotationSensitivity="{TemplateBinding LeftRightRotationSensitivity}"
MaximumFieldOfView="{TemplateBinding MaximumFieldOfView}"
MinimumFieldOfView="{TemplateBinding MinimumFieldOfView}"
ModelUpDirection="{TemplateBinding ModelUpDirection}"
PageUpDownZoomSensitivity="{TemplateBinding PageUpDownZoomSensitivity}"
PanCursor="{TemplateBinding PanCursor}"
RotateAroundMouseDownPoint="{TemplateBinding RotateAroundMouseDownPoint}"
RotateCursor="{TemplateBinding RotateCursor}"
RotationSensitivity="{TemplateBinding RotationSensitivity}"
ShowCameraTarget="{TemplateBinding ShowCameraTarget}"
UpDownPanSensitivity="{TemplateBinding UpDownPanSensitivity}"
UpDownRotationSensitivity="{TemplateBinding UpDownRotationSensitivity}"
ZoomAroundMouseDownPoint="{TemplateBinding ZoomAroundMouseDownPoint}"
ZoomCursor="{TemplateBinding ZoomCursor}"
ZoomRectangleCursor="{TemplateBinding ZoomRectangleCursor}"
ZoomSensitivity="{TemplateBinding ZoomSensitivity}">
<HelixToolkit:CameraController.InputBindings>
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:CameraController.ResetCameraCommand}" Gezture="{Binding ResetCameraKeyGesture, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:CameraController.RotateCommand}" Gezture="{Binding RotateGesture, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:CameraController.RotateCommand}" Gezture="{Binding RotateGesture2, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:CameraController.PanCommand}" Gezture="{Binding PanGesture, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:CameraController.PanCommand}" Gezture="{Binding PanGesture2, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:CameraController.ZoomCommand}" Gezture="{Binding ZoomGesture, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:CameraController.ZoomCommand}" Gezture="{Binding ZoomGesture2, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:CameraController.ZoomRectangleCommand}" Gezture="{Binding ZoomRectangleGesture, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:CameraController.ChangeFieldOfViewCommand}" Gezture="{Binding ChangeFieldOfViewGesture, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:CameraController.ChangeLookAtCommand}" Gezture="{Binding ChangeLookAtGesture, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:CameraController.ZoomExtentsCommand}" Gezture="{Binding ZoomExtentsGesture, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:CameraController.ResetCameraCommand}" Gezture="{Binding ResetCameraGesture, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:CameraController.TopViewCommand}" Gezture="{Binding TopViewGesture, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:CameraController.BottomViewCommand}" Gezture="{Binding BottomViewGesture, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:CameraController.LeftViewCommand}" Gezture="{Binding LeftViewGesture, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:CameraController.RightViewCommand}" Gezture="{Binding RightViewGesture, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:CameraController.FrontViewCommand}" Gezture="{Binding FrontViewGesture, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:CameraController.BackViewCommand}" Gezture="{Binding BackViewGesture, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:InputBindingX Command="{x:Static HelixToolkit:HelixViewport3D.OrthographicToggleCommand}" Gezture="{Binding OrthographicToggleGesture, RelativeSource={RelativeSource TemplatedParent}}" />
</HelixToolkit:CameraController.InputBindings>
<Grid x:Name="PART_ViewportGrid">
<AdornerDecorator
x:Name="PART_AdornerLayer"
DataContext="{TemplateBinding DataContext}"
IsHitTestVisible="False" Margin="-4,0,0,0" />
<!-- the main viewport3D is inserted here -->
</Grid>
</HelixToolkit:CameraController>
<!-- Coordinate system -->
<Viewport3D
x:Name="PART_CoordinateView"
Width="{TemplateBinding CoordinateSystemWidth}"
Height="{TemplateBinding CoordinateSystemHeight}"
Margin="0"
HorizontalAlignment="{TemplateBinding CoordinateSystemHorizontalPosition}"
VerticalAlignment="{TemplateBinding CoordinateSystemVerticalPosition}"
ClipToBounds="False"
IsHitTestVisible="False"
Visibility="{TemplateBinding ShowCoordinateSystem,
Converter={StaticResource BooleanToVisibilityConverter}}">
<HelixToolkit:ArrowVisual3D Fill="#964B4B" Point2="8 0 0" />
<HelixToolkit:ArrowVisual3D Fill="#4B964B" Point2="0 8 0" />
<HelixToolkit:ArrowVisual3D Fill="#4B4B96" Point2="0 0 8" />
<HelixToolkit:BillboardTextVisual3D
Foreground="{Binding CoordinateSystemLabelForeground, RelativeSource={RelativeSource TemplatedParent}}"
Position="10 0 0"
Text="{Binding CoordinateSystemLabelX, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:BillboardTextVisual3D
Foreground="{Binding CoordinateSystemLabelForeground, RelativeSource={RelativeSource TemplatedParent}}"
Position="0 10 0"
Text="{Binding CoordinateSystemLabelY, RelativeSource={RelativeSource TemplatedParent}}" />
<HelixToolkit:BillboardTextVisual3D
Foreground="{Binding CoordinateSystemLabelForeground, RelativeSource={RelativeSource TemplatedParent}}"
Position="0 0 10"
Text="{Binding CoordinateSystemLabelZ, RelativeSource={RelativeSource TemplatedParent}}" />
<!--<local:PieSliceVisual3D Normal="1,0,0" UpVector="0,0,1" InnerRadius="3" OuterRadius="6" Fill="#80ff0000"/>
<local:PieSliceVisual3D Normal="0,1,0" UpVector="1,0,0" InnerRadius="3" OuterRadius="6" Fill="#8000ff00"/>
<local:PieSliceVisual3D Normal="0,0,1" UpVector="0,1,0" InnerRadius="3" OuterRadius="6" Fill="#800000ff"/>-->
</Viewport3D>
<Grid IsHitTestVisible="False">
<!-- Titles -->
<StackPanel
Margin="5"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Background="{TemplateBinding TitleBackground}">
<TextBlock
FontFamily="{TemplateBinding TitleFontFamily}"
FontSize="{TemplateBinding TitleSize}"
FontWeight="Bold"
Foreground="{TemplateBinding TextBrush}"
Text="{TemplateBinding Title}"
Visibility="{TemplateBinding Title,
Converter={StaticResource NotNullToVisibilityConverter}}" />
<TextBlock
FontFamily="{TemplateBinding TitleFontFamily}"
FontSize="{TemplateBinding SubTitleSize}"
Foreground="{TemplateBinding TextBrush}"
Text="{TemplateBinding SubTitle}"
Visibility="{TemplateBinding SubTitle,
Converter={StaticResource NotNullToVisibilityConverter}}" />
</StackPanel>
<StackPanel
Margin="6"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Background="{TemplateBinding InfoBackground}">
<TextBlock
Padding="4"
HorizontalAlignment="Left"
Foreground="{TemplateBinding InfoForeground}"
Text="{TemplateBinding FrameRateText}"
Visibility="{TemplateBinding ShowFrameRate,
Converter={StaticResource BooleanToVisibilityConverter}}" />
<TextBlock
Padding="4"
HorizontalAlignment="Right"
Foreground="{TemplateBinding InfoForeground}"
Text="{TemplateBinding FieldOfViewText}"
Visibility="{TemplateBinding ShowFieldOfView,
Converter={StaticResource BooleanToVisibilityConverter}}" />
<TextBlock
HorizontalAlignment="Right"
Foreground="{TemplateBinding InfoForeground}"
Text="{TemplateBinding Status}"
Visibility="{TemplateBinding Status,
Converter={StaticResource NotNullToVisibilityConverter}}" />
</StackPanel>
<StackPanel
Margin="6"
HorizontalAlignment="Left"
VerticalAlignment="Bottom"
Background="{TemplateBinding InfoBackground}">
<TextBlock
Padding="4"
Foreground="{TemplateBinding InfoForeground}"
Text="{TemplateBinding CameraInfo}"
Visibility="{TemplateBinding ShowCameraInfo,
Converter={StaticResource BooleanToVisibilityConverter}}" />
<TextBlock
Padding="4"
Foreground="{TemplateBinding InfoForeground}"
Text="{TemplateBinding TriangleCountInfo}"
Visibility="{TemplateBinding ShowTriangleCountInfo,
Converter={StaticResource BooleanToVisibilityConverter}}" />
<TextBlock
Foreground="{TemplateBinding InfoForeground}"
Text="{TemplateBinding DebugInfo}"
Visibility="{TemplateBinding DebugInfo,
Converter={StaticResource NotNullToVisibilityConverter}}" />
</StackPanel>
</Grid>
<Viewport3D
x:Name="PART_ViewCubeViewport"
Width="{TemplateBinding ViewCubeWidth}"
Height="{TemplateBinding ViewCubeHeight}"
Margin="0"
HorizontalAlignment="{TemplateBinding ViewCubeHorizontalPosition}"
VerticalAlignment="{TemplateBinding ViewCubeVerticalPosition}"
Opacity="0.5"
Visibility="{TemplateBinding ShowViewCube,
Converter={StaticResource BooleanToVisibilityConverter}}">
<HelixToolkit:ViewCubeVisual3D
x:Name="PART_ViewCube"
BackText="{Binding ViewCubeBackText, RelativeSource={RelativeSource TemplatedParent}}"
BottomText="{Binding ViewCubeBottomText, RelativeSource={RelativeSource TemplatedParent}}"
EnableEdgeClicks="{Binding IsViewCubeEdgeClicksEnabled, RelativeSource={RelativeSource TemplatedParent}}"
FrontText="{Binding ViewCubeFrontText, RelativeSource={RelativeSource TemplatedParent}}"
IsEnabled="{Binding IsRotationEnabled, RelativeSource={RelativeSource TemplatedParent}}"
IsTopBottomViewOrientedToFrontBack="{Binding IsTopBottomViewOrientedToFrontBack, RelativeSource={RelativeSource TemplatedParent}}"
LeftText="{Binding ViewCubeLeftText, RelativeSource={RelativeSource TemplatedParent}}"
ModelUpDirection="{Binding ModelUpDirection, RelativeSource={RelativeSource TemplatedParent}}"
RightText="{Binding ViewCubeRightText, RelativeSource={RelativeSource TemplatedParent}}"
TopText="{Binding ViewCubeTopText, RelativeSource={RelativeSource TemplatedParent}}" />
</Viewport3D>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Grid.Resources>
</Grid>
</Window>