Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/HeuristicLab.Problems.BinPacking.Views/3.3/Container3DView.xaml @ 17604

Last change on this file since 17604 was 15167, checked in by jkarder, 7 years ago

#2739: improved 3d visualization

  • in UpdateVisualization, no materials are available after Clear, therefore TryGetValue is unnecessary
  • removed unnecessary ctrlDown field and OnKeyDown event handler
File size: 3.6 KB
Line 
1<!--
2/* HeuristicLab
3 * Copyright (C) 2002-2016 Joseph Helm and Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see<http://www.gnu.org/licenses/> .
19 */
20-->
21
22<UserControl x:Class="HeuristicLab.Problems.BinPacking.Views.Container3DView"
23             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
24             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
25             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
26             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
27             mc:Ignorable="d"
28             d:DesignHeight="300" d:DesignWidth="300"
29             MouseMove="Container3DView_MouseMove" MouseDown="Container3DView_MouseDown" MouseUp="Container3DView_MouseUp"
30             MouseWheel="Container3DView_OnMouseWheel"
31             MouseEnter="Container3DView_OnMouseEnter"
32             Focusable="true"
33             >
34    <Grid>
35        <Border BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
36            <Viewport3D Name="viewport3D1" >
37                <Viewport3D.Camera>
38                    <PerspectiveCamera x:Name="camMain" Position="0.5 8 8" LookDirection="0 -1 -1"> <!-- camera position for design time-->
39                    </PerspectiveCamera>
40                </Viewport3D.Camera>
41                <ModelVisual3D>
42                    <ModelVisual3D.Content>
43                        <DirectionalLight x:Name="dirLightMain" Direction="0,-1,-1"/>
44                    </ModelVisual3D.Content>
45                </ModelVisual3D>
46                <ModelVisual3D>
47                </ModelVisual3D>
48                <ModelVisual3D x:Name="MyModel">
49                    <ModelVisual3D.Content>
50                        <Model3DGroup>
51                        </Model3DGroup>
52                    </ModelVisual3D.Content>
53                    <ModelVisual3D.Transform>
54                        <Transform3DGroup>
55                            <ScaleTransform3D x:Name="scale" ScaleX="1" ScaleY="1" ScaleZ="1"/>
56                            <RotateTransform3D x:Name="rotateX">
57                                <RotateTransform3D.Rotation>
58                                    <AxisAngleRotation3D Axis="0 1 0"/>
59                                </RotateTransform3D.Rotation>
60                            </RotateTransform3D>
61                            <RotateTransform3D x:Name="rotateY">
62                                <RotateTransform3D.Rotation>
63                                    <AxisAngleRotation3D Axis="1 0 0"/>
64                                </RotateTransform3D.Rotation>
65                            </RotateTransform3D>
66                            <ScaleTransform3D x:Name="scaleZoom" ScaleX="1" ScaleY="1" ScaleZ="1"/>
67                        </Transform3DGroup>
68                    </ModelVisual3D.Transform>
69                </ModelVisual3D>
70            </Viewport3D>
71        </Border>
72    </Grid>
73</UserControl>
Note: See TracBrowser for help on using the repository browser.