190 lines
6.5 KiB
VB.net
190 lines
6.5 KiB
VB.net
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
|