diff --git a/Icarus/Constants/Const3dPrint.vb b/Icarus/Constants/Const3dPrint.vb index 316a150..163f2db 100644 --- a/Icarus/Constants/Const3dPrint.vb +++ b/Icarus/Constants/Const3dPrint.vb @@ -5,6 +5,7 @@ Public Const PART = "Part" Public Const PRINT_SOLID = "PrintSolid" Public Const LAY_MACH_START = "MachStart" + Public Const LAY_PARTREFERENCE = "PartFrame" Public Const LAY_REFERENCE = "Frame" Public Const LAY_OTHERS = "Aux" Public Const LAY_RIBS = "Ribs" diff --git a/Icarus/DispositionPanel/DispositionPanelVM.vb b/Icarus/DispositionPanel/DispositionPanelVM.vb index 2c1d57c..3321944 100644 --- a/Icarus/DispositionPanel/DispositionPanelVM.vb +++ b/Icarus/DispositionPanel/DispositionPanelVM.vb @@ -87,7 +87,7 @@ Public Class DispositionPanelVM Get If Not IsNothing(Map.refTopPanelVM.SelPart) Then Dim ptReference As New Point3d - EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference) + EgtStartPoint(Map.refTopPanelVM.SelPart.nPartReferenceId, GDB_ID.ROOT, ptReference) Return LenToString(ptReference.z, 1) Else Return "" @@ -95,7 +95,7 @@ Public Class DispositionPanelVM End Get Set(value As String) Dim ptReference As New Point3d - EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference) + EgtStartPoint(Map.refTopPanelVM.SelPart.nPartReferenceId, GDB_ID.ROOT, ptReference) Dim dNewZPos As Double = ptReference.z StringToLen(value, dNewZPos) Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart) @@ -118,7 +118,7 @@ Public Class DispositionPanelVM Friend Sub UpdateZPos() Dim ptReference As New Point3d - EgtStartPoint(Map.refTopPanelVM.SelPart.nReferenceId, GDB_ID.ROOT, ptReference) + EgtStartPoint(Map.refTopPanelVM.SelPart.nPartReferenceId, GDB_ID.ROOT, ptReference) Dim dNewZPos As Double = ptReference.z Dim b3Print As BBox3d = GetSolidForReferenceBBox(Map.refTopPanelVM.SelPart) Dim dMin As Double = 0 diff --git a/Icarus/ManagePartPanel/ManagePartPanelVM.vb b/Icarus/ManagePartPanel/ManagePartPanelVM.vb index 7f3bc53..4758342 100644 --- a/Icarus/ManagePartPanel/ManagePartPanelVM.vb +++ b/Icarus/ManagePartPanel/ManagePartPanelVM.vb @@ -451,6 +451,8 @@ Public Class ManagePartPanelVM End Select Next ' aggiungo layer riferimento + Dim nPartReferenceLayerId As Integer = EgtCreateGroup(nPartId) + EgtSetName(nPartReferenceLayerId, LAY_PARTREFERENCE) Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId) EgtSetName(nReferenceLayerId, LAY_REFERENCE) EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.BL) @@ -462,7 +464,7 @@ Public Class ManagePartPanelVM EgtSetInfo(nPartId, FILE_PATH, sFilePath) EgtSetInfo(nPartId, PART_NAME, ManagePart_Part.sName) EgtSetInfo(nPartId, "PartOnTable", 1) - Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath) + Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nPartReferenceLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath) Map.refTopPanelVM.PartList.Add(NewPart) ' aggiorno riferimento Map.refReferencePanelVM.UpdateFramePosition(NewPart) diff --git a/Icarus/ManagePartPanel/ManagePartUtility.vb b/Icarus/ManagePartPanel/ManagePartUtility.vb index cb96f95..8153cf2 100644 --- a/Icarus/ManagePartPanel/ManagePartUtility.vb +++ b/Icarus/ManagePartPanel/ManagePartUtility.vb @@ -718,6 +718,8 @@ Public Class GeomEntity_MenuItem EgtSetName(nOthersLayerId, LAY_OTHERS) EgtSetColor(nOthersLayerId, GeomEntityColors.c3Others) ' aggiungo riferimento + Dim nPartReferenceLayerId As Integer = EgtCreateGroup(nPartId) + EgtSetName(nPartReferenceLayerId, LAY_PARTREFERENCE) Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId) EgtSetName(nReferenceLayerId, LAY_REFERENCE) EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, ReferenceBtn.References.BL) @@ -726,7 +728,7 @@ Public Class GeomEntity_MenuItem ' lo aggiungo a lista pezzi EgtSetInfo(nPartId, FILE_PATH, sFilePath) EgtSetInfo(nPartId, "PartOnTable", 1) - Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath) + Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nPartReferenceLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath) Map.refTopPanelVM.PartList.Add(NewPart) ' aggiorno riferimento Map.refReferencePanelVM.UpdateFramePosition(NewPart) diff --git a/Icarus/ReferencePanel/ReferencePanelVM.vb b/Icarus/ReferencePanel/ReferencePanelVM.vb index a6cd4de..e095825 100644 --- a/Icarus/ReferencePanel/ReferencePanelVM.vb +++ b/Icarus/ReferencePanel/ReferencePanelVM.vb @@ -115,6 +115,10 @@ Public Class ReferencePanelVM ElseIf EgtGetInfo(SelPart.nPartId, KEY_MOVEDPART2, vtMovedPart) Then ptOrig = ptOrig - vtMovedPart End If + Dim nPartFrameId As Integer = EgtCreateGeoFrame(SelPart.nPartReferenceLayerId, New Frame3d(ptOrig), GDB_RT.GLOB) + EgtSetStatus(nPartFrameId, GDB_ST.OFF) + ' elimino componente Z + ptOrig = ptOrig + New Vector3d(0, 0, -ptOrig.z) frPrintSolid = New Frame3d(ptOrig) End If Dim nFrameId As Integer = EgtCreateGeoFrame(SelPart.nReferenceLayerId, frPrintSolid, GDB_RT.GLOB) diff --git a/Icarus/SceneHost/MySceneHostVM.vb b/Icarus/SceneHost/MySceneHostVM.vb index 36ba98a..3f7450e 100644 --- a/Icarus/SceneHost/MySceneHostVM.vb +++ b/Icarus/SceneHost/MySceneHostVM.vb @@ -329,6 +329,15 @@ Public Class MySceneHostVM WriteMainPrivateProfileString(S_PRINTING3D, K_IMPORTCURREXTENSION, OpenFileDialog.FilterIndex) Dim sFile As String = String.Empty sFile = OpenFileDialog.FileName + ' disabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma + Map.refProjManagerVM.SetProjCmdIsEnabled(False) + Map.refTopPanelVM.SetTopPanelIsEnabled(False) + Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(False) + Map.refTFSEditorVM.SetTFSEditorIsEnabled(False) + Map.refSliderManagerVM.SetLayerIndexIsEnabled(False) + Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(False) + Map.refSliceManagerVM.SetButtonsIsEnabled(False) + Map.refInstrumentPanelVM.SetEdgeAnalysisIsEnabled(False) ' importo la nuova geometria If MainController.InsertProject(sFile, False) Then ' la sposto in centro tavola @@ -340,6 +349,15 @@ Public Class MySceneHostVM Map.refTopPanelVM.SelPage = Pages.IMPORT End If EgtDraw() + ' riabilito ProjManager, TopPanel e uscita dal programma + Map.refProjManagerVM.SetProjCmdIsEnabled(True) + Map.refTopPanelVM.SetTopPanelIsEnabled(True) + Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(True) + Map.refTFSEditorVM.SetTFSEditorIsEnabled(True) + Map.refSliderManagerVM.SetLayerIndexIsEnabled(True) + Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(True) + Map.refSliceManagerVM.SetButtonsIsEnabled(True) + Map.refInstrumentPanelVM.SetEdgeAnalysisIsEnabled(True) End Sub Public Sub InsertRib() @@ -1075,9 +1093,14 @@ Public Class MySceneHostVM Dim nOthersLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_OTHERS) Dim sFilePath As String = "" EgtGetInfo(nPartId, FILE_PATH, sFilePath) + Dim nPartReferenceLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_PARTREFERENCE) + If nPartReferenceLayerId = GDB_ID.NULL Then + nPartReferenceLayerId = EgtCreateGroup(nPartId) + EgtSetName(nPartReferenceLayerId, LAY_PARTREFERENCE) + End If Dim nReferenceLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_REFERENCE) Dim nFrameId As Integer = EgtGetFirstInGroup(nReferenceLayerId) - Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath) + Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nPartReferenceLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath) Map.refTopPanelVM.PartList.Add(NewPart) Dim bPartToRecalc As Boolean = False EgtGetInfo(nPartId, MAC_TORECALC_SLICE, bPartToRecalc) diff --git a/Icarus/ViewModel/Print3dPartVM.vb b/Icarus/ViewModel/Print3dPartVM.vb index 0c27358..b6de868 100644 --- a/Icarus/ViewModel/Print3dPartVM.vb +++ b/Icarus/ViewModel/Print3dPartVM.vb @@ -25,7 +25,25 @@ Public Class Print3dPartVM End Get End Property - ' riferimento del solido/superficie di stampa + ' riferimento del pezzo solido/superficie da stampare + Private m_nPartReferenceLayerId As Integer = GDB_ID.NULL + Public ReadOnly Property nPartReferenceLayerId As Integer + Get + Return m_nPartReferenceLayerId + End Get + End Property + Private m_nPartReferenceId As Integer = GDB_ID.NULL + Public ReadOnly Property nPartReferenceId As Integer + Get + Dim nTemp As Integer = EgtGetFirstInGroup(nPartReferenceLayerId) + If nTemp <> GDB_ID.NULL Then + Return nTemp + Else + Return m_nReferenceId + End If + End Get + End Property + ' riferimento di stampa del pezzo solido/superficie (sempre Z 0) Private m_nReferenceLayerId As Integer = GDB_ID.NULL Public ReadOnly Property nReferenceLayerId As Integer Get @@ -122,10 +140,11 @@ Public Class Print3dPartVM m_sImportedFilePath = sImportedFilePath End Sub - Sub New(nPartId As Integer, nPrintSolidLayerId As Integer, nReferenceLayerId As Integer, nReferenceId As Integer, nMachStartLayerId As Integer, + Sub New(nPartId As Integer, nPrintSolidLayerId As Integer, nPartReferenceLayerId As Integer, nReferenceLayerId As Integer, nReferenceId As Integer, nMachStartLayerId As Integer, nRibsLayerId As Integer, nShellNumberLayerId As Integer, nAuxSolidsLayerId As Integer, nOthersLayerId As Integer, sImportedFilePath As String) m_nPartId = nPartId m_nPrintSolidLayerId = nPrintSolidLayerId + m_nPartReferenceLayerId = nPartReferenceLayerId m_nReferenceLayerId = nReferenceLayerId m_nReferenceId = nReferenceId m_nMachStartLayerId = nMachStartLayerId