c529c9dd59
- aggiungo file mancanti.
114 lines
5.5 KiB
VB.net
114 lines
5.5 KiB
VB.net
Imports EgtUILib
|
|
|
|
Public Class FlatPartsImportUC
|
|
|
|
''Per creazione Scene
|
|
'Friend Shared WithEvents ScenaFlatPartsImport As New Scene
|
|
'Dim ScenaFlatPartsImportHost As New System.Windows.Forms.Integration.WindowsFormsHost
|
|
|
|
''Per ScenaFlatPartsImport
|
|
'' Properties
|
|
'Private m_sCurrDir As String = String.Empty
|
|
'Private m_sCurrFile As String = String.Empty
|
|
'Private m_nFileType As Integer = FT.NULL
|
|
'Private m_bFirst As Boolean = True
|
|
|
|
Private Sub FlatPartsImportUC_Initialized(sender As Object, e As EventArgs)
|
|
|
|
' ScenaFlatPartsImportHost.Child = ScenaFlatPartsImport
|
|
' ScenaFlatPartsImportHost.SetValue(Grid.ColumnProperty, 1)
|
|
' ScenaFlatPartsImportHost.SetValue(Grid.RowProperty, 0)
|
|
' ScenaFlatPartsImportHost.SetValue(Grid.RowSpanProperty, 2)
|
|
' Me.BackGroundGridFlatPartsImport.Children.Add(ScenaFlatPartsImportHost)
|
|
|
|
End Sub
|
|
|
|
Private Sub FlatPartsImportUC_Loaded(sender As Object, e As RoutedEventArgs)
|
|
|
|
' If (Not m_bFirst) Then
|
|
' EgtSetCurrentContext(ScenaFlatPartsImport.GetCtx())
|
|
' Return
|
|
' End If
|
|
|
|
' ' imposto colore di default
|
|
' Dim DefColor As New Color3d(0, 0, 0)
|
|
' GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor, MainWindow.GetIniFile())
|
|
' ScenaFlatPartsImport.SetDefaultMaterial(DefColor)
|
|
' ' imposto colori sfondo
|
|
' Dim BackTopColor As New Color3d(192, 192, 192)
|
|
' GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor, MainWindow.GetIniFile())
|
|
' Dim BackBotColor As New Color3d(BackTopColor)
|
|
' GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor, MainWindow.GetIniFile())
|
|
' ScenaFlatPartsImport.SetViewBackground(BackTopColor, BackBotColor)
|
|
' ' imposto colore di evidenziazione
|
|
' Dim MarkColor As New Color3d(255, 255, 0)
|
|
' GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor, MainWindow.GetIniFile())
|
|
' ScenaFlatPartsImport.SetMarkMaterial(MarkColor)
|
|
' ' imposto colore per superfici selezionate
|
|
' Dim SelSurfColor As New Color3d(255, 255, 192)
|
|
' GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor, MainWindow.GetIniFile())
|
|
' ScenaFlatPartsImport.SetSelSurfMaterial(SelSurfColor)
|
|
' ' imposto tipo e colore del rettangolo di zoom
|
|
' Dim bOutline As Boolean = True
|
|
' Dim ZwColor As New Color3d(0, 0, 0)
|
|
' GetPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, bOutline, ZwColor, MainWindow.GetIniFile())
|
|
' ScenaFlatPartsImport.SetZoomWinAttribs(bOutline, ZwColor)
|
|
' ' imposto colore della linea di distanza
|
|
' Dim DstLnColor As New Color3d(255, 0, 0)
|
|
' GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor, MainWindow.GetIniFile())
|
|
' ScenaFlatPartsImport.SetDistLineMaterial(DstLnColor)
|
|
' ' imposto parametri OpenGL
|
|
' Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3, MainWindow.GetIniFile())
|
|
' Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1, MainWindow.GetIniFile()) <> 0)
|
|
' Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32, MainWindow.GetIniFile())
|
|
' Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32, MainWindow.GetIniFile())
|
|
' ScenaFlatPartsImport.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
|
' ' inizializzo la scena (DB geometrico + visualizzazione)
|
|
' ScenaFlatPartsImport.Init()
|
|
' ' leggo direttorio corrente
|
|
' GetPrivateProfileString(S_FLATPARTS, K_FLPCURRDIR, "", m_sCurrDir, MainWindow.GetIniFile())
|
|
' ' lo carico
|
|
' LoadCurrDir()
|
|
' ' imposto misura
|
|
' If EgtUiUnitsAreMM() Then
|
|
' rbMm.Select()
|
|
' Else
|
|
' rbInch.Select()
|
|
' End If
|
|
|
|
End Sub
|
|
|
|
Private Sub ScenaFlatPartsImportUC_SelectionChanged(sender As Object, e As SelectionChangedEventArgs)
|
|
' ' Recupero item selezionato
|
|
' Dim vItems As ListView.SelectedListViewItemCollection = ListView1.SelectedItems
|
|
' If vItems.Count() = 0 Then
|
|
' Return
|
|
' End If
|
|
' ' A seconda del tipo
|
|
' Select Case vItems(0).ImageIndex
|
|
' Case 0 ' Vai nel direttorio padre
|
|
' m_sCurrDir = IO.Path.GetDirectoryName(m_sCurrDir)
|
|
' m_sCurrFile = ""
|
|
' LoadCurrDir()
|
|
' ListView1.Items(0).Selected = True
|
|
' ListView1.Items(0).Focused = True
|
|
' Case 1 ' Vai nella radice del disco
|
|
' m_sCurrDir = vItems(0).Text
|
|
' m_sCurrFile = ""
|
|
' LoadCurrDir()
|
|
' ListView1.Items(0).Selected = True
|
|
' ListView1.Items(0).Focused = True
|
|
' Case 2 ' Vai nel sottodirettorio
|
|
' m_sCurrDir = IO.Path.Combine(m_sCurrDir, vItems(0).Text)
|
|
' m_sCurrFile = ""
|
|
' LoadCurrDir()
|
|
' ListView1.Items(0).Selected = True
|
|
' ListView1.Items(0).Focused = True
|
|
' Case 3 ' File
|
|
' m_sCurrFile = vItems(0).Text
|
|
' LoadCurrFile()
|
|
' End Select
|
|
End Sub
|
|
|
|
End Class
|