Files
egtbeamwall/EgtBEAMWALL.Optimizer/ShowBeamPanel/ShowBeamPanelVM.vb
T
Demetrio Cassarino 7b4f8529c3 EgtBEAMWALL 3.1.4.6:
-cambiato gestione SetVisibility
-aggiunto su veriifica singolo pezzo disabilita intera riga
2026-04-21 16:55:11 +02:00

202 lines
6.0 KiB
VB.net

Imports EgtUILib
Imports EgtWPFLib5
Imports EgtBEAMWALL.Core
Public Class ShowBeamPanelVM
Inherits VMBase
#Region "FIELDS & PROPERTIES"
Private m_bShowAll As Boolean = True
Friend Property bShowAll As Boolean
Get
Return m_bShowAll
End Get
Set(value As Boolean)
m_bShowAll = value
If m_bShowAll Then
m_ShowSolid_IsEnabled = False
'm_ShowBuilding_IsEnabled = Not IsNothing(Map.refProjectVM.BTLStructureVM) AndAlso Map.refProjectVM.BTLStructureVM.BTLStructureM.nAsseBaseId <> GDB_ID.NULL
Else
m_ShowSolid_IsEnabled = True
'm_ShowBuilding_IsEnabled = False
End If
UpdatePartBtnIsEnabled()
NotifyPropertyChanged(NameOf(ShowSolid_IsEnabled))
NotifyPropertyChanged(NameOf(ShowBuilding_IsEnabled))
NotifyPropertyChanged(NameOf(ShowAll_Visibility))
End Set
End Property
Private m_bShowSolid As Boolean
Public Property ShowSolid_IsChecked As Boolean
Get
Return m_bShowSolid
End Get
Set(value As Boolean)
m_bShowSolid = value
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, m_bShowSolid)
End Set
End Property
Friend Sub SetShowSolid(bValue As Boolean)
If m_bShowSolid = bValue Then Return
m_bShowSolid = bValue
NotifyPropertyChanged(NameOf(ShowSolid_IsChecked))
End Sub
Private m_bShowBuilding As Boolean = False
Public Property ShowBuilding_IsChecked As Boolean
Get
Return m_bShowBuilding
End Get
Set(value As Boolean)
m_bShowBuilding = value
If m_bShowBuilding Then
Map.refSceneShowBuldingVM.SceneShowBulding.Enable(True)
Map.refProjectVM.SetSceneShowBuldingVisibility(True)
Map.refProjectVM.SetManagerTabVisibility(False)
Map.refProjectVM.SetFeatureListVisibility(False)
Map.refOptimizePanelVM.SetOptimizePanelIsEnabled(False)
Else
EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
Map.refProjectVM.SetSceneShowBuldingVisibility(False)
Map.refProjectVM.SetManagerTabVisibility(True)
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then Map.refProjectVM.SetFeatureListVisibility(False)
Map.refOptimizePanelVM.SetOptimizePanelIsEnabled(True)
End If
NotifyPropertyChanged(NameOf(ShowBuilding_IsChecked))
End Set
End Property
Friend Sub SetShowBuilding(bValue As Boolean)
m_bShowBuilding = bValue
NotifyPropertyChanged(NameOf(ShowBuilding_IsChecked))
End Sub
Private m_ShowAll_IsEnabled As Boolean = True
Public Property ShowAll_IsEnabled As Boolean
Get
Return m_ShowAll_IsEnabled
End Get
Set(value As Boolean)
m_ShowAll_IsEnabled = value
End Set
End Property
Friend Sub SetShowAll_IsEnabled(bValue As Boolean)
m_ShowAll_IsEnabled = bValue
NotifyPropertyChanged(NameOf(ShowAll_IsEnabled))
End Sub
Private m_ShowSolid_IsEnabled As Boolean
Public Property ShowSolid_IsEnabled As Boolean
Get
Return m_ShowSolid_IsEnabled
End Get
Set(value As Boolean)
m_ShowSolid_IsEnabled = value
End Set
End Property
Friend Sub SetShowSolid_IsEnabled(bValue As Boolean)
m_ShowSolid_IsEnabled = bValue
NotifyPropertyChanged(NameOf(ShowSolid_IsEnabled))
End Sub
Private m_ShowBuilding_IsEnabled As Boolean = True
Public Property ShowBuilding_IsEnabled As Boolean
Get
Return m_ShowBuilding_IsEnabled
End Get
Set(value As Boolean)
m_ShowBuilding_IsEnabled = value
NotifyPropertyChanged(NameOf(ShowBuilding_IsEnabled))
End Set
End Property
Public ReadOnly Property ShowAll_Visibility As Visibility
Get
Return If(Map.refMainMenuVM.SelPage = Pages.VIEW, Visibility.Visible, Visibility.Collapsed)
End Get
End Property
#Region "ToolTip"
Public ReadOnly Property ShowAll_ToolTip As String
Get
Return EgtMsg(61925)
End Get
End Property
Public ReadOnly Property ShowSolid_ToolTip As String
Get
Return EgtMsg(61926)
End Get
End Property
Public ReadOnly Property ShowBuilding_ToolTip As String
Get
Return EgtMsg(61927)
End Get
End Property
#End Region
' Definizione comandi
Private m_cmdShowAll As ICommand
#End Region ' FIELDS & PROPERTIES
#Region "CONSTRUCTOR"
Sub New()
'Creo riferimento a questa classe in EgtBeamWALL
Map.SetRefShowBeamPanelVM(Me)
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Private Sub UpdatePartBtnIsEnabled()
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.PartShowAllChanged()
If Not IsNothing(Map.refBTLPartManagerVM) Then Map.refBTLPartManagerVM.PartShowAllChanged()
End Sub
#End Region ' METHODS
#Region "COMMANDS"
#Region "ShowAll"
Public ReadOnly Property ShowAll_Command As ICommand
Get
If m_cmdShowAll Is Nothing Then
m_cmdShowAll = New Command(AddressOf ShowAllCmd)
End If
Return m_cmdShowAll
End Get
End Property
Public Sub ShowAllCmd()
ShowAll(True)
End Sub
Public Sub ShowAll(bDraw As Boolean)
If IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
' se necessario tolgo solido dal precedentemente selezionato
If Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLPart) AndAlso m_bShowSolid Then
Map.refShowBeamPanelVM.SetShowSolid(False)
Map.refProjectVM.BTLStructureVM.ShowSolid(GDB_ID.NULL, False, False)
End If
' mostro tutti i pezzi
Map.refProjectVM.BTLStructureVM.ShowAll(False)
' deseleziono tutto
Map.refProjectVM.BTLStructureVM.SelBTLParts.Clear()
' se attivata opzione, li assemblo
Map.refProjectVM.BTLStructureVM.ShowBuilding(ShowBuilding_IsChecked, False)
If bDraw Then EgtDraw()
End Sub
#End Region ' ShowAll
#End Region ' COMMANDS
End Class