diff --git a/Application.xaml.vb b/Application.xaml.vb
index ec665b9..5290da7 100644
--- a/Application.xaml.vb
+++ b/Application.xaml.vb
@@ -12,13 +12,13 @@
Protected Overrides Sub OnStartup(e As StartupEventArgs)
MyBase.OnStartup(e)
ShutdownMode = System.Windows.ShutdownMode.OnMainWindowClose
- 'If e.Args.Count = 0 Then
- ' ' creo finestra SplashScreen
- ' Dim SplashScreen As New SplashScreenV
- ' Me.MainWindow = SplashScreen
- ' Me.MainWindow.Show()
- ' Map.SetRefSplashScreen(SplashScreen)
- 'End If
+ If e.Args.Count = 0 Then
+ ' creo finestra SplashScreen
+ Dim SplashScreen As New SplashScreenV
+ Me.MainWindow = SplashScreen
+ Me.MainWindow.Show()
+ Map.SetRefSplashScreen(SplashScreen)
+ End If
' Creo la View principale
Me.MainWindow = New MainWindowV
' Mostro la View principale
diff --git a/Constants/ConstEgtStone3D.vb b/Constants/ConstEgtStone3D.vb
index 3fc92b3..535255a 100644
--- a/Constants/ConstEgtStone3D.vb
+++ b/Constants/ConstEgtStone3D.vb
@@ -34,7 +34,9 @@
Public Const ASSEMBLER As String = " Avvio Assembler"
+ ' unità di misura
Public Const MILLIMETER As String = "mm"
+ Public Const INCH As String = "in"
Public Const CHILD As String = "Child"
Public Const SOLID As String = "Solid"
@@ -63,16 +65,20 @@
Public Const UTILITY_FOLDER As String = "Utility"
- Public Const TABLE = "Table"
+ Public Const TABLE As String = "Table"
- Public Const SUBTITLE = "SubTitle"
+ Public Const SUBTITLE As String = "SubTitle"
' nome file cn in progetto
- Public Const KEY_ISOFILE_PATH = "IsoFilePath"
+ Public Const KEY_ISOFILE_PATH As String = "IsoFilePath"
- Public Const FILE_PATH = "FilePath"
+ Public Const FILE_PATH As String = "FilePath"
- 'enum per le trasformazioni
+ ' info per griglia
+ Public Const GRID_ON As String = "GRID ON "
+ Public Const GRID_OFF As String = "GRID OFF"
+
+ ' enum per le trasformazioni
Public Enum PairStage As Integer
FirstLine = 0
SecondLine = 1
diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb
index 26d65ee..5357d2d 100644
--- a/Constants/ConstIni.vb
+++ b/Constants/ConstIni.vb
@@ -18,4 +18,5 @@
Public Const S_MRUFILES As String = "MruFiles"
Public Const S_MRUIMPORTFILES As String = "MruImportFiles"
Public Const S_IMPORT As String = "Import"
+ Public Const K_GRIDSTATE As String = "GridState"
End Module
diff --git a/EgtStone3D.vbproj b/EgtStone3D.vbproj
index f66eeb8..66fa1d8 100644
--- a/EgtStone3D.vbproj
+++ b/EgtStone3D.vbproj
@@ -70,8 +70,7 @@
true
-
-
+ Resources\EgalwareLogo.ico
@@ -117,6 +116,10 @@
EgtMessageBoxV.xaml
+
+
+ GridPaneV.xaml
+
MainWindowV.xaml
@@ -233,6 +236,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
@@ -385,15 +392,13 @@
SettingsSingleFileGenerator
Settings.Designer.vb
+
-
-
-
diff --git a/GridPanel/GridPaneV.xaml b/GridPanel/GridPaneV.xaml
new file mode 100644
index 0000000..350db4c
--- /dev/null
+++ b/GridPanel/GridPaneV.xaml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/GridPanel/GridPaneV.xaml.vb b/GridPanel/GridPaneV.xaml.vb
new file mode 100644
index 0000000..7081c58
--- /dev/null
+++ b/GridPanel/GridPaneV.xaml.vb
@@ -0,0 +1,3 @@
+Public Class GridPaneV
+
+End Class
diff --git a/GridPanel/GridPanelVM.vb b/GridPanel/GridPanelVM.vb
new file mode 100644
index 0000000..5373314
--- /dev/null
+++ b/GridPanel/GridPanelVM.vb
@@ -0,0 +1,160 @@
+Imports EgtWPFLib5
+Imports EgtUILib
+
+Public Class GridPanelVM
+ Inherits VMBase
+
+#Region "FIELDS & PROPERTIES"
+
+ Private m_StatusGridText As String = If(OptionModule.m_bGridState, GRID_ON, GRID_OFF)
+ Public ReadOnly Property StatusGridText As String
+ Get
+ Return m_StatusGridText
+ End Get
+ End Property
+ Friend Sub SetStatusGridText(value As String)
+ m_StatusGridText = value
+ NotifyPropertyChanged(NameOf(StatusGridText))
+ End Sub
+
+ Private m_GridDimensionText As String = If(OptionModule.m_bMmUnits, LenToString(OptionModule.m_dSnapStepMm, 4), LenToString(OptionModule.m_dSnapStepInch, 4))
+ Public Property GridDimensionText As String
+ Get
+ Return m_GridDimensionText
+ End Get
+ Set(value As String)
+ m_GridDimensionText = value
+ NotifyPropertyChanged(NameOf(GridDimensionText))
+ End Set
+ End Property
+
+ Private m_MeasureUnit As String = If(OptionModule.m_bMmUnits, MILLIMETER, INCH)
+ Public ReadOnly Property MeasureUnit As String
+ Get
+ Return m_MeasureUnit
+ End Get
+ End Property
+ Public Sub SetMeasureUnit(nMeasureUnit As Integer)
+ m_MeasureUnit = If(nMeasureUnit = 0, INCH, MILLIMETER)
+ NotifyPropertyChanged(NameOf(MeasureUnit))
+ End Sub
+
+#Region "Messages"
+
+ Public ReadOnly Property MeasureUnit_Msg
+ Get
+ Return EgtMsg(110037) ' Unità di Misura
+ End Get
+ End Property
+
+#End Region ' Messages
+
+ ' Definizione dei comandi
+ Private m_cmdStatusGrid As ICommand
+ Private m_cmdGridDimension As ICommand
+ Private m_cmdStatusUnits As ICommand
+
+#End Region ' Fields & Properties
+
+#Region "CONTRUCTOR"
+
+ Sub New()
+ Map.SetRefGridPanelVM(Me)
+ End Sub
+
+#End Region ' Constructor
+
+#Region "METHODS"
+
+ Friend Sub UpdateStatusGrid(bShowGrid As Boolean, bShowGridFrame As Boolean)
+ SetStatusGridText(If(bShowGrid, GRID_ON, GRID_OFF))
+ EgtSetGridShow(bShowGrid, bShowGrid And bShowGridFrame)
+ End Sub
+
+ Friend Sub UpdateStatusUnits(bMmUnits As Boolean)
+ SetMeasureUnit(If(bMmUnits, 1, 0)) 'StatusUnitsText = If(bMmUnits, "mm", "in")
+ EgtSetUiUnits(bMmUnits)
+ End Sub
+
+#End Region ' Methods
+
+#Region "COMMANDS"
+
+#Region "StatusGridCommand"
+
+ Public ReadOnly Property StatusGridCommand As ICommand
+ Get
+ If m_cmdStatusGrid Is Nothing Then
+ m_cmdStatusGrid = New Command(AddressOf StatusGrid)
+ End If
+ Return m_cmdStatusGrid
+ End Get
+ End Property
+
+ Public Sub StatusGrid(ByVal param As Object)
+ Dim tmpGridState As Integer
+ OptionModule.m_bGridState = GetMainPrivateProfileInt(S_GENERAL, K_GRIDSTATE, 1)
+ If OptionModule.m_bGridState Then
+ tmpGridState = 0
+ Else
+ tmpGridState = 1
+ End If
+ UpdateStatusGrid(tmpGridState, OptionModule.m_bShowGridFrame)
+ WriteMainPrivateProfileString(S_GENERAL, K_GRIDSTATE, tmpGridState.ToString())
+ EgtDraw()
+ End Sub
+
+#End Region ' StatusGridCommand
+
+#Region "GridDimensionCommand"
+
+ Public ReadOnly Property GridDimensionCommand As ICommand
+ Get
+ If m_cmdGridDimension Is Nothing Then
+ m_cmdGridDimension = New Command(AddressOf GridDimension)
+ End If
+ Return m_cmdGridDimension
+ End Get
+ End Property
+
+ Public Sub GridDimension(ByVal param As Object)
+ If OptionModule.m_bMmUnits Then
+ StringToLen(m_GridDimensionText, OptionModule.m_dSnapStepMm)
+ EgtSetGridGeo(OptionModule.m_dSnapStepMm, OptionModule.m_nMinLineSStep, OptionModule.m_nMajLineSStep, OptionModule.m_nExtSStep)
+ Else
+ StringToLen(m_GridDimensionText, OptionModule.m_dSnapStepInch)
+ EgtSetGridGeo(OptionModule.m_dSnapStepInch, OptionModule.m_nMinLineSStep, OptionModule.m_nMajLineSStep, OptionModule.m_nExtSStep)
+ End If
+ EgtSetGridColor(OptionModule.m_MinLnColor, OptionModule.m_MajLnColor)
+ Keyboard.ClearFocus()
+ EgtDraw()
+ End Sub
+
+#End Region ' GridDimensionCommand
+
+#Region "StatusUnitsCommand"
+
+ Public ReadOnly Property StatusUnitsCommand As ICommand
+ Get
+ If m_cmdStatusUnits Is Nothing Then
+ m_cmdStatusUnits = New Command(AddressOf StatusUnits)
+ End If
+ Return m_cmdStatusUnits
+ End Get
+ End Property
+
+ Public Sub StatusUnits(ByVal param As Object)
+ Map.refSceneHostVM.StatusUnitsCommand()
+ If OptionModule.m_bMmUnits Then
+ m_GridDimensionText = LenToString(OptionModule.m_dSnapStepMm, 4)
+ Else
+ m_GridDimensionText = LenToString(OptionModule.m_dSnapStepInch, 4)
+ End If
+ WriteMainPrivateProfileString(S_SCENE, K_MMUNITS, If(OptionModule.m_bMmUnits, 1, 0).ToString())
+ End Sub
+
+#End Region ' StatusUnitsCommand
+
+#End Region ' Commands
+
+End Class
\ No newline at end of file
diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb
index 9c9a9e7..ec566d0 100644
--- a/My Project/AssemblyInfo.vb
+++ b/My Project/AssemblyInfo.vb
@@ -12,8 +12,8 @@ Imports System.Windows
' Controllare i valori degli attributi degli assembly
-
-
+
+
diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb
index c0d4348..7ec9e73 100644
--- a/OptionsWindow/OptionModule.vb
+++ b/OptionsWindow/OptionModule.vb
@@ -41,6 +41,20 @@ Friend Module OptionModule
' selezione tema toppanel (default=0)
Friend m_SelectedThemaTopPanel As Integer = 0
+ Friend m_bShowGridFrame As Boolean
+ Friend m_bGridState As Integer
+
+ Friend m_bMmUnits As Boolean
+
+ Friend m_MinLnColor As Color3d
+ Friend m_MajLnColor As Color3d
+
+ Friend m_dSnapStepMm As Double
+ Friend m_dSnapStepInch As Double
+ Friend m_nMinLineSStep As Integer
+ Friend m_nMajLineSStep As Integer
+ Friend m_nExtSStep As Integer
+
#End Region ' Fields & Properties
#Region "METHODS"
@@ -108,6 +122,19 @@ Friend Module OptionModule
m_SelectedThema = GetMainPrivateProfileInt(S_GENERAL, K_THEMA, 0)
' imposto il tema toppanel
m_SelectedThemaTopPanel = GetMainPrivateProfileInt(S_GENERAL, K_TOPPANEL, 0)
+ m_bShowGridFrame = (GetMainPrivateProfileInt(S_GRID, K_SHOWFRAME, 1) <> 0)
+ m_bGridState = GetMainPrivateProfileInt(S_GENERAL, K_GRIDSTATE, 1)
+ ' imposto unità di misura per interfaccia utente
+ m_bMmUnits = (GetMainPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0)
+ m_MinLnColor = New Color3d(160, 160, 160)
+ GetMainPrivateProfileColor(S_GRID, K_MINLNCOLOR, m_MinLnColor)
+ m_MajLnColor = New Color3d(160, 160, 160)
+ GetMainPrivateProfileColor(S_GRID, K_MINLNCOLOR, m_MajLnColor)
+ m_dSnapStepMm = GetMainPrivateProfileDouble(S_GRID, K_SNAPSTEP, 10)
+ m_dSnapStepInch = GetMainPrivateProfileDouble(S_GRID, K_SNAPSTEPINCH, 10)
+ m_nMinLineSStep = GetMainPrivateProfileInt(S_GRID, K_MINLINESSTEP, 1)
+ m_nMajLineSStep = GetMainPrivateProfileInt(S_GRID, K_MAJLINESSTEP, 10)
+ m_nExtSStep = GetMainPrivateProfileInt(S_GRID, K_EXTSSTEP, 50)
End Sub
#End Region ' Methods
diff --git a/OptionsWindow/OptionWindowV.xaml b/OptionsWindow/OptionWindowV.xaml
index 2a577c1..15f6859 100644
--- a/OptionsWindow/OptionWindowV.xaml
+++ b/OptionsWindow/OptionWindowV.xaml
@@ -4,6 +4,7 @@
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
xmlns:EgtStone3D="clr-namespace:EgtStone3D"
Title="{Binding Title}"
+ Icon="/Resources/EgalwareLogo.ico"
WindowStartupLocation="CenterOwner"
Style="{StaticResource OptionWindowV_Window}">
diff --git a/Resources/EgalwareLogo.ico b/Resources/EgalwareLogo.ico
index 6868d9d..ae933b7 100644
Binary files a/Resources/EgalwareLogo.ico and b/Resources/EgalwareLogo.ico differ
diff --git a/SceneHost/MySceneHostVM.vb b/SceneHost/MySceneHostVM.vb
index 7a58596..0a3d0c5 100644
--- a/SceneHost/MySceneHostVM.vb
+++ b/SceneHost/MySceneHostVM.vb
@@ -16,6 +16,13 @@ Public Class MySceneHostVM
' Flag per distinguere tra Save a SaveAs
Private m_bIsSaveAs As Boolean = False
+ Private m_GridPanelVM As GridPanelVM
+ Friend ReadOnly Property GridPanelVM As GridPanelVM
+ Get
+ Return m_GridPanelVM
+ End Get
+ End Property
+
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
@@ -33,6 +40,9 @@ Public Class MySceneHostVM
AssLogM.InitAssLog()
Map.SetRefSceneHostVM(Me)
+
+ ' Creo GridPanel
+ m_GridPanelVM = New GridPanelVM
End Sub
#End Region ' Constructor
@@ -142,7 +152,6 @@ Public Class MySceneHostVM
' 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
@@ -180,6 +189,13 @@ Public Class MySceneHostVM
EgtSetTextureMaxLinPixels(nTxrMaxLinPix)
' tipo snap point
MainScene.SetSnapPointType(SP.PT_GRID)
+ ' visualizzazione griglia
+ OptionModule.m_bShowGridFrame = (GetMainPrivateProfileInt(S_GRID, K_SHOWFRAME, 1) <> 0)
+ OptionModule.m_bGridState = GetMainPrivateProfileInt(S_GENERAL, K_GRIDSTATE, 1)
+ Map.refGridPanelVM.UpdateStatusGrid(OptionModule.m_bGridState, OptionModule.m_bShowGridFrame)
+ ' imposto unità di misura per interfaccia utente
+ OptionModule.m_bMmUnits = (GetMainPrivateProfileInt(S_SCENE, K_MMUNITS, 1) <> 0)
+ Map.refGridPanelVM.UpdateStatusUnits(OptionModule.m_bMmUnits)
End Sub
Public Overrides Function OpenProject(sFilePath As String) As Boolean
@@ -350,6 +366,22 @@ Public Class MySceneHostVM
Return bOk
End Function
+ Friend Sub StatusUnitsCommand()
+ OptionModule.m_bMmUnits = Not OptionModule.m_bMmUnits
+ Map.refGridPanelVM.UpdateStatusUnits(OptionModule.m_bMmUnits)
+ UpdateGridData()
+ EgtDraw()
+ End Sub
+
+ Private Sub UpdateGridData()
+ If OptionModule.m_bMmUnits Then
+ EgtSetGridGeo(OptionModule.m_dSnapStepMm, OptionModule.m_nMinLineSStep, OptionModule.m_nMajLineSStep, OptionModule.m_nExtSStep)
+ Else
+ EgtSetGridGeo(OptionModule.m_dSnapStepInch, OptionModule.m_nMinLineSStep, OptionModule.m_nMajLineSStep, OptionModule.m_nExtSStep)
+ End If
+ EgtSetGridColor(OptionModule.m_MinLnColor, OptionModule.m_MajLnColor)
+ End Sub
+
#End Region ' Methods
#Region "EVENTS"
diff --git a/TopPanel/TopPanelV.xaml b/TopPanel/TopPanelV.xaml
index 73d2be9..006047d 100644
--- a/TopPanel/TopPanelV.xaml
+++ b/TopPanel/TopPanelV.xaml
@@ -23,6 +23,8 @@
+
+
-
+
+
@@ -50,7 +56,7 @@
-
+
diff --git a/Utility/EgtStone3DDefaultStyle.xaml b/Utility/EgtStone3DDefaultStyle.xaml
index 4039811..3a564c4 100644
--- a/Utility/EgtStone3DDefaultStyle.xaml
+++ b/Utility/EgtStone3DDefaultStyle.xaml
@@ -17,6 +17,7 @@
+
@@ -294,6 +295,11 @@
+
+
+
+
@@ -966,6 +976,11 @@
+
+
+
+
@@ -2251,6 +2272,10 @@
+
+
@@ -2276,6 +2301,14 @@
+
+
diff --git a/Utility/Map.vb b/Utility/Map.vb
index 7fa979d..b0fcaf1 100644
--- a/Utility/Map.vb
+++ b/Utility/Map.vb
@@ -11,6 +11,7 @@ Module Map
Private m_refProjManagerVM As ProjManagerVM
Private m_refViewPanelVM As ViewPanelVM
Private m_refViewPanelProspectiveVM As ViewPanelProspectiveVM
+ Private m_refGridPanelVM As GridPanelVM
Private m_refMainWindowV As MainWindowV
Private m_refSecondaryWindowV As SecondaryWindowV
@@ -64,6 +65,12 @@ Module Map
End Get
End Property
+ Public ReadOnly Property refGridPanelVM As GridPanelVM
+ Get
+ Return m_refGridPanelVM
+ End Get
+ End Property
+
Public ReadOnly Property refSceneHostV As SceneHostV
Get
Return m_refSceneHostV
@@ -139,6 +146,11 @@ Module Map
Return Not IsNothing(m_refViewPanelProspectiveVM)
End Function
+ Friend Function SetRefGridPanelVM(GridPanelVM As GridPanelVM) As Boolean
+ m_refGridPanelVM = GridPanelVM
+ Return Not IsNothing(m_refGridPanelVM)
+ End Function
+
Friend Function SetRefSceneHostV(SceneHostV As SceneHostV) As Boolean
m_refSceneHostV = SceneHostV
Return Not IsNothing(m_refSceneHostV)