diff --git a/IniFile.vb b/IniFile.vb
index 62efb5a..f70a68d 100644
--- a/IniFile.vb
+++ b/IniFile.vb
@@ -42,9 +42,11 @@ Public Module IniFile
Friend m_nKeyLevel As Integer = 0
Friend m_nKeyOptions As UInteger = 0
Friend Enum KEY_OPT As UInteger
- BASE = 1
+ BASE = 1 ' Prodotto EgtCAM5
DOORS = 2
GUNSTOCK = 4
+ DOORCREATOR = 8 ' Prodotto DOORCreator
+ VIRTUALMILLING = 16
End Enum
Friend m_sDataRoot As String
Friend m_sConfigDir As String
@@ -233,6 +235,10 @@ Public Module IniFile
Return (IniFile.m_nKeyOptions And KEY_OPT.GUNSTOCK) <> 0 And (GetPrivateProfileInt(S_GUNSTOCK, K_GUNSTOCKENABLE, 0) <> 0)
End Function
+ Friend Function IsKeyEnabledVirtualMilling() As Boolean
+ Return (IniFile.m_nKeyOptions And KEY_OPT.VIRTUALMILLING) <> 0
+ End Function
+
Friend Function IsActiveSpecialPanel() As Boolean
Return If(GetPrivateProfileInt(S_SPECIAL, K_SPECIALENABLE, 0) <> 0, True, False)
End Function
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb
index c21692d..1b729f1 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/SimulationExpander/SimulationExpanderViewModel.vb
@@ -67,6 +67,7 @@ Namespace EgtCAM5
EgtDeselectAll()
Application.Msn.NotifyColleagues(Application.REMOVEMARKFROMLASTOPERATION)
Application.Msn.NotifyColleagues(Application.GETDISTANCE_ISCHECKED, False)
+ EgtCAM5Map.refTopCommandBarVM.SaveIsEnabled = False
If IniFile.m_bShowOnlyTable Then
EgtShowOnlyTable(False)
EgtZoom(ZM.ALL, False)
@@ -79,6 +80,7 @@ Namespace EgtCAM5
EgtShowOnlyTable(True)
EgtZoom(ZM.ALL)
End If
+ EgtCAM5Map.refTopCommandBarVM.SaveIsEnabled = True
End If
m_IsExpanded = value
Application.Msn.NotifyColleagues(Application.SIMULATIONEXPANDER_GET_ISEXPANDED, value)
@@ -557,7 +559,7 @@ Namespace EgtCAM5
Dim SliderVal As Double = GetPrivateProfileDouble(S_SIMUL, K_SLIDERVAL, 10)
SliderValue = SliderVal
' Gestione check VMill
- If EgtUILib.GetPrivateProfileInt(S_VMILL, K_VM_ENABLE, 0, m_sCurrMachIniFilePath) <> 0 Then
+ If IsKeyEnabledVirtualMilling() And EgtUILib.GetPrivateProfileInt(S_VMILL, K_VM_ENABLE, 0, m_sCurrMachIniFilePath) <> 0 Then
VMill_Visibility = Visibility.Visible
VMill_IsEnabled = True
Dim bVal As Boolean
diff --git a/ProjectPage/ProjectViewModel.vb b/ProjectPage/ProjectViewModel.vb
index b784347..ef9325f 100644
--- a/ProjectPage/ProjectViewModel.vb
+++ b/ProjectPage/ProjectViewModel.vb
@@ -870,9 +870,6 @@ Namespace EgtCAM5
Private Sub OnMyMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_ProjectScene.OnMouseMoveScene
' Se in modalità Draw esco
If IniFile.m_ProjectMode = ProjectModeOpt.DRAW OrElse IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW Then
- If bEnhancedSelIsActive Then
- EnhancedMouseMoveScene(e)
- End If
Return
End If
' Sono in modalità Machining
@@ -911,182 +908,9 @@ Namespace EgtCAM5
m_bDragging = False
End Sub
- Dim bEnhancedSelecting As Boolean = False
- Dim nMarkedEntityId As Integer = GDB_ID.NULL
- ' creo liste in cui mettere curve e superfici
- Dim CurvesIdList As New List(Of Integer)
- Dim SurfacesIdList As New List(Of Integer)
- Dim bEnhancedSelIsActive As Boolean = False
- Private Sub EnhancedMouseMoveScene(e As System.Windows.Forms.MouseEventArgs)
- ' se un tasto di modifica è premuto
- If (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control OrElse (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift OrElse _
- (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt Then
- ' verifico se c'è un elemento rimasto evidenziato
- If nMarkedEntityId <> GDB_ID.NULL Then
- ' lo deevidenzio
- EgtResetMark(nMarkedEntityId)
- nMarkedEntityId = GDB_ID.NULL
- EgtDraw()
- End If
- Return
- End If
- If bEnhancedSelecting Then Return
- bEnhancedSelecting = True
- ' recupero elementi presenti nel quadratino di selezione
- Dim nSel As Integer
- EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSel)
- Dim nId As Integer = EgtGetFirstObjInSelWin()
- ' se esiste almeno un elemento nel quadratino di selezione
- Dim TempGroup As Integer
- Dim vtZView As Vector3d
- Dim vtYView As Vector3d
- Dim vtXView As Vector3d
- Dim frView As Frame3d
- If nId <> GDB_ID.NULL Then
- ' creo un gruppo temporaneo in cui mettere la proiezione sul piano della vista
- TempGroup = EgtCreateGroup(GDB_ID.ROOT)
- EgtSetMode(TempGroup, GDB_MD.HIDDEN)
- EgtSetLevel(TempGroup, GDB_LV.TEMP)
- 'EgtSetMode(TempGroup, GDB_MD.STD)
- 'EgtSetLevel(TempGroup, GDB_LV.USER)
- CurvesIdList.Clear()
- SurfacesIdList.Clear()
- ' calcolo vettori e riferimento del punto di vista corrente
- Dim dAngVertDeg As Double
- Dim dAngOrizDeg As Double
- EgtGetGenericView(dAngVertDeg, dAngOrizDeg)
- vtZView = Vector3d.FromSpherical(1, dAngVertDeg, dAngOrizDeg)
- EgtGetViewUp(vtYView)
- vtXView = vtYView ^ vtZView
- frView = New Frame3d(Point3d.ORIG, vtXView, vtYView, vtZView)
- Else
- If nMarkedEntityId <> GDB_ID.NULL Then
- EgtResetMark(nMarkedEntityId)
- nMarkedEntityId = GDB_ID.NULL
- EgtDraw()
- End If
- bEnhancedSelecting = False
- Return
- End If
- While nId <> GDB_ID.NULL
- ' li metto nelle due liste a seconda del tipo di entità
- Select Case EgtGetType(nId)
- Case GDB_TY.CRV_ARC, GDB_TY.CRV_COMPO, GDB_TY.CRV_LINE, GDB_TY.EXT_TEXT
- Dim nCopyId As Integer = EgtCopyGlob(nId, TempGroup)
- EgtSetInfo(nCopyId, "OriginalId", nId)
- CurvesIdList.Add(nCopyId)
- Case Else
- ' non faccio nulla
- End Select
- nId = EgtGetNextObjInSelWin()
- End While
- ' Ricavo il punto corrente in coordinate mondo
- Dim ptSel As Point3d
- EgtUnProjectPoint(e.Location, ptSel)
- Dim ToMarkEntityId As Integer = GDB_ID.NULL
- ' se la lista di curve non è vuota
- If CurvesIdList.Count > 0 Then
- Dim dCurrDist As Double
- Dim dMinDist As Double
- ' proietto le curve sul piano di vista
- 'Dim dAngVertDeg As Double
- 'Dim dAngOrizDeg As Double
- 'EgtGetGenericView(dAngVertDeg, dAngOrizDeg)
- 'Dim vtZView As Vector3d = Vector3d.FromSpherical(1, dAngVertDeg, dAngOrizDeg)
- 'Dim vtYView As Vector3d
- 'EgtGetViewUp(vtYView)
- 'Dim vtXView As Vector3d
- 'vtXView = vtYView ^ vtZView
- 'Dim frView As New Frame3d(Point3d.ORIG, vtXView, vtYView, vtZView)
- EgtScaleGroup(TempGroup, frView, 1, 1, 0)
- ' ciclo sulle proiezioni
- Dim bFirst As Boolean = True
- For Index = 0 To CurvesIdList.Count - 1
- ' calcolo la distanza della curva dal punto di selezione per trovare quella a distanza minima
- If EgtGetMinDistPntSidePointCurve(ptSel, CurvesIdList(Index), vtZView, dCurrDist, New Point3d, New Integer) Then
- EgtOutLog(CurvesIdList(Index) & " " & dCurrDist)
- If bFirst OrElse dCurrDist < dMinDist Then
- dMinDist = dCurrDist
- EgtGetInfo(CurvesIdList(Index), "OriginalId", ToMarkEntityId)
- bFirst = False
- End If
- End If
- Next
- If ToMarkEntityId <> nMarkedEntityId Then
- EgtResetMark(nMarkedEntityId)
- EgtSetMark(ToMarkEntityId)
- nMarkedEntityId = ToMarkEntityId
- End If
- Else
-
- ' Verifico se sono presenti superfici nell'area di selezione
- nId = EgtGetFirstObjInSelWin()
- ' se ne esiste almeno una, creo il vettore normale
- If nId <> GDB_ID.NULL Then
- ' ciclo sugli elementi nell'area di selezione per crearne il bordo
- While nId <> GDB_ID.NULL
- ' li metto nelle due liste a seconda del tipo di entità
- Select Case EgtGetType(nId)
- Case GDB_TY.SRF_FRGN, GDB_TY.SRF_MESH, GDB_TY.VOL_ZMAP
- Dim nCount As Integer = 0
- ' ne calcolo il contorno
- Dim nSilhouetteId As Integer = EgtGetSurfTmSilhouette(nId, vtZView, TempGroup, GDB_RT.GLOB, nCount)
- EgtSetInfo(nSilhouetteId, "OriginalId", nId)
-
-
- SurfacesIdList.Add(nSilhouetteId)
- Case Else
- ' non faccio nulla
- End Select
- nId = EgtGetNextObjInSelWin()
- End While
-
- End If
-
- If SurfacesIdList.Count > 0 Then
- ' lo porto nel punto di vista
- ' verifico se una di quelle prese è contenuta nelle altre
- ' se si intersecano solamente calcolo il centro di ciascuna
- ' e prendo quella con il centro più vicina al punto di selezione
-
- ' proietto i contorni sul piano di vista
- EgtScaleGroup(TempGroup, frView, 1, 1, 0)
- ' se sono contenuti uno nell'altro, seleziono quello contenuto,
- ' altrimenti quello dietro
-
- EgtGetInfo(SurfacesIdList(0), "OriginalId", ToMarkEntityId)
- If ToMarkEntityId <> nMarkedEntityId Then
- EgtResetMark(nMarkedEntityId)
- EgtSetMark(ToMarkEntityId)
- nMarkedEntityId = ToMarkEntityId
- End If
- Else
- EgtResetMark(nMarkedEntityId)
- nMarkedEntityId = GDB_ID.NULL
- End If
- End If
- EgtSaveFile("c:\EgtData\Varie\Temp\ProveSelezione.nge", NGE.CMPTEXT)
- ' cancello gruppo temporaneo
- EgtErase(TempGroup)
- EgtDraw()
- bEnhancedSelecting = False
- End Sub
-
- Private Sub EnhancedMouseUpScene(e As System.Windows.Forms.MouseEventArgs)
- ' Se già selezionato
- If EgtIsSelectedObj(nMarkedEntityId) Then
- EgtDeselectObj(nMarkedEntityId)
- Else
- EgtSelectObj(nMarkedEntityId)
- End If
- End Sub
-
Private Sub OnMyMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_ProjectScene.OnMouseUpScene
' Se in modalità Draw esco
If IniFile.m_ProjectMode = ProjectModeOpt.DRAW OrElse IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW Then
- If bEnhancedSelIsActive Then
- EnhancedMouseUpScene(e)
- End If
Return
End If
' Sono in modalità Machining
@@ -1170,10 +994,6 @@ Namespace EgtCAM5
If Not bOk Then Return
' Se in modalità Draw accetto tutto
If IniFile.m_ProjectMode = ProjectModeOpt.DRAW OrElse IniFile.m_ProjectMode = ProjectModeOpt.ONLYDRAW Then
- ' Se attiva enhanced selection rifiuto tutto
- If bEnhancedSelIsActive Then
- bOk = False
- End If
Return
End If
' Sono in modalità Machining
diff --git a/TopCommandBar/TopCommandBarView.xaml b/TopCommandBar/TopCommandBarView.xaml
index c0ecd35..5e20959 100644
--- a/TopCommandBar/TopCommandBarView.xaml
+++ b/TopCommandBar/TopCommandBarView.xaml
@@ -24,10 +24,12 @@
-