-
Notifications
You must be signed in to change notification settings - Fork 1
/
MDLViewer.xaml
69 lines (66 loc) · 3.93 KB
/
MDLViewer.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
<UserControl x:Class="MDLUtility2.MDLViewer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Height="402" Width="363" Background="Gray">
<Grid x:Name="mainGrid" ShowGridLines="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition MaxWidth="0"></ColumnDefinition>
<ColumnDefinition Width="auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid x:Name="myGrid" Grid.Column="0" MouseMove="mainViewport_MouseMove" MouseWheel="mainViewport_MouseWheel" Focusable="True" MouseUp="UserControl_MouseUp">
<Viewport3D Name="mainViewport" ClipToBounds="True" Focusable="True" IsHitTestVisible="True" DockPanel.Dock="Top">
<Viewport3D.Camera>
<PerspectiveCamera
LookDirection="-11,-10,-9"
UpDirection="0,1,0"
Position="11,10,9"
FieldOfView="70" />
</Viewport3D.Camera>
<Viewport3D.Children>
<ModelVisual3D x:Name="lightsModel">
<ModelVisual3D.Children>
<ModelVisual3D>
<ModelVisual3D.Content>
<AmbientLight x:Name="ambLight" Color="DarkGray"/>
</ModelVisual3D.Content>
</ModelVisual3D>
<ModelVisual3D>
<ModelVisual3D.Content>
<DirectionalLight x:Name="dirLight" Color="White" Direction="0,-1,-1" />
</ModelVisual3D.Content>
</ModelVisual3D>
</ModelVisual3D.Children>
</ModelVisual3D>
</Viewport3D.Children>
</Viewport3D>
</Grid>
<Canvas x:Name="hiddenCanvas" Grid.Column="1">
<ScrollViewer x:Name="scrollToolBox" Visibility="Hidden" Canvas.Top="3" Canvas.Right="22" Height="{Binding ElementName=hiddenCanvas,Path=Height}" VerticalScrollBarVisibility="Auto" Background="Silver">
<StackPanel x:Name="stackToolBox">
<Expander x:Name="expanderGroups" Header="Display Elements">
<StackPanel>
<CheckBox x:Name="chkLights" Checked="chkLights_Checked" Unchecked="chkLights_Checked">Lights</CheckBox>
<CheckBox x:Name="chkGarages" Checked="chkGarages_Checked" Unchecked="chkGarages_Checked">Garages</CheckBox>
<CheckBox x:Name="chkOther" Checked="chkOther_Checked" Unchecked="chkOther_Checked">Hardpoints</CheckBox>
<CheckBox x:Name="chkBackground" Checked="chkBackground_Checked" Unchecked="chkBackground_Checked">Background</CheckBox>
</StackPanel>
</Expander>
</StackPanel>
</ScrollViewer>
</Canvas>
<Canvas x:Name="SideBar" Grid.Column="2">
<StackPanel x:Name="ButtonPanel" Canvas.Top="0" Canvas.Right="0" >
<ToggleButton x:Name="btnToolBox" Checked="btnToolBox_Checked" Unchecked="btnToolBox_Unchecked">
ToolBox
<ToggleButton.LayoutTransform>
<RotateTransform Angle="90"></RotateTransform>
</ToggleButton.LayoutTransform>
</ToggleButton>
</StackPanel>
</Canvas>
</Grid>
</UserControl>