- Correzioni su Selezioni/Deselezioni/Riselezioni dei Part nella DG e dei Layer nel TreeView

- Inserite 2 FeatureListV separate (e parte di 2 diverse Tab) per Layer e Part selezionati
This commit is contained in:
RenzoL
2022-04-07 08:59:16 +02:00
parent e88c603fca
commit 19a8ca1267
10 changed files with 144 additions and 17 deletions
+2 -2
View File
@@ -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
@@ -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
@@ -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
@@ -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)
@@ -66,6 +66,8 @@
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<EventSetter Event="PreviewMouseDown" Handler="ElementLayerTreeView_PreviewMouseDown"/>
<EventSetter Event="PreviewMouseUp" Handler="ElementLayerTreeView_PreviewMouseUp"/>
</Style>
</TreeView.ItemContainerStyle>
@@ -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
@@ -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
@@ -24,6 +24,26 @@
</EgtWPFLib5:EgtScrollViewer>
</TabItem.Content>
</TabItem>
<TabItem Header="LAYER">
<TabItem.Content>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<EgtWPFLib5:EgtScrollViewer Focusable="False">
<EgtBEAMWALL:PartParametersV DataContext="{StaticResource PartParametersVM}"
Tag="{Binding Tag.SelBTLLayer, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LayersWallBottomPanelV}}}"
Margin="5"/>
</EgtWPFLib5:EgtScrollViewer>
<TextBlock Grid.Row="1"
Text="{Binding Tag.SelBTLLayer.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LayersWallBottomPanelV}}}"
Foreground="{Binding Tag.SelBTLLayer.CALC_ERR_Foreground, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LayersWallBottomPanelV}}}"
Margin="5,0,5,0"
Visibility="{Binding Tag.SelBTLLayer.CALC_MSG_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LayersWallBottomPanelV}}}"/>
</Grid>
</TabItem.Content>
</TabItem>
<TabItem Header="PART">
<TabItem.Content>
<Grid>
@@ -37,7 +57,7 @@
Margin="5"/>
</EgtWPFLib5:EgtScrollViewer>
<TextBlock Grid.Row="1"
Text="{Binding Tag.SelBTLPart.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LayersWallBottomPanelV}}}"
Text="{Binding Tag.SelBTLLayer.SelBTLPart.sCALC_MSG, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LayersWallBottomPanelV}}}"
Foreground="{Binding Tag.SelBTLLayer.SelBTLPart.CALC_ERR_Foreground, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LayersWallBottomPanelV}}}"
Margin="5,0,5,0"
Visibility="{Binding Tag.SelBTLLayer.SelBTLPart.CALC_MSG_Visibility, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LayersWallBottomPanelV}}}"/>
@@ -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
@@ -168,17 +168,23 @@
<Image Source="/Resources/LeftPanel/RemoveFeature.png" Stretch="Uniform"/>
</Button>
</StackPanel>
<!--Lista feature per Layer-->
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<!--Lista feature per Layer-->
<EgtBEAMWALL:FeatureListV DataContext="{ StaticResource FeatureListVM}"
Tag="{Binding Tag.SelBTLLayer, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LayersWallLeftPanelV}}}"
Visibility="{Binding LayerFeatureList_Visibility}"
Grid.Row="1"/>
Grid.Row="0"/>
<!--Lista feature per Part-->
<EgtBEAMWALL:FeatureListV DataContext="{ StaticResource FeatureListVM}"
Tag="{Binding Tag.SelBTLLayer.SelBTLPart, RelativeSource={RelativeSource AncestorType={x:Type EgtBEAMWALL:LayersWallLeftPanelV}}}"
Visibility="{Binding PartFeatureList_Visibility}"
Grid.Row="1"/>
</Grid>
</Grid>
</Grid>