Imports EgtBEAMWALL.Core.ConstBeam Imports EgtUILib Public Class ViewPanelVM Inherits EgtWPFLib5.ViewPanelVM ' 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 Public Shared Function BWSetView(nView As VT, Optional bRedraw As Boolean = True) ' condizioni che cambiano la vista del progetto Select Case m_Type Case BWType.BEAM Select Case nView Case VT.TOP EgtSetView(VT.TOP, bRedraw) Case VT.FRONT EgtSetView(VT.FRONT, bRedraw) Case VT.BACK EgtSetView(VT.BACK, bRedraw) Case VT.RIGHT EgtSetView(VT.RIGHT, bRedraw) Case VT.LEFT EgtSetView(VT.LEFT, bRedraw) Case VT.ISO_SW EgtSetView(VT.ISO_SW, bRedraw) Case Else ' VT.ISO_SW EgtSetView(VT.ISO_SW, bRedraw) End Select Case BWType.WALL 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 Function Public Shared Sub UpdateMachParam(ViewDir As VT) m_nViewDir = ViewDir End Sub Public Shared Sub UpdateBWType(Type As BWType) m_Type = Type End Sub #Region "COMMANDS" #Region "TopViewCommand" ''' ''' Execute the TopView. This method is invoked by the TopViewCommand. ''' Public Overrides Sub TopView(ByVal param As Object) ViewPanelVM.BWSetView(VT.TOP, True) End Sub #End Region ' TopViewCommand #Region "FrontViewCommand" ''' ''' Execute the FrontView. This method is invoked by the FrontViewCommand. ''' Public Overrides Sub FrontView(ByVal param As Object) ViewPanelVM.BWSetView(VT.FRONT, True) End Sub #End Region ' FrontViewCommand #Region "LeftViewCommand" ''' ''' Execute the LeftView. This method is invoked by the LeftViewCommand. ''' Public Overrides Sub LeftView(ByVal param As Object) ViewPanelVM.BWSetView(VT.LEFT, True) End Sub #End Region ' LeftViewCommand #Region "BackViewCommand" ''' ''' Execute the BackView. This method is invoked by the BackViewCommand. ''' Public Overrides Sub BackView(ByVal param As Object) ViewPanelVM.BWSetView(VT.BACK, True) End Sub #End Region ' BackViewCommand #Region "RightViewCommand" ''' ''' Execute the RightView. This method is invoked by the RightViewCommand. ''' Public Overrides Sub RightView(ByVal param As Object) ViewPanelVM.BWSetView(VT.RIGHT, True) End Sub #End Region ' RightViewCommand '#Region "IsoViewSECommand" ' ''' ' ''' Returns a command that do IsoViewSE. ' ''' ' Public ReadOnly Property IsoViewSECommand As ICommand ' Get ' If m_cmdIsoViewSE Is Nothing Then ' m_cmdIsoViewSE = New Command(AddressOf IsoViewSE) ' End If ' Return m_cmdIsoViewSE ' End Get ' End Property ' ''' ' ''' Execute the IsoViewSE. This method is invoked by the IsoViewSECommand. ' ''' ' Public Sub IsoViewSE(ByVal param As Object) ' LibMap.refSceneHostVM.MainScene.IsoViewSE() ' End Sub '#End Region ' IsoViewSECommand #Region "IsoViewSWCommand" ''' ''' Execute the IsoViewSW. This method is invoked by the IsoViewSWCommand. ''' Public Overrides Sub IsoViewSW(ByVal param As Object) ViewPanelVM.BWSetView(VT.ISO_SW, True) End Sub #End Region ' IsoViewSWCommand '#Region "IsoViewNECommand" ' ''' ' ''' Returns a command that do IsoViewNE. ' ''' ' Public ReadOnly Property IsoViewNECommand As ICommand ' Get ' If m_cmdIsoViewNE Is Nothing Then ' m_cmdIsoViewNE = New Command(AddressOf IsoViewNE) ' End If ' Return m_cmdIsoViewNE ' End Get ' End Property ' ''' ' ''' Execute the IsoViewNE. This method is invoked by the IsoViewNECommand. ' ''' ' Public Sub IsoViewNE(ByVal param As Object) ' LibMap.refSceneHostVM.MainScene.IsoViewNE() ' End Sub '#End Region ' IsoViewNECommand '#Region "IsoViewNWCommand" ' ''' ' ''' Returns a command that do IsoViewNW. ' ''' ' Public ReadOnly Property IsoViewNWCommand As ICommand ' Get ' If m_cmdIsoViewNW Is Nothing Then ' m_cmdIsoViewNW = New Command(AddressOf IsoViewNW) ' End If ' Return m_cmdIsoViewNW ' End Get ' End Property ' ''' ' ''' Execute the IsoViewNW. This method is invoked by the IsoViewNWCommand. ' ''' ' Public Sub IsoViewNW(ByVal param As Object) ' LibMap.refSceneHostVM.MainScene.IsoViewNW() ' End Sub '#End Region ' IsoViewNWCommand '#Region "ViewToCPlaneCommand" ' ''' ' ''' Returns a command that do GetDist. ' ''' ' Public ReadOnly Property ViewToCPlaneCommand As ICommand ' Get ' If m_cmdViewToCPlane Is Nothing Then ' m_cmdViewToCPlane = New Command(AddressOf ViewToCPlane) ' End If ' Return m_cmdViewToCPlane ' End Get ' End Property ' ''' ' ''' Execute the GetDist. This method is invoked by the GetDistCommand. ' ''' ' Public Sub ViewToCPlane(ByVal param As Object) ' LibMap.refSceneHostVM.MainScene.CPlaneView() ' End Sub '#End Region ' ViewToCPlaneCommand #End Region ' COMMANDS End Class