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 | <Viewport3D Name="viewport3D1" >
|
---|
36 | <Viewport3D.Camera>
|
---|
37 | <PerspectiveCamera x:Name="camMain" Position="0.5 8 8" LookDirection="0 -1 -1"> <!-- camera position for design time-->
|
---|
38 | </PerspectiveCamera>
|
---|
39 | </Viewport3D.Camera>
|
---|
40 | <ModelVisual3D>
|
---|
41 | <ModelVisual3D.Content>
|
---|
42 | <DirectionalLight x:Name="dirLightMain" Direction="0,-1,-1"/>
|
---|
43 | </ModelVisual3D.Content>
|
---|
44 | </ModelVisual3D>
|
---|
45 | <ModelVisual3D>
|
---|
46 | </ModelVisual3D>
|
---|
47 | <ModelVisual3D x:Name="MyModel">
|
---|
48 | <ModelVisual3D.Content>
|
---|
49 | <Model3DGroup>
|
---|
50 | <GeometryModel3D>
|
---|
51 | <GeometryModel3D.Geometry>
|
---|
52 | <!-- two opaque cubes, one in front one in back-->
|
---|
53 | <MeshGeometry3D x:Name="meshMain"
|
---|
54 | Positions="0 0 -2.5 1 0 -2.5 0 1 -2.5 1 1 -2.5 0 0 -1.5 1 0 -1.5 0 1 -1.5 1 1 -1.5
|
---|
55 | 0 0 0 1 0 0 0 1 0 1 1 0 0 0 1 1 0 1 0 1 1 1 1 1"
|
---|
56 | TriangleIndices="10 11 9 10 9 8 15 9 11 15 13 9 14 13 15 14 12 13 14 10 12 10 8 12 10 15 11 10 14 15 0 9 13 8 13 12
|
---|
57 | 2 3 1 2 1 0 7 1 3 7 5 1 6 5 7 6 4 5 6 2 4 2 0 4 2 7 3 2 6 7 0 1 5 0 5 4 ">
|
---|
58 | </MeshGeometry3D>
|
---|
59 | </GeometryModel3D.Geometry>
|
---|
60 | <GeometryModel3D.Material>
|
---|
61 | <DiffuseMaterial>
|
---|
62 | <DiffuseMaterial.Brush>
|
---|
63 | <SolidColorBrush Color="LightGreen"/>
|
---|
64 | </DiffuseMaterial.Brush>
|
---|
65 | </DiffuseMaterial>
|
---|
66 | </GeometryModel3D.Material>
|
---|
67 | </GeometryModel3D>
|
---|
68 | <GeometryModel3D>
|
---|
69 | <GeometryModel3D.Geometry>
|
---|
70 | <!-- two transparent cubes, one in front one in back-->
|
---|
71 | <!-- draw transparent cubes from back to front and always draw outer and inner triangles and draw from front to back-->
|
---|
72 | <MeshGeometry3D x:Name="meshInsides"
|
---|
73 | Positions="-1 -1 -1 2 -1 -1 -1 2 -1 2 2 -1 -1 -1 2 2 -1 2 -1 2 2 2 2 2
|
---|
74 | -1 -1 -3 2 -1 -3 -1 2 -3 2 2 -3 -1 -1 -1 2 -1 -1 -1 2 -1 2 2 -1"
|
---|
75 | TriangleIndices="9 11 10 8 9 10 11 9 15 9 13 15 15 13 14 13 12 14 12 10 14 12 8 10 11 15 10 15 14 10 13 9 8 12 13 8
|
---|
76 | 1 3 2 0 1 2 3 1 7 1 5 7 7 5 6 5 4 6 4 2 6 4 0 2 3 7 2 7 6 2 5 1 0 4 5 0
|
---|
77 | ">
|
---|
78 | </MeshGeometry3D>
|
---|
79 | </GeometryModel3D.Geometry>
|
---|
80 | <GeometryModel3D.Material>
|
---|
81 | <MaterialGroup>
|
---|
82 | <DiffuseMaterial>
|
---|
83 | <DiffuseMaterial.Brush>
|
---|
84 | <SolidColorBrush Opacity="0.1" Color="DarkGray"/>
|
---|
85 | </DiffuseMaterial.Brush>
|
---|
86 | </DiffuseMaterial>
|
---|
87 | </MaterialGroup>
|
---|
88 | </GeometryModel3D.Material>
|
---|
89 | </GeometryModel3D>
|
---|
90 | <GeometryModel3D>
|
---|
91 | <GeometryModel3D.Geometry>
|
---|
92 | <!-- two transparent cubes, one in front one in back-->
|
---|
93 | <!-- draw transparent cubes from back to front and always draw outer and inner triangles and draw from front to back-->
|
---|
94 | <MeshGeometry3D x:Name="meshTransparent"
|
---|
95 | Positions="-1 -1 -1 2 -1 -1 -1 2 -1 2 2 -1 -1 -1 2 2 -1 2 -1 2 2 2 2 2
|
---|
96 | -1 -1 -3 2 -1 -3 -1 2 -3 2 2 -3 -1 -1 -1 2 -1 -1 -1 2 -1 2 2 -1"
|
---|
97 | TriangleIndices="2 3 1 2 1 0 7 1 3 7 5 1 6 5 7 6 4 5 6 2 4 2 0 4 2 7 3 2 6 7 0 1 5 0 5 4
|
---|
98 | 10 11 9 10 9 8 15 9 11 15 13 9 14 13 15 14 12 13 14 10 12 10 8 12 10 15 11 10 14 15 0 9 13 8 13 12
|
---|
99 | ">
|
---|
100 | </MeshGeometry3D>
|
---|
101 | </GeometryModel3D.Geometry>
|
---|
102 | <GeometryModel3D.Material>
|
---|
103 | <MaterialGroup>
|
---|
104 | <DiffuseMaterial>
|
---|
105 | <DiffuseMaterial.Brush>
|
---|
106 | <SolidColorBrush Opacity="0.1" Color="DarkGray"/>
|
---|
107 | </DiffuseMaterial.Brush>
|
---|
108 | </DiffuseMaterial>
|
---|
109 | </MaterialGroup>
|
---|
110 | </GeometryModel3D.Material>
|
---|
111 | </GeometryModel3D>
|
---|
112 |
|
---|
113 | </Model3DGroup>
|
---|
114 | </ModelVisual3D.Content>
|
---|
115 | <ModelVisual3D.Transform>
|
---|
116 | <Transform3DGroup>
|
---|
117 | <ScaleTransform3D x:Name="scale" ScaleX="1" ScaleY="1" ScaleZ="1"/>
|
---|
118 | <TranslateTransform3D OffsetX="-0.5" OffsetY="-0.5" OffsetZ="-0.5" />
|
---|
119 | <RotateTransform3D>
|
---|
120 | <RotateTransform3D.Rotation>
|
---|
121 | <AxisAngleRotation3D x:Name="rotateX" Axis="0 1 0"/>
|
---|
122 | </RotateTransform3D.Rotation>
|
---|
123 | </RotateTransform3D>
|
---|
124 | <RotateTransform3D>
|
---|
125 | <RotateTransform3D.Rotation>
|
---|
126 | <AxisAngleRotation3D x:Name="rotateY" Axis="1 0 0"/>
|
---|
127 | </RotateTransform3D.Rotation>
|
---|
128 | </RotateTransform3D>
|
---|
129 | <TranslateTransform3D OffsetX="0.5" OffsetY="0.5" OffsetZ="0.5" />
|
---|
130 | <ScaleTransform3D x:Name="scaleZoom" CenterX="0.5" CenterY="0.5" CenterZ="0.5" ScaleX="1" ScaleY="1" ScaleZ="1"/>
|
---|
131 | </Transform3DGroup>
|
---|
132 | </ModelVisual3D.Transform>
|
---|
133 | </ModelVisual3D>
|
---|
134 | </Viewport3D>
|
---|
135 | </Grid>
|
---|
136 | </UserControl>
|
---|