diff --git a/Icarus/Constants/Const3dPrint.vb b/Icarus/Constants/Const3dPrint.vb
index 4b27ebe..1f3158f 100644
--- a/Icarus/Constants/Const3dPrint.vb
+++ b/Icarus/Constants/Const3dPrint.vb
@@ -124,6 +124,8 @@
Public Const KEY_EXTRUSION_ID = "ExtrusionId"
Public Const KEY_EXTRUSION_LENGTH = "ExtrusionLength"
Public Const KEY_RIB_TYPE = "RibType"
+ Public Const KEY_SHELLNBR_TYPE = "ShellNumberType"
+ Public Const KEY_AUXSOLID_TYPE = "AuxSolidType"
' parametri riferimento
Public Const KEY_REFERENCE = "Reference"
diff --git a/Icarus/Icarus.vbproj b/Icarus/Icarus.vbproj
index b4e654e..0a0a95b 100644
--- a/Icarus/Icarus.vbproj
+++ b/Icarus/Icarus.vbproj
@@ -187,6 +187,14 @@
SecondaryWindowV.xaml
+
+ ShellNumberPanelV.xaml
+
+
+
+ ShellNumberParamPanelV.xaml
+
+ ShowPanelV.xaml
@@ -347,6 +355,14 @@
DesignerMSBuild:Compile
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ XamlIntelliSenseFileGenerator
+ MSBuild:CompileDesigner
diff --git a/Icarus/ImportPanel/ImportPanelVM.vb b/Icarus/ImportPanel/ImportPanelVM.vb
index 69fe0ff..27cc1d2 100644
--- a/Icarus/ImportPanel/ImportPanelVM.vb
+++ b/Icarus/ImportPanel/ImportPanelVM.vb
@@ -289,13 +289,23 @@ Public Class ImportPanelVM
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
Dim nOthersLayerId As Integer = EgtCreateGroup(nPartId)
diff --git a/Icarus/LeftPanel/LeftPanelV.xaml b/Icarus/LeftPanel/LeftPanelV.xaml
index 78ec6e1..82dc800 100644
--- a/Icarus/LeftPanel/LeftPanelV.xaml
+++ b/Icarus/LeftPanel/LeftPanelV.xaml
@@ -30,7 +30,7 @@
-
+
diff --git a/Icarus/LeftPanel/LeftPanelVM.vb b/Icarus/LeftPanel/LeftPanelVM.vb
index d546e46..d664008 100644
--- a/Icarus/LeftPanel/LeftPanelVM.vb
+++ b/Icarus/LeftPanel/LeftPanelVM.vb
@@ -36,6 +36,8 @@ Public Class LeftPanelVM
Map.refStartMachPanelVM.Dispose()
Case Panels.RIBS
Map.refRibPanelVM.Dispose()
+ Case Panels.SHELLNUMBER
+ Map.refShellNumberPanelVM.Dispose()
End Select
m_SelPanel = Panel
Select Case Panel
@@ -49,6 +51,8 @@ Public Class LeftPanelVM
Map.refStartMachPanelVM.Init()
Case Panels.RIBS
Map.refRibPanelVM.Init()
+ Case Panels.SHELLNUMBER
+ Map.refShellNumberPanelVM.Init()
End Select
If Not m_SelPanel = Panels.NULL Then
Map.refViewLayerManagerVM.UpdateForced()
diff --git a/Icarus/RightPanel/RightPanelV.xaml b/Icarus/RightPanel/RightPanelV.xaml
index 5692a12..fa8d706 100644
--- a/Icarus/RightPanel/RightPanelV.xaml
+++ b/Icarus/RightPanel/RightPanelV.xaml
@@ -27,7 +27,7 @@
-
+
diff --git a/Icarus/RightPanel/RightPanelVM.vb b/Icarus/RightPanel/RightPanelVM.vb
index 9dad6ef..3409383 100644
--- a/Icarus/RightPanel/RightPanelVM.vb
+++ b/Icarus/RightPanel/RightPanelVM.vb
@@ -11,7 +11,7 @@ Public Class RightPanelVM
CURRPRINTPARAM = 2
PRINTPARAMDB = 3
RIBPARAM = 4
- SHELLNUMBER = 5
+ SHELLNUMBERPARAM = 5
AUXSOLIDPARAM = 6
TFSEDITOR = 7
SIMULATION = 8
@@ -52,7 +52,8 @@ Public Class RightPanelVM
Case Panels.RIBPARAM
Map.refRibParamPanelVM.Init()
-
+ Case Panels.SHELLNUMBERPARAM
+ Map.refShellNumberParamPanelVM.Init()
Case Panels.TFSEDITOR
'Map.refTFSEditorVM.Refresh()
Case Panels.SIMULATION
diff --git a/Icarus/SceneHost/MySceneHostVM.vb b/Icarus/SceneHost/MySceneHostVM.vb
index bc25a02..bc46ba1 100644
--- a/Icarus/SceneHost/MySceneHostVM.vb
+++ b/Icarus/SceneHost/MySceneHostVM.vb
@@ -404,6 +404,76 @@ Public Class MySceneHostVM
End If
End Sub
+ Public Sub InsertShellNumber()
+ ' Recupero cartella dell'ultimo progetto aperto
+ Dim sDir As String = MainController.GetCurrFile()
+ If String.IsNullOrWhiteSpace(sDir) Then
+ GetMainPrivateProfileString(S_MRUIMPORTFILES, K_FILE & 1, "", sDir)
+ End If
+ If Not String.IsNullOrWhiteSpace(sDir) Then
+ sDir = Path.GetDirectoryName(sDir)
+ End If
+ Dim OpenFileDialog As New OpenFileDialog With {.Title = "Insert",
+ .Filter = "Stereolithography (*.stl)|*.stl" &
+ "|Iges files (*.igs;*.iges)|*.igs;*.iges" &
+ "|Step files (*.stp;*.step)|*.stp;*.step" &
+ "|3D Manufacturing format (*.3mf)|*.3mf" &
+ "|New geometry EgalTech(*.nge)|*.nge" &
+ "|All Files (*.*)|*.*",
+ .FilterIndex = 1,
+ .InitialDirectory = sDir}
+ If Not OpenFileDialog.ShowDialog Then
+ Return
+ End If
+ Dim sFile As String = String.Empty
+ sFile = OpenFileDialog.FileName
+ ' importo la nuova geometria
+ If MainController.InsertProject(sFile, False) Then
+ ' sposto le nuove geometrie nel layer ShellNumber del pezzo
+ Dim nNewPartId As Integer = EgtGetLastPart()
+ Dim nNewLayerId As Integer = EgtGetFirstGroupInGroup(nNewPartId)
+ Dim nNewEntityId As Integer = EgtGetFirstInGroup(nNewLayerId)
+ While nNewEntityId <> GDB_ID.NULL
+ Dim EntityType As GDB_TY = EgtGetType(nNewEntityId)
+ Select Case EntityType
+ Case GDB_TY.CRV_COMPO, GDB_TY.CRV_LINE, GDB_TY.CRV_ARC
+ Dim nNewShellNumberId As Integer = nNewEntityId
+ If EntityType = GDB_TY.CRV_LINE OrElse EntityType = GDB_TY.CRV_ARC Then
+ nNewShellNumberId = EgtCreateCurveCompo(Map.refTopPanelVM.SelPart.nPartId, nNewEntityId, False)
+ Else
+ ' lo copio nel layer dei rib
+ nNewShellNumberId = EgtCopy(nNewEntityId, Map.refShellNumberPanelVM.nShellNumberLayerId, GDB_POS.LAST_SON)
+ End If
+ EgtSetName(nNewShellNumberId, RIB_CURVE)
+ ' coloro l'entita' di verde
+ Dim c3LightBlue As Color3d
+ c3LightBlue.FromColor(System.Drawing.Color.Lime)
+ EgtSetColor(nNewShellNumberId, c3LightBlue)
+ ' lo aggiungo alla lista
+ Dim NewEntity As ShellNumberEntity = New ShellNumberEntity(ShellNumberEntity.ShellNumberTypes.FROMIMPORT, nNewShellNumberId)
+ Map.refShellNumberPanelVM.ShellNumberList.Add(NewEntity)
+ Case GDB_TY.SRF_MESH, GDB_TY.SRF_FRGN, GDB_TY.SRF_BEZ
+ Dim nNewShellNumberId = nNewEntityId
+ ' lo copio nel layer dei rib
+ nNewShellNumberId = EgtCopy(nNewEntityId, Map.refShellNumberPanelVM.nShellNumberLayerId, GDB_POS.LAST_SON)
+ EgtSetName(nNewShellNumberId, RIB_EXTRUSION)
+ ' coloro l'entita' di verde
+ Dim c3LightBlue As Color3d
+ c3LightBlue.FromColor(System.Drawing.Color.Lime)
+ EgtSetColor(nNewShellNumberId, c3LightBlue)
+ ' lo aggiungo alla lista
+ Dim NewEntity As ShellNumberEntity = New ShellNumberEntity(ShellNumberEntity.ShellNumberTypes.FROMIMPORT, nNewShellNumberId)
+ Map.refShellNumberPanelVM.ShellNumberList.Add(NewEntity)
+ End Select
+ nNewEntityId = EgtGetNext(nNewEntityId)
+ End While
+ EgtErase(nNewPartId)
+ ' seleziono ultima rib
+ Map.refShellNumberPanelVM.SelLastShellNumber()
+ EgtDraw()
+ End If
+ End Sub
+
Public Overrides Sub ImportProject()
Dim sDir As String = String.Empty
GetMainPrivateProfileString(S_MRUIMPORT, K_FILE & "1", "", sDir)
@@ -481,6 +551,8 @@ Public Class MySceneHostVM
StartMach_OnMouseDownScene(sender, e)
Case ModifyModes.RIBS
Rib_OnMouseDownScene(sender, e)
+ Case ModifyModes.SHELLNUMBER
+ ShellNumber_OnMouseDownScene(sender, e)
End Select
End If
@@ -522,6 +594,8 @@ Public Class MySceneHostVM
StartMach_OnMouseMoveScene(sender, e)
Case ModifyModes.RIBS
Rib_OnMouseMoveScene(sender, e)
+ Case ModifyModes.SHELLNUMBER
+ ShellNumber_OnMouseMoveScene(sender, e)
End Select
End If
'Select Case Map.refMainMenuVM.SelPage
@@ -562,6 +636,8 @@ Public Class MySceneHostVM
StartMach_OnMouseUpScene(sender, e)
Case ModifyModes.RIBS
Rib_OnMouseUpScene(sender, e)
+ Case ModifyModes.SHELLNUMBER
+ ShellNumber_OnMouseUpScene(sender, e)
End Select
End If
'Select Case Map.refMainMenuVM.SelPage
@@ -601,6 +677,7 @@ Public Class MySceneHostVM
Case ModifyModes.RIBS
bOk = Map.refRibPanelVM.OnMouseSelectingObj(nId)
Case ModifyModes.SHELLNUMBER
+ bOk = Map.refShellNumberPanelVM.OnMouseSelectingObj(nId)
Case ModifyModes.AUXSOLIDS
End Select
End If
@@ -900,6 +977,7 @@ Public Class MySceneHostVM
Case ModifyModes.RIBS
Map.refRibPanelVM.UpdateUI()
Case ModifyModes.SHELLNUMBER
+ Map.refShellNumberPanelVM.UpdateUI()
Case ModifyModes.AUXSOLIDS
End Select
End If
@@ -917,6 +995,7 @@ Public Class MySceneHostVM
Case ModifyModes.RIBS
Map.refRibPanelVM.OnExecCmdEnd(command)
Case ModifyModes.SHELLNUMBER
+ Map.refShellNumberPanelVM.OnExecCmdEnd(command)
Case ModifyModes.AUXSOLIDS
End Select
End If
@@ -1119,6 +1198,62 @@ Public Class MySceneHostVM
#End Region ' Rib
+#Region "ShellNumber"
+
+ Friend Sub ShellNumber_OnMouseDownScene(sender As Object, e As Forms.MouseEventArgs)
+ ' Verifico se selezionato indicativo di pezzo
+ EgtSetObjFilterForSelWin(True, True, True, True, True)
+ Dim nSel As Integer
+ EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
+ Dim nId As Integer = EgtGetFirstObjInSelWin()
+ While nId <> GDB_ID.NULL
+ ' Recupero l'identificativo del pezzo cui appartiene
+ Dim nPartId As Integer = EgtGetParent(nId)
+ Dim bFound As Boolean = False
+ If nPartId = Map.refShellNumberPanelVM.nShellNumberLayerId Then bFound = True
+ If Not bFound Then
+ nId = EgtGetNextObjInSelWin()
+ Continue While
+ End If
+ ' Memorizzo Id da selezionare
+ m_nIdToSel = nId
+ Exit While
+ nId = EgtGetNextObjInSelWin()
+ End While
+ ' Dati per drag
+ m_bDragToStart = True
+ End Sub
+
+ Friend Sub ShellNumber_OnMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
+ ' Se drag non abilitato o già in esecuzione, esco
+ If Not m_bDragToStart Then Return
+ ' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
+ If m_bDragToStart Then
+ If Math.Abs(e.Location.X - m_locPrev.X) < m_nRestRadius And
+ Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
+ Return
+ End If
+ m_bDragToStart = False
+ End If
+ End Sub
+
+ Friend Sub ShellNumber_OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
+ ' Se eseguito drag
+ If Not m_bDragToStart Then
+ ' Se selezione da eseguire
+ ElseIf m_nIdToSel <> GDB_ID.NULL Then
+ ' Eseguo la selezione
+ Map.refShellNumberPanelVM.SelStartFromId(m_nIdToSel)
+ End If
+ ' Reset
+ m_bDrag = False
+ m_nIdToSel = GDB_ID.NULL
+ m_nIdToDesel = GDB_ID.NULL
+ EgtDraw()
+ End Sub
+
+#End Region ' Rib
+
#End Region ' VIEW EVENTS
End Class
diff --git a/Icarus/ShellNumberPanel/ShellNumberPanelV.xaml b/Icarus/ShellNumberPanel/ShellNumberPanelV.xaml
new file mode 100644
index 0000000..3ac0743
--- /dev/null
+++ b/Icarus/ShellNumberPanel/ShellNumberPanelV.xaml
@@ -0,0 +1,300 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Icarus/ShellNumberPanel/ShellNumberPanelV.xaml.vb b/Icarus/ShellNumberPanel/ShellNumberPanelV.xaml.vb
new file mode 100644
index 0000000..da5b187
--- /dev/null
+++ b/Icarus/ShellNumberPanel/ShellNumberPanelV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class ShellNumberPanelV
+
+End Class
diff --git a/Icarus/ShellNumberPanel/ShellNumberPanelVM.vb b/Icarus/ShellNumberPanel/ShellNumberPanelVM.vb
new file mode 100644
index 0000000..846da85
--- /dev/null
+++ b/Icarus/ShellNumberPanel/ShellNumberPanelVM.vb
@@ -0,0 +1,1245 @@
+Imports System.Collections.ObjectModel
+Imports System.Collections.Specialized
+Imports System.Globalization
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class ShellNumberPanelVM
+ Inherits VMBase
+
+#Region "FIELDS & PROPERTIES"
+
+ Public Enum StartMachTypes As Integer
+ NULL = 0
+ POINT = 1
+ COMPO = 2
+ End Enum
+ Public Enum ShellNumberSelectionTypes As Integer
+ CURVE = 1
+ EXTRUSION = 2
+ BOTH = 3
+ End Enum
+
+ Private m_nPartId As Integer = GDB_ID.NULL
+ Private m_nShellNumberLayerId As Integer = GDB_ID.NULL
+ Friend ReadOnly Property nShellNumberLayerId As Integer
+ Get
+ Return m_nShellNumberLayerId
+ End Get
+ End Property
+
+ Private m_ShellNumberList As New ObservableCollection(Of ShellNumberEntity)
+ Public ReadOnly Property ShellNumberList As ObservableCollection(Of ShellNumberEntity)
+ Get
+ Return m_ShellNumberList
+ End Get
+ End Property
+ Private m_SelShellNumber As ShellNumberEntity
+ Public Property SelShellNumber As ShellNumberEntity
+ Get
+ Return m_SelShellNumber
+ End Get
+ Set(value As ShellNumberEntity)
+ m_SelShellNumber = value
+ EgtDeselectLayerObjs(m_nShellNumberLayerId)
+ If Not IsNothing(value) Then
+ EgtSelectObj(value.nCurveId)
+ EgtSelectObj(value.nExtrusionId)
+ ' aggiorno visibilita' bottoni edit
+ NotifyPropertyChanged(NameOf(Compo_Visibility))
+ ' aggiorno campi di testo posizione
+ NotifyPropertyChanged(NameOf(sXPos))
+ NotifyPropertyChanged(NameOf(sYPos))
+ NotifyPropertyChanged(NameOf(sZPos))
+ End If
+ EgtDraw()
+ End Set
+ End Property
+
+ Public Property sXPos As String
+ Get
+ If Not IsNothing(m_SelShellNumber) Then
+ Dim nId As Integer = If(m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW, m_SelShellNumber.nCurveId, m_SelShellNumber.nExtrusionId)
+ Dim b3Reference As New BBox3d
+ EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
+ Return LenToString(b3Reference.Min.x, 1)
+ Else
+ Return ""
+ End If
+ End Get
+ Set(value As String)
+ Dim nId As Integer = If(m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW, m_SelShellNumber.nCurveId, m_SelShellNumber.nExtrusionId)
+ Dim b3Reference As New BBox3d
+ EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
+ Dim dNewXPos As Double = b3Reference.Min.x
+ StringToLen(value, dNewXPos)
+ If dNewXPos >= 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then
+ EgtMove(m_SelShellNumber.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min)
+ EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min)
+ EgtDraw()
+ Else
+ NotifyPropertyChanged(NameOf(sXPos))
+ End If
+ End Set
+ End Property
+
+ Public Property sYPos As String
+ Get
+ If Not IsNothing(m_SelShellNumber) Then
+ Dim nId As Integer = If(m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW, m_SelShellNumber.nCurveId, m_SelShellNumber.nExtrusionId)
+ Dim b3Reference As New BBox3d
+ EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
+ Return LenToString(b3Reference.Min.y, 1)
+ Else
+ Return ""
+ End If
+ End Get
+ Set(value As String)
+ Dim nId As Integer = If(m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW, m_SelShellNumber.nCurveId, m_SelShellNumber.nExtrusionId)
+ Dim b3Reference As New BBox3d
+ EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
+ Dim dNewYPos As Double = b3Reference.Min.y
+ StringToLen(value, dNewYPos)
+ If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then
+ EgtMove(m_SelShellNumber.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min)
+ EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min)
+ EgtDraw()
+ Else
+ NotifyPropertyChanged(NameOf(sYPos))
+ End If
+ End Set
+ End Property
+
+ Public Property sZPos As String
+ Get
+ If Not IsNothing(m_SelShellNumber) Then
+ Dim nId As Integer = If(m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW, m_SelShellNumber.nCurveId, m_SelShellNumber.nExtrusionId)
+ Dim b3Reference As New BBox3d
+ EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
+ Return LenToString(b3Reference.Min.z, 1)
+ Else
+ Return ""
+ End If
+ End Get
+ Set(value As String)
+ Dim nId As Integer = If(m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW, m_SelShellNumber.nCurveId, m_SelShellNumber.nExtrusionId)
+ Dim b3Reference As New BBox3d
+ EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Reference)
+ Dim dNewZPos As Double = b3Reference.Min.y
+ StringToLen(value, dNewZPos)
+ If dNewZPos >= 0 Then
+ EgtMove(m_SelShellNumber.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min)
+ EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min)
+ EgtDraw()
+ Else
+ NotifyPropertyChanged(NameOf(sZPos))
+ End If
+ End Set
+ End Property
+
+ Private m_RotAxes() As Boolean = {False, False, True}
+ Public Property RotAxes As Boolean()
+ Get
+ Return m_RotAxes
+ End Get
+ Set(value As Boolean())
+ m_RotAxes = value
+ End Set
+ End Property
+
+ Public ReadOnly Property vtSelRotAxes As Vector3d
+ Get
+ If m_RotAxes(0) Then
+ Return Vector3d.X_AX
+ ElseIf m_RotAxes(1) Then
+ Return Vector3d.Y_AX
+ ElseIf m_RotAxes(2) Then
+ Return Vector3d.Z_AX
+ End If
+ End Get
+ End Property
+
+ Private m_sRotAngle As String
+ Public Property sRotAngle As String
+ Get
+ Return m_sRotAngle
+ End Get
+ Set(value As String)
+ Dim dNewAngle As Double = 0
+ If Not StringToLen(value, dNewAngle) Then
+ m_sRotAngle = 0
+ NotifyPropertyChanged(NameOf(sRotAngle))
+ Return
+ End If
+ Dim nId As Integer = If(m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW, m_SelShellNumber.nCurveId, m_SelShellNumber.nExtrusionId)
+ Dim b3Rib As New BBox3d
+ EgtGetBBox(nId, GDB_BB.STANDARD, b3Rib)
+ Dim bOk As Boolean = False
+ bOk = EgtRotate(nId, b3Rib.Center(), vtSelRotAxes, dNewAngle)
+ If bOk AndAlso m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW Then EgtRotate(m_SelShellNumber.nExtrusionId, b3Rib.Center, vtSelRotAxes, dNewAngle)
+ If bOk Then
+ EgtDraw()
+ RefreshPos()
+ m_sRotAngle = 0
+ NotifyPropertyChanged(NameOf(sRotAngle))
+ Else
+ m_sRotAngle = value
+ End If
+ End Set
+ End Property
+
+ Private m_bAdd_IsChecked As Boolean
+ Public Property bAdd_IsChecked As Boolean
+ Get
+ Return m_bAdd_IsChecked
+ End Get
+ Set(value As Boolean)
+ If Not m_bMachParam_IsChecked Then
+ m_bAdd_IsChecked = value
+ If value Then
+ m_bEdit_IsChecked = False
+ m_bGrid_IsChecked = False
+ m_bMove_IsChecked = False
+ m_bRotate_IsChecked = False
+ NotifyPropertyChanged(NameOf(bEdit_IsChecked))
+ NotifyPropertyChanged(NameOf(bGrid_IsChecked))
+ NotifyPropertyChanged(NameOf(bMove_IsChecked))
+ NotifyPropertyChanged(NameOf(bRotate_IsChecked))
+ End If
+ End If
+ End Set
+ End Property
+
+ Private m_bEdit_IsChecked As Boolean
+ Public Property bEdit_IsChecked As Boolean
+ Get
+ Return m_bEdit_IsChecked
+ End Get
+ Set(value As Boolean)
+ If Not IsNothing(m_SelShellNumber) AndAlso Not m_bMachParam_IsChecked Then
+ m_bEdit_IsChecked = value
+ If value Then
+ m_bAdd_IsChecked = False
+ m_bGrid_IsChecked = False
+ m_bMove_IsChecked = False
+ m_bRotate_IsChecked = False
+ NotifyPropertyChanged(NameOf(bAdd_IsChecked))
+ NotifyPropertyChanged(NameOf(bGrid_IsChecked))
+ NotifyPropertyChanged(NameOf(bMove_IsChecked))
+ NotifyPropertyChanged(NameOf(bRotate_IsChecked))
+ End If
+ Else
+ NotifyPropertyChanged(NameOf(bEdit_IsChecked))
+ End If
+ End Set
+ End Property
+
+ Private m_bGrid_IsChecked As Boolean
+ Public Property bGrid_IsChecked As Boolean
+ Get
+ Return m_bGrid_IsChecked
+ End Get
+ Set(value As Boolean)
+ If Not m_bMachParam_IsChecked Then
+ m_bGrid_IsChecked = value
+ If value Then
+ m_bAdd_IsChecked = False
+ m_bEdit_IsChecked = False
+ m_bMove_IsChecked = False
+ m_bRotate_IsChecked = False
+ NotifyPropertyChanged(NameOf(bAdd_IsChecked))
+ NotifyPropertyChanged(NameOf(bEdit_IsChecked))
+ NotifyPropertyChanged(NameOf(bMove_IsChecked))
+ NotifyPropertyChanged(NameOf(bRotate_IsChecked))
+ End If
+ End If
+ End Set
+ End Property
+
+ Private m_bMove_IsChecked As Boolean
+ Public Property bMove_IsChecked As Boolean
+ Get
+ Return m_bMove_IsChecked
+ End Get
+ Set(value As Boolean)
+ If Not IsNothing(m_SelShellNumber) AndAlso Not m_bMachParam_IsChecked Then
+ m_bMove_IsChecked = value
+ If value Then
+ m_bAdd_IsChecked = False
+ m_bEdit_IsChecked = False
+ m_bGrid_IsChecked = False
+ m_bRotate_IsChecked = False
+ NotifyPropertyChanged(NameOf(bAdd_IsChecked))
+ NotifyPropertyChanged(NameOf(bEdit_IsChecked))
+ NotifyPropertyChanged(NameOf(bGrid_IsChecked))
+ NotifyPropertyChanged(NameOf(bRotate_IsChecked))
+ End If
+ Else
+ NotifyPropertyChanged(NameOf(bMove_IsChecked))
+ End If
+ End Set
+ End Property
+
+ Private m_bRotate_IsChecked As Boolean
+ Public Property bRotate_IsChecked As Boolean
+ Get
+ Return m_bRotate_IsChecked
+ End Get
+ Set(value As Boolean)
+ If Not IsNothing(m_SelShellNumber) AndAlso Not m_bMachParam_IsChecked Then
+ m_bRotate_IsChecked = value
+ If value Then
+ m_bAdd_IsChecked = False
+ m_bEdit_IsChecked = False
+ m_bGrid_IsChecked = False
+ m_bMove_IsChecked = False
+ NotifyPropertyChanged(NameOf(bAdd_IsChecked))
+ NotifyPropertyChanged(NameOf(bEdit_IsChecked))
+ NotifyPropertyChanged(NameOf(bGrid_IsChecked))
+ NotifyPropertyChanged(NameOf(bMove_IsChecked))
+ End If
+ Else
+ NotifyPropertyChanged(NameOf(bRotate_IsChecked))
+ End If
+ End Set
+ End Property
+
+ Private m_bMachParam_IsChecked As Boolean
+ Public Property bMachParam_IsChecked As Boolean
+ Get
+ Return m_bMachParam_IsChecked
+ End Get
+ Set(value As Boolean)
+ If Not IsNothing(m_SelShellNumber) AndAlso Not IsNothing(Map.refTopPanelVM.SelMachining) AndAlso value Then
+ m_bMachParam_IsChecked = True
+ m_bAdd_IsChecked = False
+ m_bEdit_IsChecked = False
+ m_bGrid_IsChecked = False
+ m_bMove_IsChecked = False
+ m_bRotate_IsChecked = False
+ NotifyPropertyChanged(NameOf(bAdd_IsChecked))
+ NotifyPropertyChanged(NameOf(bEdit_IsChecked))
+ NotifyPropertyChanged(NameOf(bGrid_IsChecked))
+ NotifyPropertyChanged(NameOf(bMove_IsChecked))
+ NotifyPropertyChanged(NameOf(bRotate_IsChecked))
+ Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.SHELLNUMBERPARAM)
+ NotifyPropertyChanged(NameOf(ShellNumberList_IsEnabled))
+ Else
+ NotifyPropertyChanged(NameOf(m_bMachParam_IsChecked))
+ End If
+ End Set
+ End Property
+ Friend Sub ResetMachParamIsChecked()
+ m_bMachParam_IsChecked = False
+ NotifyPropertyChanged(NameOf(bMachParam_IsChecked))
+ NotifyPropertyChanged(NameOf(ShellNumberList_IsEnabled))
+ End Sub
+
+ Public ReadOnly Property Compo_Visibility As Visibility
+ Get
+ Return If(Not IsNothing(m_SelShellNumber) AndAlso m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW, Visibility.Visible, Visibility.Collapsed)
+ End Get
+ End Property
+
+ Public ReadOnly Property ShellNumberList_IsEnabled As Boolean
+ Get
+ Return Not m_bMachParam_IsChecked
+ End Get
+ End Property
+ ' riferimento griglia all'ingresso in questa pagina
+ Private m_OriginalGridFrame As New Frame3d
+
+ ' parametro che indica se e' in corso il disegno di un percorso
+ Private m_bIsCreatingPath As Boolean = False
+ Public ReadOnly Property bIsCreatingPath As Boolean
+ Get
+ Return m_bIsCreatingPath
+ End Get
+ End Property
+ Private m_bIsCreatingExtrusion As Boolean = False
+ Public ReadOnly Property bIsCreatingExtrusion As Boolean
+ Get
+ Return m_bIsCreatingExtrusion
+ End Get
+ End Property
+
+
+ ' Definizione comandi
+ Private m_cmdImport As ICommand
+ Private m_cmdLine2P As ICommand
+ Private m_cmdDelete As ICommand
+ Private m_cmdModifyCurve As ICommand
+ Private m_cmdAddPointCurve As ICommand
+ Private m_cmdRemovePointCurve As ICommand
+ Private m_cmdExtrude As ICommand
+ Private m_cmdCPlaneTop As ICommand
+ Private m_cmdCPlaneFront As ICommand
+ Private m_cmdCPlaneRight As ICommand
+ Private m_cmdCPlaneBack As ICommand
+ Private m_cmdCPlaneLeft As ICommand
+ Private m_cmdCPlaneBottom As ICommand
+ Private m_cmdCPlaneView As ICommand
+ Private m_cmdCPlaneElevation As ICommand
+ Private m_cmdCPlaneOrigin As ICommand
+ Private m_cmdCPlaneRotate As ICommand
+ Private m_cmdCPlane3P As ICommand
+ Private m_cmdCPlanePerpObj As ICommand
+ Private m_cmdCPlaneObj As ICommand
+ Private m_cmdDragMove As ICommand
+ Private m_cmdDragRotate As ICommand
+ Private m_cmdMachParam As ICommand
+
+#End Region ' FIELDS & PROPERTIES
+
+#Region "CONSTRUCTORS"
+
+ Sub New()
+ ' Creo riferimento a questa classe in EgtCAM5Map
+ Map.SetRefShellNumberPanelVM(Me)
+ End Sub
+
+#End Region ' CONSTRUCTORS
+
+#Region "METHODS"
+
+ Friend Sub Init()
+ ' azzero indice
+ StartEntity.ResetSharedIndex()
+ ' fisso frame originale
+ m_OriginalGridFrame = EgtGetGridFrame()
+ ' recupero dati pezzo selezionato layer ed entita'
+ m_nPartId = Map.refTopPanelVM.SelPart.nPartId
+ m_nShellNumberLayerId = Map.refTopPanelVM.SelPart.nShellNumberLayerId
+ 'recupero tutte le entita' rib
+ m_ShellNumberList.Clear()
+ Dim nShellNumberId As Integer = EgtGetFirstInGroup(m_nShellNumberLayerId)
+ While nShellNumberId <> GDB_ID.NULL
+ Dim EntityType As GDB_TY = EgtGetType(nShellNumberId)
+ Dim DrawType As Integer = ShellNumberEntity.ShellNumberTypes.FROMDRAW
+ EgtGetInfo(nShellNumberId, KEY_SHELLNBR_TYPE, DrawType)
+ If EntityType = GDB_TY.CRV_COMPO AndAlso DrawType = ShellNumberEntity.ShellNumberTypes.FROMDRAW Then
+ Dim nExtrusionId As Integer = GDB_ID.NULL
+ EgtGetInfo(nShellNumberId, KEY_EXTRUSION_ID, nExtrusionId)
+ Dim ShellNumberEntity As ShellNumberEntity = New ShellNumberEntity(ShellNumberEntity.ShellNumberTypes.FROMDRAW, nShellNumberId)
+ If nExtrusionId <> GDB_ID.NULL Then
+ ShellNumberEntity.SetExtrusionId(nExtrusionId)
+ End If
+ m_ShellNumberList.Add(ShellNumberEntity)
+ ElseIf (EntityType = GDB_TY.SRF_BEZ OrElse EntityType = GDB_TY.SRF_MESH OrElse EntityType = GDB_TY.SRF_FRGN) AndAlso DrawType = ShellNumberEntity.ShellNumberTypes.FROMIMPORT Then
+ Dim ShellNumberEntity As ShellNumberEntity = New ShellNumberEntity(ShellNumberEntity.ShellNumberTypes.FROMIMPORT, nShellNumberId)
+ m_ShellNumberList.Add(ShellNumberEntity)
+ End If
+ nShellNumberId = EgtGetNext(nShellNumberId)
+ End While
+ If m_ShellNumberList.Count > 0 Then
+ SelShellNumber = m_ShellNumberList(0)
+ NotifyPropertyChanged(NameOf(SelShellNumber))
+ End If
+ Map.refSceneHostVM.MainScene.SetStatusNull()
+ End Sub
+
+ Friend Sub Dispose()
+ ' ripristino frame originale
+ EgtSetGridFrame(m_OriginalGridFrame)
+ ' se in modifica parametri
+ If m_bMachParam_IsChecked Then
+ ' ripristino modalita' standard
+ Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.NULL)
+ Map.refShellNumberPanelVM.ResetMachParamIsChecked()
+ End If
+ EgtDraw()
+ Map.refSceneHostVM.MainScene.SetStatusNull()
+ End Sub
+
+ Friend Sub RefreshPos()
+ NotifyPropertyChanged(NameOf(sXPos))
+ NotifyPropertyChanged(NameOf(sYPos))
+ NotifyPropertyChanged(NameOf(sZPos))
+ End Sub
+
+ Private Function InitCommand(RibSelectionType As ShellNumberSelectionTypes) As Boolean
+ ' attivo modifiche su scena
+ Map.refSceneHostVM.MainScene.ResetStatus()
+ ' rendo traspanete estrusione
+ EgtSetAlpha(m_SelShellNumber.nExtrusionId, 50)
+ ' seleziono percorso corrente
+ EgtDeselectAll()
+ Select Case RibSelectionType
+ Case ShellNumberSelectionTypes.CURVE
+ EgtSelectObj(m_SelShellNumber.nCurveId)
+ Case ShellNumberSelectionTypes.EXTRUSION
+ ' creo layer per estrusione
+ Dim nNewExtrusionLayerId As Integer = EgtCreateGroup(m_nPartId)
+ EgtSetName(nNewExtrusionLayerId, LAY_NEWEXTRUSION)
+ EgtSetCurrPartLayer(m_nPartId, nNewExtrusionLayerId)
+ EgtSelectObj(m_SelShellNumber.nCurveId)
+ Case ShellNumberSelectionTypes.BOTH
+ EgtSelectObj(m_SelShellNumber.nCurveId)
+ EgtSelectObj(m_SelShellNumber.nExtrusionId)
+ End Select
+ EgtDraw()
+ Return True
+ End Function
+
+ Friend Sub UpdateUI()
+ ' se attiva operazione in piu' passaggi, esco
+ If Map.refSceneHostVM.MainController.GetContinue() Then Return
+ End Sub
+
+ Friend Sub OnExecCmdEnd(command As Controller.CMD)
+ Select Case command
+ Case Controller.CMD.MODIFYCURVE, Controller.CMD.ADDPOINTCURVE, Controller.CMD.REMOVEPOINTCURVE
+ ' leggo altezza estrusione
+ Dim dExtrusionLength As Double = 0
+ EgtGetInfo(m_SelShellNumber.nExtrusionId, KEY_EXTRUSION_LENGTH, dExtrusionLength)
+ ' cancello estrusione
+ EgtErase(m_SelShellNumber.nExtrusionId)
+ Dim nNewEntityId As Integer = EgtCreateSurfTmByRegionExtrusion(m_nShellNumberLayerId, 1, {m_SelShellNumber.nCurveId}, Vector3d.Z_AX * dExtrusionLength, EPS_STM)
+ EgtSetName(nNewEntityId, RIB_EXTRUSION)
+ EgtSetInfo(nNewEntityId, KEY_EXTRUSION_LENGTH, dExtrusionLength)
+ ' coloro l'entita' di verde
+ Dim c3LightBlue As Color3d
+ c3LightBlue.FromColor(System.Drawing.Color.Lime)
+ EgtSetColor(nNewEntityId, c3LightBlue)
+ ' aggiorno riferimento nella curva
+ m_SelShellNumber.SetExtrusionId(nNewEntityId)
+ ' seleziono nuova estrusione
+ EgtSelectObj(m_SelShellNumber.nExtrusionId)
+ ' ripristino trasparenza estrusione
+ EgtSetAlpha(m_SelShellNumber.nExtrusionId, 100)
+ EgtDraw()
+ ' rimetto la selezione scena a null
+ Map.refSceneHostVM.MainScene.SetStatusNull()
+ Case Controller.CMD.MOVE, Controller.CMD.ROTATE
+ EgtSetAlpha(Map.refShellNumberPanelVM.SelShellNumber.nExtrusionId, 100)
+ ' seleziono nuova estrusione
+ EgtSelectObj(m_SelShellNumber.nExtrusionId)
+ EgtDraw()
+ ' rimetto la selezione scena a null
+ Map.refSceneHostVM.MainScene.SetStatusNull()
+ Case Controller.CMD.GRID_ELEVATION, Controller.CMD.GRID_3P, Controller.CMD.GRID_ORIGIN, Controller.CMD.GRID_PERPCURVE, Controller.CMD.GRID_ROTATE, Controller.CMD.GRID_ROTATE3D
+ ' rimetto la selezione scena a null
+ Map.refSceneHostVM.MainScene.SetStatusNull()
+ End Select
+ If command <> Controller.CMD.LINE2P AndAlso command <> Controller.CMD.EXTRUDE Then Return
+ ' se finita creazione estrusione
+ If m_bIsCreatingExtrusion Then
+ m_bIsCreatingExtrusion = False
+ ' se riferimento non nullo, elimino vecchia estrusione
+ If m_SelShellNumber.nExtrusionId <> GDB_ID.NULL Then
+ EgtErase(m_SelShellNumber.nExtrusionId)
+ End If
+ Dim NewEntity As ShellNumberEntity = Nothing
+ Dim nNewExtrusionLayerId As Integer = EgtGetFirstNameInGroup(m_nPartId, LAY_NEWEXTRUSION)
+ Dim nNewEntityId As Integer = EgtGetFirstInGroup(nNewExtrusionLayerId)
+ Dim NewGeomType As GDB_TY = EgtGetType(nNewEntityId)
+ If NewGeomType = GDB_TY.SRF_FRGN OrElse NewGeomType = GDB_TY.SRF_MESH Then
+ EgtSetName(nNewEntityId, RIB_EXTRUSION)
+ Dim dExtrusionLength As Double = 0
+ StringToLen(Map.refControllerInputPanelVM.Text, dExtrusionLength)
+ EgtSetInfo(nNewEntityId, KEY_EXTRUSION_LENGTH, dExtrusionLength)
+ ' coloro l'entita' di verde
+ Dim c3LightBlue As Color3d
+ c3LightBlue.FromColor(System.Drawing.Color.Lime)
+ EgtSetColor(nNewEntityId, c3LightBlue)
+ '' lo sposto nel layer dei rib
+ EgtRelocateGlob(nNewEntityId, m_nShellNumberLayerId, GDB_POS.LAST_SON)
+ ' aggiungo riferimento a curva
+ m_SelShellNumber.SetExtrusionId(nNewEntityId)
+ End If
+ ' cancello layer estrusione
+ EgtErase(nNewExtrusionLayerId)
+ ' aggiorno posizione
+ RefreshPos()
+ EgtDraw()
+ ' rimetto la selezione scena a null
+ Map.refSceneHostVM.MainScene.SetStatusNull()
+ End If
+ ' se finita creazione curva
+ If bIsCreatingPath Then
+ m_bIsCreatingPath = False
+ Dim NewEntity As ShellNumberEntity = Nothing
+ Dim nNewRibLayerId As Integer = EgtGetFirstNameInGroup(m_nPartId, LAY_NEWRIB)
+ Dim nNewEntityId As Integer = EgtGetFirstInGroup(nNewRibLayerId)
+ Dim NewGeomType As GDB_TY = EgtGetType(nNewEntityId)
+ If NewGeomType = GDB_TY.CRV_COMPO Then
+ EgtSetName(nNewEntityId, RIB_CURVE)
+ ' coloro l'entita' di verde
+ Dim c3LightBlue As Color3d
+ c3LightBlue.FromColor(System.Drawing.Color.Lime)
+ EgtSetColor(nNewEntityId, c3LightBlue)
+ ' lo sposto nel layer dei rib
+ EgtRelocateGlob(nNewEntityId, m_nShellNumberLayerId, GDB_POS.LAST_SON)
+ ' lo aggiungo alla lista
+ NewEntity = New ShellNumberEntity(ShellNumberEntity.ShellNumberTypes.FROMDRAW, nNewEntityId)
+ m_ShellNumberList.Add(NewEntity)
+ ' lo seleziono
+ SelShellNumber = NewEntity
+ NotifyPropertyChanged(NameOf(SelShellNumber))
+ ' creo layer per estrusione
+ Dim nNewExtrusionLayerId As Integer = EgtCreateGroup(m_nPartId)
+ EgtSetName(nNewExtrusionLayerId, LAY_NEWEXTRUSION)
+ EgtSetCurrPartLayer(m_nPartId, nNewExtrusionLayerId)
+ ' seleziono percorso da estrudere
+ EgtDeselectAll()
+ EgtSelectObj(nNewEntityId)
+ If Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.EXTRUDE) Then
+ m_bIsCreatingExtrusion = True
+ Else
+ ' cancello layer
+ 'EgtErase(nNewRibLayerId)
+ EgtErase(nNewExtrusionLayerId)
+ End If
+ End If
+ ' cancello layer di disegno
+ EgtErase(nNewRibLayerId)
+ End If
+ End Sub
+
+ Friend Sub OnKeyDown(Key As Forms.Keys)
+ If Key = Forms.Keys.Escape Then
+
+ End If
+ End Sub
+
+ Friend Function OnMouseSelectingObj(nId As Integer) As Boolean
+ Return EgtGetParent(nId) = m_nShellNumberLayerId
+ End Function
+
+ Friend Sub SelStartFromId(nId)
+ Dim SelShellNumberEntity As ShellNumberEntity = m_ShellNumberList.FirstOrDefault(Function(x) x.nCurveId = nId OrElse x.nExtrusionId = nId)
+ If Not IsNothing(SelShellNumberEntity) Then
+ SelShellNumber = SelShellNumberEntity
+ NotifyPropertyChanged(NameOf(SelShellNumber))
+ End If
+ End Sub
+
+ Friend Sub SelLastShellNumber()
+ If ShellNumberList.Count <= 0 Then Return
+ SelShellNumber = ShellNumberList(ShellNumberList.Count - 1)
+ NotifyPropertyChanged(NameOf(SelShellNumber))
+ End Sub
+
+#End Region ' METHODS
+
+#Region "COMMANDS"
+
+#Region "Import"
+
+ '''
+ ''' Returns a command that do CPlaneTop.
+ '''
+ Public ReadOnly Property Import_Command As ICommand
+ Get
+ If m_cmdImport Is Nothing Then
+ m_cmdImport = New Command(AddressOf Import)
+ End If
+ Return m_cmdImport
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
+ '''
+ Public Sub Import(ByVal param As Object)
+ Map.refSceneHostVM.InsertShellNumber()
+ End Sub
+
+#End Region ' Import
+
+#Region "Line2P"
+
+ '''
+ ''' Returns a command that do CPlaneTop.
+ '''
+ Public ReadOnly Property Line2P_Command As ICommand
+ Get
+ If m_cmdLine2P Is Nothing Then
+ m_cmdLine2P = New Command(AddressOf Line2P)
+ End If
+ Return m_cmdLine2P
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
+ '''
+ Public Sub Line2P(ByVal param As Object)
+ Dim nNewShellNumberLayerId As Integer = EgtCreateGroup(m_nPartId)
+ EgtSetName(nNewShellNumberLayerId, LAY_NEWRIB)
+ EgtSetCurrPartLayer(m_nPartId, nNewShellNumberLayerId)
+ Map.refSceneHostVM.MainController.SetContinue()
+ If Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.LINE2P) Then
+ m_bIsCreatingPath = True
+ End If
+ End Sub
+
+#End Region ' Line2P
+
+#Region "Delete"
+
+ Public ReadOnly Property Delete_Command As ICommand
+ Get
+ If m_cmdDelete Is Nothing Then
+ m_cmdDelete = New Command(AddressOf Delete)
+ End If
+ Return m_cmdDelete
+ End Get
+ End Property
+
+ Public Sub Delete()
+ If IsNothing(SelShellNumber) Then Return
+ Dim bOk As Boolean = False
+ Select Case m_SelShellNumber.Type
+ Case ShellNumberEntity.ShellNumberTypes.FROMDRAW
+ bOk = EgtErase(m_SelShellNumber.nCurveId)
+ If bOk Then EgtErase(m_SelShellNumber.nExtrusionId)
+ Case ShellNumberEntity.ShellNumberTypes.FROMIMPORT
+ bOk = EgtErase(m_SelShellNumber.nExtrusionId)
+ End Select
+ If bOk Then
+ Dim nSelStartIndex As Integer = m_ShellNumberList.IndexOf(SelShellNumber)
+ m_ShellNumberList.Remove(SelShellNumber)
+ If nSelStartIndex < m_ShellNumberList.Count Then
+ SelShellNumber = m_ShellNumberList(nSelStartIndex)
+ ElseIf m_ShellNumberList.Count > 0 Then
+ SelShellNumber = m_ShellNumberList(m_ShellNumberList.Count - 1)
+ Else
+ SelShellNumber = Nothing
+ End If
+ NotifyPropertyChanged(NameOf(SelShellNumber))
+ End If
+ End Sub
+
+#End Region ' Delete
+
+#Region "ModifyCurve"
+
+ '''
+ ''' Returns a command that do Linear Dimension.
+ '''
+ Public ReadOnly Property ModifyCurve_Command As ICommand
+ Get
+ If m_cmdModifyCurve Is Nothing Then
+ m_cmdModifyCurve = New Command(AddressOf ModifyCurve)
+ End If
+ Return m_cmdModifyCurve
+ End Get
+ End Property
+
+ '''
+ ''' Execute the LinearDimension. This method is invoked by the LinDimCommand.
+ '''
+ Public Sub ModifyCurve(ByVal param As Object)
+ InitCommand(ShellNumberSelectionTypes.CURVE)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.MODIFYCURVE)
+ End Sub
+
+#End Region ' ModifyCurve
+
+#Region "AddPointCurve"
+
+ '''
+ ''' Returns a command that do Linear Dimension.
+ '''
+ Public ReadOnly Property AddPointCurve_Command As ICommand
+ Get
+ If m_cmdAddPointCurve Is Nothing Then
+ m_cmdAddPointCurve = New Command(AddressOf AddPointCurve)
+ End If
+ Return m_cmdAddPointCurve
+ End Get
+ End Property
+
+ '''
+ ''' Execute the LinearDimension. This method is invoked by the LinDimCommand.
+ '''
+ Public Sub AddPointCurve(ByVal param As Object)
+ InitCommand(ShellNumberSelectionTypes.CURVE)
+ If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.CURVETOARC)
+ Else
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.ADDPOINTCURVE)
+ End If
+ End Sub
+
+#End Region ' AddPointCurve
+
+#Region "RemovePointCurve"
+
+ '''
+ ''' Returns a command that do Linear Dimension.
+ '''
+ Public ReadOnly Property RemovePointCurve_Command As ICommand
+ Get
+ If m_cmdRemovePointCurve Is Nothing Then
+ m_cmdRemovePointCurve = New Command(AddressOf RemovePointCurve)
+ End If
+ Return m_cmdRemovePointCurve
+ End Get
+ End Property
+
+ '''
+ ''' Execute the LinearDimension. This method is invoked by the LinDimCommand.
+ '''
+ Public Sub RemovePointCurve(ByVal param As Object)
+ InitCommand(ShellNumberSelectionTypes.CURVE)
+ If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.CURVETOLINE)
+ Else
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.REMOVEPOINTCURVE)
+ End If
+ End Sub
+
+#End Region ' RemovePointCurve
+
+#Region "Extrude"
+
+ '''
+ ''' Returns a command that do Extrude.
+ '''
+ Public ReadOnly Property Extrude_Command As ICommand
+ Get
+ If m_cmdExtrude Is Nothing Then
+ m_cmdExtrude = New Command(AddressOf Extrude)
+ End If
+ Return m_cmdExtrude
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Extrude. This method is invoked by the ExtrudeCommand.
+ '''
+ Public Sub Extrude(ByVal param As Object)
+ InitCommand(ShellNumberSelectionTypes.EXTRUSION)
+ If Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.EXTRUDE) Then
+ m_bIsCreatingExtrusion = True
+ End If
+ End Sub
+
+#End Region ' Extrude
+
+#Region "CPlaneTop"
+
+ '''
+ ''' Returns a command that do CPlaneTop.
+ '''
+ Public ReadOnly Property CPlaneTop_Command As ICommand
+ Get
+ If m_cmdCPlaneTop Is Nothing Then
+ m_cmdCPlaneTop = New Command(AddressOf CPlaneTop)
+ End If
+ Return m_cmdCPlaneTop
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneTop. This method is invoked by the CPlaneTopCommand.
+ '''
+ Public Sub CPlaneTop(ByVal param As Object)
+ Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.TOP)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
+ End Sub
+
+#End Region ' CPlaneTop
+
+#Region "CPlaneFront"
+
+ '''
+ ''' Returns a command that do CPlaneFront.
+ '''
+ Public ReadOnly Property CPlaneFront_Command As ICommand
+ Get
+ If m_cmdCPlaneFront Is Nothing Then
+ m_cmdCPlaneFront = New Command(AddressOf CPlaneFront)
+ End If
+ Return m_cmdCPlaneFront
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneFront. This method is invoked by the CPlaneFrontCommand.
+ '''
+ Public Sub CPlaneFront(ByVal param As Object)
+ Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.FRONT)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
+ End Sub
+
+#End Region ' CPlaneFront
+
+#Region "CPlaneRight"
+
+ '''
+ ''' Returns a command that do CPlaneRight.
+ '''
+ Public ReadOnly Property CPlaneRight_Command As ICommand
+ Get
+ If m_cmdCPlaneRight Is Nothing Then
+ m_cmdCPlaneRight = New Command(AddressOf CPlaneRight)
+ End If
+ Return m_cmdCPlaneRight
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneRight. This method is invoked by the CPlaneRightCommand.
+ '''
+ Public Sub CPlaneRight(ByVal param As Object)
+ Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.RIGHT)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
+ End Sub
+
+#End Region ' CPlaneRight
+
+#Region "CPlaneBack"
+
+ '''
+ ''' Returns a command that do CPlaneBack.
+ '''
+ Public ReadOnly Property CPlaneBack_Command As ICommand
+ Get
+ If m_cmdCPlaneBack Is Nothing Then
+ m_cmdCPlaneBack = New Command(AddressOf CPlaneBack)
+ End If
+ Return m_cmdCPlaneBack
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneBack. This method is invoked by the CPlaneBackCommand.
+ '''
+ Public Sub CPlaneBack(ByVal param As Object)
+ Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.BACK)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
+ End Sub
+
+#End Region ' CPlaneBack
+
+#Region "CPlaneLeft"
+
+ '''
+ ''' Returns a command that do CPlaneLeft.
+ '''
+ Public ReadOnly Property CPlaneLeft_Command As ICommand
+ Get
+ If m_cmdCPlaneLeft Is Nothing Then
+ m_cmdCPlaneLeft = New Command(AddressOf CPlaneLeft)
+ End If
+ Return m_cmdCPlaneLeft
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneLeft. This method is invoked by the CPlaneLeftCommand.
+ '''
+ Public Sub CPlaneLeft(ByVal param As Object)
+ Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.LEFT)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
+ End Sub
+
+#End Region ' CPlaneLeft
+
+#Region "CPlaneBottom"
+
+ '''
+ ''' Returns a command that do CPlaneBottom.
+ '''
+ Public ReadOnly Property CPlaneBottom_Command As ICommand
+ Get
+ If m_cmdCPlaneBottom Is Nothing Then
+ m_cmdCPlaneBottom = New Command(AddressOf CPlaneBottom)
+ End If
+ Return m_cmdCPlaneBottom
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneBottom. This method is invoked by the CPlaneBottomCommand.
+ '''
+ Public Sub CPlaneBottom(ByVal param As Object)
+ Map.refSceneHostVM.MainController.SetLastInteger(Controller.GRID_TYPE.BOTTOM)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID)
+ End Sub
+
+#End Region ' CPlaneBottom
+
+#Region "CPlaneElevation"
+
+ '''
+ ''' Returns a command that do CPlaneElevation.
+ '''
+ Public ReadOnly Property CPlaneElevation_Command As ICommand
+ Get
+ If m_cmdCPlaneElevation Is Nothing Then
+ m_cmdCPlaneElevation = New Command(AddressOf CPlaneElevation)
+ End If
+ Return m_cmdCPlaneElevation
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneElevation. This method is invoked by the CPlaneElevationCommand.
+ '''
+ Public Sub CPlaneElevation(ByVal param As Object)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_ELEVATION)
+ End Sub
+
+#End Region ' CPlaneElevation
+
+#Region "CPlaneOrigin"
+
+ '''
+ ''' Returns a command that do CPlaneOrigin.
+ '''
+ Public ReadOnly Property CPlaneOrigin_Command As ICommand
+ Get
+ If m_cmdCPlaneOrigin Is Nothing Then
+ m_cmdCPlaneOrigin = New Command(AddressOf CPlaneOrigin)
+ End If
+ Return m_cmdCPlaneOrigin
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneOrigin. This method is invoked by the CPlaneOriginCommand.
+ '''
+ Public Sub CPlaneOrigin(ByVal param As Object)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_ORIGIN)
+ End Sub
+
+#End Region ' CPlaneOrigin
+
+#Region "CPlaneRotate"
+
+ '''
+ ''' Returns a command that do CPlaneRotate.
+ '''
+ Public ReadOnly Property CPlaneRotate_Command As ICommand
+ Get
+ If m_cmdCPlaneRotate Is Nothing Then
+ m_cmdCPlaneRotate = New Command(AddressOf CPlaneRotate)
+ End If
+ Return m_cmdCPlaneRotate
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneRotate. This method is invoked by the CPlaneRotateCommand.
+ '''
+ Public Sub CPlaneRotate(ByVal param As Object)
+ If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_ROTATE)
+ Else
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_ROTATE3D)
+ End If
+ End Sub
+
+#End Region ' CPlaneRotate
+
+#Region "CPlane3P"
+
+ '''
+ ''' Returns a command that do CPlane3P.
+ '''
+ Public ReadOnly Property CPlane3P_Command As ICommand
+ Get
+ If m_cmdCPlane3P Is Nothing Then
+ m_cmdCPlane3P = New Command(AddressOf CPlane3P)
+ End If
+ Return m_cmdCPlane3P
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlane3P. This method is invoked by the CPlane3PCommand.
+ '''
+ Public Sub CPlane3P(ByVal param As Object)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_3P)
+ End Sub
+
+#End Region ' CPlane3P
+
+#Region "CPlanePerpObj"
+
+ '''
+ ''' Returns a command that do CPlanePerpObj.
+ '''
+ Public ReadOnly Property CPlanePerpObj_Command As ICommand
+ Get
+ If m_cmdCPlanePerpObj Is Nothing Then
+ m_cmdCPlanePerpObj = New Command(AddressOf CPlanePerpObj)
+ End If
+ Return m_cmdCPlanePerpObj
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlanePerpObj. This method is invoked by the CPlanePerpObjCommand.
+ '''
+ Public Sub CPlanePerpObj(ByVal param As Object)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_PERPCURVE)
+ End Sub
+
+#End Region ' CPlanePerpObj
+
+#Region "CPlaneObj"
+
+ '''
+ ''' Returns a command that do CPlanepObj.
+ '''
+ Public ReadOnly Property CPlaneObj_Command As ICommand
+ Get
+ If m_cmdCPlaneObj Is Nothing Then
+ m_cmdCPlaneObj = New Command(AddressOf CPlaneObj)
+ End If
+ Return m_cmdCPlaneObj
+ End Get
+ End Property
+
+ '''
+ ''' Execute the CPlaneObj. This method is invoked by the CPlaneObjCommand.
+ '''
+ Public Sub CPlaneObj(ByVal param As Object)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_OBJ)
+ End Sub
+
+#End Region ' CPlaneObj
+
+#Region "DragMove"
+
+ Public ReadOnly Property DragMove_Command As ICommand
+ Get
+ If m_cmdDragMove Is Nothing Then
+ m_cmdDragMove = New Command(AddressOf DragMove)
+ End If
+ Return m_cmdDragMove
+ End Get
+ End Property
+
+ Public Sub DragMove()
+ InitCommand(ShellNumberSelectionTypes.BOTH)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.MOVE)
+ End Sub
+
+#End Region ' DragMove
+
+#Region "DragRotate"
+
+ Public ReadOnly Property DragRotate_Command As ICommand
+ Get
+ If m_cmdDragRotate Is Nothing Then
+ m_cmdDragRotate = New Command(AddressOf DragRotate)
+ End If
+ Return m_cmdDragRotate
+ End Get
+ End Property
+
+ Public Sub DragRotate()
+ InitCommand(ShellNumberSelectionTypes.BOTH)
+ Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.ROTATE)
+ End Sub
+
+#End Region ' DragRotate
+
+#Region "MachParam"
+
+ Public ReadOnly Property MachParam_Command As ICommand
+ Get
+ If m_cmdMachParam Is Nothing Then
+ m_cmdMachParam = New Command(AddressOf MachParam)
+ End If
+ Return m_cmdMachParam
+ End Get
+ End Property
+
+ Public Sub MachParam()
+ If IsNothing(Map.refTopPanelVM.SelMachining) Then Return
+ m_bAdd_IsChecked = False
+ m_bEdit_IsChecked = False
+ m_bGrid_IsChecked = False
+ m_bMove_IsChecked = False
+ m_bRotate_IsChecked = False
+ NotifyPropertyChanged(NameOf(bAdd_IsChecked))
+ NotifyPropertyChanged(NameOf(bEdit_IsChecked))
+ NotifyPropertyChanged(NameOf(bGrid_IsChecked))
+ NotifyPropertyChanged(NameOf(bMove_IsChecked))
+ NotifyPropertyChanged(NameOf(bRotate_IsChecked))
+ Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.SHELLNUMBERPARAM)
+ End Sub
+
+#End Region ' MachParam
+
+#End Region ' COMMANDS
+
+End Class
+
+Public Class ShellNumberEntity
+ Inherits VMBase
+
+ Public Enum ShellNumberTypes As Integer
+ FROMDRAW = 1
+ FROMIMPORT = 2
+ End Enum
+
+ Private Shared m_nSharedIndex As Integer = 0
+ Private ReadOnly Property nSharedIndex As Integer
+ Get
+ m_nSharedIndex += 1
+ Return m_nSharedIndex
+ End Get
+ End Property
+ Friend Shared Sub ResetSharedIndex()
+ m_nSharedIndex = 0
+ End Sub
+
+ Private m_Type As ShellNumberTypes
+ Public ReadOnly Property Type As ShellNumberTypes
+ Get
+ Return m_Type
+ End Get
+ End Property
+
+ Private m_nCurveId As Integer = GDB_ID.NULL
+ Public ReadOnly Property nCurveId As Integer
+ Get
+ Return m_nCurveId
+ End Get
+ End Property
+
+ Private m_nExtrusionId As Integer = GDB_ID.NULL
+ Public ReadOnly Property nExtrusionId As Integer
+ Get
+ Return m_nExtrusionId
+ End Get
+ End Property
+ Friend Sub SetExtrusionId(nId As Integer)
+ m_nExtrusionId = nId
+ EgtSetInfo(m_nCurveId, KEY_EXTRUSION_ID, m_nExtrusionId)
+ End Sub
+
+ Private m_nIndex As Integer
+ Public ReadOnly Property nIndex As Integer
+ Get
+ Return m_nIndex
+ End Get
+ End Property
+
+ Public ReadOnly Property ghName As String
+ Get
+ Return String.Format("[{0}] {1}", {m_nIndex, If(m_Type = ShellNumberTypes.FROMDRAW, "Draw Shell Number", "Import Shell Number")})
+ End Get
+ End Property
+
+ Sub New(Type As ShellNumberTypes, nId As Integer)
+ m_nIndex = nSharedIndex
+ m_Type = Type
+ EgtSetInfo(nId, KEY_RIB_TYPE, Type)
+ Select Case Type
+ Case ShellNumberTypes.FROMDRAW
+ m_nCurveId = nId
+ Case ShellNumberTypes.FROMIMPORT
+ m_nExtrusionId = nId
+ End Select
+ End Sub
+
+End Class
diff --git a/Icarus/ShellNumberParamPanel/ShellNumberParamPanelV.xaml b/Icarus/ShellNumberParamPanel/ShellNumberParamPanelV.xaml
new file mode 100644
index 0000000..7b7c987
--- /dev/null
+++ b/Icarus/ShellNumberParamPanel/ShellNumberParamPanelV.xaml
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Icarus/ShellNumberParamPanel/ShellNumberParamPanelV.xaml.vb b/Icarus/ShellNumberParamPanel/ShellNumberParamPanelV.xaml.vb
new file mode 100644
index 0000000..6544411
--- /dev/null
+++ b/Icarus/ShellNumberParamPanel/ShellNumberParamPanelV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class ShellNumberParamPanelV
+
+End Class
diff --git a/Icarus/ShellNumberParamPanel/ShellNumberParamPanelVM.vb b/Icarus/ShellNumberParamPanel/ShellNumberParamPanelVM.vb
new file mode 100644
index 0000000..21bfe4c
--- /dev/null
+++ b/Icarus/ShellNumberParamPanel/ShellNumberParamPanelVM.vb
@@ -0,0 +1,253 @@
+Imports System.Collections.ObjectModel
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Public Class ShellNumberParamPanelVM
+ Inherits MachiningCathegory
+
+#Region "FIELDS & PROPERTIES"
+
+ ' Definizione comandi
+ Private m_cmdOk As ICommand
+ Private m_cmdCancel As ICommand
+
+#End Region ' FIELDS & PROPERTIES
+
+#Region "CONSTRUCTORS"
+
+ Sub New()
+ ' Creo riferimento a questa classe in EgtCAM5Map
+ Map.SetRefShellNumberParamPanelVM(Me)
+ End Sub
+
+#End Region ' CONSTRUCTORS
+
+#Region "METHODS"
+
+ Friend Sub Init()
+ If IsNothing(Map.refShellNumberPanelVM.SelShellNumber) Then
+ ' ripristino modalita' standard
+ Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.NULL)
+ Return
+ End If
+ Dim nPartId As Integer = Map.refTopPanelVM.SelPart.nPartId
+ Dim nShellNumberId As Integer = GDB_ID.NULL
+ Select Case Map.refShellNumberPanelVM.SelShellNumber.Type
+ Case RibEntity.RibTypes.FROMDRAW
+ nShellNumberId = Map.refShellNumberPanelVM.SelShellNumber.nCurveId
+ Case RibEntity.RibTypes.FROMIMPORT
+ nShellNumberId = Map.refShellNumberPanelVM.SelShellNumber.nExtrusionId
+ End Select
+
+ m_Type = Cathegories.SHELL_NUMBER
+ m_sName = "Reduce Shell Number"
+ m_MachiningParamList = New List(Of MachiningParam)({New ShellNumberNumericMachiningParam(MachiningParam.Params.SHELLNBRDIFFERENCE, nShellNumberId, nPartId),
+ New ShellNumberNumericMachiningParam(MachiningParam.Params.SHELLNBRCOASTING, nShellNumberId, nPartId),
+ New ShellNumberNumericMachiningParam(MachiningParam.Params.SHELLNBRWIPE, nShellNumberId, nPartId),
+ New ShellNumberNumericMachiningParam(MachiningParam.Params.SHELLNBRWIPEDIR, nShellNumberId, nPartId)})
+ NotifyPropertyChanged(NameOf(MachiningParamList))
+ NotifyPropertyChanged(NameOf(sName))
+ End Sub
+
+ Friend Sub SaveCurrParams()
+ For Each Param In m_MachiningParamList
+ Param.SaveParam()
+ Next
+ End Sub
+
+ Friend Sub ResetCurrParams()
+ For Each Param In m_MachiningParamList
+ Param.ResetParam()
+ Next
+ End Sub
+
+ Friend Sub WriteParamsInShellNumber(nRibId As Integer)
+ For Each Param As ShellNumberNumericMachiningParam In m_MachiningParamList
+ Param.WriteParamInShellNumber(nRibId)
+ Next
+ End Sub
+
+#End Region ' METHODS
+
+#Region "COMMANDS"
+
+#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()
+ If Not IsNothing(Map.refShellNumberPanelVM.SelShellNumber) Then
+ ' scrivo i parametri modificati
+ Select Case Map.refShellNumberPanelVM.SelShellNumber.Type
+ Case ShellNumberEntity.ShellNumberTypes.FROMDRAW
+ WriteParamsInShellNumber(Map.refShellNumberPanelVM.SelShellNumber.nCurveId)
+ WriteParamsInShellNumber(Map.refShellNumberPanelVM.SelShellNumber.nExtrusionId)
+ Case ShellNumberEntity.ShellNumberTypes.FROMIMPORT
+ WriteParamsInShellNumber(Map.refShellNumberPanelVM.SelShellNumber.nExtrusionId)
+ End Select
+ End If
+ ' ripristino modalita' standard
+ Map.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.NULL)
+ Map.refShellNumberPanelVM.ResetMachParamIsChecked()
+ 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.refRightPanelVM.SetSelPanel(RightPanelVM.Panels.NULL)
+ Map.refShellNumberPanelVM.ResetMachParamIsChecked()
+ End Sub
+
+#End Region ' Cancel
+
+#End Region ' COMMANDS
+
+End Class
+
+Public Class ShellNumberNumericMachiningParam
+ Inherits NumericMachiningParam
+
+ Public Overrides Property dValue As String
+ Get
+ Return If(m_bIsLen, LenToString(m_dValue, 1), m_dValue)
+ End Get
+ Set(value As String)
+ If m_bIsLen Then
+ StringToLen(value, m_dValue)
+ Else
+ m_dValue = value
+ End If
+ NotifyPropertyChanged(NameOf(dValue))
+ NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
+ End Set
+ End Property
+
+ Private m_dPartValue As Double
+ Public ReadOnly Property dPartValue As Double
+ Get
+ Return m_dPartValue
+ End Get
+ End Property
+
+ Public ReadOnly Property bIsModifiedFromPart As Boolean
+ Get
+ Return m_dValue <> m_dPartValue
+ End Get
+ End Property
+
+ ' Definizione comandi
+ Private m_cmdResetParam As ICommand
+
+ Sub New(Type As Params, nShellNumberId As Integer, nPartId As Integer)
+ MyBase.New(Type)
+ Dim bReadFromPart As Boolean = False
+ Select Case Type
+ Case Params.SHELLNBRDIFFERENCE
+ bReadFromPart = EgtGetInfo(nShellNumberId, MAC_SHELLNBRDIFFERENCE, m_dValue)
+ EgtGetInfo(nPartId, MAC_SHELLNBRDIFFERENCE, m_dPartValue)
+ m_bIsLen = True
+ Case Params.SHELLNBRCOASTING
+ bReadFromPart = EgtGetInfo(nShellNumberId, MAC_SHELLNBRCOASTING, m_dValue)
+ EgtGetInfo(nPartId, MAC_SHELLNBRCOASTING, m_dPartValue)
+ m_bIsLen = True
+ Case Params.SHELLNBRWIPE
+ bReadFromPart = EgtGetInfo(nShellNumberId, MAC_SHELLNBRWIPE, m_dValue)
+ EgtGetInfo(nPartId, MAC_SHELLNBRWIPE, m_dPartValue)
+ m_bIsLen = True
+ Case Params.SHELLNBRWIPEDIR
+ bReadFromPart = EgtGetInfo(nShellNumberId, MAC_SHELLNBRWIPEDIR, m_dValue)
+ EgtGetInfo(nPartId, MAC_SHELLNBRWIPEDIR, m_dPartValue)
+ m_bIsLen = True
+ End Select
+ m_dOrigValue = m_dValue
+ If Not bReadFromPart Then
+ m_dValue = m_dPartValue
+ End If
+ End Sub
+
+ Friend Sub WriteParamInShellNumber(nShellNumberId As Integer)
+ Dim sWriteValue As String = ""
+ If m_bIsLen Then
+ sWriteValue = LenToString(m_dValue, 2)
+ Else
+ sWriteValue = DoubleToString(m_dValue, 2)
+ End If
+ Select Case Type
+ Case Params.SHELLNBRDIFFERENCE
+ If bIsModifiedFromPart Then
+ EgtSetInfo(nShellNumberId, MAC_SHELLNBRDIFFERENCE, sWriteValue)
+ Else
+ EgtRemoveInfo(nShellNumberId, MAC_SHELLNBRDIFFERENCE)
+ End If
+ Case Params.SHELLNBRCOASTING
+ If bIsModifiedFromPart Then
+ EgtSetInfo(nShellNumberId, MAC_SHELLNBRCOASTING, sWriteValue)
+ Else
+ EgtRemoveInfo(nShellNumberId, MAC_SHELLNBRCOASTING)
+ End If
+ Case Params.SHELLNBRWIPE
+ If bIsModifiedFromPart Then
+ EgtSetInfo(nShellNumberId, MAC_SHELLNBRWIPE, sWriteValue)
+ Else
+ EgtRemoveInfo(nShellNumberId, MAC_SHELLNBRWIPE)
+ End If
+ Case Params.SHELLNBRWIPEDIR
+ If bIsModifiedFromPart Then
+ EgtSetInfo(nShellNumberId, MAC_SHELLNBRWIPEDIR, sWriteValue)
+ Else
+ EgtRemoveInfo(nShellNumberId, MAC_SHELLNBRWIPEDIR)
+ End If
+ End Select
+ End Sub
+
+ Friend Overrides Sub SaveParam()
+ m_dOrigValue = m_dValue
+ End Sub
+
+ Friend Overrides Sub ResetParam()
+ m_dValue = m_dOrigValue
+ End Sub
+
+#Region "COMMANDS"
+
+#Region "ResetParam"
+
+ Public ReadOnly Property ResetParam_Command As ICommand
+ Get
+ If m_cmdResetParam Is Nothing Then
+ m_cmdResetParam = New Command(AddressOf ResetParamCmd)
+ End If
+ Return m_cmdResetParam
+ End Get
+ End Property
+
+ Public Sub ResetParamCmd()
+ m_dValue = m_dPartValue
+ NotifyPropertyChanged(NameOf(dValue))
+ NotifyPropertyChanged(NameOf(bIsModifiedFromPart))
+ End Sub
+
+#End Region ' ResetParam
+
+#End Region ' COMMANDS
+
+End Class
diff --git a/Icarus/SliceManager/SliceManagerVM.vb b/Icarus/SliceManager/SliceManagerVM.vb
index 0bf6bb7..1fde729 100644
--- a/Icarus/SliceManager/SliceManagerVM.vb
+++ b/Icarus/SliceManager/SliceManagerVM.vb
@@ -289,7 +289,7 @@ Public Class SliceManagerVM
Return
End If
' esco da altre pagine
-
+ Map.refTopPanelVM.SelPage = Pages.NULL
' eseguo calcoli
CalcSlice(True, True, True)
Map.refTopPanelVM.SelPage = Pages.SLICE
diff --git a/Icarus/TopPanel/TopPanelV.xaml b/Icarus/TopPanel/TopPanelV.xaml
index 55a0022..b3d9a81 100644
--- a/Icarus/TopPanel/TopPanelV.xaml
+++ b/Icarus/TopPanel/TopPanelV.xaml
@@ -37,6 +37,7 @@
+
diff --git a/Icarus/TopPanel/TopPanelV.xaml.vb b/Icarus/TopPanel/TopPanelV.xaml.vb
index 566a343..bb08bd8 100644
--- a/Icarus/TopPanel/TopPanelV.xaml.vb
+++ b/Icarus/TopPanel/TopPanelV.xaml.vb
@@ -1,3 +1,12 @@
Public Class TopPanelV
+ Private Sub ModifyModeList_PreviewMouseDown(sender As Object, e As MouseButtonEventArgs)
+ If TypeOf sender Is ListBoxItem Then
+ Dim Item As ListBoxItem = DirectCast(sender, ListBoxItem)
+ If Not IsNothing(Item) AndAlso Item.IsSelected Then
+ Map.refTopPanelVM.SetModifyIsChecked(False)
+ End If
+ End If
+ End Sub
+
End Class
diff --git a/Icarus/TopPanel/TopPanelVM.vb b/Icarus/TopPanel/TopPanelVM.vb
index ea4e70d..e6cc913 100644
--- a/Icarus/TopPanel/TopPanelVM.vb
+++ b/Icarus/TopPanel/TopPanelVM.vb
@@ -83,6 +83,10 @@ Public Class TopPanelVM
Return m_SelModifyMode
End Get
Set(value As ModifyModeButton)
+ ' se in slice
+ If m_SelPage = Pages.SLICE Then
+ SetSelPage(Pages.MODIFY)
+ End If
m_SelModifyMode = value
If Not IsNothing(value) Then
Dim SelLeftPanel As LeftPanelVM.Panels = LeftPanelVM.Panels.NULL
@@ -106,6 +110,8 @@ Public Class TopPanelVM
Else
Map.refLeftPanelVM.SetSelPanel(LeftPanelVM.Panels.NULL)
End If
+ ' chiudo il popup
+ SetModifyIsChecked(False)
End Set
End Property
Friend Sub SetSelModifyMode(ModifyMode As ModifyModes)
@@ -113,6 +119,20 @@ Public Class TopPanelVM
NotifyPropertyChanged(NameOf(SelModifyMode))
End Sub
+ Private m_bModify_IsChecked As Boolean
+ Public Property bModify_IsChecked As Boolean
+ Get
+ Return m_bModify_IsChecked
+ End Get
+ Set(value As Boolean)
+ m_bModify_IsChecked = value
+ End Set
+ End Property
+ Friend Sub SetModifyIsChecked(value As Boolean)
+ m_bModify_IsChecked = value
+ NotifyPropertyChanged(NameOf(bModify_IsChecked))
+ End Sub
+
#End Region ' Pages
#Region "Parts Manager"
diff --git a/Icarus/Utility/Dictionary.xaml b/Icarus/Utility/Dictionary.xaml
index 4947599..711f46a 100644
--- a/Icarus/Utility/Dictionary.xaml
+++ b/Icarus/Utility/Dictionary.xaml
@@ -39,6 +39,8 @@
+
+
diff --git a/Icarus/Utility/Map.vb b/Icarus/Utility/Map.vb
index 3f7e865..4c90301 100644
--- a/Icarus/Utility/Map.vb
+++ b/Icarus/Utility/Map.vb
@@ -58,6 +58,8 @@ Module Map
Private m_refSimulationPanelVM As SimulationPanelVM
Private m_refReferencePanelVM As ReferencePanelVM
Private m_refViewLayerManagerVM As ViewLayerManagerVM
+ Private m_refShellNumberPanelVM As ShellNumberPanelVM
+ Private m_refShellNumberParamPanelVM As ShellNumberParamPanelVM
#Region "Get"
@@ -408,6 +410,18 @@ Module Map
End Get
End Property
+ Public ReadOnly Property refShellNumberPanelVM As ShellNumberPanelVM
+ Get
+ Return m_refShellNumberPanelVM
+ End Get
+ End Property
+
+ Public ReadOnly Property refShellNumberParamPanelVM As ShellNumberParamPanelVM
+ Get
+ Return m_refShellNumberParamPanelVM
+ End Get
+ End Property
+
#End Region ' Get
#Region "Set"
@@ -701,6 +715,16 @@ Module Map
Return Not IsNothing(m_refViewLayerManagerVM)
End Function
+ Friend Function SetRefShellNumberPanelVM(ShellNumberPanelVM As ShellNumberPanelVM) As Boolean
+ m_refShellNumberPanelVM = ShellNumberPanelVM
+ Return Not IsNothing(m_refShellNumberPanelVM)
+ End Function
+
+ Friend Function SetRefShellNumberParamPanelVM(ShellNumberParamPanelVM As ShellNumberParamPanelVM) As Boolean
+ m_refShellNumberParamPanelVM = ShellNumberParamPanelVM
+ Return Not IsNothing(m_refShellNumberParamPanelVM)
+ End Function
+
#End Region ' Set
#Region "Init"