diff --git a/Icarus/My Project/AssemblyInfo.vb b/Icarus/My Project/AssemblyInfo.vb index 15ad57e..45f523b 100644 --- a/Icarus/My Project/AssemblyInfo.vb +++ b/Icarus/My Project/AssemblyInfo.vb @@ -70,5 +70,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/Icarus/RibPanel/RibPanelV.xaml b/Icarus/RibPanel/RibPanelV.xaml index c3dda11..2608893 100644 --- a/Icarus/RibPanel/RibPanelV.xaml +++ b/Icarus/RibPanel/RibPanelV.xaml @@ -206,6 +206,7 @@ Grid.Row="6" Content="Grid" IsChecked="{Binding bGrid_IsChecked}" + IsEnabled="{Binding bGrid_IsEnabled}" Style="{StaticResource ToolBar_TextToggleButton}"/> = 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then - EgtMove(m_SelRib.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min) - EgtMove(m_SelRib.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min) + EgtMove(m_SelRib.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB) + EgtMove(m_SelRib.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB) EgtDraw() Else NotifyPropertyChanged(NameOf(sXPos)) @@ -103,8 +103,8 @@ Public Class RibPanelVM Dim dNewYPos As Double = b3Reference.Min.y StringToLen(value, dNewYPos) If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then - EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min) - EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min) + EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB) + EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB) EgtDraw() Else NotifyPropertyChanged(NameOf(sYPos)) @@ -132,8 +132,8 @@ Public Class RibPanelVM Dim dNewZPos As Double = b3Reference.Min.y StringToLen(value, dNewZPos) If dNewZPos >= 0 Then - EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min) - EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min) + EgtMove(m_SelRib.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB) + EgtMove(m_SelRib.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB) EgtDraw() Else NotifyPropertyChanged(NameOf(sZPos)) @@ -144,12 +144,28 @@ Public Class RibPanelVM End Property Private m_RotAxes() As Boolean = {False, False, True} - Public Property RotAxes As Boolean() + Public Property RotX As Boolean Get - Return m_RotAxes + Return m_RotAxes(0) End Get - Set(value As Boolean()) - m_RotAxes = value + Set(value As Boolean) + m_RotAxes(0) = value + End Set + End Property + Public Property RotY As Boolean + Get + Return m_RotAxes(1) + End Get + Set(value As Boolean) + m_RotAxes(1) = value + End Set + End Property + Public Property RotZ As Boolean + Get + Return m_RotAxes(2) + End Get + Set(value As Boolean) + m_RotAxes(2) = value End Set End Property @@ -159,7 +175,7 @@ Public Class RibPanelVM Return Vector3d.X_AX ElseIf m_RotAxes(1) Then Return Vector3d.Y_AX - ElseIf m_RotAxes(2) Then + Else Return Vector3d.Z_AX End If End Get @@ -179,20 +195,20 @@ Public Class RibPanelVM End If Dim nId As Integer = If(m_SelRib.Type = RibEntity.RibTypes.FROMDRAW, m_SelRib.nCurveId, m_SelRib.nExtrusionId) Dim b3Rib As New BBox3d - EgtGetBBox(nId, GDB_BB.STANDARD, b3Rib) + EgtGetBBoxGlob(nId, GDB_BB.STANDARD, b3Rib) Dim bOk As Boolean = False - bOk = EgtRotate(nId, b3Rib.Center(), vtSelRotAxes, dNewAngle) - If bOk AndAlso m_SelRib.Type = RibEntity.RibTypes.FROMDRAW Then EgtRotate(m_SelRib.nExtrusionId, b3Rib.Center, vtSelRotAxes, dNewAngle) + bOk = EgtRotate(nId, b3Rib.Center(), vtSelRotAxes, dNewAngle, GDB_RT.GLOB) + If bOk AndAlso m_SelRib.Type = RibEntity.RibTypes.FROMDRAW Then EgtRotate(m_SelRib.nExtrusionId, b3Rib.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB) If bOk Then EgtDraw() RefreshPos() m_sRotAngle = 0 NotifyPropertyChanged(NameOf(sRotAngle)) + ' Imposto flag di ricalcolo slice + EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True) Else m_sRotAngle = value End If - ' Imposto flag di ricalcolo slice - EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True) End Set End Property @@ -264,6 +280,12 @@ Public Class RibPanelVM End Set End Property + Public ReadOnly Property bGrid_IsEnabled As Boolean + Get + Return Map.refMyStatusBarVM.bGridVisibility + End Get + End Property + Private m_bMove_IsChecked As Boolean Public Property bMove_IsChecked As Boolean Get @@ -411,6 +433,9 @@ Public Class RibPanelVM #Region "METHODS" Friend Sub Init() + ' asse rotazione di default + RotZ = True + NotifyPropertyChanged(NameOf(RotZ)) ' azzero indice StartEntity.ResetSharedIndex() ' fisso frame originale @@ -418,6 +443,10 @@ Public Class RibPanelVM ' recupero dati pezzo selezionato layer ed entita' m_nPartId = Map.refTopPanelVM.SelPart.nPartId m_nRibLayerId = Map.refTopPanelVM.SelPart.nRibsLayerId + If m_nRibLayerId = GDB_ID.NULL Then + m_nRibLayerId = EgtCreateGroup(m_nPartId) + EgtSetName(m_nRibLayerId, LAY_RIBS) + End If 'recupero tutte le entita' rib m_RibList.Clear() Dim nRibId As Integer = EgtGetFirstInGroup(m_nRibLayerId) @@ -525,7 +554,8 @@ Public Class RibPanelVM 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 + 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, Controller.CMD.GRID_OBJ ' rimetto la selezione scena a null Map.refSceneHostVM.MainScene.SetStatusNull() End Select @@ -1162,6 +1192,7 @@ Public Class RibPanelVM Public Sub CPlaneObj(ByVal param As Object) If Map.refSceneHostVM.MainController.GetStep <> 0 Then Return ' salvo selezione precedente e deseleziono altri oggetti + m_PrevSelObjs.Clear() Dim nSelObjId As Integer = EgtGetFirstSelectedObj() While nSelObjId <> GDB_ID.NULL m_PrevSelObjs.Add(nSelObjId) diff --git a/Icarus/SceneHost/MySceneHostVM.vb b/Icarus/SceneHost/MySceneHostVM.vb index f625907..def4860 100644 --- a/Icarus/SceneHost/MySceneHostVM.vb +++ b/Icarus/SceneHost/MySceneHostVM.vb @@ -1359,7 +1359,7 @@ Public Class MySceneHostVM End If nId = EgtGetNextObjInSelWin() End While - If m_nIdToSel <> GDB_ID.NULL Then + If Map.refRibPanelVM.bCPlaneObj_IsActive And m_nIdToSel <> GDB_ID.NULL Then ' recupero dati punto di selezione Dim PtTemp As Point3d Dim nAux As Integer diff --git a/Icarus/ShellNumberPanel/ShellNumberPanelV.xaml b/Icarus/ShellNumberPanel/ShellNumberPanelV.xaml index 362c58d..59cf40c 100644 --- a/Icarus/ShellNumberPanel/ShellNumberPanelV.xaml +++ b/Icarus/ShellNumberPanel/ShellNumberPanelV.xaml @@ -206,6 +206,7 @@ Grid.Row="6" Content="Grid" IsChecked="{Binding bGrid_IsChecked}" + IsEnabled="{Binding bGrid_IsEnabled}" Style="{StaticResource ToolBar_TextToggleButton}"/> = 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) + EgtMove(m_SelShellNumber.nCurveId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB) + EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(dNewXPos, b3Reference.Min.y, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB) EgtDraw() Else NotifyPropertyChanged(NameOf(sXPos)) @@ -103,8 +103,8 @@ Public Class ShellNumberPanelVM 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) + EgtMove(m_SelShellNumber.nCurveId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB) + EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(b3Reference.Min.x, dNewYPos, b3Reference.Min.z) - b3Reference.Min, GDB_RT.GLOB) EgtDraw() Else NotifyPropertyChanged(NameOf(sYPos)) @@ -132,8 +132,8 @@ Public Class ShellNumberPanelVM 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) + EgtMove(m_SelShellNumber.nCurveId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB) + EgtMove(m_SelShellNumber.nExtrusionId, New Point3d(b3Reference.Min.x, b3Reference.Min.y, dNewZPos) - b3Reference.Min, GDB_RT.GLOB) EgtDraw() Else NotifyPropertyChanged(NameOf(sZPos)) @@ -144,12 +144,28 @@ Public Class ShellNumberPanelVM End Property Private m_RotAxes() As Boolean = {False, False, True} - Public Property RotAxes As Boolean() + Public Property RotX As Boolean Get - Return m_RotAxes + Return m_RotAxes(0) End Get - Set(value As Boolean()) - m_RotAxes = value + Set(value As Boolean) + m_RotAxes(0) = value + End Set + End Property + Public Property RotY As Boolean + Get + Return m_RotAxes(1) + End Get + Set(value As Boolean) + m_RotAxes(1) = value + End Set + End Property + Public Property RotZ As Boolean + Get + Return m_RotAxes(2) + End Get + Set(value As Boolean) + m_RotAxes(2) = value End Set End Property @@ -159,7 +175,7 @@ Public Class ShellNumberPanelVM Return Vector3d.X_AX ElseIf m_RotAxes(1) Then Return Vector3d.Y_AX - ElseIf m_RotAxes(2) Then + Else Return Vector3d.Z_AX End If End Get @@ -179,20 +195,20 @@ Public Class ShellNumberPanelVM 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) + EgtGetBBoxGlob(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) + bOk = EgtRotate(nId, b3Rib.Center(), vtSelRotAxes, dNewAngle, GDB_RT.GLOB) + If bOk AndAlso m_SelShellNumber.Type = ShellNumberEntity.ShellNumberTypes.FROMDRAW Then EgtRotate(m_SelShellNumber.nExtrusionId, b3Rib.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB) If bOk Then EgtDraw() RefreshPos() m_sRotAngle = 0 NotifyPropertyChanged(NameOf(sRotAngle)) + ' Imposto flag di ricalcolo slice + EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True) Else m_sRotAngle = value End If - ' Imposto flag di ricalcolo slice - EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True) End Set End Property @@ -264,6 +280,12 @@ Public Class ShellNumberPanelVM End Set End Property + Public ReadOnly Property bGrid_IsEnabled As Boolean + Get + Return Map.refMyStatusBarVM.bGridVisibility + End Get + End Property + Private m_bMove_IsChecked As Boolean Public Property bMove_IsChecked As Boolean Get @@ -411,6 +433,9 @@ Public Class ShellNumberPanelVM #Region "METHODS" Friend Sub Init() + ' asse rotazione di default + RotZ = True + NotifyPropertyChanged(NameOf(RotZ)) ' azzero indice StartEntity.ResetSharedIndex() ' fisso frame originale @@ -418,7 +443,11 @@ Public Class ShellNumberPanelVM ' recupero dati pezzo selezionato layer ed entita' m_nPartId = Map.refTopPanelVM.SelPart.nPartId m_nShellNumberLayerId = Map.refTopPanelVM.SelPart.nShellNumberLayerId - 'recupero tutte le entita' rib + If m_nShellNumberLayerId = GDB_ID.NULL Then + m_nShellNumberLayerId = EgtCreateGroup(m_nPartId) + EgtSetName(m_nShellNumberLayerId, LAY_SHELL_NBR) + End If + 'recupero tutte le entita' shell number m_ShellNumberList.Clear() Dim nShellNumberId As Integer = EgtGetFirstInGroup(m_nShellNumberLayerId) While nShellNumberId <> GDB_ID.NULL @@ -1308,7 +1337,7 @@ Public Class ShellNumberEntity Sub New(Type As ShellNumberTypes, nId As Integer) m_nIndex = nSharedIndex m_Type = Type - EgtSetInfo(nId, KEY_RIB_TYPE, Type) + EgtSetInfo(nId, KEY_SHELLNBR_TYPE, Type) Select Case Type Case ShellNumberTypes.FROMDRAW m_nCurveId = nId diff --git a/Icarus/StartMachPanel/StartMachPanelV.xaml b/Icarus/StartMachPanel/StartMachPanelV.xaml index 0232961..e2cd325 100644 --- a/Icarus/StartMachPanel/StartMachPanelV.xaml +++ b/Icarus/StartMachPanel/StartMachPanelV.xaml @@ -189,6 +189,7 @@ Grid.Row="6" Content="Grid" IsChecked="{Binding bGrid_IsChecked}" + IsEnabled="{Binding bGrid_IsEnabled}" Style="{StaticResource ToolBar_TextToggleButton}"/> = 0 AndAlso dNewXPos <= CurrentMachine.b3Tab.DimX Then - EgtMove(m_SelStart.nId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference) + EgtMove(m_SelStart.nId, New Point3d(dNewXPos, ptReference.y, ptReference.z) - ptReference, GDB_RT.GLOB) EgtDraw() Else NotifyPropertyChanged(NameOf(sXPos)) @@ -92,7 +92,7 @@ Public Class StartMachPanelVM Dim dNewYPos As Double = ptReference.y StringToLen(value, dNewYPos) If dNewYPos >= 0 AndAlso dNewYPos <= CurrentMachine.b3Tab.DimY Then - EgtMove(m_SelStart.nId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference) + EgtMove(m_SelStart.nId, New Point3d(ptReference.x, dNewYPos, ptReference.z) - ptReference, GDB_RT.GLOB) EgtDraw() Else NotifyPropertyChanged(NameOf(sYPos)) @@ -118,7 +118,7 @@ Public Class StartMachPanelVM Dim dNewZPos As Double = ptReference.z StringToLen(value, dNewZPos) If dNewZPos >= 0 Then - EgtMove(m_SelStart.nId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference) + EgtMove(m_SelStart.nId, New Point3d(ptReference.x, ptReference.y, dNewZPos) - ptReference, GDB_RT.GLOB) EgtDraw() Else NotifyPropertyChanged(NameOf(sZPos)) @@ -129,12 +129,28 @@ Public Class StartMachPanelVM End Property Private m_RotAxes() As Boolean = {False, False, True} - Public Property RotAxes As Boolean() + Public Property RotX As Boolean Get - Return m_RotAxes + Return m_RotAxes(0) End Get - Set(value As Boolean()) - m_RotAxes = value + Set(value As Boolean) + m_RotAxes(0) = value + End Set + End Property + Public Property RotY As Boolean + Get + Return m_RotAxes(1) + End Get + Set(value As Boolean) + m_RotAxes(1) = value + End Set + End Property + Public Property RotZ As Boolean + Get + Return m_RotAxes(2) + End Get + Set(value As Boolean) + m_RotAxes(2) = value End Set End Property @@ -144,7 +160,7 @@ Public Class StartMachPanelVM Return Vector3d.X_AX ElseIf m_RotAxes(1) Then Return Vector3d.Y_AX - ElseIf m_RotAxes(2) Then + Else Return Vector3d.Z_AX End If End Get @@ -164,16 +180,16 @@ Public Class StartMachPanelVM End If Dim b3PrintSolid As New BBox3d EgtGetBBoxGlob(Map.refTopPanelVM.SelPart.nPartId, GDB_BB.STANDARD, b3PrintSolid) - If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle) Then + If EgtRotate(Map.refTopPanelVM.SelPart.nPartId, b3PrintSolid.Center, vtSelRotAxes, dNewAngle, GDB_RT.GLOB) Then EgtDraw() RefreshPos() m_sRotAngle = 0 NotifyPropertyChanged(NameOf(sRotAngle)) + ' Imposto flag di ricalcolo slice + EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True) Else m_sRotAngle = value End If - ' Imposto flag di ricalcolo slice - EgtSetInfo(Map.refTopPanelVM.SelPart.nPartId, MAC_TORECALC_SLICE, True) End Set End Property @@ -243,6 +259,12 @@ Public Class StartMachPanelVM End Set End Property + Public ReadOnly Property bGrid_IsEnabled As Boolean + Get + Return Map.refMyStatusBarVM.bGridVisibility + End Get + End Property + Private m_bMove_IsChecked As Boolean Public Property bMove_IsChecked As Boolean Get diff --git a/Icarus/StatusBar/MyStatusBarVM.vb b/Icarus/StatusBar/MyStatusBarVM.vb index 8262818..602da62 100644 --- a/Icarus/StatusBar/MyStatusBarVM.vb +++ b/Icarus/StatusBar/MyStatusBarVM.vb @@ -23,9 +23,13 @@ Public Class MyStatusBarVM Return m_bGridVisibility End Get Set(value As Boolean) + If Map.refRibPanelVM.bGrid_IsChecked Or Map.refStartMachPanelVM.bGrid_IsChecked Or Map.refShellNumberPanelVM.bGrid_IsChecked Then Return m_bGridVisibility = value EgtSetGridShow(value, value) EgtDraw() + Map.refRibPanelVM.NotifyPropertyChanged(NameOf(Map.refRibPanelVM.bGrid_IsEnabled)) + Map.refStartMachPanelVM.NotifyPropertyChanged(NameOf(Map.refStartMachPanelVM.bGrid_IsEnabled)) + Map.refShellNumberPanelVM.NotifyPropertyChanged(NameOf(Map.refShellNumberPanelVM.bGrid_IsEnabled)) End Set End Property diff --git a/Icarus/Utility/LuaExec.vb b/Icarus/Utility/LuaExec.vb index 98d08ff..9d89590 100644 --- a/Icarus/Utility/LuaExec.vb +++ b/Icarus/Utility/LuaExec.vb @@ -69,7 +69,8 @@ Module LuaExec Dim sIsoFilePath As String = "" Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE) If nTabPartId <> GDB_ID.NULL Then - If Not EgtGetInfo(nTabPartId, KEY_ISOFILE_PATH, sIsoFilePath) Then + If Not EgtGetInfo(nTabPartId, KEY_ISOFILE_PATH, sIsoFilePath) OrElse + Not IO.Directory.Exists( IO.Path.GetDirectoryName(sIsoFilePath)) Then EgtGetCurrFilePath(sIsoFilePath) Dim sExtension As String = "" GetPrivateProfileString(S_PARTPROGRAM, K_EXTENSION, "", sExtension, CurrentMachine.sMachIniFile)