diff --git a/Icarus/Icarus.vbproj b/Icarus/Icarus.vbproj
index 868f45e..cb6340f 100644
--- a/Icarus/Icarus.vbproj
+++ b/Icarus/Icarus.vbproj
@@ -159,6 +159,11 @@
MaterialDbV.xaml
+
+ ModifyPartPanelV.xaml
+
+
+ MachineBox.xaml
@@ -343,6 +348,10 @@
DesignerMSBuild:Compile
+
+ MSBuild:Compile
+ Designer
+ MSBuild:CompileDesigner
@@ -623,6 +632,7 @@
+ IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR64.exe
diff --git a/Icarus/ImportPanel/ImportPanelV.xaml b/Icarus/ImportPanel/ImportPanelV.xaml
index 0677b1d..8c9dd96 100644
--- a/Icarus/ImportPanel/ImportPanelV.xaml
+++ b/Icarus/ImportPanel/ImportPanelV.xaml
@@ -14,7 +14,7 @@
-
@@ -70,7 +70,7 @@
-
diff --git a/Icarus/ImportPanel/ImportPanelVM.vb b/Icarus/ImportPanel/ImportPanelVM.vb
index 4b5b7e6..0a40424 100644
--- a/Icarus/ImportPanel/ImportPanelVM.vb
+++ b/Icarus/ImportPanel/ImportPanelVM.vb
@@ -238,6 +238,7 @@ Public Class ImportPanelVM
Dim nShellNumberLayerId As Integer = GDB_ID.NULL
Dim nAuxSolidsLayerId As Integer = GDB_ID.NULL
Dim nMachStartLayerId As Integer = GDB_ID.NULL
+ Dim nOthersLayerId As Integer = GDB_ID.NULL
For Each ImportLayer In ImportPart.LayerList
Select Case ImportLayer.Type
Case ImportLayer.LayerType.PRINT_SOLID
@@ -322,7 +323,7 @@ Public Class ImportPanelVM
EgtSetColor(GeomEntity.nId, c3LightBlue)
Next
Case ImportLayer.LayerType.OTHERS
- Dim nOthersLayerId As Integer = EgtCreateGroup(nPartId)
+ nOthersLayerId = EgtCreateGroup(nPartId)
EgtSetName(nOthersLayerId, LAY_OTHERS)
For Each GeomEntity In ImportLayer.EntityList
EgtRelocateGlob(GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
@@ -371,7 +372,7 @@ Public Class ImportPanelVM
EgtGetInfo(m_nImportedPartId, FILE_PATH, sFilePath)
EgtSetInfo(nPartId, FILE_PATH, sFilePath)
EgtSetInfo(nPartId, "PartOnTable", 1)
- Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, PrintSolidEntity.nId, nOriginalPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, sFilePath)
+ Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, PrintSolidEntity.nId, nOriginalPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Map.refTopPanelVM.PartList.Add(NewPart)
Next
End If
diff --git a/Icarus/LeftPanel/LeftPanelV.xaml b/Icarus/LeftPanel/LeftPanelV.xaml
index 81d4ae5..acfcd48 100644
--- a/Icarus/LeftPanel/LeftPanelV.xaml
+++ b/Icarus/LeftPanel/LeftPanelV.xaml
@@ -36,7 +36,7 @@
-
+
diff --git a/Icarus/LeftPanel/LeftPanelVM.vb b/Icarus/LeftPanel/LeftPanelVM.vb
index 3ac65ca..91706da 100644
--- a/Icarus/LeftPanel/LeftPanelVM.vb
+++ b/Icarus/LeftPanel/LeftPanelVM.vb
@@ -54,6 +54,8 @@ Public Class LeftPanelVM
Map.refRibPanelVM.Init()
Case Panels.SHELLNUMBER
Map.refShellNumberPanelVM.Init()
+ Case Panels.MODIFYPART
+ Map.refModifyPartPanelVM.Init()
End Select
Map.refViewLayerManagerVM.UpdateForced()
NotifyPropertyChanged(NameOf(SelPanel))
diff --git a/Icarus/ModifyPartPanel/ModifyPartPanelV.xaml b/Icarus/ModifyPartPanel/ModifyPartPanelV.xaml
new file mode 100644
index 0000000..e1368ae
--- /dev/null
+++ b/Icarus/ModifyPartPanel/ModifyPartPanelV.xaml
@@ -0,0 +1,109 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Icarus/ModifyPartPanel/ModifyPartPanelV.xaml.vb b/Icarus/ModifyPartPanel/ModifyPartPanelV.xaml.vb
new file mode 100644
index 0000000..cc94700
--- /dev/null
+++ b/Icarus/ModifyPartPanel/ModifyPartPanelV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class ModifyPartPanelV
+
+End Class
diff --git a/Icarus/ModifyPartPanel/ModifyPartPanelVM.vb b/Icarus/ModifyPartPanel/ModifyPartPanelVM.vb
new file mode 100644
index 0000000..33e2895
--- /dev/null
+++ b/Icarus/ModifyPartPanel/ModifyPartPanelVM.vb
@@ -0,0 +1,407 @@
+Imports System.Collections.ObjectModel
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class ModifyPartPanelVM
+ Inherits VMBase
+
+ 'Private m_nImportedPartId As Integer = GDB_ID.NULL
+ 'Friend ReadOnly Property nImportedPartId As Integer
+ ' Get
+ ' Return m_nImportedPartId
+ ' End Get
+ 'End Property
+
+ 'Private m_ImportedEntityList As New ObservableCollection(Of GeomEntity)
+ 'Public Property ImportedEntityList As ObservableCollection(Of GeomEntity)
+ ' Get
+ ' Return m_ImportedEntityList
+ ' End Get
+ ' Set(value As ObservableCollection(Of GeomEntity))
+ ' m_ImportedEntityList = value
+ ' End Set
+ 'End Property
+
+ 'Private m_SelImportedEntity As GeomEntity
+ 'Public Property SelImportedEntity As GeomEntity
+ ' Get
+ ' Return m_SelImportedEntity
+ ' End Get
+ ' Set(value As GeomEntity)
+ ' m_SelImportedEntity = value
+ ' EgtDeselectAll()
+ ' If Not IsNothing(m_SelImportedEntity) Then
+ ' EgtSelectObj(m_SelImportedEntity.nId)
+ ' End If
+ ' EgtDraw()
+ ' End Set
+ 'End Property
+ 'Friend Sub SetSelImportedEntity(nId As Integer)
+ ' m_SelImportedEntity = Map.refImportPanelVM.ImportedEntityList.FirstOrDefault(Function(x) x.nId = nId)
+ ' EgtDeselectAll()
+ ' If Not IsNothing(m_SelImportedEntity) Then
+ ' EgtSelectObj(m_SelImportedEntity.nId)
+ ' End If
+ ' EgtDraw()
+ ' NotifyPropertyChanged(NameOf(SelImportedEntity))
+ 'End Sub
+
+ Private m_ModifyPartList As New ObservableCollection(Of ModifyPart)
+ Public ReadOnly Property ModifyPartList As ObservableCollection(Of ModifyPart)
+ Get
+ Return m_ModifyPartList
+ End Get
+ End Property
+
+ Private m_SelModifyPart As ModifyPart
+ Friend Sub SetSelModifyPart(SelModifyPart As ModifyPart)
+ m_SelModifyPart = SelModifyPart
+ m_SelModifyLayer = Nothing
+ End Sub
+ Public ReadOnly Property SelModifyPart As ModifyPart
+ Get
+ Return m_SelModifyPart
+ End Get
+ End Property
+
+ Private m_SelModifyLayer As ModifyLayer
+ Public ReadOnly Property SelModifyLayer As ModifyLayer
+ Get
+ Return m_SelModifyLayer
+ End Get
+ End Property
+ Friend Sub SetSelModifyLayer(SelModifyLayer As ModifyLayer)
+ m_SelModifyPart = m_ModifyPartList.FirstOrDefault(Function(x) x.LayerList.Contains(SelModifyLayer))
+ m_SelModifyLayer = SelModifyLayer
+ End Sub
+
+ Private m_SelModifyEntity As ModifyEntity
+ Public ReadOnly Property SelModifyEntity As ModifyEntity
+ Get
+ Return m_SelModifyEntity
+ End Get
+ End Property
+ Friend Sub SetSelModifyEntity(SelModifyEntity As ModifyEntity)
+ For Each CurrPart In m_ModifyPartList
+ Dim CurrLayer As ModifyLayer = CurrPart.LayerList.FirstOrDefault(Function(x) x.EntityList.Contains(SelModifyEntity))
+ If Not IsNothing(CurrLayer) Then
+ m_SelModifyPart = CurrPart
+ m_SelModifyLayer = CurrLayer
+ Exit For
+ End If
+ Next
+ m_SelModifyEntity = SelModifyEntity
+ End Sub
+
+ ' Definizione comandi
+ Private m_cmdOk As ICommand
+ Private m_cmdCancel As ICommand
+
+ Sub New()
+ ' Creo riferimento a questa classe in EgtCAM5Map
+ Map.SetRefModifyPartPanelVM(Me)
+ End Sub
+
+#Region "METHODS"
+
+ Friend Sub Init()
+ m_ModifyPartList.Clear()
+ ' carico pezzi in lista
+ For Each PrintPart In Map.refTopPanelVM.PartList
+ m_ModifyPartList.Add(New ModifyPart(PrintPart))
+ Next
+ End Sub
+
+#End Region ' METHODS
+
+#Region "COMMANDS"
+
+ '#Region "SetReference"
+
+ ' Public ReadOnly Property SetReference_Command As ICommand
+ ' Get
+ ' If m_cmdSetReference Is Nothing Then
+ ' m_cmdSetReference = New Command(AddressOf SetReference)
+ ' End If
+ ' Return m_cmdSetReference
+ ' End Get
+ ' End Property
+
+ ' Public Sub SetReference()
+ ' If Not IsNothing(SelGeomEntity) Then
+ ' Dim ChooseReferenceWndVM As New ChooseReferenceWndVM
+ ' Dim ChooseReferenceWndV As New ChooseReferenceWndV(Application.Current.MainWindow, ChooseReferenceWndVM)
+ ' If Not ChooseReferenceWndV.ShowDialog() Then Return
+ ' SelGeomEntity.Reference = ChooseReferenceWndVM.SelReference
+ ' End If
+ ' End Sub
+
+ '#End Region ' SetReference
+
+ '#Region "AddPart"
+
+ ' Public ReadOnly Property AddPart_Command As ICommand
+ ' Get
+ ' If m_cmdAddPart Is Nothing Then
+ ' m_cmdAddPart = New Command(AddressOf AddPart)
+ ' End If
+ ' Return m_cmdAddPart
+ ' End Get
+ ' End Property
+
+ ' Public Sub AddPart()
+ ' m_ImportPartList.Add(New ImportPart)
+ ' End Sub
+
+ '#End Region ' AddPart
+
+ '#Region "RemovePart"
+
+ ' Public ReadOnly Property RemovePart_Command As ICommand
+ ' Get
+ ' If m_cmdRemovePart Is Nothing Then
+ ' m_cmdRemovePart = New Command(AddressOf RemovePart)
+ ' End If
+ ' Return m_cmdRemovePart
+ ' End Get
+ ' End Property
+
+ ' Public Sub RemovePart()
+ ' If IsNothing(SelImportLayer) Then
+ ' ' rimuovo pezzo
+ ' m_ImportPartList.Remove(SelImportPart)
+ ' Else
+ ' ' rimuovo geometria
+ ' Dim CurrEntity As GeomEntity = m_SelGeomEntity
+ ' SelImportLayer.EntityList.Remove(m_SelGeomEntity)
+ ' ' la rimetto in lista importati
+ ' ImportedEntityList.Add(CurrEntity)
+ ' End If
+ ' End Sub
+
+ '#End Region ' RemovePart
+
+#Region "Ok"
+
+ Public ReadOnly Property Ok_Command As ICommand
+ Get
+ If m_cmdOk Is Nothing Then
+ m_cmdOk = New Command(AddressOf Ok)
+ End If
+ Return m_cmdOk
+ End Get
+ End Property
+
+ Public Sub Ok()
+ 'Dim sErr As New List(Of String)
+ '' verifico che tutti i pezzi abbiano una superficie da stampare nel layer apposito
+ 'For Each CurrPart In m_ImportPartList
+ ' For Each CurrLayer In CurrPart.LayerList
+ ' Select Case CurrLayer.Type
+ ' Case ImportLayer.LayerType.PRINT_SOLID
+ ' If CurrLayer.EntityList.Count = 0 Then
+ ' If sErr.Count > 0 Then sErr(sErr.Count - 1) &= Environment.NewLine
+ ' sErr.Add(CurrPart.ghName & " - No print surface defined!")
+ ' End If
+ ' End Select
+ ' Next
+ 'Next
+ 'If sErr.Count > 0 Then
+ ' MessageBox.Show(String.Concat(sErr), "Error")
+ ' Return
+ 'Else
+ ' ' Creo pezzi e layer necessari
+ ' For Each ImportPart In m_ImportPartList
+ ' Dim frImportedPart As New Frame3d
+ ' EgtGetGroupGlobFrame(m_nImportedPartId, frImportedPart)
+ ' Dim nPartId As Integer = EgtCreateGroup(GDB_ID.ROOT, frImportedPart)
+ ' EgtSetName(nPartId, PART)
+ ' Dim nFrameId As Integer = GDB_ID.NULL
+ ' Dim b3PrintSolid As New BBox3d
+ ' Dim nPrintPartLayerId As Integer = GDB_ID.NULL
+ ' Dim PrintSolidEntity As GeomEntity = Nothing
+ ' Dim nOriginalPartLayerId As Integer = GDB_ID.NULL
+ ' Dim nRibsLayerId As Integer = GDB_ID.NULL
+ ' Dim nShellNumberLayerId As Integer = GDB_ID.NULL
+ ' Dim nAuxSolidsLayerId As Integer = GDB_ID.NULL
+ ' Dim nMachStartLayerId As Integer = GDB_ID.NULL
+ ' Dim nOthersLayerId As Integer = GDB_ID.NULL
+ ' For Each ImportLayer In ImportPart.LayerList
+ ' Select Case ImportLayer.Type
+ ' Case ImportLayer.LayerType.PRINT_SOLID
+ ' nPrintPartLayerId = EgtCreateGroup(nPartId)
+ ' EgtSetName(nPrintPartLayerId, PRINT_SOLID)
+ ' If ImportLayer.EntityList.Count > 0 Then
+ ' PrintSolidEntity = ImportLayer.EntityList(0)
+ ' EgtRelocateGlob(PrintSolidEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
+ ' ' calcolo box superficie per creazione riferimento
+ ' EgtGetBBoxGlob(PrintSolidEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
+ ' End If
+ ' 'Case ImportLayer.LayerType.ORIGINAL_SOLID
+ ' ' nOriginalPartLayerId = EgtCreateGroup(nPartId)
+ ' ' EgtSetName(nOriginalPartLayerId, ORIGINAL_SOLID)
+ ' ' For Each GeomEntity In ImportLayer.EntityList
+ ' ' EgtRelocateGlob(GeomEntity.nId, nOriginalPartLayerId, GDB_POS.LAST_SON)
+ ' ' Next
+ ' Case ImportLayer.LayerType.MACH_START
+ ' nMachStartLayerId = EgtCreateGroup(nPartId)
+ ' EgtSetName(nMachStartLayerId, LAY_MACH_START)
+ ' Dim nMachStartId As Integer = GDB_ID.NULL
+ ' If ImportLayer.EntityList.Count > 0 Then
+ ' For Each GeomEntity In ImportLayer.EntityList
+ ' ' se punto o curva compo
+ ' Dim EntityType As GDB_TY = EgtGetType(GeomEntity.nId)
+ ' Select Case EntityType
+ ' Case GDB_TY.GEO_POINT, GDB_TY.CRV_COMPO
+ ' ' gli cambio layer
+ ' EgtRelocateGlob(GeomEntity.nId, nMachStartLayerId, GDB_POS.LAST_SON)
+ ' nMachStartId = GeomEntity.nId
+ ' Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
+ ' ' altrimenti la trasformo in curva compo
+ ' nMachStartId = EgtCreateCurveCompo(nMachStartLayerId, GeomEntity.nId, True)
+ ' End Select
+ ' EgtSetName(nMachStartId, START_GEOM)
+ ' ' coloro l'entita' di rosso
+ ' Dim c3Red As Color3d
+ ' c3Red.FromColor(System.Drawing.Color.Red)
+ ' EgtSetColor(nMachStartId, c3Red)
+ ' Next
+ ' Else
+ ' ' creo punto di partenza
+ ' Dim ptStart As Point3d = b3PrintSolid.Center() - 0.6 * b3PrintSolid.DimY() * Vector3d.Y_AX() - 0.5 * b3PrintSolid.DimZ() * Vector3d.Z_AX()
+ ' nMachStartId = EgtCreateGeoPoint(nMachStartLayerId, ptStart, GDB_RT.GLOB)
+ ' EgtSetName(nMachStartId, START_GEOM)
+ ' ' coloro l'entita' di rosso
+ ' Dim c3Red As Color3d
+ ' c3Red.FromColor(System.Drawing.Color.Red)
+ ' EgtSetColor(nMachStartId, c3Red)
+ ' End If
+ ' Case ImportLayer.LayerType.RIBS
+ ' nRibsLayerId = EgtCreateGroup(nPartId)
+ ' EgtSetName(nRibsLayerId, LAY_RIBS)
+ ' For Each GeomEntity In ImportLayer.EntityList
+ ' EgtSetInfo(GeomEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
+ ' EgtRelocateGlob(GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON)
+ ' ' coloro l'entita' di viola
+ ' Dim c3LightBlue As Color3d
+ ' c3LightBlue.FromColor(System.Drawing.Color.MediumOrchid)
+ ' EgtSetColor(GeomEntity.nId, c3LightBlue)
+ ' Next
+ ' Case ImportLayer.LayerType.SHELL_NUMBER
+ ' nShellNumberLayerId = EgtCreateGroup(nPartId)
+ ' EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
+ ' For Each GeomEntity In ImportLayer.EntityList
+ ' EgtSetInfo(GeomEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
+ ' EgtRelocateGlob(GeomEntity.nId, nShellNumberLayerId, GDB_POS.LAST_SON)
+ ' ' coloro l'entita' di verde
+ ' Dim c3LightBlue As Color3d
+ ' c3LightBlue.FromColor(System.Drawing.Color.Lime)
+ ' EgtSetColor(GeomEntity.nId, c3LightBlue)
+ ' Next
+ ' Case ImportLayer.LayerType.AUX_SOLIDS
+ ' nAuxSolidsLayerId = EgtCreateGroup(nPartId)
+ ' EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
+ ' For Each GeomEntity In ImportLayer.EntityList
+ ' EgtSetInfo(GeomEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT)
+ ' EgtRelocateGlob(GeomEntity.nId, nAuxSolidsLayerId, GDB_POS.LAST_SON)
+ ' ' coloro l'entita' di oro
+ ' Dim c3LightBlue As Color3d
+ ' c3LightBlue.FromColor(System.Drawing.Color.DarkGoldenrod)
+ ' EgtSetColor(GeomEntity.nId, c3LightBlue)
+ ' Next
+ ' Case ImportLayer.LayerType.OTHERS
+ ' nOthersLayerId = EgtCreateGroup(nPartId)
+ ' EgtSetName(nOthersLayerId, LAY_OTHERS)
+ ' For Each GeomEntity In ImportLayer.EntityList
+ ' EgtRelocateGlob(GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
+ ' Next
+ ' End Select
+ ' Next
+ ' ' aggiungo riferimento
+ ' Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
+ ' EgtSetName(nReferenceLayerId, LAY_REFERENCE)
+ ' ' Creo riferimento
+ ' Dim ptOrig As New Point3d(b3PrintSolid.Min())
+ ' Select Case PrintSolidEntity.Reference
+ ' Case ChooseReferenceWndVM.References.TL
+ ' ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX
+ ' Case ChooseReferenceWndVM.References.TR
+ ' ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
+ ' Case ChooseReferenceWndVM.References.BL
+ ' Case ChooseReferenceWndVM.References.BR
+ ' ptOrig += b3PrintSolid.DimX() * Vector3d.X_AX
+ ' Case ChooseReferenceWndVM.References.TC
+ ' ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
+ ' Case ChooseReferenceWndVM.References.ML
+ ' ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX
+ ' Case ChooseReferenceWndVM.References.MR
+ ' ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
+ ' Case ChooseReferenceWndVM.References.TC
+ ' ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
+ ' Case ChooseReferenceWndVM.References.MR
+ ' ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
+ ' Case ChooseReferenceWndVM.References.BC
+ ' ptOrig += b3PrintSolid.DimX() / 2 * Vector3d.X_AX
+ ' Case ChooseReferenceWndVM.References.MC
+ ' ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
+ ' End Select
+ ' Dim frPrintSolid As New Frame3d(ptOrig)
+ ' nFrameId = EgtCreateGeoFrame(nReferenceLayerId, frPrintSolid, GDB_RT.GLOB)
+ ' If nFrameId Then
+ ' EgtSetName(nFrameId, FRAME_PART)
+ ' EgtSetMode(nFrameId, GDB_MD.LOCKED)
+ ' End If
+ ' EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, PrintSolidEntity.Reference)
+ ' ' appoggio il pezzo sulla tavola
+ ' EgtMove( nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
+ ' ' lo aggiungo a lista pezzi
+ ' Dim sFilePath As String = ""
+ ' EgtGetInfo(m_nImportedPartId, FILE_PATH, sFilePath)
+ ' EgtSetInfo(nPartId, FILE_PATH, sFilePath)
+ ' EgtSetInfo(nPartId, "PartOnTable", 1)
+ ' Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, PrintSolidEntity.nId, nOriginalPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
+ ' Map.refTopPanelVM.PartList.Add(NewPart)
+ ' Next
+ 'End If
+ ''EgtAddMachGroup("3dPrint")
+ ''EgtSetTable("Tab")
+
+ ''Dim nRawId As Integer = EgtAddRawPart(b3PrintSolid.Min, b3PrintSolid.DimX, b3PrintSolid.DimY, b3PrintSolid.DimZ, New Color3d(128, 128, 128, 30))
+ ''EgtAddPartToRawPart(nPartId, b3PrintSolid.Min, nRawId)
+ ''EgtMoveToCornerRawPart(nRawId, New Point3d(dPosX, dPosY, 0), MCH_CR.BL)
+
+ ''EgtResetCurrMachGroup()
+
+ '' seleziono ultimo pezzo aggiunto
+ 'Map.refTopPanelVM.SelLastPart()
+ '' elimino vecchio pezzo d'importazione
+ 'EgtErase(m_nImportedPartId)
+
+ 'EgtDraw()
+ ' ripristino modalita' standard
+ Map.refTopPanelVM.SelPage = Pages.MODIFY
+ End Sub
+
+#End Region ' Ok
+
+#Region "Cancel"
+
+ Public ReadOnly Property Cancel_Command As ICommand
+ Get
+ If m_cmdCancel Is Nothing Then
+ m_cmdCancel = New Command(AddressOf Cancel)
+ End If
+ Return m_cmdCancel
+ End Get
+ End Property
+
+ Public Sub Cancel()
+ ' ripristino modalita' standard
+ Map.refTopPanelVM.SelPage = Pages.MODIFY
+ End Sub
+
+#End Region ' Cancel
+
+#End Region ' COMMANDS
+
+End Class
diff --git a/Icarus/ModifyPartPanel/ModifyPartUtility.vb b/Icarus/ModifyPartPanel/ModifyPartUtility.vb
new file mode 100644
index 0000000..fbfa7fa
--- /dev/null
+++ b/Icarus/ModifyPartPanel/ModifyPartUtility.vb
@@ -0,0 +1,231 @@
+Imports System.Collections.ObjectModel
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class ModifyEntity
+ Inherits VMBase
+
+ Private m_bIsSelected As Boolean
+ Public Property bIsSelected As Boolean
+ Get
+ Return m_bIsSelected
+ End Get
+ Set(value As Boolean)
+ m_bIsSelected = value
+ ' seleziono in scena
+ EgtDeselectAll()
+ If Not IsNothing(value) Then
+ EgtSelectObj(m_nId)
+ End If
+ EgtDraw()
+ ' segno come elemento selezionato in treeview
+ Map.refModifyPartPanelVM.SetSelModifyEntity(Me)
+ End Set
+ End Property
+
+ Private m_nId As Integer = GDB_ID.NULL
+ Public ReadOnly Property nId As Integer
+ Get
+ Return m_nId
+ End Get
+ End Property
+
+ Private m_sName As String
+ Public ReadOnly Property sName As String
+ Get
+ Return m_sName
+ End Get
+ End Property
+
+ Public ReadOnly Property ghName As String
+ Get
+ Return m_nId & If(Not String.IsNullOrWhiteSpace(m_sName), " - " & m_sName, "")
+ End Get
+ End Property
+
+ ' Definizione comandi
+ Private m_cmdImportedEntity As ICommand
+
+ Sub New(nId As Integer, sName As String)
+ m_nId = nId
+ m_sName = sName
+ End Sub
+
+#Region "COMMANDS"
+
+#Region "ImportedEntity"
+
+ Public ReadOnly Property ImportedEntity_DoubleClick As ICommand
+ Get
+ If m_cmdImportedEntity Is Nothing Then
+ m_cmdImportedEntity = New Command(AddressOf ImportedEntity)
+ End If
+ Return m_cmdImportedEntity
+ End Get
+ End Property
+
+ Public Sub ImportedEntity()
+ If Not IsNothing(Map.refImportPanelVM.SelImportLayer) Then
+ 'Map.refModifyPartPanelVM.ImportedEntityList.Remove(Me)
+ Map.refModifyPartPanelVM.SelModifyLayer.EntityList.Add(Me)
+ End If
+ End Sub
+
+#End Region ' ImportedEntity
+
+#End Region ' COMMANDS
+
+End Class
+
+Public Class ModifyPart
+ Inherits VMBase
+
+ Private m_bIsSelected As Boolean
+ Public Property bIsSelected As Boolean
+ Get
+ Return m_bIsSelected
+ End Get
+ Set(value As Boolean)
+ m_bIsSelected = value
+ Map.refModifyPartPanelVM.SetSelModifyPart(Me)
+ End Set
+ End Property
+
+ Private m_nId As Integer
+ Public ReadOnly Property nId As Integer
+ Get
+ Return m_nId
+ End Get
+ End Property
+
+ Private m_sName As String
+ Public Property sName As String
+ Get
+ Return m_sName
+ End Get
+ Set(value As String)
+ m_sName = value
+ End Set
+ End Property
+
+ Public ReadOnly Property ghName As String
+ Get
+ Return If(Not String.IsNullOrWhiteSpace(m_sName), m_nId & " - " & m_sName, "Part" & m_nId)
+ End Get
+ End Property
+
+ Private m_LayerList As New ObservableCollection(Of ModifyLayer)
+ Public ReadOnly Property LayerList As ObservableCollection(Of ModifyLayer)
+ Get
+ Return m_LayerList
+ End Get
+ End Property
+
+ Sub New(PrintPart As Print3dPartVM)
+ 'm_nId = If(Map.refImportPanelVM.ImportPartList.Count = 0, 1, Map.refImportPanelVM.ImportPartList.Max(Function(x) x.m_nId) + 1)
+ m_LayerList.Add(New ModifyLayer(ImportLayer.LayerType.PRINT_SOLID, "Print", PrintPart))
+ m_LayerList.Add(New ModifyLayer(ImportLayer.LayerType.MACH_START, "Layer Start", PrintPart))
+ m_LayerList.Add(New ModifyLayer(ImportLayer.LayerType.RIBS, "Ribs", PrintPart))
+ m_LayerList.Add(New ModifyLayer(ImportLayer.LayerType.SHELL_NUMBER, "Reduce Shell Number", PrintPart))
+ m_LayerList.Add(New ModifyLayer(ImportLayer.LayerType.AUX_SOLIDS, "Filled Solids", PrintPart))
+ m_LayerList.Add(New ModifyLayer(ImportLayer.LayerType.OTHERS, "Others", PrintPart))
+ End Sub
+
+End Class
+
+Public Class ModifyLayer
+ Inherits VMBase
+
+ Public Enum LayerType As Integer
+ PRINT_SOLID = 1
+ MACH_START = 2
+ RIBS = 3
+ SHELL_NUMBER = 4
+ AUX_SOLIDS = 5
+ OTHERS = 7
+ End Enum
+
+ Private m_nLayerId As Integer
+
+ Private m_bIsSelected As Boolean
+ Public Property bIsSelected As Boolean
+ Get
+ Return m_bIsSelected
+ End Get
+ Set(value As Boolean)
+ m_bIsSelected = value
+ Map.refModifyPartPanelVM.SetSelModifyLayer(Me)
+ End Set
+ End Property
+
+ Private m_Type As LayerType
+ Public Property Type As LayerType
+ Get
+ Return m_Type
+ End Get
+ Set(value As LayerType)
+ m_Type = value
+ End Set
+ End Property
+
+ Private m_sName As String
+ Public Property sName As String
+ Get
+ Return m_sName
+ End Get
+ Set(value As String)
+ m_sName = value
+ End Set
+ End Property
+
+ Private m_EntityList As New ObservableCollection(Of ModifyEntity)
+ Public Property EntityList As ObservableCollection(Of ModifyEntity)
+ Get
+ Return m_EntityList
+ End Get
+ Set(value As ObservableCollection(Of ModifyEntity))
+ m_EntityList = value
+ End Set
+ End Property
+
+ Sub New(Type As LayerType, sName As String)
+ m_Type = Type
+ m_sName = sName
+ End Sub
+
+ Sub New(Type As LayerType, sName As String, PrintPart As Print3dPartVM)
+ m_Type = Type
+ m_sName = sName
+ Select Case Type
+ Case LayerType.PRINT_SOLID
+ m_nLayerId = PrintPart.nPrintSolidLayerId
+ Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
+ Dim sEnitytName As String = ""
+ EgtGetName(nEntityId, sEnitytName)
+ m_EntityList.Add(New ModifyEntity(nEntityId, sEnitytName))
+ Case LayerType.MACH_START
+ m_nLayerId = PrintPart.nMachStartLayerId
+ Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
+ Dim sEntitytName As String = ""
+ EgtGetName(nEntityId, sEntitytName)
+ While nEntityId <> GDB_ID.NULL
+ m_EntityList.Add(New ModifyEntity(nEntityId, sEntitytName))
+ nEntityId = EgtGetNext(nEntityId)
+ EgtGetName(nEntityId, sEntitytName)
+ End While
+ Case LayerType.RIBS
+ m_nLayerId = PrintPart.nRibsLayerId
+ Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
+ Dim sEnitytName As String = ""
+ EgtGetName(nEntityId, sEnitytName)
+ m_EntityList.Add(New ModifyEntity(nEntityId, sEnitytName))
+ Case LayerType.SHELL_NUMBER
+ m_nLayerId = PrintPart.nShellNumberLayerId
+ Case LayerType.AUX_SOLIDS
+ m_nLayerId = PrintPart.nAuxSolidsLayerId
+ Case LayerType.OTHERS
+ m_nLayerId = PrintPart.nOthersLayerId
+ End Select
+ End Sub
+
+End Class
diff --git a/Icarus/SceneHost/MySceneHostVM.vb b/Icarus/SceneHost/MySceneHostVM.vb
index f7e558e..c251708 100644
--- a/Icarus/SceneHost/MySceneHostVM.vb
+++ b/Icarus/SceneHost/MySceneHostVM.vb
@@ -902,11 +902,12 @@ Public Class MySceneHostVM
Dim nShellNumberLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_SHELL_NBR)
Dim nAuxSolidsLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_AUX_SOLIDS)
Dim nMachStartLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_MACH_START)
+ Dim nOthersLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_OTHERS)
Dim sFilePath As String = ""
EgtGetInfo(nPartId, FILE_PATH, sFilePath)
Dim nReferenceLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_REFERENCE)
Dim nFrameId As Integer = EgtGetFirstInGroup(nReferenceLayerId)
- Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nPrintPartId, nOriginalPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, sFilePath)
+ Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nPrintPartId, nOriginalPartLayerId, 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/TopPanel/TopPanelV.xaml b/Icarus/TopPanel/TopPanelV.xaml
index d0d18c2..58ad88f 100644
--- a/Icarus/TopPanel/TopPanelV.xaml
+++ b/Icarus/TopPanel/TopPanelV.xaml
@@ -42,11 +42,11 @@
FontWeight="Light"
VerticalContentAlignment="Center">
-
+
+