diff --git a/EgtBEAMWALL.Core/BTLModel/BTLStructureM.vb b/EgtBEAMWALL.Core/BTLModel/BTLStructureM.vb index 57140ec8..dc575c21 100644 --- a/EgtBEAMWALL.Core/BTLModel/BTLStructureM.vb +++ b/EgtBEAMWALL.Core/BTLModel/BTLStructureM.vb @@ -547,8 +547,8 @@ Public Class BTLStructureM ' recupero i part - If Not bIsLayersWall Then NewBTLStructure.m_BTLPartMList = LoadParts(ProjId) - 'NewBTLStructure.m_BTLPartMList = LoadParts(ProjId) + 'If Not bIsLayersWall Then NewBTLStructure.m_BTLPartMList = LoadParts(ProjId) + NewBTLStructure.m_BTLPartMList = LoadParts(ProjId) 'Dim nPartId As Integer = EgtGetFirstPart() 'While nPartId <> GDB_ID.NULL diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLElementVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLElementVM.vb index bc182167..821711bb 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLElementVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLElementVM.vb @@ -19,6 +19,21 @@ Public Class BTLElementVM End Property Private m_BTLStructureM As BTLStructureM + 'Private m_IsSelected As Boolean + 'Public Property IsSelected As Boolean + ' Get + ' Return m_IsSelected + ' End Get + ' Set(value As Boolean) + ' m_IsSelected = value + ' If m_IsSelected Then Map.refProjectVM.BTLStructureVM.SelBTLElementVM = Me + + ' 'Map.refProjectVM.BTLStructureVM.SelBTLLayer.SelBTLPart = Nothing + ' 'Map.refProjectVM.BTLStructureVM.SelBTLPart = Nothing + + ' End Set + 'End Property + Friend WithEvents m_BTLLayerVMList As ObservableCollection(Of BTLLayerVM) Public Overloads ReadOnly Property BTLLayerVMList As ObservableCollection(Of BTLLayerVM) Get diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLLayerVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLLayerVM.vb index 71540f1f..171ca2b6 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLLayerVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLLayerVM.vb @@ -26,7 +26,11 @@ Public Class BTLLayerVM End Get Set(value As Boolean) m_IsSelected = value - Map.refProjectVM.BTLStructureVM.SelBTLLayer = Me + If m_IsSelected Then Map.refProjectVM.BTLStructureVM.SelBTLLayer = Me + + 'Map.refProjectVM.BTLStructureVM.SelBTLLayer.SelBTLPart = Nothing + 'Map.refProjectVM.BTLStructureVM.SelBTLPart = Nothing + End Set End Property @@ -146,7 +150,7 @@ Public Class BTLLayerVM Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False) End If ' seleziono pezzo nella scena - Map.refProjectVM.BTLStructureVM.SceneSelPartSelection() + Map.refProjectVM.BTLStructureVM.SceneSelPartInLayerSelection() 'Map.refProjectVM.BTLStructureVM.SceneSelPartSelection() ' seleziono pezzo in Db geometrico EgtBeamSetPart(m_SelBTLPart.nPartId) ' seleziono pagina BottomPanel diff --git a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb index a62795c0..6d523f75 100644 --- a/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/BTLViewModel/BTLStructureVM.vb @@ -113,20 +113,27 @@ Public Class BTLStructureVM '' carico i Part del Layer selezionato 'BTLPartVMList = Me.BTLPartVMList + ' se c'era un Part selezionato lo deseleziono + SelBTLLayer.SelBTLPart = Nothing ' setto il Layer selezionato come Part selezionato - SelBTLLayer.SelBTLPart = Me.SelBTLLayer + 'SelBTLLayer.SelBTLPart = Me.SelBTLLayer ' se modalità building, la tolgo If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then ShowBuilding(False, False) End If + ' seleziono pezzo nella scena SceneSelPartSelection() ' seleziono pezzo in Db geometrico EgtBeamSetPart(m_SelBTLLayer.nPartId) ' seleziono pagina LayersWallBottomPanel - Map.refBottomPanelVM.SetSelPartFeatureTab(LayersWallBottomPanelVM.PartFeatureTab.PART) + + ' mostro tutti i pezzi + Map.refShowBeamPanelVM.ShowAll(True) + + Map.refLayersWallBottomPanelVM.SetSelPartFeatureTab(LayersWallBottomPanelVM.PartFeatureTab.LAYER) ' mostro barra di gestione pezzo Map.refProjectVM.SetLayersWallPartManager_Visibility(True) Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.LayersWallPartManager_Visibility)) @@ -227,6 +234,26 @@ Public Class BTLStructureVM SceneSelPartSelection() Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False) EgtZoom(ZM.ALL) + ElseIf Map.refMainMenuVM.SelPage = Pages.LAYERSWALL Then + ' se modalità building, la tolgo + If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then + ShowBuilding(False, False) + End If + ' seleziono pezzo nella scena + SceneSelPartSelection() + ' seleziono pezzo in Db geometrico + EgtBeamSetPart(m_SelBTLPart.nPartId) + ' seleziono pagina BottomPanel + Map.refBottomPanelVM.SetSelPartFeatureTab(BottomPanelVM.PartFeatureTab.PART) + ' mostro barra di gestione pezzo + Map.refProjectVM.SetPartManager_Visibility(True) + Map.refProjectVM.NotifyPropertyChanged(NameOf(Map.refProjectVM.PartManager_Visibility)) + ' deseleziono le feature + If Not IsNothing(m_SelBTLPart.SelBTLFeatureVM) Then SelBTLPart.SelBTLFeatureVM = Nothing + ' aggiorno stato selezionato tutto + Map.refShowBeamPanelVM.bShowAll = False + Core.ViewPanelVM.BWSetView(If(Core.ViewPanelVM.Type = BWType.BEAM, VT.ISO_SW, VT.TOP), False) + EgtZoom(ZM.ALL) End If End If NotifyPropertyChanged(NameOf(SelBTLPart)) @@ -900,7 +927,7 @@ Public Class BTLStructureVM Dim DisableMgr As New DisableModifiedMgr ' ciclo sui pezzi For Each Part As BTLPartVM In m_BTLPartVMList - ' se non è quello selezionato, lo nasondo + ' se non è quello selezionato, lo nascondo If Part IsNot m_SelBTLPart Then EgtSetMode(Part.nPartId, GDB_MD.HIDDEN) Else @@ -911,6 +938,26 @@ Public Class BTLStructureVM DisableMgr.ReEnable() End Sub + Friend Sub SceneSelPartInLayerSelection() + ' deseleziono tutto + EgtDeselectAll() + ' disabilito impostazione modificato + Dim DisableMgr As New DisableModifiedMgr + ' ciclo sui pezzi + If Not IsNothing(m_SelBTLLayer.SelBTLPart) Then + For Each Part As BTLPartVM In m_SelBTLLayer.BTLPartVMList + ' se non è quello selezionato, lo nascondo + If Not Part.nPartId = m_SelBTLLayer.SelBTLPart.nPartId Then + EgtSetMode(Part.nPartId, GDB_MD.HIDDEN) + Else + EgtSetMode(Part.nPartId, GDB_MD.STD) + End If + Next + End If + ' ripristino precedente impostazione modificato + DisableMgr.ReEnable() + End Sub + Friend Sub ShowAll(Optional bRedraw As Boolean = True) ' disabilito impostazione modificato Dim DisableMgr As New DisableModifiedMgr @@ -931,7 +978,7 @@ Public Class BTLStructureVM BTLPartIdList.Sort() Dim nGeomPartId As Integer = EgtGetFirstPart() While nGeomPartId <> GDB_ID.NULL - Dim CurrPart As BTLPartVM = BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nGeomPartId) + Dim CurrPart As BTLPartVM = If(Not IsNothing(SelBTLLayer), SelBTLLayer.BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nGeomPartId), BTLPartVMList.FirstOrDefault(Function(x) x.nPartId = nGeomPartId)) If Not IsNothing(CurrPart) Then Dim nMode As Integer EgtGetMode(CurrPart.nPartId, nMode) diff --git a/EgtBEAMWALL.ViewerOptimizer/ElementLayerTreeView/ElementLayerTreeViewV.xaml b/EgtBEAMWALL.ViewerOptimizer/ElementLayerTreeView/ElementLayerTreeViewV.xaml index dbfe7d2f..541dd991 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ElementLayerTreeView/ElementLayerTreeViewV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/ElementLayerTreeView/ElementLayerTreeViewV.xaml @@ -66,6 +66,8 @@ diff --git a/EgtBEAMWALL.ViewerOptimizer/ElementLayerTreeView/ElementLayerTreeViewV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/ElementLayerTreeView/ElementLayerTreeViewV.xaml.vb index 496c0d73..210baeef 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ElementLayerTreeView/ElementLayerTreeViewV.xaml.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ElementLayerTreeView/ElementLayerTreeViewV.xaml.vb @@ -1,3 +1,31 @@ Public Class ElementLayerTreeViewV + Dim nPrevPartId As Integer = 0 + + Private Sub ElementLayerTreeView_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs) + ' se ci troviamo nella pagina LayersWall e un Layer è già selezionato + If Map.refMainMenuVM.SelPage = EgtBEAMWALL.Core.ConstGen.Pages.LAYERSWALL AndAlso + Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLLayer) AndAlso + Map.refProjectVM.BTLStructureVM.SelBTLLayer.IsSelected Then + ' salvo il PartId dell'elemento che era già selezionato + nPrevPartId = Map.refProjectVM.BTLStructureVM.SelBTLLayer.nPartId + End If + End Sub + + Private Sub ElementLayerTreeView_PreviewMouseUp(sender As Object, e As MouseButtonEventArgs) + ' se ci troviamo nella pagina LayersWall e un Layer è già selezionato + If Map.refMainMenuVM.SelPage = EgtBEAMWALL.Core.ConstGen.Pages.LAYERSWALL AndAlso + Not IsNothing(Map.refProjectVM.BTLStructureVM.SelBTLLayer) AndAlso + Map.refProjectVM.BTLStructureVM.SelBTLLayer.IsSelected Then + ' se l'elemento su cui ho clickato è lo stesso che era selezionato + If Map.refProjectVM.BTLStructureVM.SelBTLLayer.nPartId = nPrevPartId Then + ' riassegno SelBTLLayer a se stesso per eseguire la riselezione di se stesso + Map.refProjectVM.BTLStructureVM.SelBTLLayer = Map.refProjectVM.BTLStructureVM.SelBTLLayer + End If + + 'Map.refProjectVM.BTLStructureVM.ShowBuilding(True, False) + + End If + End Sub + End Class diff --git a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml.vb b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml.vb index 389c4e0f..9bed12d3 100644 --- a/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml.vb +++ b/EgtBEAMWALL.ViewerOptimizer/ItemParamList/BTLPartListV.xaml.vb @@ -4,7 +4,11 @@ If TypeOf sender Is DataGridRow Then Dim Row As DataGridRow = DirectCast(sender, DataGridRow) If Not IsNothing(Row) AndAlso Row.IsSelected Then - Map.refProjectVM.BTLStructureVM.SelBTLPart = Map.refProjectVM.BTLStructureVM.SelBTLPart + If Map.refMainMenuVM.SelPage = EgtBEAMWALL.Core.ConstGen.Pages.LAYERSWALL Then + Map.refProjectVM.BTLStructureVM.SelBTLLayer.SelBTLPart = Map.refProjectVM.BTLStructureVM.SelBTLLayer.SelBTLPart + Else + Map.refProjectVM.BTLStructureVM.SelBTLPart = Map.refProjectVM.BTLStructureVM.SelBTLPart + End If End If End If End Sub diff --git a/EgtBEAMWALL.ViewerOptimizer/LayersWallBottomPanel/LayersWallBottomPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/LayersWallBottomPanel/LayersWallBottomPanelV.xaml index f41f23f9..5611b090 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LayersWallBottomPanel/LayersWallBottomPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/LayersWallBottomPanel/LayersWallBottomPanelV.xaml @@ -24,6 +24,26 @@ + + + + + + + + + + + + + + @@ -37,7 +57,7 @@ Margin="5"/> diff --git a/EgtBEAMWALL.ViewerOptimizer/LayersWallBottomPanel/LayersWallBottomPanelVM.vb b/EgtBEAMWALL.ViewerOptimizer/LayersWallBottomPanel/LayersWallBottomPanelVM.vb index 48219859..9ca09eda 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LayersWallBottomPanel/LayersWallBottomPanelVM.vb +++ b/EgtBEAMWALL.ViewerOptimizer/LayersWallBottomPanel/LayersWallBottomPanelVM.vb @@ -5,9 +5,10 @@ Public Class LayersWallBottomPanelVM Friend Enum PartFeatureTab As Integer STRUCTURE_ = 0 - PART = 1 - FEATURE = 2 - STATISTICS = 3 + LAYER = 1 + PART = 2 + FEATURE = 3 + STATISTICS = 4 End Enum Private m_SelPartFeatureTab As PartFeatureTab diff --git a/EgtBEAMWALL.ViewerOptimizer/LayersWallLeftPanel/LayersWallLeftPanelV.xaml b/EgtBEAMWALL.ViewerOptimizer/LayersWallLeftPanel/LayersWallLeftPanelV.xaml index 21463a53..3882a598 100644 --- a/EgtBEAMWALL.ViewerOptimizer/LayersWallLeftPanel/LayersWallLeftPanelV.xaml +++ b/EgtBEAMWALL.ViewerOptimizer/LayersWallLeftPanel/LayersWallLeftPanelV.xaml @@ -168,17 +168,23 @@ - + + + + + + + + Grid.Row="0"/> + +