Files
2025-04-16 10:06:08 +02:00

1572 lines
70 KiB
VB.net

Imports System.IO
Imports System.Security.Cryptography
Imports EgtUILib
Imports EgtWindowMaker.ManageWindowVM
Imports EgtWPFLib5
Imports Microsoft.Win32
Public Class MySceneHostVM
Inherits EgtWPFLib5.SceneHostVM
Friend m_bIsFocused As Boolean
Friend Sub SetIsFocused(bValue As Boolean)
m_bIsFocused = bValue
End Sub
' Flag per distinguere tra Save a SaveAs
Private m_bIsSaveAs As Boolean = False
' Identificativi per pezzo da selezionare/deselezionare
Private m_nIdToSel As Integer = GDB_ID.NULL
Private m_nIdToDesel As Integer = GDB_ID.NULL
' Dati movimento
Private m_dMaxStep As Double = 0
' Dati per Drag
Private m_nRestRadius As Integer = 5
Private m_bDrag As Boolean = False
Private m_bDragToStart As Boolean = False
Private m_bVerify As Boolean = False
Private m_bFromParking As Boolean = False
Private m_bDragging As Boolean = False
Private m_locPrev As System.Drawing.Point
Private m_ptPrev As Point3d
Private m_vtTotMove As Vector3d
Private m_dSnapDist As Double = 0
Private bReducedCut As Boolean = False
Private m_bMagnetic As Boolean
Private m_nSelIdList As New List(Of Integer)
' punto di snap per inizializzazione
Private m_SnapType As SP
Friend ReadOnly Property SnapType As SP
Get
Return m_SnapType
End Get
End Property
#Region "CONSTRUCTOR"
Sub New()
MyBase.New()
AddHandler MainController.OnNewProject, AddressOf OnNewProject
AddHandler MainController.OnOpenProject, AddressOf OnOpenProject
AddHandler MainController.OnSavingProject, AddressOf OnSavingProject
AddHandler MainController.OnSavedProject, AddressOf OnSavedProject
AddHandler MainController.OnInsertedProject, AddressOf OnInsertedProject
AddHandler MainController.OnImportingProject, AddressOf OnImportingProject
AddHandler MainController.OnImportedProject, AddressOf OnImportedProject
AddHandler MainController.PrepareInputBox, AddressOf PrepareInputBox
AddHandler MainController.SetInputBoxText, AddressOf SetInputBoxText
AddHandler MainController.SetInputBoxCheck, AddressOf SetInputBoxCheck
AddHandler MainController.AddInputBoxCombo, AddressOf AddInputBoxCombo
AddHandler MainController.UpdateUI, AddressOf UpdateUI
AddHandler MainController.OnExecCmdEnd, AddressOf OnExecCmdEnd
End Sub
#End Region ' CONSTRUCTOR
#Region "METHODS"
Overrides Sub InitScene()
InitSceneEvents()
' Inizializzazione Scena
PreInitializeScene()
' Se tutto bene
If MainScene.Init() And Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.BASE) Then
PostInitializeScene()
' Non imposto automaticamente il focus sulla scena muovendo il mouse sopra di essa (necessario click)
MainScene.SetFocusOnMove(True, 0.3, 0.3, 0.1, 0.2)
' Imposto stato gestione mouse diretto della scena a nessuno
MainScene.SetStatusNull()
EgtSetCurrentContext(MainScene.GetCtx())
' inizializzo gestore lavorazioni
'EgtInitMachMgr(Map.refMainWindowVM.MainWindowM.sMachinesRoot, Map.refMainWindowVM.MainWindowM.sToolMakersDir)
Return
End If
' Problemi
' Se manca la chiave
If Map.refMainWindowVM.MainWindowM.nKeyLevel = -1 Or Map.refMainWindowVM.MainWindowM.nKeyLevel = -2 Then
EgtOutLog("Missing Dongle")
' Box di avviso chiave mancante : "Chiave non presente. \n Inserirla e riavviare il programma." "Errore"
Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 2) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 3)
Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
MessageBox.Show(sText, sTitle, MessageBoxButton.OK, MessageBoxImage.Error)
' Altrimenti manca la licenza
Else
EgtOutLog("Problems with Licence")
' Box di avviso licenza con problemi : "Programma senza licenza. \n Caricala e riavvia il programma." "Errore"
Dim sText As String = EgtMsg(MSG_MISSINGKEYWD + 5) & vbCrLf & EgtMsg(MSG_MISSINGKEYWD + 6)
Dim sTitle As String = EgtMsg(MSG_MISSINGKEYWD + 1)
If MessageBox.Show(sText, sTitle, MessageBoxButton.OKCancel, MessageBoxImage.Error) = MessageBoxResult.OK Then
' Apro dialogo per richiesta file licenza
Dim LicDlg As New Microsoft.Win32.OpenFileDialog() With {
.DefaultExt = ".lic",
.Filter = "Licences (.lic)|*.lic",
.CheckFileExists = True,
.ValidateNames = True
}
If LicDlg.ShowDialog() = True Then
' Recupero il direttorio del file
Dim sDir As String = Path.GetDirectoryName(LicDlg.FileName)
' Se il file non è già nel direttorio di configurazione lo copio
If Not String.Equals(Path.GetFullPath(sDir), Path.GetFullPath(Map.refMainWindowVM.MainWindowM.sConfigDir), StringComparison.OrdinalIgnoreCase) Then
Try
File.Copy(LicDlg.FileName, Path.Combine(Map.refMainWindowVM.MainWindowM.sConfigDir, LicDlg.SafeFileName), True)
Catch ex As Exception
End Try
End If
' Imposto il nuovo file di licenza nell'Ini
WriteMainPrivateProfileString(S_GENERAL, K_LICENCE, LicDlg.SafeFileName)
End If
End If
End If
' Chiudo il programma
End
End Sub
Public Overrides Sub InitSceneEvents()
AddHandler MainScene.OnCursorPos, AddressOf OnCursorPos
AddHandler MainScene.OnMouseSetObjFilterForSelect, AddressOf OnMouseSetObjFilterForSelect
AddHandler MainScene.OnMouseSelectedAll, AddressOf OnMouseSelectedAll
AddHandler MainScene.OnMouseDeselectedAll, AddressOf OnMouseDeselectedAll
AddHandler MainScene.OnMouseDownScene, AddressOf OnMouseDownScene
AddHandler MainScene.OnMouseMoveScene, AddressOf OnMouseMoveScene
AddHandler MainScene.OnMouseUpScene, AddressOf OnMouseUpScene
AddHandler MainScene.OnMouseSelectingObj, AddressOf OnMouseSelectingObj
AddHandler MainScene.OnMouseSelectedObj, AddressOf OnMouseSelectedObj
AddHandler MainScene.OnMouseSelectedPart, AddressOf OnMouseSelectedPart
AddHandler MainScene.OnMouseSelectedLayer, AddressOf OnMouseSelectedLayer
AddHandler MainScene.OnMouseSelectedPath, AddressOf OnMouseSelectedPath
AddHandler MainScene.OnMousePointFromSelection, AddressOf OnMousePointFromSelection
AddHandler MainScene.OnMouseDone, AddressOf OnMouseDone
AddHandler MainScene.OnMouseSelectedPoint, AddressOf OnMouseSelectedPoint
AddHandler MainScene.OnMouseSelectedDir, AddressOf OnMouseSelectedDir
AddHandler MainScene.OnMouseMoveSelPoint, AddressOf OnMouseMoveSelPoint
AddHandler MainScene.OnShowDistance, AddressOf OnShowDistance
AddHandler MainScene.KeyDown, AddressOf OnKeyDown
AddHandler MainScene.OnCloseGetDist, AddressOf OnCloseGetDist
AddHandler MainScene.OnChangedSnapPointType, AddressOf OnChangedSnapPointType
End Sub
Private Sub PreInitializeScene()
' imposto colore di default
Dim DefColor As New Color3d(0, 0, 0)
GetMainPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
MainScene.SetDefaultMaterial(DefColor)
' imposto colori sfondo
Dim BackTopColor As New Color3d(192, 192, 192)
GetMainPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
Dim BackBotColor As New Color3d(BackTopColor)
GetMainPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
MainScene.SetViewBackground(BackTopColor, BackBotColor)
' imposto spessore linee
Dim nLineWidth As Integer = 1
nLineWidth = GetMainPrivateProfileInt(S_SCENE, K_LINEWIDTH, nLineWidth)
MainScene.SetLineWidth(nLineWidth)
' imposto colore di evidenziazione
Dim MarkColor As New Color3d(255, 255, 0)
GetMainPrivateProfileColor(S_SCENE, K_MARK, MarkColor)
MainScene.SetMarkMaterial(MarkColor)
' imposto colore per superfici selezionate
Dim SelSurfColor As New Color3d(255, 255, 192)
GetMainPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor)
MainScene.SetSelSurfMaterial(SelSurfColor)
' imposto tipo e colore del rettangolo di zoom
Dim bOutline As Boolean = True
Dim ZwColor As New Color3d(0, 0, 0)
GetMainPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor)
MainScene.SetZoomWinAttribs(bOutline, ZwColor)
' imposto colore della linea di distanza
Dim DstLnColor As New Color3d(255, 0, 0)
GetMainPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor)
MainScene.SetDistLineMaterial(DstLnColor)
' imposto parametri OpenGL
Dim nDriver As Integer = GetMainPrivateProfileInt(S_OPENGL, K_DRIVER, 3)
Dim b2Buff As Boolean = (GetMainPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1) <> 0)
Dim nColorBits As Integer = GetMainPrivateProfileInt(S_OPENGL, K_COLORBITS, 32)
Dim nDepthBits As Integer = GetMainPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32)
MainScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
End Sub
Private Sub PostInitializeScene()
' Impostazioni Controller
MainController.SetScene(MainScene)
'MainController.SetSurfTmTolerance(OptionModule.m_dGeometryTolerance)
MainController.SetSurfTmTolerance(0.1)
MainController.SetUseCustomColors(True, S_SCENE, K_CUSTOMCOLORS)
' imposto unità di misura per interfaccia utente
Dim bMmUnits As Boolean = GetMainPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0
EgtSetUiUnits(bMmUnits)
' imposto visualizzazione riferimento globale
EgtSetGlobFrameShow(True)
' imposto i dati della griglia
Dim MinLnColor As Color3d = New Color3d(160, 160, 160)
GetMainPrivateProfileColor(S_GRID, K_MINLNCOLOR, MinLnColor)
Dim MajLnColor As Color3d = New Color3d(160, 160, 160)
GetMainPrivateProfileColor(S_GRID, K_MAJLNCOLOR, MajLnColor)
EgtSetGridFrame(Frame3d.GLOB)
'EgtSetGridGeo(If(bMmUnits, OptionModule.m_dSnapStepMm, OptionModule.m_dSnapStepInch),
' OptionModule.m_nMinLineSStep, OptionModule.m_nMajLineSStep, OptionModule.m_nExtSStep)
EgtSetGridGeo(If(bMmUnits, 100, 10),
10, 10, 10)
EgtSetGridColor(MinLnColor, MajLnColor)
'EgtSetGridShow(OptionModule.m_bGridVisibility, OptionModule.m_bGridVisibility)
EgtSetGridShow(False, False)
' imposto tipo coordinate
MainScene.SetGridCursorPos(True)
' visualizzazione avanzata dei triangoli costituenti le superfici
Dim bShowTriaAdv As Boolean = (GetMainPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0)
EgtSetShowTriaAdv(bShowTriaAdv)
' visualizzazione direzione curve
Dim bShowCurveDirection As Boolean = (GetMainPrivateProfileInt(S_SCENE, K_CURVEDIR, 0) <> 0)
EgtSetShowCurveDirection(bShowCurveDirection)
' tipo visualizzazione per Zmap
Dim nShowZmap As Integer = GetMainPrivateProfileInt(S_SCENE, K_SHOWZMAP, 1)
EgtSetShowZmap(DirectCast(nShowZmap, ZSM), False)
' dimensione lineare max in pixel delle textures
Dim nTxrMaxLinPix As Integer = GetMainPrivateProfileInt(S_SCENE, K_TEXMAXLINPIX, 4096)
EgtSetTextureMaxLinPixels(nTxrMaxLinPix)
' tipo snap point
MainScene.SetSnapPointType(SP.PT_GRID)
' nascondo input box
'Map.refFreeContourInputVM.ResetInputBox()
End Sub
Friend Sub EmitTitle()
' emissione del titolo
'Map.refSecondaryWindowVM.SetTitle()
End Sub
#End Region ' METHODS
#Region "ProjectManager"
Public Overrides Function NewProject() As Boolean
'EgtSetCurrentContext(MainScene.GetCtx())
'Dim bOk As Boolean = MainController.NewProject()
'MainScene.SetStatusNull()
'Return bOk
End Function
Public Overrides Function OpenProject(sFilePath As String) As Boolean
'EgtSetCurrentContext(MainScene.GetCtx())
'Dim bOk As Boolean = False
'If String.IsNullOrEmpty(sFilePath) Then
' ' Recupero cartella dell'ultimo progetto aperto
' Dim sDir As String = MainController.GetCurrFile()
' If String.IsNullOrWhiteSpace(sDir) Then
' GetMainPrivateProfileString(S_MRUFILES, K_FILE & 1, "", sDir)
' End If
' If Not String.IsNullOrWhiteSpace(sDir) Then
' sDir = Path.GetDirectoryName(sDir)
' End If
' Dim OpenFileDialog As New Windows.Forms.OpenFileDialog With {
' .Title = "Open",
' .Filter = "Icarus project(*.icrs)|*.icrs" &
' "|New geometry EgalTech(*.nge)|*.nge",
' .FilterIndex = 1,
' .InitialDirectory = sDir
' }
' If Not OpenFileDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then Return False
' sFilePath = OpenFileDialog.FileName
'End If
'bOk = MainController.OpenProject(sFilePath, False)
'' Imposto stato gestione mouse diretto della scena a nessuno
'MainScene.SetStatusNull()
'Return bOk
End Function
Public Overrides Function SaveProject() As Boolean
'' Se nome progetto non definito o con estensione non valida lo chiedo
'Dim sCurrFile As String = ""
'EgtGetCurrFilePath(sCurrFile)
'Dim bOk As Boolean = False
'If String.IsNullOrWhiteSpace(sCurrFile) Or EgtGetFileType(sCurrFile) <> FT.NGE Then
' bOk = SaveAsProject()
'Else
' Dim bDeleteNgeFile As Boolean = Path.GetExtension(sCurrFile) = ".nge"
' EgtSetCurrFilePath(Path.ChangeExtension(sCurrFile, "icrs"))
' ' Salvataggio standard
' bOk = MainController.SaveProject()
' If bOk AndAlso bDeleteNgeFile AndAlso File.Exists(sCurrFile) Then
' Try
' File.Delete(sCurrFile)
' Catch ex As Exception
' EgtOutLog("Delete nge file failed!")
' End Try
' End If
'End If
'' Imposto stato gestione mouse diretto della scena a nessuno
'MainScene.SetStatusNull()
'Return bOk
End Function
Public Overrides Function SaveAsProject() As Boolean
'm_bIsSaveAs = True
'Dim sFile As String = ""
'EgtGetCurrFilePath(sFile)
'Dim bOk As Boolean = False
'' Se nome vuoto, assegno "New"
'If String.IsNullOrWhiteSpace(sFile) Then sFile = "New.icrs"
'' Eventuale sistemazione estensione
'sFile = IO.Path.ChangeExtension(sFile, "icrs")
'' Assegnazione nome file con dialogo
'Dim SaveFileDialog As New Windows.Forms.SaveFileDialog With {
' .Title = "Save",
' .Filter = "Icarus Project(*.icrs)|*.icrs",
' .FileName = sFile,
' .InitialDirectory = IO.Path.GetDirectoryName(sFile)
'}
'If SaveFileDialog.ShowDialog = Windows.Forms.DialogResult.OK Then
' Dim sFileName As String = SaveFileDialog.FileName
' EgtSetCurrFilePath(sFileName)
' ' Salvataggio standard
' bOk = MainController.SaveProject()
'End If
'm_bIsSaveAs = False
'' Imposto stato gestione mouse diretto della scena a nessuno
'MainScene.SetStatusNull()
'Return bOk
End Function
Public Overrides Function InsertProject() As Boolean
'' 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
'If Not Directory.Exists(sDir) Then sDir = ""
'Dim ExtIndex As Integer = GetMainPrivateProfileInt(S_PRINTING3D, K_IMPORTCURREXTENSION, 1)
'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" &
' "|Imported Files (*.*)|*.stl;*.igs;*.iges;*.stp;*.step;*.3mf;*.nge" &
' "|All Files (*.*)|*.*",
' .FilterIndex = ExtIndex,
' .InitialDirectory = sDir}
'If Not OpenFileDialog.ShowDialog Then
' Return False
'End If
'WriteMainPrivateProfileString(S_PRINTING3D, K_IMPORTCURREXTENSION, OpenFileDialog.FilterIndex)
'Dim sFile As String = String.Empty
'sFile = OpenFileDialog.FileName
'' disabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
'Map.refProjManagerVM.SetProjCmdIsEnabled(False)
'Map.refTopPanelVM.SetTopPanelIsEnabled(False)
'Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(False)
'Map.refSliceManagerVM.SetButtonsIsEnabled(False)
'Map.refSliderManagerVM.SetLayerIndexIsEnabled(False)
'Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(False)
'Map.refInstrumentPanelVM.SetEdgeAnalysisIsEnabled(False)
'Map.refSliderManagerVM.SetSliderVisibility(False)
'' mostro finestra di caricamento
'Dim ImportLoadingWnd As ImportLoadingWndV = New ImportLoadingWndV(Application.Current.MainWindow, New ImportLoadingWndVM)
'ImportLoadingWnd.Show()
'' importo la nuova geometria
'Dim bOk As Boolean = MainController.InsertProject(sFile, False)
'If bOk Then
' Map.refViewLayerManagerVM.SetViewLayerManagerIsEnabled(True)
' ' la sposto in centro tavola
' Dim nNewPartId As Integer = EgtGetLastPart()
' Dim b3NewPart As New BBox3d
' EgtGetBBoxGlob(nNewPartId, GDB_BB.STANDARD, b3NewPart)
' EgtMove(nNewPartId, New Point3d((CurrentMachine.b3Tab.DimX / 2) - (b3NewPart.DimX / 2), (CurrentMachine.b3Tab.DimY / 2) - (b3NewPart.DimY / 2), 0) - b3NewPart.Min(), GDB_RT.GLOB)
' ' imposto modalita' import
' Map.refTopPanelVM.SelPage = Pages.IMPORT
'Else
' Map.refProjManagerVM.SetProjCmdIsEnabled(True)
' Map.refTopPanelVM.SetTopPanelIsEnabled(True)
' Map.refSliceManagerVM.SetButtonsIsEnabled(True)
' Map.refSliderManagerVM.SetLayerIndexIsEnabled(True)
' Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(True)
' Map.refInstrumentPanelVM.SetEdgeAnalysisIsEnabled(True)
' Map.refSliderManagerVM.SetSliderVisibility(True)
'End If
'' chiudo finestra di caricamento
'ImportLoadingWnd.Close()
'EgtDraw()
'Return bOk
End Function
Public Overrides Function ExportProject() As Boolean
'' Reset controller e scena
'MainController.ResetStatus()
''Assegnazione nome file con dialogo
'Dim SaveFileDialog As New SaveFileDialog With {
' .Title = "Export",
' .Filter = "3D Manufacturing format (*.3mf)|*.3mf" &
' "|Stereolithography (*.stl)|*.stl",
' .FilterIndex = 1,
' .FileName = Path.ChangeExtension(MainController.GetCurrFile(), "").TrimEnd("."c)
'}
'Dim DialogResult As Boolean? = SaveFileDialog.ShowDialog
'If IsNothing(DialogResult) OrElse Not DialogResult Then Return False
'MainController.SetDefaultFilterForExport(EEX_FLT.DEFAULT + EEX_FLT.LEV_TEMP)
'Return MainController.ExportProject(SaveFileDialog.FileName, False)
End Function
Public Function ExportProjectForMachine(sFilePath As String) As Boolean
'' Reset controller e scena
'MainController.ResetStatus()
'MainController.SetDefaultFilterForExport(EEX_FLT.MODE_HIDDEN + EEX_FLT.MODE_STD + EEX_FLT.STAT_ON + EEX_FLT.STAT_OFF + EEX_FLT.LEV_TEMP)
'Return MainController.ExportGeomId(Map.refTopPanelVM.SelPart.nPartId, sFilePath, False)
End Function
Public Function ExportProjectForMachine(sDirPath As String, b3dm As Boolean, ByRef sFilePath As String) As Boolean
'sFilePath = sDirPath & "\ProjectSlice" & If(b3dm, ".3dm", ".3mf")
'' Reset controller e scena
'MainController.ResetStatus()
'MainController.SetDefaultFilterForExport(EEX_FLT.MODE_HIDDEN + EEX_FLT.MODE_STD + EEX_FLT.STAT_ON + EEX_FLT.STAT_OFF + EEX_FLT.LEV_TEMP)
'Dim nExportGeomId As Integer = 0
'If b3dm Then
' If Not ExecPrepare3dmExport(nExportGeomId) Then Return False
'Else
' nExportGeomId = Map.refTopPanelVM.SelPart.nPartId
'End If
'Return MainController.ExportGeomId(nExportGeomId, sFilePath, False)
End Function
Public Overrides Function ExecScript(sFilePath As String) As Boolean
'Dim bOk As Boolean = False
'If String.IsNullOrEmpty(sFilePath) Then
' Dim sDir As String = String.Empty
' 'GetMainPrivateProfileString(S_GENERAL, K_LASTLUADIR, "", sDir)
' bOk = MainController.Exec(sDir)
'Else
' bOk = MainController.Exec(sFilePath, False)
'End If
'Dim bMachiningMode As Boolean = EgtGetCurrMachGroup() <> GDB_ID.NULL
'If Not bMachiningMode And EgtGetCurrLayer() = GDB_ID.NULL Then
' Dim nCurrPart As Integer = EgtGetCurrPart()
' If nCurrPart = GDB_ID.NULL Or Not EgtSetCurrPartLayer(nCurrPart, EgtGetFirstLayer(nCurrPart, True)) Then
' EgtResetCurrPartLayer()
' End If
'End If
'Return bOk
End Function
#End Region ' ProjectManager
#Region "SCENE EVENTS"
Private Sub OnCursorPos(ByVal sender As Object, ByVal sCursorPos As String)
'Map.refMyStatusBarVM.SetCurrPos(sCursorPos)
End Sub
Private Sub OnMouseSetObjFilterForSelect(sender As Object, bZeroDim As Boolean, bCurve As Boolean,
bSurf As Boolean, bVolume As Boolean, bExtra As Boolean)
'' Se in modalità modifica e non seleziona pezzo
'If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
' Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
' MainController.MouseSetObjFilterForSelect(bZeroDim, bCurve, bSurf, bVolume, bExtra)
'End If
End Sub
Private Sub OnMouseSelectedAll(ByVal sender As Object, bOnlyVisble As Boolean)
'' Se in modalità modifica e non seleziona pezzo
'If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
' Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
' MainController.MouseSelectedAll(bOnlyVisble)
'End If
End Sub
Private Sub OnMouseDeselectedAll(ByVal sender As Object)
'' Se in modalità modifica e non seleziona pezzo
'If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
' Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
' MainController.MouseDeselectedAll()
'End If
End Sub
Private Sub OnMouseDownScene(sender As Object, e As Forms.MouseEventArgs)
' se sto eseguendo comandi, esco
If MainController.GetStep() <> 0 Then Return
If e.Button = Forms.MouseButtons.Middle Then Return
'If Map.refInstrumentPanelVM.GetDistIsChecked Then Return
' Se in modalità modifica
If Not IsNothing(Map.refManageWindowVM.CurrWindow) Then
Part_OnMouseDownScene(sender, e)
End If
End Sub
Private Sub OnMouseMoveScene(sender As Object, e As Forms.MouseEventArgs)
' se sto eseguendo comandi, esco
If MainController.GetStep() <> 0 Then Return
If e.Button = Forms.MouseButtons.Middle Then Return
'If Map.refInstrumentPanelVM.GetDistIsChecked Then Return
' Se in modalità modifica
If Not IsNothing(Map.refManageWindowVM.CurrWindow) Then
Part_OnMouseMoveScene(sender, e)
End If
End Sub
Private Sub OnMouseUpScene(sender As Object, e As Forms.MouseEventArgs)
' se sto eseguendo comandi, esco
If MainController.GetStep() <> 0 Then Return
If e.Button = Forms.MouseButtons.Middle Then Return
'If Map.refInstrumentPanelVM.GetDistIsChecked Then Return
' Se in modalità modifica
If Not IsNothing(Map.refManageWindowVM.CurrWindow) Then
Part_OnMouseUpScene(sender, e)
End If
End Sub
Private Sub OnMouseSelectingObj(ByVal sender As Object, ByVal nId As Integer, ByRef bOk As Boolean)
bOk = Map.refManageWindowVM.OnMouseSelectingObj(nId)
End Sub
Private Sub OnMouseSelectedObj(ByVal sender As Object, ByVal nId As Integer, ByVal bLast As Boolean)
MainController.MouseSelectedObj(nId, bLast)
End Sub
Private Sub OnMouseSelectedPart(ByVal sender As Object, ByVal nId As Integer)
'' Se in modalità modifica e non seleziona pezzo
'If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
' Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
' MainController.MouseSelectedPart(nId)
'End If
End Sub
Private Sub OnMouseSelectedLayer(ByVal sender As Object, ByVal nId As Integer)
'' Se in modalità modifica e non seleziona pezzo
'If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
' Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
' MainController.MouseSelectedLayer(nId)
'End If
End Sub
Private Sub OnMouseSelectedPath(ByVal sender As Object, ByVal nId As Integer, ByVal bHaltOnFork As Boolean)
'' Se in modalità modifica e non seleziona pezzo
'If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
' Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
' MainController.MouseSelectedPath(nId, bHaltOnFork)
'End If
End Sub
Private Sub OnMousePointFromSelection(ByVal sender As Object, ByVal nId As Integer, ByVal PtP As Point3d, ByVal nAux As Integer)
'' Se in modalità modifica e non seleziona pezzo
'If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
' Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
' MainController.SetPointFromSelection(nId, PtP, nAux)
'End If
End Sub
Private Sub OnMouseDone(ByVal sender As Object)
'' Se in modalità modifica e non seleziona pezzo
'If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
' Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
' MainController.Done(Map.refControllerInputPanelVM.Text)
'End If
End Sub
Private Sub OnMouseSelectedPoint(ByVal sender As Object, ByVal PtP As Point3d, ByVal nSep As SEP, ByVal nId As Integer)
'' Se in modalità modifica e non seleziona pezzo
'If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
' Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
' Dim bDone As Boolean = (Keyboard.Modifiers And ModifierKeys.Control) <> ModifierKeys.Control
' MainController.MouseSelectedPoint(PtP, nSep, nId, bDone)
'End If
End Sub
Private Sub OnMouseSelectedDir(ByVal sender As Object, ByVal VtDir As Vector3d)
'' Se in modalità modifica e non seleziona pezzo
'If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
' Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
' MainController.SetLastVector3d(VtDir)
'End If
End Sub
Private Sub OnMouseMoveSelPoint(ByVal sender As Object, ByVal PtP As Point3d)
'' Se in modalità modifica e non seleziona pezzo
'If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso
' Not IsNothing(Map.refTopPanelVM.SelModifyMode) AndAlso Map.refTopPanelVM.SelModifyMode.ModifyMode <> ModifyModes.SELECT_ Then
' MainController.MouseMoveInSelectionPoint(PtP)
'End If
End Sub
Private Sub OnShowDistance(ByVal sender As Object, ByVal sDistance As String)
'Map.refMyStatusBarVM.SetOutputMessage(sDistance)
End Sub
Private Sub OnKeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs)
'If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso Not IsNothing(Map.refTopPanelVM.SelModifyMode) Then
' Select Case Map.refTopPanelVM.SelModifyMode.ModifyMode
' 'Case ModifyModes.SELECT_
' Case ModifyModes.DISPOSITION
' Map.refDispositionPanelVM.OnKeyDown(e.KeyData)
' Case ModifyModes.REFERENCE
' Case ModifyModes.STARTMACH
' Map.refStartMachPanelVM.OnKeyDown(e.KeyData)
' Case ModifyModes.RIBS
' Map.refRibPanelVM.OnKeyDown(e.KeyData)
' Case ModifyModes.SHELLNUMBER
' Map.refShellNumberPanelVM.OnKeyDown(e.KeyData)
' Case ModifyModes.AUXSOLIDS
' Map.refFilledSolidPanelVM.OnKeyDown(e.KeyData)
' End Select
'End If
End Sub
Private Sub OnCloseGetDist(sender As System.Object)
'Map.refInstrumentPanelVM.SetGetDistance_IsChecked(False)
End Sub
Friend Sub OnChangedSnapPointType(ByVal sender As Object, ByVal nSpType As SP, ByVal bUser As Boolean)
'm_SnapType = nSpType
'If Not IsNothing(Map.refMyStatusBarVM) Then Map.refMyStatusBarVM.SetSnapPointType(nSpType)
End Sub
#End Region ' SCENE EVENTS
#Region "CONTROLLER EVENTS"
Private Sub OnNewProject(sender As Object, bOk As Boolean)
'EgtErase(EgtGetFirstPart())
'CurrentMachine.CreateMachineTable()
'If Not bOk Then
' MessageBox.Show(Application.Current.MainWindow, EgtMsg(10002), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error on new file - Error
'End If
'EgtZoom(ZM.ALL)
'MainScene.SetStatusNull()
End Sub
Private Sub OnOpenProject(sender As Object, sFile As String, bOk As Boolean)
'WriteMainPrivateProfileString(S_GENERAL, K_LASTNGEDIR, Path.GetDirectoryName(sFile))
'If bOk Then
' Map.refProjManagerVM.MruFiles.Add(sFile)
'Else
' Map.refProjManagerVM.MruFiles.Remove(sFile)
' Dim sMsg As String
' If My.Computer.FileSystem.FileExists(sFile) Then
' sMsg = EgtMsg(10003) & " '" & sFile & "'" 'Error opening file
' Else
' sMsg = EgtMsg(10009) & " '" & sFile & "'" 'Missing file
' End If
' MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) 'Error
'End If
'' leggo materiale e macchina
'Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
'If nTabPartId <> GDB_ID.NULL Then
' Dim sMachineName As String = ""
' If Not EgtGetInfo(nTabPartId, KEY_MACHINE_NAME, sMachineName) Then sMachineName = "Cms-Kreator"
' Dim ProjectMachine As Machine = Map.refMachinePanelVM.MachineList.FirstOrDefault(Function(x) x.Name = sMachineName)
' If Not IsNothing(ProjectMachine) Then
' ' imposto la macchina
' Map.refMachinePanelVM.SelectedMachine = ProjectMachine
' Else
' MessageBox.Show("Project machine not found! Impossible to open the project.", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
' Map.refProjManagerVM.NewProject(False)
' Return
' End If
' Dim sMaterialGuid As String = ""
' EgtGetInfo(nTabPartId, KEY_MATERIAL_GUID, sMaterialGuid)
' Dim MaterialGuid As Guid
' Dim ProjectMaterial As MaterialIndex = Nothing
' If Guid.TryParse(sMaterialGuid, MaterialGuid) Then
' ' cerco materiale in lista
' ProjectMaterial = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sGUID = sMaterialGuid)
' End If
' If IsNothing(ProjectMaterial) Then
' Dim sMaterialName As String = ""
' EgtGetInfo(nTabPartId, KEY_MATERIAL_NAME, sMaterialName)
' ProjectMaterial = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sName = sMaterialName)
' End If
' If Not IsNothing(ProjectMaterial) Then
' Map.refTopPanelVM.SetSelMaterial(ProjectMaterial, True)
' Map.refTopPanelVM.NotifyPropertyChanged(NameOf(Map.refTopPanelVM.SelMaterial))
' Else
' Dim sMaterialName As String = ""
' EgtGetInfo(nTabPartId, KEY_MATERIAL_NAME, sMaterialName)
' MessageBox.Show("Project material (Guid:" & sMaterialGuid & " Name:""" & sMaterialName & """) not found!" & Environment.NewLine &
' "Please select another material!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning)
' End If
'End If
'' leggo pezzi
'Map.refTopPanelVM.PartList.Clear()
'Dim bProjectToRecalc As Boolean = False
'Dim nPartId As Integer = EgtGetFirstPart()
'While nPartId <> GDB_ID.NULL
' Dim nIsOnTable As Integer = 0
' If Not EgtGetInfo(nPartId, "PartOnTable", nIsOnTable) OrElse nIsOnTable <> 1 Then
' nPartId = EgtGetNextPart(nPartId)
' Continue While
' End If
' Dim nPrintPartLayerId As Integer = EgtGetFirstNameInGroup(nPartId, PRINT_SOLID)
' Dim nPrintPartId As Integer = EgtGetFirstInGroup(nPrintPartLayerId)
' Dim nRibsLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_RIBS)
' Dim nShellNumberLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_SHELL_NBR)
' Dim nAuxSolidsLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_AUX_SOLIDS)
' Dim nMachStartLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_MACH_START)
' Dim nOthersLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_OTHERS)
' Dim sFilePath As String = ""
' EgtGetInfo(nPartId, FILE_PATH, sFilePath)
' Dim nPartReferenceLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_PARTREFERENCE)
' If nPartReferenceLayerId = GDB_ID.NULL Then
' nPartReferenceLayerId = EgtCreateGroup(nPartId)
' EgtSetName(nPartReferenceLayerId, LAY_PARTREFERENCE)
' End If
' Dim nReferenceLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_REFERENCE)
' Dim nFrameId As Integer = EgtGetFirstInGroup(nReferenceLayerId)
' Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nPartReferenceLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
' Map.refTopPanelVM.PartList.Add(NewPart)
' Dim bPartToRecalc As Boolean = False
' EgtGetInfo(nPartId, MAC_TORECALC_SLICE, bPartToRecalc)
' If bPartToRecalc AndAlso Not bProjectToRecalc Then bProjectToRecalc = True
' ' Disabilito segnalazione modificato
' Dim DisableMgr As New DisableModifiedMgr
' ' setto i solidi non calcolati
' EgtSetInfo(nPartId, KEY_CALC_SOLIDS, 0)
' EgtSetInfo(nPartId, KEY_HAS_SOLIDS, 0)
' ' Ripristino stato segnalazione modifica
' DisableMgr.ReEnable()
' nPartId = EgtGetNextPart(nPartId)
'End While
'' aggiorno colori entita'
'GeomEntityColors.UpdateColors(LayerType.ALL)
'' aggiorno tempo e massa
'Map.refSliceManagerVM.UpdateTimeAndMass()
'Map.refSliceManagerVM.UpdateDimensions()
'Map.refSliderManagerVM.SetLayerIndexToMax()
'' seleziono primo pezzo trovato
'Map.refTopPanelVM.SelFirstPart()
'' resetto calcolo solidi
'Map.refViewLayerManagerVM.ResetSolid()
'' imposto modalita' modifica
'Map.refTopPanelVM.SelPage = Pages.MODIFY
'EgtZoom(ZM.ALL)
'MainScene.SetStatusNull()
End Sub
Private Sub OnSavingProject(ByVal sender As Object, sFile As String)
'' Se in SaveAs, aggiorno nome CN da generare
'If m_bIsSaveAs Then
' Dim nTabPartId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, TABLE)
' If nTabPartId <> GDB_ID.NULL Then
' EgtRemoveInfo(nTabPartId, KEY_ISOFILE_PATH)
' End If
'End If
End Sub
Private Sub OnSavedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
'WriteMainPrivateProfileString(S_GENERAL, K_LASTNGEDIR, Path.GetDirectoryName(sFile))
'If bOk Then
' Map.refProjManagerVM.MruFiles.Add(sFile)
'Else
' Map.refProjManagerVM.MruFiles.Remove(sFile)
' Dim sMsg As String = EgtMsg(10004) & " '" & sFile & "'" 'Error saving file
' MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
'End If
End Sub
Private Sub OnInsertedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
'' Segnalo eventuale errore
'If Not bOk Then
' Dim sMsg As String = EgtMsg(10006) & " '" & sFile & "'" 'Error importing file
' MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
'End If
'Map.refProjManagerVM.MruImportFiles.Add(sFile)
'EgtSetInfo(EgtGetLastPart(), FILE_PATH, sFile)
'EgtDraw()
'MainScene.SetStatusNull()
End Sub
Private Sub OnImportingProject(sender As Object, nType As Integer, ByRef nFlag As Integer)
'If nType <> FT.NULL Then
' If nType = FT.CNC Then
' nFlag = GetMainPrivateProfileInt(S_IMPORT, K_CNCFLAG, EIC_FL.NONE)
' Else
' nFlag = 0
' End If
' ' Abilito progress e bottone stop
' Map.refMyStatusBarVM.StartLoading("", True)
'Else
' MessageBox.Show(Application.Current.MainWindow, EgtMsg(10005), EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' File type unknown - Error
'End If
End Sub
Private Sub OnImportedProject(ByVal sender As Object, ByVal sFile As String, ByVal bOk As Boolean)
'EgtZoom(ZM.ALL)
'' Disabilito progress e bottone stop
'Map.refMyStatusBarVM.EndLoading("")
'' Salvo path
'WriteMainPrivateProfileString(S_GENERAL, K_LASTIMPDIR, Path.GetDirectoryName(sFile))
'' Segnalo eventuale errore
'If Not bOk Then
' Dim sMsg As String = EgtMsg(10006) & " '" & sFile & "'" 'Error importing file
' MessageBox.Show(Application.Current.MainWindow, sMsg, EgtMsg(10001), MessageBoxButton.OK, MessageBoxImage.Error) ' Error
'ElseIf Path.GetExtension(sFile) <> ".cnc" Then
' ' creo oggetto pezzo in lista
' 'Map.refProjectVM.
'End If
'MainScene.SetStatusNull()
End Sub
Private Sub PrepareInputBox(ByVal sTitle As String, ByVal sLabel As String, ByVal sCheckLabel As String,
ByVal bShowCombo As Boolean, ByVal bShowBtn As Boolean)
'Map.refControllerInputPanelVM.PrepareInputBox(sTitle, sLabel, sCheckLabel, bShowCombo, bShowBtn)
End Sub
Private Sub SetInputBoxText(ByVal sText As String)
'Map.refControllerInputPanelVM.SetInputBoxText(sText)
End Sub
Private Sub SetInputBoxCheck(ByVal bCheck As Boolean)
'Map.refControllerInputPanelVM.SetInputBoxCheck(bCheck)
End Sub
Private Sub AddInputBoxCombo(ByVal sText As String, ByVal bSelected As Boolean)
'Map.refControllerInputPanelVM.AddInputBoxCombo(sText, bSelected)
End Sub
Private Sub UpdateUI(ByVal sender As Object, ByVal bReloadUI As Boolean)
'' pulisco input e relativi messaggi
'Map.refControllerInputPanelVM.ResetInputBox()
'If MainController.GetContinue() Then
' Map.refMyStatusBarVM.SetOutputMessage(EgtMsg(399)) ' Continue : 'L' with line, 'A' with arc
'Else
' Map.refMyStatusBarVM.ClearOutputMessage()
'End If
'If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso Not IsNothing(Map.refTopPanelVM.SelModifyMode) Then
' Select Case Map.refTopPanelVM.SelModifyMode.ModifyMode
' 'Case ModifyModes.SELECT_
' Case ModifyModes.DISPOSITION
' Map.refDispositionPanelVM.UpdateUI()
' Case ModifyModes.REFERENCE
' Case ModifyModes.STARTMACH
' Map.refStartMachPanelVM.UpdateUI()
' Case ModifyModes.RIBS
' Map.refRibPanelVM.UpdateUI()
' Case ModifyModes.SHELLNUMBER
' Map.refShellNumberPanelVM.UpdateUI()
' Case ModifyModes.AUXSOLIDS
' Map.refFilledSolidPanelVM.UpdateUI()
' End Select
'End If
'' aggiorno titolo
'EmitTitle()
End Sub
Private Sub OnExecCmdEnd(command As Controller.CMD)
'If Not IsNothing(Map.refTopPanelVM.SelPage) AndAlso Map.refTopPanelVM.SelPage = Pages.MODIFY AndAlso Not IsNothing(Map.refTopPanelVM.SelModifyMode) Then
' Select Case Map.refTopPanelVM.SelModifyMode.ModifyMode
' 'Case ModifyModes.SELECT_
' Case ModifyModes.DISPOSITION
' Case ModifyModes.REFERENCE
' Case ModifyModes.STARTMACH
' Map.refStartMachPanelVM.OnExecCmdEnd(command)
' Case ModifyModes.RIBS
' Map.refRibPanelVM.OnExecCmdEnd(command)
' Case ModifyModes.SHELLNUMBER
' Map.refShellNumberPanelVM.OnExecCmdEnd(command)
' Case ModifyModes.AUXSOLIDS
' Map.refFilledSolidPanelVM.OnExecCmdEnd(command)
' End Select
'End If
End Sub
#End Region ' CONTROLLER EVENTS
'#Region "VIEW EVENTS"
#Region "Part"
Friend Sub Part_OnMouseDownScene(sender As Object, e As Forms.MouseEventArgs)
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(False, False, True, False, False)
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
If Not Map.refManageWindowVM.OnMouseSelectingObj(nId) Then
nId = EgtGetNextObjInSelWin()
Continue While
End If
'Dim nAreaId As Integer = Map.refManageWindowVM.FindAreaIdFromGeomId(nId)
'If nAreaId = GDB_ID.NULL Then
' nId = EgtGetNextObjInSelWin()
' Continue While
'End If
' Se già selezionato
If m_nSelIdList.Contains(nId) Then
' Memorizzo Id da deselezionare
m_nIdToDesel = nId
Else
' Memorizzo Id da selezionare
m_nIdToSel = nId
End If
Exit While
nId = EgtGetNextObjInSelWin()
End While
' Dati per drag
m_bDragToStart = True
End Sub
Private m_ShownAreaList As New List(Of ShownArea)
Friend Sub ResetShownAreaList()
m_ShownAreaList.Clear()
End Sub
Class ShownArea
Private m_nId As Integer
Public ReadOnly Property nId As Integer
Get
Return m_nId
End Get
End Property
Private m_bFound As Boolean
Public ReadOnly Property bFound As Boolean
Get
Return m_bFound
End Get
End Property
Friend Sub SetFound(bValue As Boolean)
m_bFound = bValue
End Sub
Sub New(nId As Integer, bFound As Boolean)
m_nId = nId
m_bFound = bFound
End Sub
End Class
Friend Sub Part_OnMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' 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 Or
Math.Abs(e.Location.Y - m_locPrev.Y) > m_nRestRadius Then
m_bDragToStart = False
End If
End If
If (Map.refManageWindowVM.SelParamCathegory = ManageWindowVM.ParamCathegories.SPLIT OrElse
Map.refManageWindowVM.SelParamCathegory = ManageWindowVM.ParamCathegories.SASH OrElse
Map.refManageWindowVM.SelParamCathegory = ManageWindowVM.ParamCathegories.FILL) AndAlso
Map.refManageWindowVM.SplitParamPage = ManageWindowVM.SplitParamPages.SELECTION Then
' resetto trovati
For Each Area In m_ShownAreaList
Area.SetFound(False)
Next
Dim bModifiedAlpha As Boolean = False
' Verifico se selezionato indicativo di pezzo
EgtSetObjFilterForSelWin(False, False, True, False, False)
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 nAreaId As Integer = Map.refManageWindowVM.FindAreaIdFromGeomId(nId)
If nAreaId = GDB_ID.NULL Then
nId = EgtGetNextObjInSelWin()
Continue While
End If
Dim ShownArea As ShownArea = m_ShownAreaList.FirstOrDefault(Function(x) x.nId = nId)
' se non trovato modifico alpha ed aggiungo a lista
If IsNothing(ShownArea) Then
m_ShownAreaList.Add(New ShownArea(nId, True))
EgtSetAlpha(nId, 25)
bModifiedAlpha = True
Else
ShownArea.SetFound(True)
End If
Exit While
nId = EgtGetNextObjInSelWin()
End While
' ripristino alpha ed elimino da lista tutti i non trovati
For AreaIndex = m_ShownAreaList.Count - 1 To 0 Step -1
If Not m_ShownAreaList(AreaIndex).bFound Then
Dim nStat As Integer
EgtGetStatus(m_ShownAreaList(AreaIndex).nId, nStat)
If nStat <> GDB_ST.SEL Then
EgtSetAlpha(m_ShownAreaList(AreaIndex).nId, 10)
bModifiedAlpha = True
m_ShownAreaList.RemoveAt(AreaIndex)
End If
End If
Next
If bModifiedAlpha Then EgtDraw()
End If
End Sub
Friend Sub Part_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
' deseleziono eventuali altre entita' selezionate
While m_nSelIdList.Count > 0
Dim nSelId = m_nSelIdList(m_nSelIdList.Count - 1)
Dim SelArea As Area = Map.refManageWindowVM.GetAreaFromId(nSelId)
If Not IsNothing(SelArea) AndAlso SelArea.AreaList.Count > 0 AndAlso Not IsNothing(SelArea.AreaList(0)) AndAlso
((Map.refManageWindowVM.SelParamCathegory = ParamCathegories.SPLIT And SelArea.AreaList(0).AreaType = AreaTypes.SPLIT) OrElse
(Map.refManageWindowVM.SelParamCathegory = ParamCathegories.SASH And SelArea.AreaList(0).AreaType = AreaTypes.SASH) OrElse
(Map.refManageWindowVM.SelParamCathegory = ParamCathegories.FILL And SelArea.AreaList(0).AreaType = AreaTypes.FILL)) AndAlso
Not SelArea.AreaList(0).bApplied Then
SelArea.AreaList.Remove(SelArea.AreaList(0))
End If
DeselectGeometry(nSelId)
End While
' Eseguo la selezione
SelectGeometry(m_nIdToSel)
Map.refManageWindowVM.SelAreaFromId(m_nIdToSel)
ElseIf m_nIdToDesel <> GDB_ID.NULL Then
' Eseguo la deselezione
DeselectGeometry(m_nIdToDesel)
Map.refManageWindowVM.DeselAreaFromId()
End If
' Reset
m_bDrag = False
m_nIdToSel = GDB_ID.NULL
m_nIdToDesel = GDB_ID.NULL
EgtDraw()
End Sub
Friend Sub ResetSelIdList()
EgtDeselectAll()
m_nSelIdList.Clear()
End Sub
Friend Function GetSelIds(nSelId As Integer) As List(Of Integer)
Dim SelIdList As New List(Of Integer)
' recupero Id dell'area selezionata
Dim nSelLayerId As Integer = EgtGetParent(nSelId)
Dim nSelAreaId As Integer = EgtGetParent(nSelLayerId)
Dim nSelAreaType As Integer = 0
EgtGetInfo(nSelAreaId, WIN_AREATYPE, nSelAreaType)
Dim bFrenchSash As Boolean = False
' verifico se sash french,
If Map.refManageWindowVM.SelParamCathegory = ParamCathegories.SASH AndAlso nSelAreaType = LuaAreaTypes.SASH Then
' recupero Parent area e verifico se e' di tipo Split
Dim nParentAreaId As Integer = EgtGetParent(nSelAreaId)
Dim nParentAreaType As Integer = 0
EgtGetInfo(nParentAreaId, WIN_AREATYPE, nParentAreaType)
If nParentAreaType = LuaAreaTypes.SPLIT OrElse nParentAreaType = LuaAreaTypes.NULL Then
' recupero area Split dell'area parent e verifico se e' di tipo French
Dim nSplitLayerId As Integer = EgtGetFirstNameInGroup(EgtGetParent(nParentAreaId), LUA_WIN_SPLIT)
Dim nSplitType As Integer = 0
EgtGetInfo(nSplitLayerId, LUA_WIN_SPLITTYPE, nSplitType)
If nSplitType = LuaSplitTypes.FRENCH Then
bFrenchSash = True
' risalgo ad area split
nSelAreaId = EgtGetParent(nParentAreaId)
nSelAreaType = LuaAreaTypes.SPLIT
End If
End If
End If
' recupero eventuale riferimento ad area originale e info child (per split multipli)
Dim nOrigSplitAreaId As Integer = GDB_ID.NULL
Dim sChildList As String = ""
If EgtGetInfo(nSelAreaId, LUA_WIN_ORIGSPLIT, nOrigSplitAreaId) Then
EgtGetInfo(nOrigSplitAreaId, "ChildSplit", sChildList)
sChildList = nOrigSplitAreaId & "," & sChildList
End If
If String.IsNullOrWhiteSpace(sChildList) AndAlso EgtGetInfo(nSelAreaId, "ChildSplit", sChildList) Then
sChildList = nSelAreaId & "," & sChildList
End If
' se area split ed ha child,
If Not String.IsNullOrWhiteSpace(sChildList) Then
' gestione split multiplo
Dim ChildArray() As String = sChildList.Split(","c)
For nChildIndex = 0 To ChildArray.Count - 1
Dim sChild As String = ChildArray(nChildIndex)
Dim nChildId As Integer = 0
If Not String.IsNullOrWhiteSpace(sChild) AndAlso Integer.TryParse(sChild, nChildId) Then
If bFrenchSash Then
Dim nAreaId As Integer = EgtGetFirstNameInGroup(nChildId, WIN_AREA & 1)
Dim nSashAreaId As Integer = EgtGetFirstNameInGroup(nAreaId, WIN_AREA & "*"c)
Dim nChildSelLayerId As Integer = EgtGetFirstNameInGroup(nSashAreaId, WIN_SELECTION)
Dim nChildSelId As Integer = EgtGetFirstInGroup(nChildSelLayerId)
SelIdList.Add(nChildSelId)
If nChildIndex = ChildArray.Count - 1 Then
nAreaId = EgtGetFirstNameInGroup(nChildId, WIN_AREA & 2)
nSashAreaId = EgtGetFirstNameInGroup(nAreaId, WIN_AREA & "*"c)
nChildSelLayerId = EgtGetFirstNameInGroup(nSashAreaId, WIN_SELECTION)
nChildSelId = EgtGetFirstInGroup(nChildSelLayerId)
SelIdList.Add(nChildSelId)
End If
Else
Dim nSplitSelLayerId As Integer = EgtGetFirstNameInGroup(nChildId, LUA_WIN_SPLITSELECTION)
Dim nSplitSelId As Integer = EgtGetFirstInGroup(nSplitSelLayerId)
SelIdList.Add(nSplitSelId)
End If
End If
Next
Else
' se Sash multiplo
If bFrenchSash Then
For AreaIndex = 1 To 2
Dim nChildAreaId As Integer = EgtGetFirstNameInGroup(nSelAreaId, WIN_AREA & AreaIndex)
Dim nSashAreaId As Integer = EgtGetFirstNameInGroup(nChildAreaId, WIN_AREA & "*")
Dim nChildSelLayerId As Integer = EgtGetFirstNameInGroup(nSashAreaId, WIN_SELECTION)
Dim nChildSelId As Integer = EgtGetFirstInGroup(nChildSelLayerId)
SelIdList.Add(nChildSelId)
Next
Else
SelIdList.Add(nSelId)
End If
End If
Return SelIdList
End Function
Friend Sub SelectGeometry(nId As Integer)
Dim SelGeomList As List(Of Integer)
SelGeomList = GetSelIds(nId)
For Each GeomId In SelGeomList
' Eseguo la selezione
m_nSelIdList.Add(GeomId)
EgtSetAlpha(GeomId, 70)
EgtSelectObj(GeomId)
Next
End Sub
Friend Sub DeselectGeometry(nId As Integer)
Dim SelGeomList As List(Of Integer)
SelGeomList = GetSelIds(nId)
For Each GeomId In SelGeomList
' Eseguo la deselezione
m_nSelIdList.Remove(GeomId)
If m_ShownAreaList.Any(Function(x) x.nId = GeomId) Then
EgtSetAlpha(GeomId, 25)
Else
EgtSetAlpha(GeomId, 10)
End If
EgtDeselectObj(GeomId)
Next
End Sub
Friend Function EraseIdFromSelList(nId As Integer) As Boolean
m_nSelIdList.Remove(nId)
If m_ShownAreaList.Any(Function(x) x.nId = m_nIdToDesel) Then
m_ShownAreaList.Remove(m_ShownAreaList.FirstOrDefault(Function(x) x.nId = nId))
Return True
End If
Return False
End Function
#End Region ' Part
'#Region "Import"
' Friend Sub Import_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()
' Dim nCurrIdToSel As Integer = GDB_ID.NULL
' While nId <> GDB_ID.NULL
' ' Recupero l'identificativo del pezzo cui appartiene
' Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId))
' If nPartId = Map.refManagePartPanelVM.nImportedPartId Then
' Dim EntityType As GDB_TY = EgtGetType(nId)
' Select Case EntityType
' Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_COMPO, GDB_TY.CRV_LINE
' nCurrIdToSel = nId
' Exit While
' Case GDB_TY.SRF_BEZ, GDB_TY.SRF_FRGN, GDB_TY.SRF_MESH
' If nCurrIdToSel = GDB_ID.NULL Then nCurrIdToSel = nId
' End Select
' End If
' nId = EgtGetNextObjInSelWin()
' End While
' ' Memorizzo Id da selezionare
' m_nIdToSel = nCurrIdToSel
' ' Dati per drag
' m_bDragToStart = True
' End Sub
' Friend Sub Import_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 Import_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
' Map.refManagePartPanelVM.SetSelImportedEntity(m_nIdToSel)
' End If
' ' Reset
' m_bDrag = False
' m_nIdToSel = GDB_ID.NULL
' m_nIdToDesel = GDB_ID.NULL
' End Sub
'#End Region ' Import
'#Region "StartMach"
' Friend Sub StartMach_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
' ' Se per Griglia da faccia di oggetto
' If Map.refStartMachPanelVM.bCPlaneObj_IsActive Then
' If EgtGetType(nId) = GDB_TY.SRF_MESH Then
' m_nIdToSel = nId
' Exit While
' End If
' Else
' ' Recupero l'identificativo del pezzo cui appartiene
' Dim nStartMachLayerId As Integer = EgtGetParent(nId)
' If nStartMachLayerId = Map.refStartMachPanelVM.nStartMachLayerId Then
' m_nIdToSel = nId
' Exit While
' End If
' End If
' nId = EgtGetNextObjInSelWin()
' End While
' If Map.refStartMachPanelVM.bCPlaneObj_IsActive And m_nIdToSel <> GDB_ID.NULL Then
' ' recupero dati punto di selezione
' Dim PtTemp As Point3d
' Dim nAux As Integer
' If EgtGetPointFromSelect(m_nIdToSel, e.Location, PtTemp, nAux) Then
' ' eseguo la selezione
' EgtSelectObj(m_nIdToSel)
' ' dati ausiliari
' EgtSetSelInfo(m_nIdToSel, nAux, PtTemp)
' End If
' End If
' ' Dati per drag
' m_bDragToStart = True
' End Sub
' Friend Sub StartMach_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 StartMach_OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' ' Se eseguito drag
' If Not m_bDragToStart Then
' ' se in scelta piano da oggetto resetto eventuale selezione
' If Map.refRibPanelVM.bCPlaneObj_IsActive Then
' EgtDeselectAll()
' End If
' ' Se selezione da eseguire
' ElseIf m_nIdToSel <> GDB_ID.NULL Then
' If Map.refStartMachPanelVM.bCPlaneObj_IsActive Then
' ' eseguo comando
' Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_OBJ)
' Map.refStartMachPanelVM.ResetCPlaneObjIsActive()
' ' imposto dimensioni griglia standard (non tavola)
' EgtSetGridGeo( -1, -1, -1, OptionModule.m_nExtSStep)
' ' ripristino selezioni precedenti
' For Each Id In Map.refStartMachPanelVM.PrevSelObjs
' EgtSelectObj(Id)
' Next
' Map.refControllerInputPanelVM.ResetInputBox()
' Else
' ' Eseguo la selezione
' Map.refStartMachPanelVM.SelStartFromId(m_nIdToSel)
' End If
' End If
' ' Reset
' m_bDrag = False
' m_nIdToSel = GDB_ID.NULL
' m_nIdToDesel = GDB_ID.NULL
' EgtDraw()
' End Sub
'#End Region ' StartMach
'#Region "Rib"
' Friend Sub Rib_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
' ' Se per Griglia da faccia di oggetto
' If Map.refRibPanelVM.bCPlaneObj_IsActive Then
' If EgtGetType(nId) = GDB_TY.SRF_MESH Then
' m_nIdToSel = nId
' Exit While
' End If
' Else
' Dim nRibLayerId As Integer = EgtGetParent(nId)
' If nRibLayerId = Map.refRibPanelVM.nRibLayerId Then
' m_nIdToSel = nId
' Exit While
' End If
' End If
' nId = EgtGetNextObjInSelWin()
' End While
' 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
' If EgtGetPointFromSelect(m_nIdToSel, e.Location, PtTemp, nAux) Then
' ' eseguo la selezione
' EgtSelectObj(m_nIdToSel)
' ' dati ausiliari
' EgtSetSelInfo(m_nIdToSel, nAux, PtTemp)
' End If
' End If
' ' Dati per drag
' m_bDragToStart = True
' End Sub
' Friend Sub Rib_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 Rib_OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' ' Se eseguito drag
' If Not m_bDragToStart Then
' ' se in scelta piano da oggetto resetto eventuale selezione
' If Map.refRibPanelVM.bCPlaneObj_IsActive Then
' EgtDeselectAll()
' End If
' ' Se selezione da eseguire
' ElseIf m_nIdToSel <> GDB_ID.NULL Then
' If Map.refRibPanelVM.bCPlaneObj_IsActive Then
' ' eseguo comando
' Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_OBJ)
' Map.refRibPanelVM.ResetCPlaneObjIsActive()
' ' imposto dimensioni griglia standard (non tavola)
' EgtSetGridGeo( -1, -1, -1, OptionModule.m_nExtSStep)
' ' ripristino selezioni precedenti
' For Each Id In Map.refRibPanelVM.PrevSelObjs
' EgtSelectObj(Id)
' Next
' Map.refControllerInputPanelVM.ResetInputBox()
' Else
' ' Eseguo la selezione
' Map.refRibPanelVM.SelStartFromId(m_nIdToSel)
' End If
' End If
' ' Reset
' m_bDrag = False
' m_nIdToSel = GDB_ID.NULL
' m_nIdToDesel = GDB_ID.NULL
' EgtDraw()
' End Sub
'#End Region ' Rib
'#Region "ShellNumber"
' Friend Sub ShellNumber_OnMouseDownScene(sender As Object, e As Forms.MouseEventArgs)
' m_nIdToSel = GDB_ID.NULL
' ' 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
' ' Se per Griglia da faccia di oggetto
' If Map.refShellNumberPanelVM.bCPlaneObj_IsActive Then
' If EgtGetType(nId) = GDB_TY.SRF_MESH Then
' m_nIdToSel = nId
' Exit While
' End If
' Else
' Dim nShellNumberLayerId As Integer = EgtGetParent(nId)
' If nShellNumberLayerId = Map.refShellNumberPanelVM.nShellNumberLayerId Then
' m_nIdToSel = nId
' Exit While
' End If
' End If
' nId = EgtGetNextObjInSelWin()
' End While
' If Map.refShellNumberPanelVM.bCPlaneObj_IsActive And m_nIdToSel <> GDB_ID.NULL Then
' ' recupero dati punto di selezione
' Dim PtTemp As Point3d
' Dim nAux As Integer
' If EgtGetPointFromSelect(m_nIdToSel, e.Location, PtTemp, nAux) Then
' ' eseguo la selezione
' EgtSelectObj(m_nIdToSel)
' ' dati ausiliari
' EgtSetSelInfo(m_nIdToSel, nAux, PtTemp)
' End If
' End If
' ' 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 in scelta piano da oggetto resetto eventuale selezione
' If Map.refRibPanelVM.bCPlaneObj_IsActive Then
' EgtDeselectAll()
' End If
' ' Se selezione da eseguire
' ElseIf m_nIdToSel <> GDB_ID.NULL Then
' If Map.refShellNumberPanelVM.bCPlaneObj_IsActive Then
' ' eseguo comando
' Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_OBJ)
' Map.refShellNumberPanelVM.ResetCPlaneObjIsActive()
' ' imposto dimensioni griglia standard (non tavola)
' EgtSetGridGeo( -1, -1, -1, OptionModule.m_nExtSStep)
' ' ripristino selezioni precedenti
' For Each Id In Map.refShellNumberPanelVM.PrevSelObjs
' EgtSelectObj(Id)
' Next
' Map.refControllerInputPanelVM.ResetInputBox()
' Else
' ' eseguo la selezione
' Map.refShellNumberPanelVM.SelStartFromId(m_nIdToSel)
' End If
' End If
' ' Reset
' m_bDrag = False
' m_nIdToSel = GDB_ID.NULL
' m_nIdToDesel = GDB_ID.NULL
' EgtDraw()
' End Sub
'#End Region ' ShellNumber
'#Region "FilledSolid"
' Friend Sub FilledSolid_OnMouseDownScene(sender As Object, e As Forms.MouseEventArgs)
' m_nIdToSel = GDB_ID.NULL
' ' 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
' ' Se per Griglia da faccia di oggetto
' If Map.refFilledSolidPanelVM.bCPlaneObj_IsActive Then
' If EgtGetType(nId) = GDB_TY.SRF_MESH Then
' m_nIdToSel = nId
' Exit While
' End If
' Else
' Dim nFilledSolidLayerId As Integer = EgtGetParent(nId)
' If nFilledSolidLayerId = Map.refFilledSolidPanelVM.nFilledSolidLayerId Then
' m_nIdToSel = nId
' Exit While
' End If
' End If
' nId = EgtGetNextObjInSelWin()
' End While
' If Map.refFilledSolidPanelVM.bCPlaneObj_IsActive And m_nIdToSel <> GDB_ID.NULL Then
' ' recupero dati punto di selezione
' Dim PtTemp As Point3d
' Dim nAux As Integer
' If EgtGetPointFromSelect(m_nIdToSel, e.Location, PtTemp, nAux) Then
' ' eseguo la selezione
' EgtSelectObj(m_nIdToSel)
' ' dati ausiliari
' EgtSetSelInfo(m_nIdToSel, nAux, PtTemp)
' End If
' End If
' ' Dati per drag
' m_bDragToStart = True
' End Sub
' Friend Sub FilledSolid_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 FilledSolid_OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
' ' Se eseguito drag
' If Not m_bDragToStart Then
' ' se in scelta piano da oggetto resetto eventuale selezione
' If Map.refRibPanelVM.bCPlaneObj_IsActive Then
' EgtDeselectAll()
' End If
' ' Se selezione da eseguire
' ElseIf m_nIdToSel <> GDB_ID.NULL Then
' If Map.refFilledSolidPanelVM.bCPlaneObj_IsActive Then
' ' eseguo comando
' Map.refSceneHostVM.MainController.ExecuteCommand(Controller.CMD.GRID_OBJ)
' Map.refFilledSolidPanelVM.ResetCPlaneObjIsActive()
' ' imposto dimensioni griglia standard (non tavola)
' EgtSetGridGeo( -1, -1, -1, OptionModule.m_nExtSStep)
' ' ripristino selezioni precedenti
' For Each Id In Map.refFilledSolidPanelVM.PrevSelObjs
' EgtSelectObj(Id)
' Next
' Map.refControllerInputPanelVM.ResetInputBox()
' Else
' ' eseguo la selezione
' Map.refFilledSolidPanelVM.SelStartFromId(m_nIdToSel)
' End If
' End If
' ' Reset
' m_bDrag = False
' m_nIdToSel = GDB_ID.NULL
' m_nIdToDesel = GDB_ID.NULL
' EgtDraw()
' End Sub
'#End Region ' FilledSolid
'#End Region ' VIEW EVENTS
End Class