-aggiunto pulsanti vista a scena assemblato

This commit is contained in:
Demetrio Cassarino
2025-10-16 16:43:13 +02:00
parent a64e93c866
commit 29246fb70c
7 changed files with 228 additions and 10 deletions
@@ -219,10 +219,14 @@
<Compile Include="SceneHost\SceneHostV.xaml.vb">
<DependentUpon>SceneHostV.xaml</DependentUpon>
</Compile>
<Compile Include="SceneShowBulding\SceneBuildingV.xaml.vb">
<DependentUpon>SceneBuildingV.xaml</DependentUpon>
</Compile>
<Compile Include="SceneShowBulding\SceneShowBuldingV.xaml.vb">
<DependentUpon>SceneShowBuldingV.xaml</DependentUpon>
</Compile>
<Compile Include="SceneShowBulding\SceneShowBuldingVM.vb" />
<Compile Include="SceneShowBulding\ViewPanelShowBuildingVM.vb" />
<Compile Include="SetUp\SetUpSupportClass.vb" />
<Compile Include="SetUp\SetUpV.xaml.vb">
<DependentUpon>SetUpV.xaml</DependentUpon>
@@ -735,6 +739,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SceneShowBulding\SceneBuildingV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SceneShowBulding\SceneShowBuldingV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -148,7 +148,7 @@
</UniformGrid>
</Grid>
<Border Grid.ColumnSpan="2" Margin="10,5,10,5" Background="{StaticResource BeamWall_Glacier}" Style="{StaticResource OnlyProdPage_Border}">
<TextBlock Grid.ColumnSpan="2"
Text="{Binding BTLStructureVM.SelBTLPart.sNAM}"
@@ -233,11 +233,12 @@
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>-->
<EgtBEAMWALL:SceneShowBuldingV Grid.Row="1"
Grid.Column="2"
Grid.RowSpan="4"
Margin="4,0,4,0"
Visibility="{Binding DataContext.SceneShowBuldingVisibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
<EgtBEAMWALL:SceneBuildingV Grid.Row="1"
Grid.Column="2"
Grid.RowSpan="4"
Margin="4,0,4,0"
Visibility="{Binding DataContext.SceneShowBuldingVisibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:OnlyProdProjectV}}}"/>
<!--</Grid>-->
<GridSplitter Grid.Row="2"
@@ -0,0 +1,19 @@
<UserControl x:Class="SceneBuildingV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtBEAMWALL="clr-namespace:EgtBEAMWALL.Optimizer">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<WrapPanel Grid.Column="1" Margin="0,2,2,0"
Width="{Binding ActualWidth, ElementName=TOPTRAY}"
Style="{StaticResource OnlyProdProject_WrapPanel}">
<EgtBEAMWALL:OnlyProdViewPanelV DataContext="{StaticResource ViewPanelShowBuildingVM}"/>
</WrapPanel>
<EgtBEAMWALL:SceneShowBuldingV />
</Grid>
</UserControl>
@@ -0,0 +1,3 @@
Public Class SceneBuildingV
End Class
@@ -1,7 +1,4 @@
Imports System.Windows.Threading
Imports EgtUILib
Public Class SceneShowBuldingV
Public Class SceneShowBuldingV
#Region "FIELDS & PROPERTIES"
@@ -0,0 +1,189 @@
Imports EgtBEAMWALL.Core.ConstBeam
Imports EgtUILib
Imports EgtWPFLib5
Public Class ViewPanelShowBuildingVM
Inherits EgtWPFLib5.ViewPanelVM
#Region "FIELDS & PROPERTIES"
' Tipo di progetto aperto
Private Shared m_Type As BWType
Public Shared ReadOnly Property Type As BWType
Get
Return m_Type
End Get
End Property
' Posizione vista
Private Shared m_nViewDir As VT = VT.ISO_SW
' Definzione Comandi
Private m_ZoomAllCommandCmd As ICommand
#End Region ' Fields & Properties
#Region "METHODS"
Public Shared Sub BWSetView(nView As VT, Optional bRedraw As Boolean = True)
Select Case nView
Case VT.TOP
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(0, -90, bRedraw) ' equivalente a vista TOP
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(0, 90, bRedraw) ' equivalente a vista TOP ruotata di 180 su Z
End Select
Case VT.FRONT
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(90, -90, bRedraw) ' equivalente a vista FRONT
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(90, 90, bRedraw) ' equivalente a vista FRONT ruotata di 180 su Z
End Select
Case VT.BACK
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(-90, -90, bRedraw) ' equivalente a vista BACK
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(-90, 90, bRedraw) ' equivalente a vista BACK ruotata di 180 su Z
End Select
Case VT.RIGHT
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(90, 0, bRedraw) ' equivalente a vista RIGHT
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(-90, 0, bRedraw) ' equivalente a vista RIGHT ruotata di 180 su Z
End Select
Case VT.LEFT
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(-90, 0, bRedraw) ' equivalente a vista LEFT
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(90, 0, bRedraw) ' equivalente a vista LEFT ruotata di 180 su Z
End Select
Case VT.ISO_SW
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(60, 225, bRedraw) ' equivalente a vista ISO_SW
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(60, 45, bRedraw) ' equivalente a vista ISO_SW ruotata di 180 su Z
End Select
Case Else ' VT.ISO_SW
Select Case m_nViewDir
Case VT.ISO_SW, VT.ISO_SE
EgtSetGenericView(60, 225, bRedraw) ' equivalente a vista ISO_SW
Case VT.ISO_NW, VT.ISO_NE
EgtSetGenericView(60, 45, bRedraw) ' equivalente a vista ISO_SW ruotata di 180 su Z
End Select
End Select
'End Select
End Sub
Public Shared Sub UpdateMachParam(ViewDir As VT)
m_nViewDir = ViewDir
End Sub
Public Shared Sub UpdateBWType(Type As BWType)
m_Type = Type
End Sub
#End Region ' Methods
#Region "COMMANDS"
#Region "ZoomAllCommand"
Public Overloads ReadOnly Property ZoomAllCommand As ICommand
Get
If m_ZoomAllCommandCmd Is Nothing Then
m_ZoomAllCommandCmd = New Command(AddressOf ZoomAll)
End If
Return m_ZoomAllCommandCmd
End Get
End Property
Public Overloads Sub ZoomAll(param As Object)
' Setto il nuovo contesto
EgtSetCurrentContext(Map.refSceneShowBuldingVM.SceneShowBulding.GetCtx())
EgtZoom(ZM.ALL)
' Ritorno al contesto corrente
EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
End Sub
#End Region ' ZoomAllCommand
#Region "TopViewCommand"
Public Overrides Sub TopView(param As Object)
' Setto il nuovo contesto
EgtSetCurrentContext(Map.refSceneShowBuldingVM.SceneShowBulding.GetCtx())
ViewPanelShowBuildingVM.BWSetView(VT.TOP, True)
' Ritorno al contesto corrente
EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
End Sub
#End Region ' TopViewCommand
#Region "FrontViewCommand"
Public Overrides Sub FrontView(param As Object)
' Setto il nuovo contesto
EgtSetCurrentContext(Map.refSceneShowBuldingVM.SceneShowBulding.GetCtx())
ViewPanelShowBuildingVM.BWSetView(VT.FRONT, True)
' Ritorno al contesto corrente
EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
End Sub
#End Region ' FrontViewCommand
#Region "LeftViewCommand"
Public Overrides Sub LeftView(param As Object)
' Setto il nuovo contesto
EgtSetCurrentContext(Map.refSceneShowBuldingVM.SceneShowBulding.GetCtx())
ViewPanelShowBuildingVM.BWSetView(VT.LEFT, True)
' Ritorno al contesto corrente
EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
End Sub
#End Region ' LeftViewCommand
#Region "BackViewCommand"
Public Overrides Sub BackView(param As Object)
' Setto il nuovo contesto
EgtSetCurrentContext(Map.refSceneShowBuldingVM.SceneShowBulding.GetCtx())
ViewPanelShowBuildingVM.BWSetView(VT.BACK, True)
' Ritorno al contesto corrente
EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
End Sub
#End Region ' BackViewCommand
#Region "RightViewCommand"
Public Overrides Sub RightView(param As Object)
' Setto il nuovo contesto
EgtSetCurrentContext(Map.refSceneShowBuldingVM.SceneShowBulding.GetCtx())
ViewPanelShowBuildingVM.BWSetView(VT.RIGHT, True)
' Ritorno al contesto corrente
EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
End Sub
#End Region ' RightViewCommand
#Region "IsoViewSWCommand"
Public Overrides Sub IsoViewSW(param As Object)
' Setto il nuovo contesto
EgtSetCurrentContext(Map.refSceneShowBuldingVM.SceneShowBulding.GetCtx())
ViewPanelShowBuildingVM.BWSetView(VT.ISO_SW, True)
' Ritorno al contesto corrente
EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
End Sub
#End Region ' IsoViewSWCommand
#End Region ' Commands
End Class
@@ -54,6 +54,7 @@
<EgtBEAMWALL:StrategyManagerVM x:Key="StrategyManagerVM"/>
<EgtBEAMWALL:ForcedStrategyPanelVM x:Key="ForcedStrategyPanelVM"/>
<EgtBEAMWALL:GeneralParametersStrategyVM x:Key="GeneralParametersStrategyVM"/>
<EgtBEAMWALL:ViewPanelShowBuildingVM x:Key="ViewPanelShowBuildingVM"/>
<!--<EgtBEAMWALL:ForcedStrategyBTLVM x:Key="ForcedStrategyBTLVM"/>-->
<!--#endregion Panel ViewModel-->