diff --git a/Icarus/Constants/ConstGen.vb b/Icarus/Constants/ConstGen.vb
index 30e31c2..1e1ccef 100644
--- a/Icarus/Constants/ConstGen.vb
+++ b/Icarus/Constants/ConstGen.vb
@@ -34,6 +34,7 @@ Public Module ConstGen
MATERIALDB = 5
MACHININGDB = 6
CURRMACHINING = 7
+ MODIFYPART = 8
End Enum
' MOdalita' di modifica
diff --git a/Icarus/ImportPanel/ImportPanelVM.vb b/Icarus/ImportPanel/ImportPanelVM.vb
index 00c5747..ec7ee57 100644
--- a/Icarus/ImportPanel/ImportPanelVM.vb
+++ b/Icarus/ImportPanel/ImportPanelVM.vb
@@ -364,6 +364,7 @@ Public Class ImportPanelVM
EgtSetMode(nFrameId, GDB_MD.LOCKED)
End If
EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, PrintSolidEntity.Reference)
+ EgtMove(nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
' lo aggiungo a lista pezzi
Dim sFilePath As String = ""
EgtGetInfo(m_nImportedPartId, FILE_PATH, sFilePath)
diff --git a/Icarus/LeftPanel/LeftPanelV.xaml b/Icarus/LeftPanel/LeftPanelV.xaml
index 82dc800..377cf51 100644
--- a/Icarus/LeftPanel/LeftPanelV.xaml
+++ b/Icarus/LeftPanel/LeftPanelV.xaml
@@ -35,6 +35,9 @@
+
+
+
diff --git a/Icarus/LeftPanel/LeftPanelVM.vb b/Icarus/LeftPanel/LeftPanelVM.vb
index d664008..a5d8932 100644
--- a/Icarus/LeftPanel/LeftPanelVM.vb
+++ b/Icarus/LeftPanel/LeftPanelVM.vb
@@ -14,6 +14,7 @@ Public Class LeftPanelVM
RIBS = 5
SHELLNUMBER = 6
AUXSOLIDS = 7
+ MODIFYPART = 8
End Enum
Private m_SelPanel As Panels
diff --git a/Icarus/My Project/AssemblyInfo.vb b/Icarus/My Project/AssemblyInfo.vb
index ae1f7a2..d686007 100644
--- a/Icarus/My Project/AssemblyInfo.vb
+++ b/Icarus/My Project/AssemblyInfo.vb
@@ -61,4 +61,4 @@ Imports System.Windows
'
-
+
diff --git a/Icarus/RibPanel/RibPanelVM.vb b/Icarus/RibPanel/RibPanelVM.vb
index e7625eb..1dd90bb 100644
--- a/Icarus/RibPanel/RibPanelVM.vb
+++ b/Icarus/RibPanel/RibPanelVM.vb
@@ -681,7 +681,8 @@ Public Class RibPanelVM
'''
Public Sub Line2P(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
- Dim nNewRibLayerId As Integer = EgtCreateGroup(m_nPartId)
+ Dim nNewRibLayerId As Integer = EgtGetFirstNameInGroup(m_nPartId, LAY_NEWRIB)
+ If nNewRibLayerId = GDB_ID.NULL Then nNewRibLayerId = EgtCreateGroup(m_nPartId)
EgtSetName(nNewRibLayerId, LAY_NEWRIB)
EgtSetCurrPartLayer(m_nPartId, nNewRibLayerId)
Map.refSceneHostVM.MainController.SetContinue()
diff --git a/Icarus/ShellNumberPanel/ShellNumberPanelVM.vb b/Icarus/ShellNumberPanel/ShellNumberPanelVM.vb
index 41ee11e..6cfff72 100644
--- a/Icarus/ShellNumberPanel/ShellNumberPanelVM.vb
+++ b/Icarus/ShellNumberPanel/ShellNumberPanelVM.vb
@@ -695,7 +695,8 @@ Public Class ShellNumberPanelVM
'''
Public Sub Line2P(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
- Dim nNewShellNumberLayerId As Integer = EgtCreateGroup(m_nPartId)
+ Dim nNewShellNumberLayerId As Integer = EgtGetFirstNameInGroup(m_nPartId, LAY_NEWRIB)
+ If nNewShellNumberLayerId = GDB_ID.NULL Then nNewShellNumberLayerId = EgtCreateGroup(m_nPartId)
EgtSetName(nNewShellNumberLayerId, LAY_NEWRIB)
EgtSetCurrPartLayer(m_nPartId, nNewShellNumberLayerId)
Map.refSceneHostVM.MainController.SetContinue()
diff --git a/Icarus/SliderManager/LayerAdvancementSliderV.xaml b/Icarus/SliderManager/LayerAdvancementSliderV.xaml
index 5ea7e6a..f7265b3 100644
--- a/Icarus/SliderManager/LayerAdvancementSliderV.xaml
+++ b/Icarus/SliderManager/LayerAdvancementSliderV.xaml
@@ -3,5 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400"
Value="{Binding dLayerAdvancement}"
+ Minimum="0"
+ Maximum="100"
Visibility="{Binding LayerAdvancement_Visibility}"/>
diff --git a/Icarus/SliderManager/SliderManagerVM.vb b/Icarus/SliderManager/SliderManagerVM.vb
index 54b8308..13ff78e 100644
--- a/Icarus/SliderManager/SliderManagerVM.vb
+++ b/Icarus/SliderManager/SliderManagerVM.vb
@@ -22,10 +22,22 @@ Public Class SliderManagerVM
Select Case m_nSelViewSlider
Case ViewSliderType.ONLY_SELECTED
' se diverso da nullo nascondo precedente
- If m_nLayerIndex > 0 Then EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).nLayerId, GDB_ST.OFF)
+ If Not IsNothing(Map.refTopPanelVM.SelPart) Then
+ ' riporto vecchio strato a visualizzazione di tutti i solidi
+ If m_nLayerIndex > 0 Then dLayerAdvancement = 100
+ If m_nLayerIndex = 0 Then
+ For Each Layer In Map.refTopPanelVM.SelPart.LayerList
+ EgtSetStatus(Layer.nLayerId, GDB_ST.OFF)
+ Next
+ ElseIf m_nLayerIndex > 0 Then
+ EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).nLayerId, GDB_ST.OFF)
+ End If
+ End If
m_nLayerIndex = value
' se diverso da nullo visualizzo corrente
- If m_nLayerIndex > 0 Then EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).nLayerId, GDB_ST.ON_)
+ If Not IsNothing(Map.refTopPanelVM.SelPart) AndAlso m_nLayerIndex > 0 Then EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).nLayerId, GDB_ST.ON_)
+ ' porto barra nuovo strato a 100
+ If m_nLayerIndex > 0 Then SetLayerAdvancement(100)
Case ViewSliderType.UNTIL_SELECTED
Dim LayerIndex As Integer = If(m_nLayerIndex > 0, m_nLayerIndex, 1)
If value > m_nLayerIndex Then
@@ -55,6 +67,56 @@ Public Class SliderManagerVM
EgtDraw()
End Set
End Property
+ Private Sub SetLayerIndex(value As Integer)
+ Select Case m_nSelViewSlider
+ Case ViewSliderType.ONLY_SELECTED
+ If Not IsNothing(Map.refTopPanelVM.SelPart) Then
+ ' riporto vecchio strato a visualizzazione di tutti i solidi
+ If m_nLayerIndex > 0 Then dLayerAdvancement = 100
+ For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1
+ If nLayerInd = value - 1 Then
+ EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_)
+ Else
+ EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.OFF)
+ End If
+ Next
+ End If
+ m_nLayerIndex = value
+ NotifyPropertyChanged(NameOf(ghShowValue))
+ EgtDraw()
+ Case ViewSliderType.UNTIL_SELECTED
+ If Not IsNothing(Map.refTopPanelVM.SelPart) Then
+ ' riporto vecchio strato a visualizzazione di tutti i solidi
+ If m_nLayerIndex > 0 Then dLayerAdvancement = 100
+ For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1
+ If nLayerInd <= value - 1 Then
+ EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_)
+ Else
+ EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.OFF)
+ End If
+ Next
+ End If
+ m_nLayerIndex = value
+ NotifyPropertyChanged(NameOf(ghShowValue))
+ EgtDraw()
+ Case ViewSliderType.FROM_SELECTED
+ If Not IsNothing(Map.refTopPanelVM.SelPart) Then
+ ' riporto vecchio strato a visualizzazione di tutti i solidi
+ If m_nLayerIndex > 0 Then dLayerAdvancement = 100
+ For nLayerInd = 0 To Map.refTopPanelVM.SelPart.LayerList.Count - 1
+ If nLayerInd >= value - 1 Then
+ EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.ON_)
+ Else
+ EgtSetStatus(Map.refTopPanelVM.SelPart.LayerList(nLayerInd).nLayerId, GDB_ST.OFF)
+ End If
+ Next
+ End If
+ m_nLayerIndex = value
+ NotifyPropertyChanged(NameOf(ghShowValue))
+ EgtDraw()
+ End Select
+ NotifyPropertyChanged(NameOf(nLayerIndex))
+ End Sub
Public ReadOnly Property ghShowValue As String
Get
@@ -92,9 +154,59 @@ Public Class SliderManagerVM
Return m_dLayerAdvancement
End Get
Set(value As Double)
- m_dLayerAdvancement = value
+ Select Case m_nSelViewSlider
+ Case ViewSliderType.ONLY_SELECTED
+ Dim nTotSolid As Integer = 0
+ For Each nLayerId In Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).SolidLayerIdList
+ nTotSolid += EgtGetGroupObjs(nLayerId)
+ Next
+ Dim nTotToolPath As Integer = 0
+ For Each nLayerId In Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).ToolPathLayerIdList
+ nTotToolPath += EgtGetGroupObjs(nLayerId)
+ Next
+ Dim nOldSolidAdvancement As Integer = Math.Ceiling(nTotSolid * m_dLayerAdvancement / 100)
+ Dim nNewSolidAdvancement As Integer = Math.Ceiling(nTotSolid * value / 100)
+ If nNewSolidAdvancement <> nOldSolidAdvancement Then
+ Dim nIndex As Integer = 0
+ For nSolidLayerIndex = 0 To Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).SolidLayerIdList.Count - 1
+ Dim nId As Integer = EgtGetFirstInGroup(Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).SolidLayerIdList(nSolidLayerIndex))
+ While nId <> GDB_ID.NULL
+ nIndex += 1
+ If nIndex <= nNewSolidAdvancement Then
+ EgtSetStatus(nId, GDB_ST.ON_)
+ Else
+ EgtSetStatus(nId, GDB_ST.OFF)
+ End If
+ nId = EgtGetNext(nId)
+ End While
+ Next
+ End If
+ Dim nOldToolPathAdvancement As Integer = Math.Ceiling(nTotToolPath * m_dLayerAdvancement / 100)
+ Dim nNewToolPathAdvancement As Integer = Math.Ceiling(nTotToolPath * value / 100)
+ If nNewToolPathAdvancement <> nOldToolPathAdvancement Then
+ Dim nIndex As Integer = 0
+ For nToolPathLayerIndex = 0 To Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).ToolPathLayerIdList.Count - 1
+ Dim nId As Integer = EgtGetFirstInGroup(Map.refTopPanelVM.SelPart.LayerList(m_nLayerIndex - 1).ToolPathLayerIdList(nToolPathLayerIndex))
+ While nId <> GDB_ID.NULL
+ nIndex += 1
+ If nIndex <= nNewToolPathAdvancement Then
+ EgtSetStatus(nId, GDB_ST.ON_)
+ Else
+ EgtSetStatus(nId, GDB_ST.OFF)
+ End If
+ nId = EgtGetNext(nId)
+ End While
+ Next
+ End If
+ m_dLayerAdvancement = value
+ End Select
+ EgtDraw()
End Set
End Property
+ Friend Sub SetLayerAdvancement(value As Double)
+ m_dLayerAdvancement = value
+ NotifyPropertyChanged(NameOf(dLayerAdvancement))
+ End Sub
Private m_LayerIndex_Visibility As Visibility = Visibility.Collapsed
Public Property LayerIndex_Visibility As Visibility
@@ -217,21 +329,21 @@ Public Class SliderManagerVM
NotifyPropertyChanged(NameOf(nLayerIndex_Minimum))
NotifyPropertyChanged(NameOf(nLayerIndex_Maximum))
NotifyPropertyChanged(NameOf(ghShowMaximum))
- nLayerIndex = m_nLayerIndex
+ SetLayerIndex(m_nLayerIndex)
End Sub
Friend Sub SetLayerIndexToMax()
- nLayerIndex = m_nLayerIndex_Maximum
+ SetLayerIndex(m_nLayerIndex_Maximum)
NotifyPropertyChanged(NameOf(nLayerIndex))
End Sub
Friend Sub SetLayerIndexToMin()
- nLayerIndex = m_nLayerIndex_Minimum
+ SetLayerIndex(m_nLayerIndex_Minimum)
NotifyPropertyChanged(NameOf(nLayerIndex))
End Sub
Friend Sub SetLayerIndexToZero()
- nLayerIndex = 0
+ SetLayerIndex(0)
NotifyPropertyChanged(NameOf(nLayerIndex))
End Sub
diff --git a/Icarus/StartMachPanel/StartMachPanelVM.vb b/Icarus/StartMachPanel/StartMachPanelVM.vb
index 06f6435..3630937 100644
--- a/Icarus/StartMachPanel/StartMachPanelVM.vb
+++ b/Icarus/StartMachPanel/StartMachPanelVM.vb
@@ -460,7 +460,8 @@ Public Class StartMachPanelVM
'''
Public Sub Point(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
- Dim nNewStartLayerId As Integer = EgtCreateGroup(m_nPartId)
+ Dim nNewStartLayerId As Integer = EgtGetFirstNameInGroup(m_nPartId, LAY_NEWSTART)
+ If nNewStartLayerId = GDB_ID.NULL Then nNewStartLayerId = EgtCreateGroup(m_nPartId)
EgtSetName(nNewStartLayerId, LAY_NEWSTART)
EgtSetCurrPartLayer(m_nPartId, nNewStartLayerId)
'InitCommand(True)
@@ -490,7 +491,8 @@ Public Class StartMachPanelVM
'''
Public Sub Line2P(ByVal param As Object)
If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return
- Dim nNewStartLayerId As Integer = EgtCreateGroup(m_nPartId)
+ Dim nNewStartLayerId As Integer = EgtGetFirstNameInGroup(m_nPartId, LAY_NEWSTART)
+ If nNewStartLayerId = GDB_ID.NULL Then nNewStartLayerId = EgtCreateGroup(m_nPartId)
EgtSetName(nNewStartLayerId, LAY_NEWSTART)
EgtSetCurrPartLayer(m_nPartId, nNewStartLayerId)
Map.refSceneHostVM.MainController.SetContinue()
diff --git a/Icarus/TopPanel/TopPanelV.xaml b/Icarus/TopPanel/TopPanelV.xaml
index 7579757..69ac927 100644
--- a/Icarus/TopPanel/TopPanelV.xaml
+++ b/Icarus/TopPanel/TopPanelV.xaml
@@ -26,16 +26,28 @@
Text="PRINTING PARAMETERS"
Style="{StaticResource TopPanel_TextBlock}"/>
-
-
+
+
+
+
+
+
+
+
+
+ ''' Returns a command that do CPlaneTop.
+ '''
+ Public ReadOnly Property PartModify_Command As ICommand
+ Get
+ If m_cmdPartModify Is Nothing Then
+ m_cmdPartModify = New Command(AddressOf PartModify)
+ End If
+ Return m_cmdPartModify
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
+ '''
+ Public Sub PartModify()
+ If IsNothing(m_SelPart) Then Return
+ SelPage = Pages.MODIFYPART
+ End Sub
+
+#End Region ' PartModify
+
#Region "Machining"
'''
diff --git a/Icarus/ViewLayerManager/ViewLayerManagerVM.vb b/Icarus/ViewLayerManager/ViewLayerManagerVM.vb
index 6c2694d..0da700b 100644
--- a/Icarus/ViewLayerManager/ViewLayerManagerVM.vb
+++ b/Icarus/ViewLayerManager/ViewLayerManagerVM.vb
@@ -166,9 +166,11 @@ Public Class ViewLayer
Map.refTopPanelVM.SetTopPanelIsEnabled(True)
Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(True)
End If
- If Map.refTopPanelVM.SelPage = Pages.SLICE Then
- Map.refSliderManagerVM.SetSliderVisibility(bIsVisible)
- End If
+ End If
+ If Map.refTopPanelVM.SelPage = Pages.SLICE AndAlso (m_Type = ViewLayerType.SOLID_SLICE OrElse m_Type = ViewLayerType.SLICE_TOOLPATH) Then
+ 'If Then
+ ' Map.refSliderManagerVM.SetSliderVisibility(Map.refViewLayerManagerVM.LayerList.Any(Function(x) (x.Type = ViewLayerType.SOLID_SLICE OrElse x.Type = ViewLayerType.START_MACHINING) AndAlso x.bIsVisible))
+ 'End If
End If
Dim Status As GDB_ST = If(bIsVisible, GDB_ST.ON_, GDB_ST.OFF)
For Each CurrPart In Map.refTopPanelVM.PartList
@@ -187,14 +189,14 @@ Public Class ViewLayer
EgtSetStatus(CurrPart.nAuxSolidsLayerId, Status)
Case ViewLayerType.SOLID_SLICE
For Each Layer In Map.refTopPanelVM.SelPart.LayerList
- EgtSetStatus(Layer.nLayerId, GDB_ST.ON_)
+ 'EgtSetStatus(Layer.nLayerId, GDB_ST.ON_)
For Each Entity In Layer.SolidLayerIdList
EgtSetStatus(Entity, Status)
Next
Next
Case ViewLayerType.SLICE_TOOLPATH
For Each Layer In Map.refTopPanelVM.SelPart.LayerList
- EgtSetStatus(Layer.nLayerId, GDB_ST.ON_)
+ 'EgtSetStatus(Layer.nLayerId, GDB_ST.ON_)
For Each Entity In Layer.ToolPathLayerIdList
EgtSetStatus(Entity, Status)
Next