-aggiunto scena assemblato

-migliorato gestione popup
This commit is contained in:
Demetrio Cassarino
2025-06-06 09:33:32 +02:00
parent aee76d1150
commit 6591de143a
15 changed files with 250 additions and 213 deletions
@@ -1554,10 +1554,9 @@ Public Class BTLPartVM
EgtDraw()
NotifyPropertyChanged(NameOf(SelBTLFeatureVM))
' se modalità building, la tolgo
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
If Not IsNothing(m_SelBTLFeatureVM) AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
Map.refShowBeamPanelVM.SetShowBuilding(False)
Map.refProjectVM.BTLStructureVM.SceneSelPartSelection()
End If
End Set
End Property
@@ -1584,11 +1583,11 @@ Public Class BTLPartVM
End If
EgtDraw()
NotifyPropertyChanged(NameOf(SelBTLFeatureVM))
NotifyPropertyChanged(NameOf(SelBTLFeatureVMOnlyGraph))
' se modalità building, la tolgo
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
If Not IsNothing(m_SelBTLFeatureVM) AndAlso Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
Map.refShowBeamPanelVM.SetShowBuilding(False)
Map.refProjectVM.BTLStructureVM.SceneSelPartSelection()
End If
End Set
End Property
@@ -107,7 +107,8 @@ Public Class BTLStructureVM
'Map.refProjectVM.BTLStructureVM.ShowBuilding(If(Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE, Map.refShowBeamPanelVM.ShowBuilding_IsChecked, False), False)
End Select
' aggiornamento grafica
Configuration.UpdateGraphics()
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.PartShowAllChanged()
If Not IsNothing(Map.refBTLPartManagerVM) Then Map.refBTLPartManagerVM.PartShowAllChanged()
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.FeatureSelectionChanged()
End Sub
@@ -142,7 +143,8 @@ Public Class BTLStructureVM
End If
End Select
' aggiornamento grafica
Configuration.UpdateGraphics()
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.PartShowAllChanged()
If Not IsNothing(Map.refBTLPartManagerVM) Then Map.refBTLPartManagerVM.PartShowAllChanged()
End Sub
Public Sub SelectBTLPart(BtlPart As BTLPartVM)
@@ -159,6 +161,7 @@ Public Class BTLStructureVM
' se modalità building, la tolgo
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
ShowBuilding(False, False)
Map.refShowBeamPanelVM.SetShowBuilding(False)
End If
SceneSelPartSelection()
' seleziono pezzo in Db geometrico
@@ -216,6 +219,7 @@ Public Class BTLStructureVM
' se modalità building, la tolgo
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
ShowBuilding(False, False)
Map.refShowBeamPanelVM.SetShowBuilding(False)
End If
SceneSelPartSelection()
' seleziono pezzo in Db geometrico
@@ -919,7 +923,6 @@ Public Class BTLStructureVM
AddHandler m_BTLPartVMList.CollectionChanged, AddressOf OnBTLPartVMListChanged
End Sub
Friend Sub LoadFilters()
For Each BTLPartVM As BTLPartVM In m_BTLPartVMList
' verifico sezione, gruppo e sottogruppo per inserirli nei filtri
@@ -1030,8 +1033,17 @@ Public Class BTLStructureVM
End Sub
Friend Sub ShowBuilding(bShow As Boolean, Optional bRedraw As Boolean = True)
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) AndAlso Not IsNothing(Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup) Then
EgtSetStatus(Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.Id, GDB_ST.OFF)
'If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) AndAlso Not IsNothing(Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup) Then
' EgtSetStatus(Map.refProjectVM.MachGroupPanelVM.SelectedMachGroup.Id, GDB_ST.OFF)
'End If
If bShow Then
ShowAll(False)
Dim CurrProdPathFile As String = ProjectManagerVM.CurrProj.sProjPath
If IO.File.Exists(CurrProdPathFile) Then
EgtOpenFile(CurrProdPathFile)
Else
EgtOutLog("File nge mancante")
End If
End If
' disabilito impostazione modificato
Dim DisableMgr As New DisableModifiedMgr
@@ -657,7 +657,10 @@ Public Class CALCPanelVM
(Map.refMainMenuVM.SelPage = Pages.MACHINING AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) OrElse
(Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
' se modalita' assemblato
Configuration.AssembledMode(Map.refShowBeamPanelVM.ShowBuilding_IsChecked)
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
End If
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
Dim ProjType As BWType
If Map.refMainMenuVM.SelPage = Pages.VIEW Then
@@ -195,6 +195,9 @@
<Compile Include="SceneHost\SceneHostV.xaml.vb">
<DependentUpon>SceneHostV.xaml</DependentUpon>
</Compile>
<Compile Include="SceneShowBulding\SceneShowBuldingV.xaml.vb">
<DependentUpon>SceneShowBuldingV.xaml</DependentUpon>
</Compile>
<Compile Include="SetUp\SetUpSupportClass.vb" />
<Compile Include="SetUp\SetUpV.xaml.vb">
<DependentUpon>SetUpV.xaml</DependentUpon>
@@ -680,6 +683,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="SceneShowBulding\SceneShowBuldingV.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SetUp\SetUpV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
+12 -3
View File
@@ -199,7 +199,10 @@ Public Class LeftPanelVM
Friend Sub VerifyAll()
If (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
' se modalita' assemblato
Configuration.AssembledMode(Map.refShowBeamPanelVM.ShowBuilding_IsChecked)
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
End If
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
Dim ProjType As BWType = ProjectManagerVM.CurrProd.nType
If Not CreateBarListToVerify(ProjType, BarList) Then Return
@@ -282,7 +285,10 @@ Public Class LeftPanelVM
Dim CurrSection As SectionXMaterial = Map.refProjectVM.BTLStructureVM.SelSection
' se modalita' assemblato
Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
Configuration.AssembledMode(bShowBuilding)
If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then
' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
End If
' ruoto i pezzi selezionati
For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts
Part.BackRotation(False, False)
@@ -321,7 +327,10 @@ Public Class LeftPanelVM
If ((Map.refMainMenuVM.SelPage = Pages.VIEW OrElse Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE) AndAlso IsNothing(ProjectManagerVM.CurrProj)) OrElse IsNothing(Map.refProjectVM.BTLStructureVM) Then Return
' se modalita' assemblato
Dim bShowBuilding As Boolean = Map.refShowBeamPanelVM.ShowBuilding_IsChecked
Configuration.AssembledMode(bShowBuilding)
If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then
' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
End If
' inverto i pezzi selezionati
For Each Part In Map.refProjectVM.BTLStructureVM.SelBTLParts
Part.Invert()
@@ -121,7 +121,7 @@
ToolTip="Ruota Tutti"
IsEnabled="{Binding RotatePart_IsEnabled}"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/PartManager/LeftRotate.png" Stretch="Uniform"/>
<Image Source="/Resources/NewPage/Rotate.png" Stretch="Uniform"/>
</Button>
<Button Grid.Column="6"
Command="{Binding Invert_Command}"
@@ -82,7 +82,6 @@ Public Class MyMachGroupVM
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
Map.refShowBeamPanelVM.SetShowBuilding(False)
Map.refProjectVM.BTLStructureVM.SceneSelPartSelection()
End If
End Set
End Property
@@ -130,7 +129,14 @@ Public Class MyMachGroupVM
If m_PartVMList.Count > 0 Then
' verifico se la dimensione e' maggiore del box minimo dei pezzi
Dim b3Parts As New BBox3d
Configuration.VerifyMaxDimension(m_PartVMList, b3Parts)
Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(m_PartVMList(0).nPartId, "Box")
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Parts)
For PartIndex = 1 To m_PartVMList.Count - 1
Dim b3Part As New BBox3d
nBoxLayerId = EgtGetFirstNameInGroup(m_PartVMList(PartIndex).nPartId, "Box")
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Part)
b3Parts.Add(b3Part)
Next
Dim b3RawPart As New BBox3d
EgtGetRawPartBBox(nRawPartId, b3RawPart)
Dim dMinValue As Double = 0
@@ -147,7 +153,19 @@ Public Class MyMachGroupVM
If EgtModifyRawPartSize(nRawPartId, dValue, MyMachGroupM.dW, MyMachGroupM.dH) Then
' riporto il grezzo nell'angolo tavola di origine
Dim b3Tab As New BBox3d
Configuration.SelectCorner(b3Tab, nRawPartId)
EgtGetTableArea(1, b3Tab)
Dim p3OrigOnTab As Point3d
Select Case CurrentMachine.OrigCorner
Case MCH_CR.BL
p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
Case MCH_CR.BR
p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
Case MCH_CR.TL
p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
Case MCH_CR.TR
p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
End Select
EgtMoveToCornerRawPart(nRawPartId, p3OrigOnTab, CurrentMachine.OrigCorner)
' sposto tutti i pezzi di quanto si e' accorciato il grezzo
If CurrentMachine.NestingCorner = MCH_CR.TR OrElse CurrentMachine.NestingCorner = MCH_CR.BR Then
For Each Part In m_PartVMList
@@ -186,7 +204,14 @@ Public Class MyMachGroupVM
If m_PartVMList.Count > 0 Then
' verifico se la dimensione e' maggiore del box minimo dei pezzi
Dim b3Parts As New BBox3d
Configuration.VerifyMaxDimension(m_PartVMList, b3Parts)
Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(m_PartVMList(0).nPartId, "Box")
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Parts)
For PartIndex = 1 To m_PartVMList.Count - 1
Dim b3Part As New BBox3d
nBoxLayerId = EgtGetFirstNameInGroup(m_PartVMList(PartIndex).nPartId, "Box")
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Part)
b3Parts.Add(b3Part)
Next
Dim b3RawPart As New BBox3d
EgtGetRawPartBBox(nRawPartId, b3RawPart)
Dim dMinValue As Double = 0
@@ -203,7 +228,19 @@ Public Class MyMachGroupVM
If EgtModifyRawPartSize(nRawPartId, MyMachGroupM.dL, dValue, MyMachGroupM.dH) Then
' riporto il grezzo nell'angolo tavola di origine
Dim b3Tab As New BBox3d
Configuration.SelectCorner(b3Tab, nRawPartId)
EgtGetTableArea(1, b3Tab)
Dim p3OrigOnTab As Point3d
Select Case CurrentMachine.OrigCorner
Case MCH_CR.BL
p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
Case MCH_CR.BR
p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
Case MCH_CR.TL
p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
Case MCH_CR.TR
p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
End Select
EgtMoveToCornerRawPart(nRawPartId, p3OrigOnTab, CurrentMachine.OrigCorner)
' sposto tutti i pezzi di quanto si e' accorciato il grezzo
If CurrentMachine.NestingCorner = MCH_CR.TR OrElse CurrentMachine.NestingCorner = MCH_CR.TL Then
For Each Part In m_PartVMList
@@ -1258,7 +1258,26 @@ Public Class OnlyProdManagerVM
ReloadBTLStructure()
' elimino i pezzi da sovrascrivere nel progetto corrente
Configuration.DeletePieces(UpdateBTLWndVM.BTLPartList)
For Each BTLPartToOverwriteWith In UpdateBTLWndVM.BTLPartList
If BTLPartToOverwriteWith.bInsert Then
Dim BTLPartToUpdate As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPDN = BTLPartToOverwriteWith.nPDN)
' se BTLPartToUpdate è Nothing significa che il pezzo è nuovo e quindi basta accodarlo senza eliminare nulla
If Not IsNothing(BTLPartToUpdate) Then
Dim nPartToDeleteId As Integer = BTLPartToUpdate.nPartId
Dim nCurrPartId = EgtGetCurrPart()
EgtErase(nPartToDeleteId)
nCurrPartId = EgtGetCurrPart()
' verifico se rimuovere sezione dalla lista
If Not Map.refProjectVM.BTLStructureVM.BTLPartVMList.Any(Function(x) x IsNot BTLPartToUpdate AndAlso x.Section = BTLPartToUpdate.Section) Then
Map.refProjectVM.BTLStructureVM.SectionList.Remove(BTLPartToUpdate.Section)
End If
' rimuovo dalla lista pezzi
Dim Index As Integer = Map.refProjectVM.BTLStructureVM.BTLPartVMList.IndexOf(BTLPartToUpdate)
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Nothing)
Map.refProjectVM.BTLStructureVM.BTLPartVMList.RemoveAt(Index)
End If
End If
Next
' salvo gli id degli AsseBase presenti nel progetto corrente
Dim AsseBaseIdList As New List(Of Integer)
@@ -158,12 +158,7 @@
</TabItem>
<TabItem Header="SCENESHOWBULDING">
<TabItem.Content>
<Button Command="{Binding Parameter_Command}"
ToolTip="{Binding Parameters_ToolTip}" Margin="0,2.5,10,2.5"
Style="{StaticResource OnlyProdLeftPanel_Button}">
<Image Source="/Resources/InstrumentPanel/Analyze.png" Stretch="Uniform"/>
</Button>
<!--<EgtBEAMWALL:SceneShowBuldingV Margin="4,4,0,4"/>-->
<EgtBEAMWALL:SceneShowBuldingV Margin="4,4,0,4"/>
</TabItem.Content>
</TabItem>
</TabControl>
@@ -787,7 +787,10 @@ Public Class RawPartManagerVM
Friend Sub VerifyAll()
If (Map.refMainMenuVM.SelPage = Pages.ONLYPRODPAGE AndAlso (IsNothing(ProjectManagerVM.CurrProj) OrElse IsNothing(Map.refProjectVM.BTLStructureVM)) AndAlso (IsNothing(ProjectManagerVM.CurrProd) OrElse IsNothing(Map.refProjectVM.MachGroupPanelVM))) Then Return
' se modalita' assemblato
Configuration.AssembledMode(Map.refShowBeamPanelVM.ShowBuilding_IsChecked)
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked AndAlso Map.refShowBeamPanelVM.bShowAll Then
' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
End If
Dim BarList() As EgtBEAMWALL.Core.Bar = Nothing
Dim ProjType As BWType
ProjType = ProjectManagerVM.CurrProd.nType
@@ -0,0 +1,10 @@
<UserControl x:Class="SceneShowBuldingV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:EgtUILib="clr-namespace:EgtUILib;assembly=EgtUILib">
<WindowsFormsHost>
<EgtUILib:Scene x:Name="SceneShowBulding"/>
</WindowsFormsHost>
</UserControl>
@@ -0,0 +1,105 @@
Imports EgtBEAMWALL.Core
Imports EgtUILib.EgtInterface
Imports EgtWPFLib5
Public Class SceneShowBuldingV
#Region "CONSTRUCTOR"
Sub New()
' La chiamata è richiesta dalla finestra di progettazione.
InitializeComponent()
' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
' Creo Riferimento
MapV.SetRefSceneShowBuldingV(Me)
' Inizializzazione Scena
PreInitializeScene()
If SceneShowBulding.Init() And Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.BEAM Or KEY_OPT.WALL) Then
PostInitializeScene()
' Imposto stato gestione mouse diretto della scena a nessuno
SceneShowBulding.SetStatusNull()
' Imposto focus pulsante su false
SceneShowBulding.SetFocusOnMove(False)
' Recupero e imposto handle finestra principale
'Dim hMainWnd As IntPtr = New WindowInteropHelper(Application.Current.MainWindow).Handle
'EgtSetMainWindowHandle(hMainWnd)
'EgtSetCurrentContext(SceneShowBulding.GetCtx())
' Imposto direttorio ausiliario per import/gestione BTL
Dim sBtlAuxDir As String = String.Empty
GetMainPrivateProfileString(S_IMPORT, K_BTLAUXDIR, "", sBtlAuxDir)
EgtSetBtlAuxDir(sBtlAuxDir)
' inizializzo gestore travi e pareti
EgtInitBeamMgr(EIB_FL.TS3_POS + EIB_FL.USEUATTR)
' inizializzo gestore lavorazioni
EgtInitMachMgr(Map.refMainWindowVM.MainWindowM.sMachinesRoot, Map.refMainWindowVM.MainWindowM.sToolMakersDir)
' Seleziono la macchina impostata nel file ini
Map.refMachinePanelVM.LoadCurrentMachine()
Return
End If
End Sub
#End Region ' Constructor
#Region "METHODS"
Private Sub PreInitializeScene()
' imposto colore di default
Dim DefColor As New Color3d(0, 0, 0)
GetMainPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
SceneShowBulding.SetDefaultMaterial(DefColor)
' imposto colori sfondo
Dim BackTopColor As New Color3d(192, 192, 192)
GetMainPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
Dim BackBotColor As New Color3d(BackTopColor)
GetMainPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
SceneShowBulding.SetViewBackground(BackTopColor, BackBotColor)
' imposto colore di evidenziazione
Dim MarkColor As New Color3d(255, 255, 0)
GetMainPrivateProfileColor(S_SCENE, K_MARK, MarkColor)
SceneShowBulding.SetMarkMaterial(MarkColor)
' imposto colore per superfici selezionate
Dim SelSurfColor As New Color3d(255, 255, 192)
GetMainPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor)
SceneShowBulding.SetSelSurfMaterial(SelSurfColor)
' imposto tipo e colore del rettangolo di zoom
Dim bOutline As Boolean = True
Dim ZwColor As New Color3d(0, 0, 0)
GetMainPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor)
SceneShowBulding.SetZoomWinAttribs(bOutline, ZwColor)
' imposto colore della linea di distanza
Dim DstLnColor As New Color3d(255, 0, 0)
GetMainPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor)
SceneShowBulding.SetDistLineMaterial(DstLnColor)
' imposto parametri OpenGL
Dim nDriver As Integer = GetMainPrivateProfileInt(S_OPENGL, K_DRIVER, 3)
Dim b2Buff As Boolean = (GetMainPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1) <> 0)
Dim nColorBits As Integer = GetMainPrivateProfileInt(S_OPENGL, K_COLORBITS, 32)
Dim nDepthBits As Integer = GetMainPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32)
SceneShowBulding.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
End Sub
Private Sub PostInitializeScene()
' imposto tipo coordinate
SceneShowBulding.SetGridCursorPos(True)
' modo di visualizzazione
Dim nShowMode As Integer = GetMainPrivateProfileInt(S_SCENE, K_SHOWMODE, SM.SHADING)
'Map.refShowPanelVM.SetShowMode(DirectCast(nShowMode, SM))
EgtSetShowMode(DirectCast(nShowMode, SM))
' visualizzazione avanzata dei triangoli costituenti le superfici
Dim bShowTriaAdv As Boolean = (GetMainPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0)
EgtSetShowTriaAdv(bShowTriaAdv)
' tipo visualizzazione per Zmap
Dim nShowZmap As Integer = GetMainPrivateProfileInt(S_SCENE, K_SHOWZMAP, 1)
EgtSetShowZmap(DirectCast(nShowZmap, ZSM), False)
' dimensione lineare max in pixel delle textures
Dim nTxrMaxLinPix As Integer = GetMainPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096)
EgtSetTextureMaxLinPixels(nTxrMaxLinPix)
' tipo snap point
SceneShowBulding.SetSnapPointType(SP.PT_SKETCH)
' imposto parametri geometrici griglia
EgtSetGridGeo(100, 1, 10, 100)
End Sub
#End Region ' Methods
End Class
@@ -51,7 +51,15 @@ Public Class ShowBeamPanelVM
End Get
Set(value As Boolean)
m_bShowBuilding = value
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then Map.refProjectVM.BTLStructureVM.ShowBuilding(m_bShowBuilding)
If m_bShowBuilding Then
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.SCENESHOWBULDING)
EgtSetCurrentContext(MapV.refSceneShowBuldingV.SceneShowBulding.GetCtx())
If Not IsNothing(Map.refProjectVM.BTLStructureVM) Then Map.refProjectVM.BTLStructureVM.ShowBuilding(m_bShowBuilding)
Else
EgtSetCurrentContext(Map.refSceneHostVM.MainScene.GetCtx())
Map.refProjectVM.SetSelManagerTab(ProjectVM.StrategyManagerTab.RAWPARTMANAGER)
End If
NotifyPropertyChanged(NameOf(ShowBuilding_IsChecked))
End Set
End Property
Friend Sub SetShowBuilding(bValue As Boolean)
@@ -143,7 +151,8 @@ Public Class ShowBeamPanelVM
Private Sub UpdatePartBtnIsEnabled()
Map.refCALCPanelVM.PartShowAllChanged()
Configuration.UpdateGraphics()
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.PartShowAllChanged()
If Not IsNothing(Map.refBTLPartManagerVM) Then Map.refBTLPartManagerVM.PartShowAllChanged()
End Sub
#End Region ' METHODS
+1 -184
View File
@@ -1,106 +1,10 @@
Imports System.Collections.ObjectModel
Imports EgtBEAMWALL.Core
Imports EgtBEAMWALL.Core
Imports EgtUILib
Imports MigraDoc.DocumentObjectModel
Imports MigraDoc.Rendering
Module Configuration
''' <summary>
''' trovo ed evidenzio MachGroup e Duplo di questo pezzo
''' </summary>
''' <param name="nSelBTLPartId">Id pezzo</param>
Friend Sub SetSearchPiece(nSelBTLPartId As Integer)
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
Dim MachGroupList As New List(Of MyMachGroupVM)
For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
Dim bFound As Boolean = False
For Each Part As PartVM In Machgroup.PartVMList
If EgtDuploGetOriginal(Part.nPartId) = nSelBTLPartId Then
Part.SetSearchFound()
bFound = True
Else
Part.ResetSearchFound()
End If
Next
If bFound Then
Machgroup.SetSearchFound()
Else
Machgroup.ResetSearchFound()
End If
Next
End If
End Sub
''' <summary>
''' deevidenzio MachGroup e Duplo di questo pezzo
''' </summary>
''' <param name="nSelBTLPartId">Id pezzo</param>
Friend Sub ResetSearchPiece(nSelBTLPartId As Integer)
If Not IsNothing(Map.refProjectVM.MachGroupPanelVM) Then
Dim MachGroupList As New List(Of MyMachGroupVM)
For Each Machgroup As MyMachGroupVM In Map.refProjectVM.MachGroupPanelVM.MachGroupVMList
Dim bFound As Boolean = False
For Each Part As PartVM In Machgroup.PartVMList
If EgtDuploGetOriginal(Part.nPartId) = nSelBTLPartId Then
Part.ResetSearchFound()
bFound = True
End If
Next
If bFound Then
Machgroup.ResetSearchFound()
End If
Next
End If
End Sub
''' <summary>
''' aggiornamento grafica
''' </summary>
Friend Sub UpdateGraphics()
If Not IsNothing(Map.refFeatureListManagerVM) Then Map.refFeatureListManagerVM.PartShowAllChanged()
If Not IsNothing(Map.refBTLPartManagerVM) Then Map.refBTLPartManagerVM.PartShowAllChanged()
End Sub
''' <summary>
''' evidenzio BTLPart di questo pezzo
''' </summary>
''' <param name="nPartId">Id pezzo</param>
Friend Sub SetSearch(nPartId As Integer)
For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Dim nDuploOriginalId As Integer = 0
If EgtGetInfo(nPartId, GDB_SI_DUPSOU, nDuploOriginalId) AndAlso nDuploOriginalId > 0 AndAlso nDuploOriginalId = Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).nPartId Then
Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).SetSearchFound()
Exit For
End If
Next
End Sub
''' <summary>
''' deevidenzio BTLPart di questo pezzo
''' </summary>
''' <param name="nPartId">Id pezzo</param>
Friend Sub ResetSearch(nPartId As Integer)
For BTLPartIndex = 0 To Map.refProjectVM.BTLStructureVM.BTLPartVMList.Count - 1
Dim nDuploOriginalId As Integer = 0
If EgtGetInfo(nPartId, GDB_SI_DUPSOU, nDuploOriginalId) AndAlso nDuploOriginalId > 0 AndAlso nDuploOriginalId = Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).nPartId Then
Map.refProjectVM.BTLStructureVM.BTLPartVMList(BTLPartIndex).ResetSearchFound()
Exit For
End If
Next
End Sub
''' <summary>
''' modalita' assemblato
''' </summary>
''' <param name="bShowBuilding">booleano visualizza modalita' assemblato</param>
Friend Sub AssembledMode(bShowBuilding As Boolean)
If bShowBuilding AndAlso Map.refShowBeamPanelVM.bShowAll Then
' devo smontarlo prima di calcolare le travi, altrimenti non trova i pezzi
Map.refProjectVM.BTLStructureVM.ShowBuilding(False, False)
End If
End Sub
''' <summary>
''' vista di tutti i pezzi
''' </summary>
@@ -126,33 +30,6 @@ Module Configuration
End If
End Sub
''' <summary>
''' elimino i pezzi da sovrascrivere nel progetto corrente
''' </summary>
''' <param name="BTLPartList">Lista BTLPart</param>
Friend Sub DeletePieces(BTLPartList As ObservableCollection(Of BTLPartToUpdate))
For Each BTLPartToOverwriteWith In BTLPartList
If BTLPartToOverwriteWith.bInsert Then
Dim BTLPartToUpdate As BTLPartVM = Map.refProjectVM.BTLStructureVM.BTLPartVMList.FirstOrDefault(Function(x) x.nPDN = BTLPartToOverwriteWith.nPDN)
' se BTLPartToUpdate è Nothing significa che il pezzo è nuovo e quindi basta accodarlo senza eliminare nulla
If Not IsNothing(BTLPartToUpdate) Then
Dim nPartToDeleteId As Integer = BTLPartToUpdate.nPartId
Dim nCurrPartId = EgtGetCurrPart()
EgtErase(nPartToDeleteId)
nCurrPartId = EgtGetCurrPart()
' verifico se rimuovere sezione dalla lista
If Not Map.refProjectVM.BTLStructureVM.BTLPartVMList.Any(Function(x) x IsNot BTLPartToUpdate AndAlso x.Section = BTLPartToUpdate.Section) Then
Map.refProjectVM.BTLStructureVM.SectionList.Remove(BTLPartToUpdate.Section)
End If
' rimuovo dalla lista pezzi
Dim Index As Integer = Map.refProjectVM.BTLStructureVM.BTLPartVMList.IndexOf(BTLPartToUpdate)
Map.refProjectVM.BTLStructureVM.SetSelBTLPart(Nothing)
Map.refProjectVM.BTLStructureVM.BTLPartVMList.RemoveAt(Index)
End If
End If
Next
End Sub
''' <summary>
''' tolgo eventuale indicazione solido rimasta da pezzo precedente
''' </summary>
@@ -166,66 +43,6 @@ Module Configuration
End If
End Sub
''' <summary>
''' verifico se la dimensione e' maggiore del box minimo dei pezzi
''' </summary>
''' <param name="PartVMList"></param>
''' <param name="b3Parts"></param>
Friend Sub VerifyMaxDimension(PartVMList As ObservableCollection(Of Core.PartVM), b3Parts As BBox3d)
Dim nBoxLayerId As Integer = EgtGetFirstNameInGroup(PartVMList(0).nPartId, "Box")
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Parts)
For PartIndex = 1 To PartVMList.Count - 1
Dim b3Part As New BBox3d
nBoxLayerId = EgtGetFirstNameInGroup(PartVMList(PartIndex).nPartId, "Box")
EgtGetBBoxGlob(nBoxLayerId, GDB_BB.EXACT, b3Part)
b3Parts.Add(b3Part)
Next
End Sub
''' <summary>
''' riporto il grezzo nell'angolo tavola di origine
''' </summary>
''' <param name="b3Tab"></param>
''' <param name="nRawPartId"></param>
Friend Sub SelectCorner(b3Tab As BBox3d, nRawPartId As Integer)
EgtGetTableArea(1, b3Tab)
Dim p3OrigOnTab As Point3d
Select Case CurrentMachine.OrigCorner
Case MCH_CR.BL
p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
Case MCH_CR.BR
p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, CurrentMachine.OrigOffsY, 0)
Case MCH_CR.TL
p3OrigOnTab = New Point3d(CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
Case MCH_CR.TR
p3OrigOnTab = New Point3d(b3Tab.DimX() - CurrentMachine.OrigOffsX, b3Tab.DimY() - CurrentMachine.OrigOffsY, 0)
End Select
EgtMoveToCornerRawPart(nRawPartId, p3OrigOnTab, CurrentMachine.OrigCorner)
End Sub
''' <summary>
'''
''' </summary>
''' <param name="nPartId"></param>
''' <param name="BTLStructureVM"></param>
Friend Sub SelectedPieces(nPartId As Integer, BTLStructureVM As BTLStructureVM)
EgtBeamShowFacesName(False)
EgtBeamShowLoadingSide(False, False)
Map.refProjectVM.MacroFeature_IsEnabled = True
' se modalità building, la tolgo
If Map.refShowBeamPanelVM.ShowBuilding_IsChecked Then
BTLStructureVM.ShowBuilding(False, False)
End If
BTLStructureVM.SceneSelPartSelection()
' seleziono pezzo in Db geometrico
EgtBeamSetPart(nPartId)
EgtBeamShowFacesName(True)
Dim bLoadingSideShow As Boolean = (BTLStructureVM.nPROJTYPE = BWType.BEAM)
Dim bLeftToRight As Boolean = Not (CurrentMachine.ViewDir = VT.ISO_NW OrElse CurrentMachine.ViewDir = VT.ISO_NE)
EgtBeamShowLoadingSide(bLoadingSideShow, bLeftToRight)
End Sub
Public Sub CreatePrintPDF(ActivePage As Integer, bPreview As Boolean)
LoadingWndHelper.OpenLoadingWnd(ActiveIds.CREATINGPDF, 1, "Creating PDF", "", 100)
Try
+12
View File
@@ -1,6 +1,7 @@
Module MapV
Private m_refStrategyProductionV As StrategyProductionV
Private m_refSceneShowBuldingV As SceneShowBuldingV
#Region "Get"
@@ -10,6 +11,12 @@
End Get
End Property
Public ReadOnly Property refSceneShowBuldingV As SceneShowBuldingV
Get
Return m_refSceneShowBuldingV
End Get
End Property
#End Region ' Get
#Region "Set"
@@ -19,6 +26,11 @@
Return Not IsNothing(m_refStrategyProductionV)
End Function
Friend Function SetRefSceneShowBuldingV(SceneShowBuldingV As SceneShowBuldingV) As Boolean
m_refSceneShowBuldingV = SceneShowBuldingV
Return Not IsNothing(m_refSceneShowBuldingV)
End Function
#End Region ' Set
End Module