Compare commits

..

17 Commits

Author SHA1 Message Date
Demetrio Cassarino 0091502aa5 Merge commit 'cf978712bae6c9217370feb1c0fc08bcdc4d7f61' into features/NewProjectGrid 2026-04-23 10:51:10 +02:00
Dario Sassi cf978712ba EgtCAM5 :
- correzione per problema blocco selezione lavorazione al rientro nella lista.
2026-04-12 21:49:59 +02:00
Dario Sassi 3e41014f5b EgtCAM5 :
- corretto aggiornamento visualizzazione PreviewTool di tipo corretto al rientro nella lavorazione.
2026-04-07 17:53:05 +02:00
Dario Sassi a62a53ea61 EgtCAM5 :
- modifica disegno utensile per preview in lavorazione.
2026-04-03 17:52:17 +02:00
Riccardo Elitropi 60adc08781 EgtCAM5 3.1d1 :
- Aggiunto parametro Overlap per Sgrossature.
2026-04-01 18:07:53 +02:00
Dario Sassi 06510d5925 EgtCAM5 :
- correzione selezione per lavorazioni.
2026-03-31 11:42:26 +02:00
Dario Sassi d8c97cf352 Merge commit '78310cd71187b942ed8c0e7d9728bd19ae207448' 2026-03-26 16:15:28 +01:00
Demetrio Cassarino 78310cd711 Merge commit '4e947f293e849ceeef263f4cc6d65bd3278e4db0' into features/NewProjectGrid 2026-03-26 15:17:59 +01:00
Demetrio Cassarino e48cbffa6b -aggiunto modifica per salvare dimensioni finestra ExecuteWindow 2026-03-26 15:17:46 +01:00
Dario Sassi 4e947f293e EgtCAM5 :
- piccole migliorie a ExecuteWindow.
2026-03-25 08:45:26 +01:00
Dario Sassi 014ce6db17 Merge remote-tracking branch 'origin/features/NewProjectGrid' 2026-03-25 08:13:42 +01:00
Dario Sassi 705aeaaab7 EgtCAM5 :
- piccola miglioria alla modifica precedente.
2026-03-24 13:35:11 +01:00
Dario Sassi 228c4f9a48 EgtCAM5 :
- correzione gestione geometria selezionata con più sottoentità per la lavorazione corrente.
2026-03-24 13:30:20 +01:00
Demetrio Cassarino 375c53122c -sistemato apertura e chiusura su infoexpander 2026-03-20 15:43:08 +01:00
Dario Sassi bb22395a22 Merge commit 'e2e365765d81fa12bad9018462bb335b668844f3' 2026-03-18 12:15:30 +01:00
Dario Sassi 4eac19a2ff EgtCAM5 :
- piccole modifiche ad analisi superfici di Bezier.
2026-03-13 13:39:21 +01:00
Dario Sassi c276398b29 Merge commit 'e88e19ed3fc5c09b063227daf658e5440c25b3ca' 2026-03-13 09:56:20 +01:00
19 changed files with 214 additions and 121 deletions
+5
View File
@@ -223,4 +223,9 @@ Module ConstIni
Public Const S_MRUGUNSTOCKPEZ As String = "MruGunStockPez" Public Const S_MRUGUNSTOCKPEZ As String = "MruGunStockPez"
Public Const K_FILE As String = "File" Public Const K_FILE As String = "File"
Public Const S_EXECUTEWINDOW As String = "ExecuteWindow"
Public Const K_LEFT As String = "Left"
Public Const K_TOP As String = "Top"
Public Const K_WIDTH As String = "Width"
Public Const K_HEIGHT As String = "Height"
End Module End Module
+1
View File
@@ -402,6 +402,7 @@
</Compile> </Compile>
<Compile Include="PopUpViewPanel\PopUpViewPanelVM.vb" /> <Compile Include="PopUpViewPanel\PopUpViewPanelVM.vb" />
<Compile Include="Utility\SelData.vb" /> <Compile Include="Utility\SelData.vb" />
<Compile Include="Utility\WindowStateBehavior.vb" />
<Compile Include="ViewPanel\ViewPanelV.xaml.vb"> <Compile Include="ViewPanel\ViewPanelV.xaml.vb">
<DependentUpon>ViewPanelV.xaml</DependentUpon> <DependentUpon>ViewPanelV.xaml</DependentUpon>
</Compile> </Compile>
+4 -2
View File
@@ -4,13 +4,14 @@
xmlns:EgtCAM5="clr-namespace:EgtCAM5" xmlns:EgtCAM5="clr-namespace:EgtCAM5"
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5" xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
Title="Execute Window" Title="Execute Window"
Height="500" Width="400" Height="500" Width="600"
IsResizable="True" IsResizable="True"
IsMinimizable="False" IsMinimizable="False"
WindowStartupLocation="CenterOwner" WindowStartupLocation="CenterOwner"
ShowInTaskbar="False" ShowInTaskbar="False"
TitleBarHeight="32" TitleBarHeight="32"
PreviewKeyDown="EgtCustomWindow_PreviewKeyDown" PreviewKeyDown="EgtCustomWindow_PreviewKeyDown"
EgtCAM5:WindowStateIniBehavior.PersistenceKey="Dimension"
CloseCommand="{Binding Close_Command,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"> CloseCommand="{Binding Close_Command,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
<Grid> <Grid>
@@ -28,7 +29,8 @@
Grid.ColumnSpan="2" Grid.ColumnSpan="2"
Content="{Binding OkMsg}" Content="{Binding OkMsg}"
Command="{Binding Ok_Command}" Command="{Binding Ok_Command}"
Style="{StaticResource EgtCAM5_InputButton}"/> Style="{StaticResource EgtCAM5_InputButton}"
Margin="0,5,0,10"/>
<Button Grid.Column="1" <Button Grid.Column="1"
Command="{Binding Reload_Command}" Command="{Binding Reload_Command}"
IsEnabled="{Binding bReload_IsEnable}" IsEnabled="{Binding bReload_IsEnable}"
+2 -2
View File
@@ -379,8 +379,8 @@ Public Class MainWindowVM
EgtSetLockId(sLockId) EgtSetLockId(sLockId)
End If End If
' Recupero livello e opzioni della chiave ' Recupero livello e opzioni della chiave
Dim bKey As Boolean = EgtGetKeyLevel(3279, 3103, 1, IniFile.m_nKeyLevel) And Dim bKey As Boolean = EgtGetKeyLevel(3279, 3104, 1, IniFile.m_nKeyLevel) And
EgtGetKeyOptions(3279, 3103, 1, IniFile.m_nKeyOptions) EgtGetKeyOptions(3279, 3104, 1, IniFile.m_nKeyOptions)
' Leggo e imposto livello utilizzatore ' Leggo e imposto livello utilizzatore
IniFile.m_nUserLevel = Math.Min(IniFile.m_nKeyLevel, GetPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1)) IniFile.m_nUserLevel = Math.Min(IniFile.m_nKeyLevel, GetPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1))
' Imposto abilitazione lavorazioni avanzate ' Imposto abilitazione lavorazioni avanzate
+2 -2
View File
@@ -70,6 +70,6 @@ Imports System.Windows
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("3.1.3.2")> <Assembly: AssemblyVersion("3.1.4.1")>
<Assembly: AssemblyFileVersion("3.1.3.2")> <Assembly: AssemblyFileVersion("3.1.4.1")>
@@ -22,9 +22,9 @@ Public Class LayerTreeViewItem
Return m_isSelected Return m_isSelected
End Get End Get
Set(value As Boolean) Set(value As Boolean)
If value Then Map.refDrawOptionPanelVM.SetInfoRowIsExpanded(value)
If (value <> m_isSelected) Then If (value <> m_isSelected) Then
m_isSelected = value m_isSelected = value
Map.refDrawOptionPanelVM.SetInfoRowIsExpanded(value)
If value Then If value Then
' recupero l'Id del nuovo oggetto selezionato ' recupero l'Id del nuovo oggetto selezionato
Map.refManageLayerExpanderVM.IsRightClickedLayerTreeItem(False) Map.refManageLayerExpanderVM.IsRightClickedLayerTreeItem(False)
@@ -95,16 +95,9 @@ Public Class MachiningTreeExpanderVM
EgtRelocate(MachiningId, nSelectedOperationId, GDB_POS.AFTER) EgtRelocate(MachiningId, nSelectedOperationId, GDB_POS.AFTER)
End If End If
' Imposto geometria da lavorare (tutta quella selezionata) ' Imposto geometria da lavorare (tutta quella selezionata)
Dim vId(EgtGetSelectedObjCount() - 1) As Integer Dim vId() As Integer = Nothing
Dim vSub(EgtGetSelectedObjCount() - 1) As Integer Dim vSub() As Integer = Nothing
Dim nInd As Integer = 0 SelData.GetAllSelectedGeom(vId, vSub)
Dim EntId As Integer = EgtGetFirstSelectedObj()
While EntId <> GDB_ID.NULL
vId(nInd) = EntId
SelData.GetSubFromId( EntId, vSub(nInd))
nInd += 1
EntId = EgtGetNextSelectedObj()
End While
EgtSetMachiningGeometry(vId, vSub) EgtSetMachiningGeometry(vId, vSub)
' Calcolo la lavorazione con la nuova geometria ' Calcolo la lavorazione con la nuova geometria
EgtApplyMachining(True) EgtApplyMachining(True)
@@ -13,7 +13,7 @@ Public Class MachiningParameterExpanderVM
''' </summary> ''' </summary>
Friend Event m_EventFocusOnButtonPreview() Friend Event m_EventFocusOnButtonPreview()
Private m_nPreviewMachiningTool As Integer Private m_nPreviewMachiningTool As Integer = MCH_LOOK.NONE
Public ReadOnly Property nPreviewMachiningTool As Integer Public ReadOnly Property nPreviewMachiningTool As Integer
Get Get
Return m_nPreviewMachiningTool Return m_nPreviewMachiningTool
@@ -440,16 +440,9 @@ Public Class MachiningParameterExpanderVM
m_CurrOperation.WriteOperationParam() m_CurrOperation.WriteOperationParam()
' Imposto geometria da lavorare (tutta quella selezionata) ' Imposto geometria da lavorare (tutta quella selezionata)
Dim vId(EgtGetSelectedObjCount() - 1) As Integer Dim vId() As Integer = Nothing
Dim vSub(EgtGetSelectedObjCount() - 1) As Integer Dim vSub() As Integer = Nothing
Dim nInd As Integer = 0 SelData.GetAllSelectedGeom(vId, vSub)
Dim EntId As Integer = EgtGetFirstSelectedObj()
While EntId <> GDB_ID.NULL
vId(nInd) = EntId
SelData.GetSubFromId(EntId, vSub(nInd))
nInd += 1
EntId = EgtGetNextSelectedObj()
End While
EgtSetMachiningGeometry(vId, vSub) EgtSetMachiningGeometry(vId, vSub)
' Rigenero la lavorazione ' Rigenero la lavorazione
@@ -92,7 +92,12 @@
ValidatesOnDataErrors=True}" ValidatesOnDataErrors=True}"
ParamCmBxSelIndex="{Binding Path=SelectedSubType}" ParamCmBxSelIndex="{Binding Path=SelectedSubType}"
Style="{DynamicResource ComboParamV_Margin}"/> Style="{DynamicResource ComboParamV_Margin}"/>
<UniformGrid Columns="2"> <EgtWPFLib5:StringParamV ParamTxBl="{Binding OverLapTxBl}"
ParamTxBx="{Binding Path=OverLap,
UpdateSourceTrigger=PropertyChanged,
ValidatesOnDataErrors=True}"
Style="{DynamicResource StringParamV_Margin}"/>
<UniformGrid Columns="2">
<TextBlock Text="{Binding UserNotesTxBl}" <TextBlock Text="{Binding UserNotesTxBl}"
Style="{DynamicResource MPExpander_UserNotesTxBlMargin}"/> Style="{DynamicResource MPExpander_UserNotesTxBlMargin}"/>
<EgtWPFLib5:EgtTextBox Text="{Binding UserNotes, UpdateSourceTrigger=PropertyChanged}" <EgtWPFLib5:EgtTextBox Text="{Binding UserNotes, UpdateSourceTrigger=PropertyChanged}"
@@ -37,14 +37,23 @@ Public Class OperationListBoxItem
If Not IsNothing(value) Then If Not IsNothing(value) Then
Dim indexes As List(Of OperationListBoxItem) = New List(Of OperationListBoxItem) Dim indexes As List(Of OperationListBoxItem) = New List(Of OperationListBoxItem)
Dim Count As Integer = 0 Dim nLastInd As Integer = -1
Dim nInd As Integer = 0
For Each OperationListBoxItem In Map.refOperationsListExpanderVM.OperationList For Each OperationListBoxItem In Map.refOperationsListExpanderVM.OperationList
If OperationListBoxItem.IsSelected And OperationListBoxItem.Id <> m_Id Then If OperationListBoxItem.IsSelected And OperationListBoxItem.Id <> m_Id Then
Count = Count + 1
indexes.Add(OperationListBoxItem) indexes.Add(OperationListBoxItem)
nLastInd = nInd
End If End If
nInd += 1
Next Next
' Per evitare problemi con primo Item selezionato quando ListView non ancora esistente
If indexes.Count = 1 And nLastInd = 0 Then
Map.refOperationsListExpanderVM.OperationList(0).IsSelected = False
indexes.Clear()
End If
' E' possibile selezionare più lavorazioni solo se della stessa fase
If indexes.Count > 0 Then If indexes.Count > 0 Then
If EgtGetOperationPhase(Id) <> EgtGetOperationPhase(indexes(0).Id) Then If EgtGetOperationPhase(Id) <> EgtGetOperationPhase(indexes(0).Id) Then
Return Return
@@ -52,10 +61,11 @@ Public Class OperationListBoxItem
End If End If
m_IsSelected = value m_IsSelected = value
' Verifico se c'è l'operazione precedente ' Verifico se c'è l'operazione precedente
If Not value Or If Not value Or
indexes.Any(Function(i) i.Type = MCH_OY.DISP) Or indexes.Any(Function(i) i.Type = MCH_OY.DISP) Or
(Not indexes.Any(Function(i) i.Type = MCH_OY.DISP) And Type = MCH_OY.DISP And Count > 0) Then (Not indexes.Any(Function(i) i.Type = MCH_OY.DISP) And Type = MCH_OY.DISP And indexes.Count > 0) Then
m_IsSelected = False m_IsSelected = False
@@ -77,6 +87,7 @@ Public Class OperationListBoxItem
If Map.refOperationsListExpanderVM.ForceDrawInIsSelected Then EgtDraw() If Map.refOperationsListExpanderVM.ForceDrawInIsSelected Then EgtDraw()
Return Return
End If End If
' Imposto la fase di lavorazione corrente ' Imposto la fase di lavorazione corrente
EgtSetCurrPhase(EgtGetOperationPhase(Id)) EgtSetCurrPhase(EgtGetOperationPhase(Id))
' Abilito la selezione dei Percorsi di Lavorazione ' Abilito la selezione dei Percorsi di Lavorazione
@@ -179,10 +179,11 @@ Public Class OperationParametersExpanderVM
Map.refProjectVM.SceneSelMode = OptionModule.m_SelGeomProbing Map.refProjectVM.SceneSelMode = OptionModule.m_SelGeomProbing
End Select End Select
' Imposto visualizzazione utensile ' Imposto visualizzazione utensile
Map.refMachiningParameterExpanderVM.SetPreviewMachiningTool(MCH_LOOK.TAB_TOOL) 'Map.refMachiningParameterExpanderVM.SetPreviewMachiningTool(MCH_LOOK.TAB_TOOL)
Map.refMachiningParameterExpanderVM.SetToolPreview_Image("pack://application:,,,/Resources/ToolPreview/Tool.png") 'Map.refMachiningParameterExpanderVM.SetToolPreview_Image("pack://application:,,,/Resources/ToolPreview/Tool.png")
Map.refMachiningParameterExpanderVM.SetSlider_IsEnable(True) 'Map.refMachiningParameterExpanderVM.SetSlider_IsEnable(True)
EgtPreparePreviewMachiningTool() EgtPreparePreviewMachiningTool()
Map.refMachiningParameterExpanderVM.PreviewMachiningTool()
EgtDraw() EgtDraw()
End If End If
OnPropertyChanged("ParametersIsExpanded") OnPropertyChanged("ParametersIsExpanded")
@@ -28,8 +28,8 @@
</UniformGrid> </UniformGrid>
<ListBox Grid.Row="1" <ListBox Grid.Row="1"
IsSynchronizedWithCurrentItem="False"
ItemsSource="{Binding OperationList}" ItemsSource="{Binding OperationList}"
IsSynchronizedWithCurrentItem="True"
x:Name="OperationList" IsEnabled="{Binding IsEnabledOperationList}" SelectionMode="Extended"> x:Name="OperationList" IsEnabled="{Binding IsEnabledOperationList}" SelectionMode="Extended">
<ListBox.Resources> <ListBox.Resources>
<DataTemplate DataType="{x:Type EgtCAM5:MachiningOpListBoxItem}"> <DataTemplate DataType="{x:Type EgtCAM5:MachiningOpListBoxItem}">
@@ -654,20 +654,17 @@ Public Class OperationsListExpanderVM
Dim sErr As String = String.Empty Dim sErr As String = String.Empty
Dim bOk As Boolean = EgtApplyAllMachinings(bRecalc, False, sErr) Dim bOk As Boolean = EgtApplyAllMachinings(bRecalc, False, sErr)
EgtSetModified() EgtSetModified()
' Deseleziono l'Operazione selezionata e la de-evidenzio nel Disegno ' Aggiorno geometrie di lavorazione selezionate e marcate
m_ForceDrawInIsSelected = False m_ForceDrawInIsSelected = False
For Each Operation In OperationList For Each Operation In OperationList
If Operation.IsSelected Then If Operation.IsSelected Then
Operation.IsSelected = False Operation.IsSelected = False
Operation.IsSelected = True
End If End If
Next Next
' Ricarico la lista delle Operazioni
LoadOperationList(GDB_ID.NULL)
' Rimetto le lampadine in modo corretto
tmpStatusLamp.UpdateStatusLamp()
m_ForceDrawInIsSelected = True m_ForceDrawInIsSelected = True
' Aggiorno visualizzazione e ritorno a cursore standard
EgtDraw() EgtDraw()
' Ripristino cursore
Application.Current.MainWindow.ForceCursor = False Application.Current.MainWindow.ForceCursor = False
Application.Current.MainWindow.Cursor = Cursors.Arrow Application.Current.MainWindow.Cursor = Cursors.Arrow
' In caso di errori, li segnalo ' In caso di errori, li segnalo
+18 -14
View File
@@ -1456,7 +1456,7 @@ Public Class ProjectVM
m_Controller.MouseMoveInSelectionPoint(PtP) m_Controller.MouseMoveInSelectionPoint(PtP)
End Sub End Sub
Private Sub OnMouseAnalyzedEx(sender As Object, nId As Integer, nSub As Integer, ptSel As Point3d) Handles m_ProjectScene.OnMouseAnalyzedEx Private Sub OnMouseAnalyzedEx(sender As Object, nId As Integer, nSub As Integer, ptSel As Point3d, nModKey As Integer) Handles m_ProjectScene.OnMouseAnalyzedEx
Map.refManageLayerExpanderVM.UpdateObjInObjTree(nId) Map.refManageLayerExpanderVM.UpdateObjInObjTree(nId)
Map.refManageLayerExpanderVM.SelectIdInObjTree(nId) Map.refManageLayerExpanderVM.SelectIdInObjTree(nId)
' Cancello geometria e info di eventuale precedente analisi ' Cancello geometria e info di eventuale precedente analisi
@@ -1470,16 +1470,14 @@ Public Class ProjectVM
' Se superficie trimesh, visualizzo dati faccetta toccata ' Se superficie trimesh, visualizzo dati faccetta toccata
ElseIf EgtGetType(nId) = GDB_TY.SRF_MESH Then ElseIf EgtGetType(nId) = GDB_TY.SRF_MESH Then
Dim nFac As Integer = EgtSurfTmFacetFromTria(nId, nSub) Dim nFac As Integer = EgtSurfTmFacetFromTria(nId, nSub)
If nFac <> -1 Then If nFac >= 0 Then
' Visualizzo la normale e il contorno della faccia ' Visualizzo la normale e il contorno della faccia
Analyze.CreateAnalyzeGroup() Analyze.CreateAnalyzeGroup()
Analyze.CreateFacetNormal(nId, nFac) Analyze.CreateFacetNormal(nId, nFac)
Analyze.CreateFacetLoops(nId, nFac) Analyze.CreateFacetLoops(nId, nFac)
If nModKey = Scene.MODKEY.SHIFT Then
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
Analyze.CreateTriaLoop(nId, nSub) Analyze.CreateTriaLoop(nId, nSub)
End If End If
' Recupero i dati (in globale o griglia a seconda della impostazione) ' Recupero i dati (in globale o griglia a seconda della impostazione)
Dim ptC As Point3d Dim ptC As Point3d
Dim vtN As Vector3d Dim vtN As Vector3d
@@ -1491,8 +1489,7 @@ Public Class ProjectVM
" : C(" + LenToString(ptC.x, 3) + "," + LenToString(ptC.y, 3) + "," + LenToString(ptC.z, 3) + ")" + " : C(" + LenToString(ptC.x, 3) + "," + LenToString(ptC.y, 3) + "," + LenToString(ptC.z, 3) + ")" +
" N(" + DoubleToString(vtN.x, 4) + "," + DoubleToString(vtN.y, 4) + "," + DoubleToString(vtN.z, 4) + ")" + " N(" + DoubleToString(vtN.x, 4) + "," + DoubleToString(vtN.y, 4) + "," + DoubleToString(vtN.z, 4) + ")" +
" / φ=" + DoubleToString(dPhi, 2) + " θ=" + DoubleToString(dTheta, 2) " / φ=" + DoubleToString(dPhi, 2) + " θ=" + DoubleToString(dTheta, 2)
If nModKey = Scene.MODKEY.SHIFT Then
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
sOut &= ", Triangle " + nSub.ToString() sOut &= ", Triangle " + nSub.ToString()
End If End If
Map.refStatusBarVM.NotifyStatusOutput(sOut) Map.refStatusBarVM.NotifyStatusOutput(sOut)
@@ -1518,20 +1515,25 @@ Public Class ProjectVM
" / φ=" + DoubleToString(dPhi, 2) + " θ=" + DoubleToString(dTheta, 2) " / φ=" + DoubleToString(dPhi, 2) + " θ=" + DoubleToString(dTheta, 2)
Map.refStatusBarVM.NotifyStatusOutput(sOut) Map.refStatusBarVM.NotifyStatusOutput(sOut)
End If End If
' Se Superficie di Bezier
ElseIf EgtGetType(nId) = GDB_TY.SRF_BEZ Then ElseIf EgtGetType(nId) = GDB_TY.SRF_BEZ Then
' Visualizzo il punto selezionato, la normale e le tangenti nelle direzioni dei parametri ' Visualizzo il punto selezionato, la normale e le tangenti nelle direzioni dei parametri
Analyze.CreateAnalyzeGroup() Analyze.CreateAnalyzeGroup()
Dim dU As Double Dim dU, dV As Double
Dim dV As Double Dim vtN As Vector3d
If Analyze.CreateSBzPointNormalAndTangents(nId, ptSel, dU, dV) Then If Analyze.CreateSBzPointNormalAndTangents(nId, ptSel, dU, dV, vtN) Then
Dim sOut As String = "U = " + dU.ToString("F3") + Dim dLen, dPhi, dTheta As Double
"; V = " + dV.ToString("F3") vtN.ToSpherical(dLen, dTheta, dPhi)
' Emetto info sulla barra di stato
Dim sOut As String = "U=" + DoubleToString(dU, 4) + ",V=" + DoubleToString(dV, 4) +
" : P(" + LenToString(ptSel.x, 3) + "," + LenToString(ptSel.y, 3) + "," + LenToString(ptSel.z, 3) + ")" +
" N(" + DoubleToString(vtN.x, 4) + "," + DoubleToString(vtN.y, 4) + "," + DoubleToString(vtN.z, 4) + ")" +
" / φ=" + DoubleToString(dPhi, 2) + " θ=" + DoubleToString(dTheta, 2)
Map.refStatusBarVM.NotifyStatusOutput(sOut) Map.refStatusBarVM.NotifyStatusOutput(sOut)
If (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then If nModKey = Scene.MODKEY.SHIFT Then
Analyze.CreateSBzIsoParam(nId, dU, dV) Analyze.CreateSBzIsoParam(nId, dU, dV)
End If End If
End If End If
End If End If
' Aggiorno la visualizzazione ' Aggiorno la visualizzazione
EgtDraw() EgtDraw()
@@ -1546,6 +1548,8 @@ Public Class ProjectVM
If e.KeyData = System.Windows.Forms.Keys.Delete AndAlso Map.refTopCommandBarVM.DrawIsChecked Then If e.KeyData = System.Windows.Forms.Keys.Delete AndAlso Map.refTopCommandBarVM.DrawIsChecked Then
m_Controller.SetLastInteger(GDB_ID.SEL) m_Controller.SetLastInteger(GDB_ID.SEL)
m_Controller.ExecuteCommand(Controller.CMD.DELETE) m_Controller.ExecuteCommand(Controller.CMD.DELETE)
' controllo per chiudere expander info
If Not Map.refInfoExpanderVM.IsEnabled Then Map.refDrawOptionPanelV.DrawGrid.RowDefinitions(1).Height = New GridLength(1, GridUnitType.Auto)
' Con END eseguo deselezione di tutto ' Con END eseguo deselezione di tutto
ElseIf e.KeyData = System.Windows.Forms.Keys.End Then ElseIf e.KeyData = System.Windows.Forms.Keys.End Then
m_Controller.MouseDeselectedAll(True) m_Controller.MouseDeselectedAll(True)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 774 B

After

Width:  |  Height:  |  Size: 797 B

+49 -38
View File
@@ -1,4 +1,5 @@
Imports EgtUILib Imports System.Data
Imports EgtUILib
Module Analyze Module Analyze
@@ -76,20 +77,6 @@ Module Analyze
Return True Return True
End Function End Function
Function CreateTriaNormal( nId As Integer, nT As Integer) As Boolean
'If m_AnaGrpId = GDB_ID.NULL Then Return False
'Dim bEnMod As Boolean = EgtGetEnableModified()
'EgtDisableModified()
'Dim ptC As Point3d
'Dim vtN As Vector3d
'If EgtSurfTmTriangleNormVersor( nId, nT, GDB_ID.ROOT, ptC, vtN) Then
' Dim nNormId As Integer = EgtCreateGeoVector( m_AnaGrpId, 50 * vtN, ptC, GDB_RT.GLOB)
' EgtSetColor( nNormId, New Color3d( 255, 0,0))
'End If
'If bEnMod Then EgtEnableModified()
Return True
End Function
Function CreateChunkNormal( nId As Integer, nChk As Integer) As Boolean Function CreateChunkNormal( nId As Integer, nChk As Integer) As Boolean
If m_AnaGrpId = GDB_ID.NULL Then Return False If m_AnaGrpId = GDB_ID.NULL Then Return False
Dim bEnMod As Boolean = EgtGetEnableModified() Dim bEnMod As Boolean = EgtGetEnableModified()
@@ -123,26 +110,26 @@ Module Analyze
If m_AnaGrpId = GDB_ID.NULL Then Return False If m_AnaGrpId = GDB_ID.NULL Then Return False
Dim bEnMod As Boolean = EgtGetEnableModified() Dim bEnMod As Boolean = EgtGetEnableModified()
EgtDisableModified() EgtDisableModified()
'Riferimento della griglia corrente ' Salvo riferimento della griglia corrente
Dim refGrid As Frame3d = EgtGetGridFrame() Dim refGrid As Frame3d = EgtGetGridFrame()
'Nuovo riferimento griglia con Z come versore estrusione della curva ' Nuovo riferimento griglia con Z come versore estrusione della curva
Dim vtExtr As Vector3d : EgtCurveExtrusion( nId, vtExtr) Dim vtExtr As Vector3d : EgtCurveExtrusion( nId, vtExtr)
If Not vtExtr.IsSmall() Then If Not vtExtr.IsSmall() Then
Dim refCrv As New Frame3d : refCrv.Setup( EgtGetGridOrigin(), vtExtr) Dim refCrv As New Frame3d : refCrv.Setup( EgtGetGridOrigin(), vtExtr)
EgtSetGridFrame( refCrv) EgtSetGridFrame( refCrv)
End If End If
'Recupero il numero di curve semplici ' Recupero il numero di curve semplici
Dim dStart, dEnd As Double Dim dStart, dEnd As Double
EgtCurveDomain( nId, dStart, dEnd) EgtCurveDomain( nId, dStart, dEnd)
Dim nCount As Integer = CInt( dEnd - dStart) - 1 Dim nCount As Integer = CInt( dEnd - dStart) - 1
' Ciclo sulle curve semplici ' Ciclo sulle curve semplici
For i As Integer = 0 To nCount For i As Integer = 0 To nCount
'Scrivo il punto iniziale di ogni curva componente ' Scrivo il punto iniziale di ogni curva componente
Dim ptS As Point3d Dim ptS As Point3d
EgtAtParamPoint( nId, i, GDB_ID.GRID, ptS) EgtAtParamPoint( nId, i, GDB_ID.GRID, ptS)
Dim nPntId As Integer = EgtCreateGeoPoint( m_AnaGrpId, ptS, GDB_RT.GRID) Dim nPntId As Integer = EgtCreateGeoPoint( m_AnaGrpId, ptS, GDB_RT.GRID)
EgtSetColor( nPntId, New Color3d( 255, 0,0)) EgtSetColor( nPntId, New Color3d( 255, 0,0))
'Scrivo il numero identificativo di ogni curva componente ' Scrivo il numero identificativo di ogni curva componente
Dim ptP As Point3d Dim ptP As Point3d
EgtAtParamPoint( nId, i + 0.5, GDB_ID.GRID, ptP) EgtAtParamPoint( nId, i + 0.5, GDB_ID.GRID, ptP)
Dim dLen As Double = 2 * Point3d.Dist( ptS, ptP) Dim dLen As Double = 2 * Point3d.Dist( ptS, ptP)
@@ -150,27 +137,52 @@ Module Analyze
Dim nTxtId As Integer = EgtCreateTextAdv( m_AnaGrpId, ptP, 0, i.ToString(), "", 100, False, dH, 1, 0, INS_POS.MC, GDB_RT.GRID) Dim nTxtId As Integer = EgtCreateTextAdv( m_AnaGrpId, ptP, 0, i.ToString(), "", 100, False, dH, 1, 0, INS_POS.MC, GDB_RT.GRID)
EgtSetColor( nTxtId, New Color3d( 255, 0,0)) EgtSetColor( nTxtId, New Color3d( 255, 0,0))
Next Next
'Se curva aperta aggiungo il punto finale ' Se curva aperta aggiungo il punto finale
If Not EgtCurveIsClosed( nId) Then If Not EgtCurveIsClosed( nId) Then
Dim ptE As Point3d Dim ptE As Point3d
EgtEndPoint( nId, GDB_ID.GRID, ptE) EgtEndPoint( nId, GDB_ID.GRID, ptE)
Dim nPntId As Integer = EgtCreateGeoPoint( m_AnaGrpId, ptE, GDB_RT.GRID) Dim nPntId As Integer = EgtCreateGeoPoint( m_AnaGrpId, ptE, GDB_RT.GRID)
EgtSetColor( nPntId, New Color3d( 255, 0,0)) EgtSetColor( nPntId, New Color3d( 255, 0,0))
End If End If
'Reimposto il riferimento originale alla griglia ' Reimposto il riferimento originale alla griglia
EgtSetGridFrame( refGrid) EgtSetGridFrame( refGrid)
If bEnMod Then EgtEnableModified() If bEnMod Then EgtEnableModified()
Return True Return True
End Function End Function
Function CreateSBzPointNormalAndTangents( nId As Integer, ptBez As Point3d, ByRef dU As Double, ByRef dV As Double) As Boolean Function CreateSBzPointNormalAndTangents( nId As Integer, ptBez As Point3d, ByRef dU As Double, ByRef dV As Double, ByRef vtN As Vector3d) As Boolean
If m_AnaGrpId = GDB_ID.NULL Then Return False Dim ptP As Point3d
Dim bEnMod As Boolean = EgtGetEnableModified() Dim vtDirU, vtDirV As Vector3d
EgtDisableModified() Dim bOk As Boolean = EgtSurfBezierParamsFromPoint( nId, ptBez, GDB_ID.ROOT, dU, dV) AndAlso
EgtSurfBezierGetPointNrmD1( nId, dU, dV, SRF_SIDE.FROM_MINUS, SRF_SIDE.FROM_MINUS, GDB_ID.ROOT,
Dim bOk As Boolean = EgtSurfBezParamsFromPoint( nId, ptBez, m_AnaGrpId, dU, dV) ptP, vtN, vtDirU, vtDirV)
If bOk AndAlso m_AnaGrpId <> GDB_ID.NULL Then
If bEnMod Then EgtEnableModified() Dim bEnMod As Boolean = EgtGetEnableModified()
EgtDisableModified()
' Disegno Punto
Dim nPntId As Integer = EgtCreateGeoPoint( m_AnaGrpId, ptBez, GDB_RT.GLOB)
EgtSetColor( nPntId, New Color3d( 255, 0, 0))
EgtSetStatus( nPntId, GDB_ST.SEL)
' Disegno Vettore Normale
Dim nNormId As Integer = EgtCreateGeoVector( m_AnaGrpId, 50 * vtN, ptBez, GDB_RT.GLOB)
EgtSetColor( nNormId, New Color3d( 255, 0, 0))
EgtSetStatus( nNormId, GDB_ST.SEL)
' Disegno tangente in U
Dim dModU As Double = vtDirU.Len()
If dModU > EPS_ZERO Then
Dim nTgUId As Integer = EgtCreateGeoVector( m_AnaGrpId, 25 / dModU * vtDirU, ptBez, GDB_RT.GLOB)
EgtSetColor( nTgUId, New Color3d( 0, 128, 192))
EgtSetStatus( nTgUId, GDB_ST.SEL)
End If
' Disegno tangente in V
Dim dModV As Double = vtDirV.Len()
If dModV > EPS_ZERO Then
Dim nTgVId As Integer = EgtCreateGeoVector( m_AnaGrpId, 25 / dModV * vtDirV, ptBez, GDB_RT.GLOB)
EgtSetColor( nTgVId, New Color3d( 255, 128, 0))
EgtSetStatus( nTgVId, GDB_ST.SEL)
End If
If bEnMod Then EgtEnableModified()
End If
Return bOk Return bOk
End Function End Function
@@ -178,15 +190,14 @@ Module Analyze
If m_AnaGrpId = GDB_ID.NULL Then Return False If m_AnaGrpId = GDB_ID.NULL Then Return False
Dim bEnMod As Boolean = EgtGetEnableModified() Dim bEnMod As Boolean = EgtGetEnableModified()
EgtDisableModified() EgtDisableModified()
Dim nIdCrv As Integer = EgtSurfBezierGetCurveU( nId, dV, m_AnaGrpId) Dim nCrvUId As Integer = EgtSurfBezierGetCurveU( nId, dV, m_AnaGrpId)
EgtSetColor( nIdCrv, New Color3d(128,128,255)) EgtSetColor( nCrvUId, New Color3d( 0, 128, 192))
Dim bOk As Boolean = nIdCrv <> GDB_ID.NULL EgtSetStatus( nCrvUId, GDB_ST.SEL)
nIdCrv = EgtSurfBezierGetCurveV( nId, dU, m_AnaGrpId) Dim nCrvVId As Integer = EgtSurfBezierGetCurveV( nId, dU, m_AnaGrpId)
bOk = bOk And nIdCrv <> GDB_ID.NULL EgtSetColor( nCrvVId, New Color3d( 255, 128, 0))
EgtSetColor( nIdCrv, New Color3d(255,128,128)) EgtSetStatus( nCrvVId, GDB_ST.SEL)
If bEnMod Then EgtEnableModified() If bEnMod Then EgtEnableModified()
Return bOk Return ( nCrvUId <> GDB_ID.NULL And nCrvVId <> GDB_ID.NULL)
End Function End Function
End Module End Module
+2
View File
@@ -794,6 +794,8 @@
<Style x:Key="ExecuteWindow_TextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}"> <Style x:Key="ExecuteWindow_TextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
<Setter Property="AcceptsReturn" Value="True"/> <Setter Property="AcceptsReturn" Value="True"/>
<Setter Property="TextWrapping" Value="Wrap"/> <Setter Property="TextWrapping" Value="Wrap"/>
<Setter Property="FontFamily" Value="Consolas"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="Margin" Value="5"/> <Setter Property="Margin" Value="5"/>
</Style> </Style>
+21 -27
View File
@@ -96,40 +96,34 @@ Module SelData
Return False Return False
End Function End Function
Friend Function GetIdSubCount() As Integer Friend Function GetAllSelectedGeom(ByRef vId() As Integer, ByRef vSub() As Integer) As Boolean
Return m_IdSub.Count() VerifyIdSub()
End Function ' Recupero tutte le entità selezionate con le loro eventuali sotto-parti
Dim MyId As New List(Of Integer)
Friend Function GetIdSub(nInd As Integer, ByRef nId As Integer, ByRef nSub As Integer) As Boolean Dim MySub As New List(Of Integer)
If nInd < 0 Or nInd > m_IdSub.Count() - 1 Then Dim nEntId As Integer = EgtGetFirstSelectedObj()
nId = GDB_ID.NULL While nEntId <> GDB_ID.NULL
Return False Dim MyEntSub As New List(Of Integer)
End If GetSubFromId( nEntId, MyEntSub)
nId = m_IdSub(nInd).m_nId For Each nEntSub As Integer In MyEntSub
nSub = m_IdSub(nInd).m_nSub MyId.Add(nEntId)
MySub.Add(nEntSub)
Next
nEntId = EgtGetNextSelectedObj()
End While
vId = MyId.ToArray()
vSub = MySub.ToArray()
Return True Return True
End Function End Function
Friend Function GetAllIdSub(ByRef vId() As Integer, ByRef vSub() As Integer) As Boolean Friend Function GetSubFromId(nId As Integer, ByRef vSub As List(Of Integer)) As Boolean
Dim MyId(m_IdSub.Count() - 1) As Integer
Dim MySub(m_IdSub.Count() - 1) As Integer
For i As Integer = 0 To m_IdSub.Count() - 1
MyId(i) = m_IdSub(i).m_nId
MySub(i) = m_IdSub(i).m_nSub
Next
vId = MyId
vSub = MySub
Return True
End Function
Friend Function GetSubFromId( nId As Integer, ByRef nSub As Integer) As Boolean
For i As Integer = 0 To m_IdSub.Count() - 1 For i As Integer = 0 To m_IdSub.Count() - 1
If m_IdSub(i).m_nId = nId Then If m_IdSub(i).m_nId = nId Then
nSub = m_IdSub(i).m_nSub vSub.Add(m_IdSub(i).m_nSub)
Return True
End If End If
Next Next
nSub = -1 If vSub.Count > 0 Then Return True
vSub.Add(-1)
Return False Return False
End Function End Function
+74
View File
@@ -0,0 +1,74 @@
Public Class WindowStateIniBehavior
Private Shared ReadOnly IsReady As New Dictionary(Of Window, Boolean)
Public Shared Function GetPersistenceKey(obj As DependencyObject) As String
Return CStr(obj.GetValue(PersistenceKeyProperty))
End Function
Public Shared Sub SetPersistenceKey(obj As DependencyObject, value As String)
obj.SetValue(PersistenceKeyProperty, value)
End Sub
Public Shared ReadOnly PersistenceKeyProperty As DependencyProperty =
DependencyProperty.RegisterAttached(
"PersistenceKey",
GetType(String),
GetType(WindowStateIniBehavior),
New PropertyMetadata(Nothing, AddressOf OnKeyChanged)
)
Private Shared Sub OnKeyChanged(d As DependencyObject, e As DependencyPropertyChangedEventArgs)
Dim Window = TryCast(d, Window)
If IsNothing(Window) Then Return
IsReady(Window) = False
AddHandler Window.Loaded, Sub() LoadState(Window)
AddHandler Window.ContentRendered,
Sub()
IsReady(Window) = True
End Sub
AddHandler Window.LocationChanged, Sub() SaveState(Window)
AddHandler Window.SizeChanged, Sub() SaveState(Window)
End Sub
Private Shared Sub SaveState(Window As Window)
If Not IsReady(Window) Then Return
EgtUILib.WritePrivateProfileString(S_EXECUTEWINDOW, K_LEFT, Window.Left.ToString(), Map.refMainWindowVM.DimensionDir)
EgtUILib.WritePrivateProfileString(S_EXECUTEWINDOW, K_TOP, Window.Top.ToString(), Map.refMainWindowVM.DimensionDir)
EgtUILib.WritePrivateProfileString(S_EXECUTEWINDOW, K_WIDTH, Window.Width.ToString(), Map.refMainWindowVM.DimensionDir)
EgtUILib.WritePrivateProfileString(S_EXECUTEWINDOW, K_HEIGHT, Window.Height.ToString(), Map.refMainWindowVM.DimensionDir)
End Sub
Private Shared Sub LoadState(Window As Window)
Dim sLeft As String = String.Empty
Dim dLeft As Double = 0
EgtUILib.GetPrivateProfileString(S_EXECUTEWINDOW, K_LEFT, String.Empty, sLeft, Map.refMainWindowVM.DimensionDir)
If sLeft IsNot String.Empty Then StringToDouble(sLeft, dLeft)
Dim sTopD As String = String.Empty
Dim dTop As Double = 0.0
EgtUILib.GetPrivateProfileString(S_EXECUTEWINDOW, K_TOP, String.Empty, sTopD, Map.refMainWindowVM.DimensionDir)
If sTopD IsNot String.Empty Then StringToDouble(sTopD, dTop)
Dim sWidth As String = String.Empty
Dim dWidth As Double = 0.0
EgtUILib.GetPrivateProfileString(S_EXECUTEWINDOW, K_WIDTH, String.Empty, sWidth, Map.refMainWindowVM.DimensionDir)
If sWidth IsNot String.Empty Then StringToDouble(sWidth, dWidth)
Dim sHeight As String = String.Empty
Dim dHeight As Double = 0.0
EgtUILib.GetPrivateProfileString(S_EXECUTEWINDOW, K_HEIGHT, String.Empty, sHeight, Map.refMainWindowVM.DimensionDir)
If sWidth IsNot String.Empty Then StringToDouble(sHeight, dHeight)
If dLeft > 0 Then Window.Left = dLeft
If dTop > 0 Then Window.Top = dTop
If dWidth > 0 Then Window.Width = dWidth
If dHeight > 0 Then Window.Height = dHeight
End Sub
End Class