diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9da6d3a
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,20 @@
+
+# /
+/revision.h
+/*.aps
+/*.ncb
+/*.suo
+/*.user
+/*.sdf
+/*.opensdf
+/Debug32
+/Release32
+/Trial32
+/Debug64
+/Release64
+/ipch
+/bin
+/obj
+/.vs
+
+/*.tmp
\ No newline at end of file
diff --git a/App.config b/App.config
new file mode 100644
index 0000000..56efbc7
--- /dev/null
+++ b/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Application.xaml b/Application.xaml
new file mode 100644
index 0000000..791a280
--- /dev/null
+++ b/Application.xaml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
diff --git a/Application.xaml.vb b/Application.xaml.vb
new file mode 100644
index 0000000..90921fa
--- /dev/null
+++ b/Application.xaml.vb
@@ -0,0 +1,24 @@
+Class Application
+
+ ' Gli eventi a livello di applicazione, ad esempio Startup, Exit e DispatcherUnhandledException,
+ ' possono essere gestiti in questo file.
+
+#Region "METHODS"
+
+ Protected Overrides Sub OnStartup(e As StartupEventArgs)
+ MyBase.OnStartup(e)
+ ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
+ ' Creo la View principale
+ Me.MainWindow = New MainWindowV
+ ' Mostro la View principale
+ Me.MainWindow.Show()
+ ' inizializzo finestra interfaccia
+ Dim m_SecondaryWindowWnd = New SecondaryWindowV(Application.Current.MainWindow) With {
+ .Owner = Me.MainWindow
+ }
+ m_SecondaryWindowWnd.Show()
+ End Sub
+
+#End Region ' Methods
+
+End Class
diff --git a/Constants/ConstGen.vb b/Constants/ConstGen.vb
new file mode 100644
index 0000000..08de7f4
--- /dev/null
+++ b/Constants/ConstGen.vb
@@ -0,0 +1,35 @@
+Module ConstGen
+
+ ' Abilitazioni licenza
+ Friend Enum KEY_OPT As UInteger
+ BASE = 1 ' Prodotto EgtStone3D
+ End Enum
+
+ ' File con dati di licenza
+ Public Const LIC_FILE_NAME As String = "EgtCAM5.lic"
+ Public Const S_LICENCE As String = "Licence"
+ Public Const K_LOCKID As String = "LockId"
+ Public Const K_KEY As String = "Key"
+ Public Const K_NESTKEY As String = "NestKey"
+
+ ' File di log generale
+ Public Const GENLOG_FILE_NAME As String = "EgtStone3D#.txt"
+
+ ' Sottodirettorio di configurazione
+ Public Const CONF_DIR As String = "Config"
+ ' Sottodirettorio delle risorse
+ Public Const RES_DIR As String = "Resources"
+ ' Sottodirettorio temporaneo
+ Public Const TEMP_DIR As String = "Temp"
+ ' Sottodirettorio lavorazioni
+ Public Const MACHININGS_DIR As String = "Machinings"
+ ' Sottodirettorio materiali
+ Public Const MATERIALS_DIR As String = "Materials"
+ ' Sottodirettorio per lavorazioni travi
+ Public Const _3DPRINTING_DIR As String = "EgtStone3D"
+ ' Sottodirettorio di default per le macchine
+ Public Const MACHINES_DFL_DIR As String = "Machines"
+ ' Sottodirettorio di default per toolmakers
+ Public Const TOOLMAKERS_DFL_DIR As String = "ToolMakers"
+
+End Module
diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb
new file mode 100644
index 0000000..6404dd6
--- /dev/null
+++ b/Constants/ConstIni.vb
@@ -0,0 +1,13 @@
+Module ConstIni
+
+ Public Const INI_FILE_NAME As String = "EgtStone3D.ini"
+
+ Public Const K_NETKEY As String = "NetKey"
+
+ Public Const S_PRINTING3D As String = "3dPrinting"
+ Public Const K_3PRNBASEDIR As String = "BaseDir"
+
+ Public Const K_LINEWIDTH As String = "LineWidth"
+ Public Const K_CUSTOMCOLORS As String = "CustomColors"
+
+End Module
diff --git a/EgtStone3D.vbproj b/EgtStone3D.vbproj
new file mode 100644
index 0000000..6225f75
--- /dev/null
+++ b/EgtStone3D.vbproj
@@ -0,0 +1,200 @@
+
+
+
+ Debug
+ AnyCPU
+ {10C7D2D3-8D43-4F83-9299-2DF704A55CD6}
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F}
+ WinExe
+ EgtStone3D
+ EgtStone3D
+ v4.7.2
+ Custom
+ true
+ true
+
+
+ AnyCPU
+ true
+ full
+ true
+ true
+ true
+ bin\Debug\
+ EgtStone3D.xml
+ 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314
+
+
+ AnyCPU
+ pdbonly
+ false
+ false
+ true
+ false
+ true
+ bin\Release\
+ EgtStone3D.xml
+ 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314
+
+
+ On
+
+
+ Binary
+
+
+ Off
+
+
+ On
+
+
+ true
+ true
+ true
+ bin\x86\Debug\
+ EgtStone3D.xml
+ 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314
+ full
+ x86
+ true
+
+
+ true
+ bin\x86\Release\
+ EgtStone3D.xml
+ true
+ 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314
+ pdbonly
+ x86
+ true
+
+
+
+ ..\..\..\EgtProg\Dll32\EgtUILib.dll
+
+
+ ..\..\..\EgtProg\Dll32\EgtWPFLib5.dll
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MainWindowV.xaml
+
+
+
+ SceneButtonV.xaml
+
+
+
+ SceneHostV.xaml
+
+
+ SecondaryWindowV.xaml
+
+
+
+ Application.xaml
+ Code
+
+
+
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Microsoft.VisualBasic.WPF.MyExtension
+ 1.0.0.0
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ VbMyResourcesResXFileCodeGenerator
+ Resources.Designer.vb
+ My.Resources
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.vb
+
+
+
+
+
+
+
+
+ IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\gtStone3D\EgtStone3DR32.exe
+IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Debug" copy $(TargetPath) c:\EgtProg\EgtStone3D\EgtStone3DD32.exe
+
+
\ No newline at end of file
diff --git a/MainWindow.xaml b/MainWindow.xaml
new file mode 100644
index 0000000..719e12b
--- /dev/null
+++ b/MainWindow.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/MainWindow.xaml.vb b/MainWindow.xaml.vb
new file mode 100644
index 0000000..b6e0269
--- /dev/null
+++ b/MainWindow.xaml.vb
@@ -0,0 +1,3 @@
+Class MainWindow
+
+End Class
\ No newline at end of file
diff --git a/MainWindow/MainWindowM.vb b/MainWindow/MainWindowM.vb
new file mode 100644
index 0000000..79ce2df
--- /dev/null
+++ b/MainWindow/MainWindowM.vb
@@ -0,0 +1,328 @@
+Imports System.Threading
+Imports EgtUILib.EgtInterface
+Imports EgtUILib.GenInterface
+Imports EgtWPFLib5
+Imports System.Math
+
+Public Class MainWindowM
+
+#Region "FIELDS & PROPERTIES"
+
+ ' massimo numero di istanze del programma ammesse
+ Const MAX_INST As Integer = 32
+
+ Private m_objMutex As Mutex
+
+ Private m_sDataRoot As String = String.Empty
+ Friend ReadOnly Property sDataRoot As String
+ Get
+ Return m_sDataRoot
+ End Get
+ End Property
+
+ Private m_sDataDir As String = String.Empty
+ Friend ReadOnly Property sDataDir As String
+ Get
+ Return m_sDataDir
+ End Get
+ End Property
+
+ Private m_sConfigDir As String = String.Empty
+ Public ReadOnly Property sConfigDir As String
+ Get
+ Return m_sConfigDir
+ End Get
+ End Property
+
+ Private m_nDebug As Integer = 0
+ Public ReadOnly Property DebugLevel As Integer
+ Get
+ Return m_nDebug
+ End Get
+ End Property
+
+ Private m_bFirstInstance As Boolean = False
+ Friend ReadOnly Property bFirstInstance As Boolean
+ Get
+ Return m_bFirstInstance
+ End Get
+ End Property
+
+ Private m_nInstance As Integer = 0
+ Friend ReadOnly Property nInstance As Integer
+ Get
+ Return m_nInstance
+ End Get
+ End Property
+
+ Private m_nUserLevel As Integer = 1
+ Friend ReadOnly Property nUserLevel As Integer
+ Get
+ Return m_nUserLevel
+ End Get
+ End Property
+
+ Private m_nKeyLevel As Integer = 0
+ Friend ReadOnly Property nKeyLevel As Integer
+ Get
+ Return m_nKeyLevel
+ End Get
+ End Property
+
+ Private m_nKeyOptions As UInteger = 0
+ Friend ReadOnly Property nKeyOptions As Integer
+ Get
+ Return m_nKeyOptions
+ End Get
+ End Property
+
+ Friend ReadOnly Property sVersion As String
+ Get
+ Return My.Application.Info.Version.Major.ToString() & "." &
+ My.Application.Info.Version.Minor.ToString() &
+ (ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
+ My.Application.Info.Version.Revision.ToString()
+ End Get
+ End Property
+
+ Private m_s3dPrintingDir As String
+ Friend ReadOnly Property s3dPrintingDir As String
+ Get
+ Return m_s3dPrintingDir
+ End Get
+ End Property
+
+ Private m_sMaterialsDir As String
+ Friend ReadOnly Property sMaterialsDir As String
+ Get
+ Return m_sMaterialsDir
+ End Get
+ End Property
+
+ Private m_sTempDir As String
+ Friend ReadOnly Property sTempDir As String
+ Get
+ Return m_sTempDir
+ End Get
+ End Property
+
+ Private m_sMachinesRoot As String
+ Friend ReadOnly Property sMachinesRoot As String
+ Get
+ Return m_sMachinesRoot
+ End Get
+ End Property
+
+ Private m_sToolMakersDir As String
+ Friend ReadOnly Property sToolMakersDir As String
+ Get
+ Return m_sToolMakersDir
+ End Get
+ End Property
+
+ Private m_sResourcesRoot As String
+ Friend ReadOnly Property sResourcesRoot As String
+ Get
+ Return m_sResourcesRoot
+ End Get
+ End Property
+
+ Private m_sLogFile As String
+ Friend ReadOnly Property sLogFile As String
+ Get
+ Return m_sLogFile
+ End Get
+ End Property
+
+#End Region ' Fields & Properties
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ InitializeEgtEnvironment()
+ End Sub
+
+#End Region ' Constructor
+
+#Region "METHODS"
+
+ Private Sub InitializeEgtEnvironment()
+ ' Impostazione path radice per i dati
+ m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory
+ If EgtUILib.GetPrivateProfileString(S_DATA, K_DATAROOT, "", m_sDataRoot, m_sDataRoot & "\" & DAT_FILE_NAME) = 0 Then
+ m_sDataRoot = System.AppDomain.CurrentDomain.BaseDirectory
+ End If
+ ' Impostazione direttorio di configurazione
+ m_sConfigDir = m_sDataRoot & "\" & CONF_DIR
+ ' Impostazione direttorio per file temporanei
+ m_sTempDir = m_sDataRoot & "\" & TEMP_DIR
+ ' Impostazione path Ini file
+ IniFile.m_sIniFile = m_sConfigDir & "\" & INI_FILE_NAME
+ ' Impostazione path resources dir
+ m_sResourcesRoot = m_sDataRoot & "\" & RES_DIR
+ ' Impostazione path machinings e materials dir
+ m_sMaterialsDir = m_sDataRoot & "\" & MATERIALS_DIR
+ ' Impostazione direttorio per le macchine
+ If GetMainPrivateProfileString(S_MACH, K_MACHINESDIR, "", m_sMachinesRoot) = 0 Then
+ m_sMachinesRoot = m_sDataRoot & "\" & MACHINES_DFL_DIR
+ End If
+ ' Impostazione direttorio per toolmakers
+ If GetMainPrivateProfileString(S_MACH, K_TOOLMAKERSDIR, "", m_sToolMakersDir) = 0 Then
+ m_sToolMakersDir = m_sDataRoot & "\" & TOOLMAKERS_DFL_DIR
+ End If
+ ' Impostazione direttorio 3dPrinting
+ If GetMainPrivateProfileString(S_PRINTING3D, K_3PRNBASEDIR, "", m_s3dPrintingDir) = 0 Then
+ m_s3dPrintingDir = m_sDataRoot & "\" & _3DPRINTING_DIR
+ End If
+ ' Verifico indice di istanza
+ ManageInstance()
+ ' Imposto tipo di chiave
+ EgtSetLockType(KEY_TYPE.HW)
+ ' Leggo e imposto chiave di protezione
+ Dim sLicFileName As String = String.Empty
+ GetMainPrivateProfileString(S_GENERAL, K_LICENCE, LIC_FILE_NAME, sLicFileName)
+ Dim sLicFile As String = m_sConfigDir & "\" & sLicFileName
+ Dim sKey As String = String.Empty
+ EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile)
+ EgtSetKey(sKey)
+ ' Impostazioni per chiave di rete
+ Dim bNetKey As Boolean = (GetMainPrivateProfileInt(S_GENERAL, K_NETKEY, 0) = 1)
+ EgtSetNetHwKey(bNetKey)
+ Dim sLockId As String = ""
+ EgtUILib.GetPrivateProfileString(S_LICENCE, K_LOCKID, "", sLockId, sLicFile)
+ If Not String.IsNullOrEmpty(sLockId) Then
+ EgtSetLockId(sLockId)
+ End If
+ ' Recupero livello e opzioni della chiave
+ Dim bKey As Boolean = EgtGetKeyLevel(5583, 2510, 1, m_nKeyLevel) And
+ EgtGetKeyOptions(5583, 2510, 1, m_nKeyOptions)
+ ' Inizializzazione generale di EgtInterface
+ m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0)
+ m_sLogFile = m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString())
+ Dim sLogMsg As String = "User " & Environment.MachineName & "\" & Environment.UserName & " (" & m_nInstance.ToString() & ")" & vbLf &
+ My.Application.Info.Title.ToString() & " ver. " &
+ My.Application.Info.Version.Major.ToString() &
+ "." & My.Application.Info.Version.Minor.ToString() &
+ (ChrW(97 - 1 + My.Application.Info.Version.Build)).ToString() &
+ My.Application.Info.Version.Revision.ToString()
+ EgtInit(m_nDebug, m_sLogFile, sLogMsg)
+ EgtSetTempDir(m_sTempDir)
+ EgtSetIniFile(IniFile.m_sIniFile)
+ ' Leggo direttorio dei messaggi (se manca uso direttorio di configurazione)
+ Dim sMsgDir As String = String.Empty
+ If GetMainPrivateProfileString(S_GENERAL, K_MESSAGESDIR, "", sMsgDir) = 0 Then
+ sMsgDir = m_sConfigDir
+ End If
+ ' Inizializzo OptionModule
+ OptionModule.InitOptionModule()
+ ' Leggo lingua corrente
+ Dim sLanguage As String = String.Empty
+ GetMainPrivateProfileString(S_GENERAL, K_MESSAGES, "", sLanguage)
+ ' Recupero nome file dei messaggi della lingua corrente
+ Dim sMsgName As String = "EgalTechIta.txt"
+ Dim nIndex As Integer = 1
+ While True
+ Dim ReadLanguage As Language = GetMainPrivateProfileLanguage(S_LANGUAGES, K_LANGUAGE & nIndex)
+ If IsNothing(ReadLanguage) Then Exit While
+ If String.Compare(ReadLanguage.Name, sLanguage, True) = 0 Then
+ sMsgName = ReadLanguage.FilePath
+ Exit While
+ End If
+ nIndex += 1
+ End While
+ ' Leggo file messaggi
+ Dim sMsgFilePath As String = sMsgDir & "\" & sMsgName
+ If Not EgtLoadMessages(sMsgFilePath) Then
+ EgtOutLog("Error in EgtLoadMessages")
+ End If
+ ' Leggo e imposto unità di misura per interfaccia utente
+ EgtSetUiUnits(GetMainPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0)
+ ' Leggo e imposto livello utilizzatore
+ m_nUserLevel = Math.Min(m_nKeyLevel, GetMainPrivateProfileInt(S_GENERAL, K_USERLEVEL, 1))
+ ' Imposto dir font Nfe e font default
+ Dim sNfeDir As String = String.Empty
+ GetMainPrivateProfileString(S_GEOMDB, K_NFEFONTDIR, "", sNfeDir)
+ Dim sDefFont As String = String.Empty
+ GetMainPrivateProfileString(S_GEOMDB, K_DEFAULTFONT, "", sDefFont)
+ EgtSetFont(sNfeDir, sDefFont)
+ ' imposto dir di default per libreria Lua e lancio libreria di base
+ Dim sLuaLibsDir As String = String.Empty
+ GetMainPrivateProfileString(S_LUA, K_LIBSDIR, "", sLuaLibsDir)
+ EgtSetLuaLibs(sLuaLibsDir)
+ Dim sLuaBaseLib As String = String.Empty
+ GetMainPrivateProfileString(S_LUA, K_BASELIB, "EgtBase", sLuaBaseLib)
+ EgtLuaRequire(sLuaBaseLib)
+ ' Info su opzioni chiave
+ EgtOutLog("KeyOptions : " & bKey.ToString() & " " & m_nKeyOptions.ToString())
+ End Sub
+
+ Private Sub ManageInstance()
+ Dim bCreated As Boolean
+ Try
+ m_objMutex = New Mutex(False, "Global\EgtStone3D", bCreated)
+ Catch
+ bCreated = False
+ End Try
+ m_bFirstInstance = bCreated
+ If bCreated Then
+ ' Prima istanza
+ m_nInstance = 1
+ ' Aggiorno stato istanze attive
+ WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, m_nInstance.ToString())
+ Else
+ ' Leggo il massimo numero di istanze ammesse
+ Dim nMaxInst As Integer = GetMaxInstances()
+ ' Cerco il primo indice di istanza libero
+ Dim nTmp As Integer = GetMainPrivateProfileInt(S_GENERAL, K_INSTANCES, 0)
+ m_nInstance = 1
+ Dim nMask As Integer = 1
+ While (nTmp And nMask) <> 0 And m_nInstance <= MAX_INST
+ m_nInstance += 1
+ nMask *= 2
+ End While
+ ' Se l'indice supera il massimo
+ If m_nInstance > nMaxInst Then
+ ' porto in primo piano la prima istanza
+ Dim bFound As Boolean = False
+ ' processi del programma a 32 bit
+ Dim localProc As Process() = Process.GetProcessesByName("EgtStone3DR32")
+ For Each p As Process In localProc
+ If p.Id <> Process.GetCurrentProcess().Id Then
+ bFound = True
+ ShowWindow(p.MainWindowHandle, 1)
+ Exit For
+ End If
+ Next
+ ' se non trovati processi a 32 bit provo a 64 bit
+ If Not bFound Then
+ localProc = Process.GetProcessesByName("EgtStone3DR64")
+ For Each p As Process In localProc
+ If p.Id <> Process.GetCurrentProcess().Id Then
+ bFound = True
+ ShowWindow(p.MainWindowHandle, SW.RESTORE)
+ Exit For
+ End If
+ Next
+ End If
+ ' esco dal programma
+ End
+ End If
+ ' Aggiorno stato istanze attive
+ nTmp += (1 << (m_nInstance - 1))
+ WriteMainPrivateProfileString(S_GENERAL, K_INSTANCES, nTmp.ToString())
+ End If
+ End Sub
+
+ Friend Function GetMaxInstances() As Integer
+ ' Leggo il massimo numero di istanze ammesse
+ Dim nMaxInst As Integer = GetMainPrivateProfileInt(S_GENERAL, K_MAXINST, 1)
+ Return Max(1, Min(nMaxInst, MAX_INST))
+ End Function
+
+ Friend Function GetKeyOption(nKeyOpt As KEY_OPT) As Boolean
+ Return ((m_nKeyOptions And nKeyOpt) <> 0)
+ End Function
+
+#End Region ' Methods
+
+End Class
diff --git a/MainWindow/MainWindowV.xaml b/MainWindow/MainWindowV.xaml
new file mode 100644
index 0000000..a21d8f2
--- /dev/null
+++ b/MainWindow/MainWindowV.xaml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MainWindow/MainWindowV.xaml.vb b/MainWindow/MainWindowV.xaml.vb
new file mode 100644
index 0000000..79d8ff9
--- /dev/null
+++ b/MainWindow/MainWindowV.xaml.vb
@@ -0,0 +1,57 @@
+Imports System.Windows.Interop
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Class MainWindowV
+
+#Region "FIELDS & PROPERTIES"
+
+ Private m_MainWindowVM As MainWindowVM
+
+#End Region ' Fields & Properties
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ m_MainWindowVM = New MainWindowVM
+ ' La chiamata è richiesta dalla finestra di progettazione.
+ InitializeComponent()
+ ' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
+ Me.DataContext = m_MainWindowVM
+ ' creo finestra della scena
+ AddHandler Me.Loaded, AddressOf MainWindowV_Loaded
+ Map.SetRefMainWindowV(Me)
+ End Sub
+
+#End Region ' Constructor
+
+#Region "EVENTS"
+
+ Private Sub MainWindowV_Loaded(sender As Object, e As RoutedEventArgs)
+ ' Carico e imposto posizione finestra
+ WinPosFromIniToWindow(S_GENERAL, K_WINPLACE, Me)
+ ' Recupero e imposto handle finestra principale
+ Dim hMainWnd As IntPtr = New WindowInteropHelper(Application.Current.MainWindow).Handle
+ EgtSetMainWindowHandle(hMainWnd)
+ ' Attivo Popup Pulsanti su scena
+ Popup_SceneButton.IsOpen = True
+ End Sub
+
+ Private Sub MainWindowV_ContentRendered(sender As Object, e As EventArgs)
+ m_MainWindowVM.ContentRendered()
+ End Sub
+
+ Private Sub MainWindowV_Closing(sender As Object, e As System.ComponentModel.CancelEventArgs)
+ If (Keyboard.Modifiers And ModifierKeys.Alt) = ModifierKeys.Alt OrElse Keyboard.IsKeyDown(Key.F4) Then
+ e.Cancel = True
+ Return
+ End If
+ ' Salvo posizione finestra (se non minimizzata)
+ If WindowState <> WindowState.Minimized Then
+ WinPosFromWindowToIni(Me, S_GENERAL, K_WINPLACE)
+ End If
+ End Sub
+
+#End Region ' Events
+
+End Class
diff --git a/MainWindow/MainWindowVM.vb b/MainWindow/MainWindowVM.vb
new file mode 100644
index 0000000..04cd420
--- /dev/null
+++ b/MainWindow/MainWindowVM.vb
@@ -0,0 +1,37 @@
+Imports EgtWPFLib5
+
+Public Class MainWindowVM
+ Inherits VMBase
+
+#Region "FIELDS & PROPERTIES"
+
+ ' Riferimento al Model della MainWindow
+ Private m_MainWindowM As MainWindowM
+ Friend ReadOnly Property MainWindowM As MainWindowM
+ Get
+ Return m_MainWindowM
+ End Get
+ End Property
+
+#End Region ' Fields & Properties
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ ' Avvio l'inizializzazione della mappa passandogli il riferimento al MainWindowVM
+ Map.BeginInit(Me)
+ ' Creo Model della MainWindow
+ m_MainWindowM = New MainWindowM
+ End Sub
+
+#End Region ' Constructor
+
+#Region "METHODS"
+
+ Friend Sub ContentRendered()
+
+ End Sub
+
+#End Region ' Methods
+
+End Class
diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb
new file mode 100644
index 0000000..9c9a9e7
--- /dev/null
+++ b/My Project/AssemblyInfo.vb
@@ -0,0 +1,56 @@
+Imports System
+Imports System.Globalization
+Imports System.Reflection
+Imports System.Resources
+Imports System.Runtime.InteropServices
+Imports System.Windows
+
+' Le informazioni generali relative a un assembly sono controllate dal seguente
+' set di attributi. Modificare i valori di questi attributi per modificare le informazioni
+' associate a un assembly.
+
+' Controllare i valori degli attributi degli assembly
+
+
+
+
+
+
+
+
+
+'Per iniziare a creare applicazioni localizzabili, impostare
+'CultureYouAreCodingWith nel file VBPROJ
+'all'interno di un . Ad esempio, se si utilizza l'inglese (Stati Uniti)
+'nei file di origine, impostare su "en-US". Rimuovere quindi il commento
+'dall'attributo NeutralResourceLanguage seguente. Aggiornare "en-US" nella riga
+'seguente in modo che corrisponda all'impostazione di UICulture nel file di progetto.
+
+'
+
+
+'L'attributo ThemeInfo indica la possibile posizione dei dizionari risorse generici e specifici del tema.
+'Primo parametro: posizione dei dizionari risorse specifici del tema
+'(da usare se nella pagina non viene trovata una risorsa,
+' oppure nei dizionari delle risorse dell'applicazione)
+
+'Parametro 2: posizione del dizionario risorse generico
+'(da usare se nella pagina non viene trovata una risorsa,
+'un'applicazione e alcun dizionario risorse specifico del tema)
+
+
+
+
+'Se il progetto viene esposto a COM, il GUID seguente verrà usato come ID del typelib
+
+
+' Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori:
+'
+' Versione principale
+' Versione secondaria
+' Numero di build
+' Revisione
+'
+
+
+
diff --git a/My Project/MyExtensions/MyWpfExtension.vb b/My Project/MyExtensions/MyWpfExtension.vb
new file mode 100644
index 0000000..2184d9b
--- /dev/null
+++ b/My Project/MyExtensions/MyWpfExtension.vb
@@ -0,0 +1,121 @@
+#If _MyType <> "Empty" Then
+
+Namespace My
+ '''
+ ''' Modulo utilizzato per definire le proprietà disponibili nello spazio dei nomi My per WPF
+ '''
+ '''
+ _
+ Module MyWpfExtension
+ Private s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.Computer)
+ Private s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.User)
+ Private s_Windows As New ThreadSafeObjectProvider(Of MyWindows)
+ Private s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.Log)
+ '''
+ ''' Restituisce l'oggetto applicazione per l'applicazione in esecuzione
+ '''
+ _
+ Friend ReadOnly Property Application() As Application
+ Get
+ Return CType(Global.System.Windows.Application.Current, Application)
+ End Get
+ End Property
+ '''
+ ''' Restituisce le informazioni sul computer host.
+ '''
+ _
+ Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.Computer
+ Get
+ Return s_Computer.GetInstance()
+ End Get
+ End Property
+ '''
+ ''' Restituisce le informazioni per l'utente corrente. Se si desidera eseguire l'applicazione con le
+ ''' credenziali utente di Windows correnti, chiamare My.User.InitializeWithWindowsUser().
+ '''
+ _
+ Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User
+ Get
+ Return s_User.GetInstance()
+ End Get
+ End Property
+ '''
+ ''' Restituisce il registro applicazioni. I listener possono essere configurati dal file di configurazione dell'applicazione.
+ '''
+ _
+ Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.Log
+ Get
+ Return s_Log.GetInstance()
+ End Get
+ End Property
+
+ '''
+ ''' Restituisce la raccolta di oggetti Window definiti nel progetto.
+ '''
+ _
+ Friend ReadOnly Property Windows() As MyWindows
+ _
+ Get
+ Return s_Windows.GetInstance()
+ End Get
+ End Property
+ _
+ _
+ Friend NotInheritable Class MyWindows
+ _
+ Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Window})(ByVal Instance As T) As T
+ If Instance Is Nothing Then
+ If s_WindowBeingCreated IsNot Nothing Then
+ If s_WindowBeingCreated.ContainsKey(GetType(T)) = True Then
+ Throw New Global.System.InvalidOperationException("The window cannot be accessed via My.Windows from the Window constructor.")
+ End If
+ Else
+ s_WindowBeingCreated = New Global.System.Collections.Hashtable()
+ End If
+ s_WindowBeingCreated.Add(GetType(T), Nothing)
+ Return New T()
+ s_WindowBeingCreated.Remove(GetType(T))
+ Else
+ Return Instance
+ End If
+ End Function
+ _
+ _
+ Private Sub Dispose__Instance__(Of T As Global.System.Windows.Window)(ByRef instance As T)
+ instance = Nothing
+ End Sub
+ _
+ _
+ Public Sub New()
+ MyBase.New()
+ End Sub
+ Private Shared s_WindowBeingCreated As Global.System.Collections.Hashtable
+ Public Overrides Function Equals(ByVal o As Object) As Boolean
+ Return MyBase.Equals(o)
+ End Function
+ Public Overrides Function GetHashCode() As Integer
+ Return MyBase.GetHashCode
+ End Function
+ _
+ _
+ Friend Overloads Function [GetType]() As Global.System.Type
+ Return GetType(MyWindows)
+ End Function
+ Public Overrides Function ToString() As String
+ Return MyBase.ToString
+ End Function
+ End Class
+ End Module
+End Namespace
+Partial Class Application
+ Inherits Global.System.Windows.Application
+ _
+ _
+ Friend ReadOnly Property Info() As Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo
+ _
+ Get
+ Return New Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(Global.System.Reflection.Assembly.GetExecutingAssembly())
+ End Get
+ End Property
+End Class
+#End If
\ No newline at end of file
diff --git a/My Project/Resources.Designer.vb b/My Project/Resources.Designer.vb
new file mode 100644
index 0000000..b22e10f
--- /dev/null
+++ b/My Project/Resources.Designer.vb
@@ -0,0 +1,62 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+' Runtime Version:$clrversion$
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My.Resources
+
+ 'This class was auto-generated by the StronglyTypedResourceBuilder
+ 'class via a tool like ResGen or Visual Studio.
+ 'To add or remove a member, edit your .ResX file then rerun ResGen
+ 'with the /str option, or rebuild your VS project.
+ '''
+ ''' A strongly-typed resource class, for looking up localized strings, etc.
+ '''
+ _
+ Friend Module Resources
+
+ Private resourceMan As Global.System.Resources.ResourceManager
+
+ Private resourceCulture As Global.System.Globalization.CultureInfo
+
+ '''
+ ''' Returns the cached ResourceManager instance used by this class.
+ '''
+ _
+ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
+ Get
+ If Object.ReferenceEquals(resourceMan, Nothing) Then
+ Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("$safeprojectname$.Resources", GetType(Resources).Assembly)
+ resourceMan = temp
+ End If
+ Return resourceMan
+ End Get
+ End Property
+
+ '''
+ ''' Overrides the current thread's CurrentUICulture property for all
+ ''' resource lookups using this strongly typed resource class.
+ '''
+ _
+ Friend Property Culture() As Global.System.Globalization.CultureInfo
+ Get
+ Return resourceCulture
+ End Get
+ Set(ByVal value As Global.System.Globalization.CultureInfo)
+ resourceCulture = value
+ End Set
+ End Property
+ End Module
+End Namespace
diff --git a/My Project/Resources.resx b/My Project/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/My Project/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/My Project/Settings.Designer.vb b/My Project/Settings.Designer.vb
new file mode 100644
index 0000000..2b85eaf
--- /dev/null
+++ b/My Project/Settings.Designer.vb
@@ -0,0 +1,73 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+' Runtime Version:4.0.30319.42000
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My
+
+ _
+ Partial Friend NotInheritable Class MySettings
+ Inherits Global.System.Configuration.ApplicationSettingsBase
+
+ Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
+
+#Region "My.Settings Auto-Save Functionality"
+#If _MyType = "WindowsForms" Then
+ Private Shared addedHandler As Boolean
+
+ Private Shared addedHandlerLockObject As New Object
+
+ _
+ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
+ If My.Application.SaveMySettingsOnExit Then
+ My.Settings.Save()
+ End If
+ End Sub
+#End If
+#End Region
+
+ Public Shared ReadOnly Property [Default]() As MySettings
+ Get
+
+#If _MyType = "WindowsForms" Then
+ If Not addedHandler Then
+ SyncLock addedHandlerLockObject
+ If Not addedHandler Then
+ AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
+ addedHandler = True
+ End If
+ End SyncLock
+ End If
+#End If
+ Return defaultInstance
+ End Get
+ End Property
+ End Class
+End Namespace
+
+Namespace My
+
+ _
+ Friend Module MySettingsProperty
+
+ _
+ Friend ReadOnly Property Settings() As Global.EgtStone3D.My.MySettings
+ Get
+ Return Global.EgtStone3D.My.MySettings.Default
+ End Get
+ End Property
+ End Module
+End Namespace
diff --git a/My Project/Settings.settings b/My Project/Settings.settings
new file mode 100644
index 0000000..40ed9fd
--- /dev/null
+++ b/My Project/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb
new file mode 100644
index 0000000..348236a
--- /dev/null
+++ b/OptionsWindow/OptionModule.vb
@@ -0,0 +1,68 @@
+Imports EgtUILib
+Imports EgtWPFLib5
+
+Friend Module OptionModule
+
+#Region "FIELDS & PROPERTIES"
+
+ ' Colori di sfondo della vista e della griglia
+ Friend m_TopSceneBackground As Color3d
+ Friend m_BotSceneBackground As Color3d
+ Friend m_GridColor As Color3d
+
+ ' Colore di default in disegno
+ Friend m_DefMaterialColor As Color3d
+
+ ' Colore di evidenziazione
+ Friend m_MarkColor As Color3d
+
+ ' Colore superfici
+ Friend m_SelSurfColor As Color3d
+
+ ' Colore rettangolo di zoom
+ Friend m_RectangleZoomColor As Color3d
+
+ ' Colore linea di distanz
+ Friend m_LineDistanceColor As Color3d
+
+#End Region ' Fields & Properties
+
+#Region "METHODS"
+
+ ' inizializzazione lettura variabili ad inizio programma
+ Friend Sub InitOptionModule()
+ ' Inizializzo variabili colori di sfondo scena, griglia
+ Dim BackTopColor As New Color3d(0, 123, 167)
+ GetMainPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
+ m_TopSceneBackground = BackTopColor
+ Dim BackBotColor As New Color3d(BackTopColor)
+ GetMainPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
+ m_BotSceneBackground = BackBotColor
+ Dim GridColor As New Color3d(0, 0, 0)
+ GetMainPrivateProfileColor(S_GRID, K_MINLNCOLOR, GridColor)
+ m_GridColor = GridColor
+ ' imposto colore di default
+ Dim DefColor As New Color3d(100, 10, 20)
+ GetMainPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
+ m_DefMaterialColor = DefColor
+ ' imposto colore di evidenziazione
+ Dim MarkColor As New Color3d(255, 255, 0)
+ GetMainPrivateProfileColor(S_SCENE, K_MARK, MarkColor)
+ m_MarkColor = MarkColor
+ ' imposto colore per superfici selezionate
+ Dim SelSurfColor As New Color3d(255, 255, 192)
+ GetMainPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor)
+ m_SelSurfColor = SelSurfColor
+ ' imposto tipo e colore del rettangolo di zoom
+ Dim ZwColor As New Color3d(0, 0, 0)
+ GetMainPrivateProfileZoomWin(S_SCENE, K_ZOOMWIN, True, ZwColor)
+ m_RectangleZoomColor = ZwColor
+ ' imposto colore della linea di distanza
+ Dim DstLnColor As New Color3d(255, 0, 0)
+ GetMainPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor)
+ m_LineDistanceColor = DstLnColor
+ End Sub
+
+#End Region ' Methods
+
+End Module
diff --git a/SceneButton/SceneButtonV.xaml b/SceneButton/SceneButtonV.xaml
new file mode 100644
index 0000000..b24872d
--- /dev/null
+++ b/SceneButton/SceneButtonV.xaml
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/SceneButton/SceneButtonV.xaml.vb b/SceneButton/SceneButtonV.xaml.vb
new file mode 100644
index 0000000..525c93f
--- /dev/null
+++ b/SceneButton/SceneButtonV.xaml.vb
@@ -0,0 +1,34 @@
+Imports System.Windows.Interop
+
+Public Class SceneButtonV
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+
+ ' La chiamata è richiesta dalla finestra di progettazione.
+ InitializeComponent()
+
+ ' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
+ AddHandler Me.Loaded, AddressOf SceneButtonV_Loaded
+ End Sub
+
+#End Region ' Constructor
+
+#Region "METHODS"
+
+ Private Sub Init()
+ 'Me.Width = Map.refMainWindowV.ActualWidth
+ 'Me.Height = Map.refMainWindowV.ActualHeight
+ Me.Width = 1920
+ Me.Height = 950
+ End Sub
+
+ Private Sub SceneButtonV_Loaded(sender As Object, e As RoutedEventArgs)
+ Init()
+ End Sub
+
+
+#End Region ' Methods
+
+End Class
diff --git a/SceneHost/MySceneHostVM.vb b/SceneHost/MySceneHostVM.vb
new file mode 100644
index 0000000..1aa9a99
--- /dev/null
+++ b/SceneHost/MySceneHostVM.vb
@@ -0,0 +1,166 @@
+Imports EgtUILib
+Imports EgtWPFLib5
+Imports System.IO
+
+Public Class MySceneHostVM
+ Inherits SceneHostVM
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ MyBase.New()
+ End Sub
+
+#End Region ' Constructor
+
+#Region "METHODS"
+
+ Overrides Sub InitScene()
+ ' Inizializzazione Scena
+ PreInitializeScene()
+ ' Se tutto bene
+ 'If MainScene.Init() And Map.refMainWindowVM.MainWindowM.GetKeyOption(KEY_OPT.BASE) Then
+ If MainScene.Init() Then
+ PostInitializeScene()
+ ' modo di visualizzazione
+ EgtSetView(VT.ISO_SE)
+ ' Imposto stato gestione mouse diretto della scena a nessuno
+ MainScene.SetStatusNull()
+ EgtSetCurrentContext(MainScene.GetCtx())
+ 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(10102) & vbCrLf & EgtMsg(10103)
+ ' Dim sTitle As String = EgtMsg(10101)
+ ' 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(10105) & vbCrLf & EgtMsg(10106)
+ ' Dim sTitle As String = EgtMsg(10101)
+ ' 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)
+ ' Dim sDir As String = 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
+
+ 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(0, 123, 167)
+ 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(0.05)
+ 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)
+ 'Map.refMyStatusBarVM.SetMeasureUnit(nMeasureUnit <> 0)
+ ' imposto visualizzazione riferimento globale
+ EgtSetGlobFrameShow(True)
+ ' imposto i dati della griglia
+ Dim bGridVisibility As Boolean = (GetMainPrivateProfileInt(S_GRID, K_SHOWGRID, 1) <> 0)
+ Dim dSnapStepMm As Double = GetMainPrivateProfileDouble(S_GRID, K_SNAPSTEP, 10)
+ Dim dSnapStepInch As Double = GetMainPrivateProfileDouble(S_GRID, K_SNAPSTEPINCH, 10)
+ Dim nMinLineSStep As Integer = GetMainPrivateProfileInt(S_GRID, K_MINLINESSTEP, 1)
+ Dim nMajLineSStep As Integer = GetMainPrivateProfileInt(S_GRID, K_MAJLINESSTEP, 10)
+ Dim nExtSStep As Integer = GetMainPrivateProfileInt(S_GRID, K_EXTSSTEP, 50)
+ 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)
+ If bMmUnits Then
+ EgtSetGridGeo(dSnapStepMm, nMinLineSStep, nMajLineSStep, nExtSStep)
+ Else
+ EgtSetGridGeo(dSnapStepInch, nMinLineSStep, nMajLineSStep, nExtSStep)
+ End If
+ EgtSetGridColor(MinLnColor, MajLnColor)
+ EgtSetGridShow(bGridVisibility, bGridVisibility)
+ ' 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
+
+#End Region ' Methods
+
+End Class
diff --git a/SceneHost/SceneHostV.xaml b/SceneHost/SceneHostV.xaml
new file mode 100644
index 0000000..be6bcf9
--- /dev/null
+++ b/SceneHost/SceneHostV.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SceneHost/SceneHostV.xaml.vb b/SceneHost/SceneHostV.xaml.vb
new file mode 100644
index 0000000..83b4366
--- /dev/null
+++ b/SceneHost/SceneHostV.xaml.vb
@@ -0,0 +1,23 @@
+Public Class SceneHostV
+
+#Region "FIELDS & PROPERTIES"
+
+ Private m_MySceneHostVM As MySceneHostVM
+
+#End Region ' Fields & Properties
+
+#Region "CONSTRUCTOR"
+
+ Sub New()
+ ' La chiamata è richiesta dalla finestra di progettazione.
+ InitializeComponent()
+ ' Aggiungere le eventuali istruzioni di inizializzazione dopo la chiamata a InitializeComponent().
+ Me.DataContext = New MySceneHostVM
+ m_MySceneHostVM = DirectCast(Me.DataContext, MySceneHostVM)
+ m_MySceneHostVM.SetMainScene(MainScene)
+ Map.SetRefSceneHostV(Me)
+ End Sub
+
+#End Region ' Constructor
+
+End Class
diff --git a/SecondaryWindow/SecondaryWindowV.xaml b/SecondaryWindow/SecondaryWindowV.xaml
new file mode 100644
index 0000000..562f742
--- /dev/null
+++ b/SecondaryWindow/SecondaryWindowV.xaml
@@ -0,0 +1,10 @@
+
+
+
+
+
diff --git a/SecondaryWindow/SecondaryWindowV.xaml.vb b/SecondaryWindow/SecondaryWindowV.xaml.vb
new file mode 100644
index 0000000..e344b58
--- /dev/null
+++ b/SecondaryWindow/SecondaryWindowV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class SecondaryWindowV
+
+End Class
diff --git a/Utility/EgtStone3DDictionary.xaml b/Utility/EgtStone3DDictionary.xaml
new file mode 100644
index 0000000..74e46a5
--- /dev/null
+++ b/Utility/EgtStone3DDictionary.xaml
@@ -0,0 +1,282 @@
+
+
+
+
+
+
+
+
+
+
+
+ 30
+
+
+
+
+
+ 2
+
+
+
+
+
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Utility/Map.vb b/Utility/Map.vb
new file mode 100644
index 0000000..0ef033d
--- /dev/null
+++ b/Utility/Map.vb
@@ -0,0 +1,70 @@
+Imports EgtWPFLib5
+
+Module Map
+
+#Region "FIELDS & PROPERTIES"
+
+ Private m_refMainWindowVM As MainWindowVM
+ Private m_refMainWindowV As MainWindowV
+ Private m_refSceneHostV As SceneHostV
+
+#End Region ' Fields & Properties
+
+#Region "Get"
+
+ Public ReadOnly Property refMainWindowV As MainWindowV
+ Get
+ Return m_refMainWindowV
+ End Get
+ End Property
+
+ Public ReadOnly Property refMainWindowVM As MainWindowVM
+ Get
+ Return m_refMainWindowVM
+ End Get
+ End Property
+
+ Public ReadOnly Property refSceneHostV As SceneHostV
+ Get
+ Return m_refSceneHostV
+ End Get
+ End Property
+
+#End Region ' Get
+
+#Region "Set"
+
+ Friend Function SetRefMainWindowV(MainWindowV As MainWindowV) As Boolean
+ m_refMainWindowV = MainWindowV
+ Return Not IsNothing(m_refMainWindowV)
+ End Function
+
+ Friend Function SetRefMainWindowVM(MainWindowVM As MainWindowVM) As Boolean
+ m_refMainWindowVM = MainWindowVM
+ Return Not IsNothing(m_refMainWindowVM)
+ End Function
+
+ Friend Function SetRefSceneHostV(SceneHostV As SceneHostV) As Boolean
+ m_refSceneHostV = SceneHostV
+ Return Not IsNothing(m_refSceneHostV)
+ End Function
+
+#End Region ' Set
+
+#Region "Init"
+
+ Friend Function BeginInit(MainWindowVM As MainWindowVM) As Boolean
+ m_refMainWindowVM = MainWindowVM
+ Return Not IsNothing(m_refMainWindowVM)
+ End Function
+
+ Friend Function EndInit() As Boolean
+ ' Verifico se tutti i pezzi necessari sono stati caricati
+ Return Not IsNothing(m_refMainWindowVM) AndAlso
+ Not IsNothing(LibMap.refStatusBarVM) AndAlso
+ LibMap.EndInit()
+ End Function
+
+#End Region ' Init
+
+End Module
diff --git a/egtstone3d b/egtstone3d
new file mode 100644
index 0000000..e69de29