- Timestamp:
- 02/07/18 14:54:42 (7 years ago)
- Location:
- branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking.Views/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking.Views/3.3/Container3DView.xaml
r15488 r15731 48 48 Unchecked="ShowResidualSpacesCheckBoxOnUnchecked" 49 49 Checked="ShowResidualSpacesCheckBoxOnChecked"/> 50 <TextBlock Name="selectedItemTextBlock" 51 Margin="10,6,0,0" 52 VerticalAlignment="Top" 53 HorizontalAlignment="Left" 54 Text="Gegenstand:"/> 50 55 </StackPanel> 51 <Border BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Margin="0, 52,0,0">56 <Border BorderThickness="1" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Margin="0,70,0,0"> 52 57 <Viewport3D Name="viewport3D1" Margin="0,-1,0,0" > 53 58 <Viewport3D.Camera> 54 <PerspectiveCamera x:Name="camMain" Position="0.5 8 8" LookDirection="0 -1 -1"> <!-- camera position for design time--> 59 <PerspectiveCamera x:Name="camMain" Position="0.5 8 8" LookDirection="0 -1 -1"> 60 <!-- camera position for design time--> 55 61 </PerspectiveCamera> 56 62 </Viewport3D.Camera> -
branches/2817-BinPackingSpeedup/HeuristicLab.Problems.BinPacking.Views/3.3/Container3DView.xaml.cs
r15705 r15731 119 119 } 120 120 121 private void DisplaySelectedItemText() { 122 string text = ""; 123 if (selectedItemKey < 0) { 124 text = $"{packing.BinShape.ToString()}"; 125 } else { 126 var packingItem = packing.Items.Single(x => selectedItemKey == x.Key); 127 var position = packing.Positions.Single(x => x.Key == packingItem.Key); 128 text = $"{packingItem.Value.ToString()}, {position.ToString()}"; 129 if (packing is BinPacking3D.BinPacking3D) { 130 var stackedWeight = ((BinPacking3D.BinPacking3D)packing).GetStackedWeightForItemId(packingItem.Key); 131 text += $", stacked weight: {stackedWeight}"; 132 } 133 } 134 selectedItemTextBlock.Text = text; 135 } 136 121 137 private void UpdateVisualization() { 122 138 Clear(); … … 126 142 var modelGroup = (Model3DGroup)MyModel.Content; 127 143 var hiddenMaterial = new DiffuseMaterial(new SolidColorBrush(hiddenColor)); 144 145 DisplaySelectedItemText(); 128 146 129 147 if (selectedItemKey >= 0) {
Note: See TracChangeset
for help on using the changeset viewer.