EgtCAM5 :
- Migliorie varie.
This commit is contained in:
@@ -26,13 +26,14 @@ Namespace EgtCAM5
|
||||
Get
|
||||
If m_bfirst Then
|
||||
SceneHost = New WindowsFormsHost() With {.Child = m_ProjectScene}
|
||||
PreInitializeScene()
|
||||
If Not m_ProjectScene.Init() Then
|
||||
EgtOutLog("Error in Project scene creation")
|
||||
' Chiudo il programma
|
||||
Application.Msn.NotifyColleagues(Application.CLOSEAPPLICATIONCOMMAND)
|
||||
End If
|
||||
IniFile.m_ProjectSceneContext = m_ProjectScene.GetCtx
|
||||
InitializeEgtProject()
|
||||
PostInitializeScene()
|
||||
' inizializzo gestore lavorazioni
|
||||
EgtInitMachMgr(IniFile.m_sMachinesRoot)
|
||||
m_bfirst = False
|
||||
@@ -68,7 +69,7 @@ Namespace EgtCAM5
|
||||
Sub New()
|
||||
Me.sTabName = EgtMsg(MSG_MAINWINDOW + 1)
|
||||
Dim WinPos As New WinPos
|
||||
GetPrivateProfileWinPos(S_GENERAL, "Win1", WinPos.nflag, WinPos.nLeft, WinPos.nTop, WinPos.nWidth, WinPos.nHeight)
|
||||
GetPrivateProfileWinPos(S_GENERAL, "Win1", WinPos.nFlag, WinPos.nLeft, WinPos.nTop, WinPos.nWidth, WinPos.nHeight)
|
||||
m_GridViewPanel = New BaseWindowView
|
||||
m_GridViewPanel.DataContext = New GridViewPanelViewModel
|
||||
WinPosToWindow(m_GridViewPanel, WinPos)
|
||||
@@ -82,10 +83,15 @@ Namespace EgtCAM5
|
||||
m_DrawOptionPanel = New BaseWindowView
|
||||
m_DrawOptionPanel.DataContext = New DrawOptionPanelViewModel
|
||||
WinPosToWindow(m_DrawOptionPanel, WinPos)
|
||||
GetPrivateProfileWinPos(S_GENERAL, "Win3", WinPos.nFlag, WinPos.nLeft, WinPos.nTop, WinPos.nWidth, WinPos.nHeight)
|
||||
m_DrawOptionPanel = New BaseWindowView
|
||||
m_DrawOptionPanel.DataContext = New DrawOptionPanelViewModel
|
||||
WinPosToWindow(m_DrawOptionPanel, WinPos)
|
||||
m_DrawOptionPanel.Show()
|
||||
' Funzione che contiene la registrazione alle funzioni che permettono di visualizzare e nascondere le finestre di disegno
|
||||
ManagePanelVisibility()
|
||||
ManageClosingApplication()
|
||||
RegisterMainWindowCommands()
|
||||
' Inizializza i parametri della scena
|
||||
'InitializeEgtProject()
|
||||
RegisterControllerCommands()
|
||||
@@ -102,7 +108,43 @@ Namespace EgtCAM5
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Private Sub InitializeEgtProject()
|
||||
Private Sub PreInitializeScene()
|
||||
' imposto colore di default
|
||||
Dim DefColor As New Color3d(0, 0, 0)
|
||||
GetPrivateProfileColor(S_GEOMDB, K_DEFAULTCOLOR, DefColor)
|
||||
m_ProjectScene.SetDefaultMaterial(DefColor)
|
||||
' imposto colori sfondo
|
||||
Dim BackTopColor As New Color3d(192, 192, 192)
|
||||
GetPrivateProfileColor(S_SCENE, K_BACKTOP, BackTopColor)
|
||||
Dim BackBotColor As New Color3d(BackTopColor)
|
||||
GetPrivateProfileColor(S_SCENE, K_BACKBOTTOM, BackBotColor)
|
||||
m_ProjectScene.SetViewBackground(BackTopColor, BackBotColor)
|
||||
' imposto colore di evidenziazione
|
||||
Dim MarkColor As New Color3d(255, 255, 0)
|
||||
GetPrivateProfileColor(S_SCENE, K_MARK, MarkColor)
|
||||
m_ProjectScene.SetMarkMaterial(MarkColor)
|
||||
' imposto colore per superfici selezionate
|
||||
Dim SelSurfColor As New Color3d(255, 255, 192)
|
||||
GetPrivateProfileColor(S_SCENE, K_SELSURF, SelSurfColor)
|
||||
m_ProjectScene.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)
|
||||
m_ProjectScene.SetZoomWinAttribs(bOutline, ZwColor)
|
||||
' imposto colore della linea di distanza
|
||||
Dim DstLnColor As New Color3d(255, 0, 0)
|
||||
GetPrivateProfileColor(S_SCENE, K_DISTLINE, DstLnColor)
|
||||
m_ProjectScene.SetDistLineMaterial(DstLnColor)
|
||||
' imposto parametri OpenGL
|
||||
Dim nDriver As Integer = GetPrivateProfileInt(S_OPENGL, K_DRIVER, 3)
|
||||
Dim b2Buff As Boolean = (GetPrivateProfileInt(S_OPENGL, K_DOUBLEBUFFER, 1) <> 0)
|
||||
Dim nColorBits As Integer = GetPrivateProfileInt(S_OPENGL, K_COLORBITS, 32)
|
||||
Dim nDepthBits As Integer = GetPrivateProfileInt(S_OPENGL, K_DEPTHBITS, 32)
|
||||
m_ProjectScene.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
|
||||
End Sub
|
||||
|
||||
Private Sub PostInitializeScene()
|
||||
'Impostazioni Controller
|
||||
m_Controller.SetScene(m_ProjectScene)
|
||||
Dim bLuaReg As Boolean = (GetPrivateProfileInt(S_GENERAL, K_COMMANDLOG, 0) <> 0)
|
||||
@@ -143,6 +185,7 @@ Namespace EgtCAM5
|
||||
' visualizzazione avanzata dei triangoli costituenti le superfici
|
||||
Dim bShowTriaAdv As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0)
|
||||
EgtSetShowTriaAdv(bShowTriaAdv)
|
||||
Application.Msn.NotifyColleagues(Application.PROJECTPAGE_DRAWMODE)
|
||||
' ObjTree non selezionato
|
||||
Application.Msn.NotifyColleagues(Application.UPDATEOBJTREEOLDID, GDB_ID.NULL)
|
||||
' nascondo input box
|
||||
@@ -180,6 +223,18 @@ Namespace EgtCAM5
|
||||
m_DrawPanel.Visibility = Visibility.Hidden
|
||||
m_DrawOptionPanel.Visibility = Visibility.Hidden
|
||||
End Sub)
|
||||
Application.Msn.Register(Application.PROJECTPAGE_DRAWMODE, Sub()
|
||||
Me.sTabName = EgtMsg(MSG_MAINWINDOW + 1)
|
||||
m_GridViewPanel.Visibility = Visibility.Visible
|
||||
m_DrawPanel.Visibility = Visibility.Visible
|
||||
m_DrawOptionPanel.Visibility = Visibility.Visible
|
||||
End Sub)
|
||||
Application.Msn.Register(Application.PROJECTPAGE_MACHININGMODE, Sub()
|
||||
Me.sTabName = EgtMsg(MSG_MAINWINDOW + 2)
|
||||
m_GridViewPanel.Visibility = Visibility.Visible
|
||||
m_DrawPanel.Visibility = Visibility.Hidden
|
||||
m_DrawOptionPanel.Visibility = Visibility.Visible
|
||||
End Sub)
|
||||
|
||||
End Sub
|
||||
|
||||
@@ -360,11 +415,11 @@ Namespace EgtCAM5
|
||||
m_Controller.ExecuteCommand(Controller.CMD.PLANE)
|
||||
End If
|
||||
End Sub)
|
||||
Application.Msn.Register(Application.DELETE, Sub()
|
||||
Application.Msn.Register(Application.DELETE, Sub()
|
||||
m_Controller.SetLastInteger(GDB_ID.SEL)
|
||||
m_Controller.ExecuteCommand(Controller.CMD.DELETE)
|
||||
End Sub)
|
||||
Application.Msn.Register(Application.CHANGECOLOR, Sub()
|
||||
Application.Msn.Register(Application.CHANGECOLOR, Sub()
|
||||
If (Keyboard.Modifiers And ModifierKeys.Control) = ModifierKeys.Control Then
|
||||
m_Controller.ExecuteCommand(Controller.CMD.CHANGEALPHA)
|
||||
ElseIf (Keyboard.Modifiers And ModifierKeys.Shift) = ModifierKeys.Shift Then
|
||||
@@ -373,7 +428,7 @@ Namespace EgtCAM5
|
||||
m_Controller.ExecuteCommand(Controller.CMD.CHANGECOLOR)
|
||||
End If
|
||||
End Sub)
|
||||
Application.Msn.Register(Application.BREAKCURVE, Sub()
|
||||
Application.Msn.Register(Application.BREAKCURVE, Sub()
|
||||
If (Keyboard.Modifiers And ModifierKeys.Shift) <> ModifierKeys.Shift Then
|
||||
m_Controller.ExecuteCommand(Controller.CMD.BREAKCURVE)
|
||||
Else
|
||||
@@ -459,11 +514,13 @@ Namespace EgtCAM5
|
||||
End Sub)
|
||||
End Sub
|
||||
|
||||
|
||||
Sub RegisterMainWindowCommands()
|
||||
Application.Msn.Register(Application.LOADGRIDDATA, Sub()
|
||||
LoadGridData()
|
||||
End Sub)
|
||||
Application.Msn.Register(Application.RESETSTATUS, Sub()
|
||||
m_Controller.ResetStatus()
|
||||
End Sub)
|
||||
End Sub
|
||||
|
||||
Private Sub ManageTopCommandBar()
|
||||
|
||||
Reference in New Issue
Block a user