Compare commits
130 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9da749521e | |||
| 4c7c851394 | |||
| 977f82ce26 | |||
| bab91a1bc3 | |||
| 32a4faf865 | |||
| f80713f319 | |||
| c88a08b184 | |||
| ffb8a286d3 | |||
| c8d2ecbdf4 | |||
| 29b1b3015b | |||
| b0ec70e41b | |||
| 8855baee98 | |||
| 7f65ab2f3c | |||
| e5bac5efd0 | |||
| b292501937 | |||
| f6849544c7 | |||
| 3d6a7029c0 | |||
| 63ba7a28b9 | |||
| 58d8b6d5ac | |||
| ce64550938 | |||
| cd8d77bb81 | |||
| 2d45e514f7 | |||
| bc9617ce5b | |||
| 7276832d88 | |||
| c838f991a5 | |||
| 3d6b9178d5 | |||
| 0800f5fcc8 | |||
| 5a836adfcc | |||
| 5a3ec874d1 | |||
| 0cf1126602 | |||
| 87467f9bc7 | |||
| 07354d2812 | |||
| 64e7c0fa87 | |||
| c7db73f7a4 | |||
| 5cb20f7e75 | |||
| 985bf10cdc | |||
| b55bdf06a4 | |||
| 55d3693387 | |||
| aa60d08779 | |||
| 3660656932 | |||
| 8d24eabf9d | |||
| e1980d26f4 | |||
| 97a75b9603 | |||
| fcba4bd03b | |||
| 37fb3d89a0 | |||
| 98d3329d16 | |||
| 8ad5743130 | |||
| 4324c8ffc5 | |||
| 3b1fc3053d | |||
| be8ae7194a | |||
| cc6a7f18ca | |||
| 22aa652e6b | |||
| a3fd1fdab0 | |||
| 01c515a388 | |||
| 62d273b31f | |||
| bd1578164f | |||
| 78fedd53cd | |||
| 1bdc394bfb | |||
| 71088b86b2 | |||
| 6ca35150b7 | |||
| c4a046a81b | |||
| a3ca678c43 | |||
| fb69d909e1 | |||
| e5b439ab10 | |||
| 79c9f685c9 | |||
| e9c6e20b74 | |||
| 72561f52a7 | |||
| 3e5ee6f046 | |||
| 0717bb0961 | |||
| d4cac86654 | |||
| a43bada11d | |||
| 9f49f4e4e1 | |||
| 42f60adb81 | |||
| 33251d50da | |||
| ad28068f95 | |||
| b13126475b | |||
| ca700c0ecd | |||
| d696eecf24 | |||
| 85aab4b5c3 | |||
| b4d9f24352 | |||
| 087069c464 | |||
| d46ca6b22c | |||
| af8c623219 | |||
| 2182ea7363 | |||
| 0201399559 | |||
| b65a76e42b | |||
| cfbc31cd5c | |||
| c693b67751 | |||
| 0b86c4f9b6 | |||
| 5d99adaaf9 | |||
| 02199c0d06 | |||
| c455321b66 | |||
| 4001f95c8a | |||
| f753bdc786 | |||
| 8231d0dd46 | |||
| b7e8c8bdaf | |||
| f337dd28d9 | |||
| 927f874604 | |||
| f27a3ae198 | |||
| 50cded7910 | |||
| 9a8fc10e24 | |||
| 57dbf6bd0b | |||
| 4dcf4a13b0 | |||
| d430b6b282 | |||
| 36adf113b8 | |||
| 6cbdf8da4b | |||
| 11a84b6e76 | |||
| d9c24e0f45 | |||
| 3451e90aaa | |||
| abd44f85d3 | |||
| 3d2c9d5bef | |||
| 006fb21fd6 | |||
| fd5bb683a1 | |||
| bf7048c660 | |||
| 25976f7ed0 | |||
| 2aa6c8d90f | |||
| 9a84ad59be | |||
| 21bdc31c96 | |||
| 5da51a5944 | |||
| 00ae3924d3 | |||
| a9f7954d23 | |||
| d43129324d | |||
| 5410e0fa02 | |||
| f2533d3422 | |||
| 3f8f669ad8 | |||
| 94574534fd | |||
| 0967d02374 | |||
| 3e28a8ee4b | |||
| 2e1f0d0361 | |||
| 032c78a195 |
+1546
-245
File diff suppressed because it is too large
Load Diff
+1809
-213
File diff suppressed because it is too large
Load Diff
@@ -234,6 +234,8 @@
|
||||
<Compile Include="btnZoomOut.vb">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="PluginUtility\ConstPlugin.vb" />
|
||||
<Compile Include="PluginUtility\IControl.vb" />
|
||||
<Compile Include="Controller.vb" />
|
||||
<Compile Include="EgtInterface.vb" />
|
||||
<Compile Include="gbLookFrom.Designer.vb">
|
||||
@@ -258,6 +260,7 @@
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="PluginUtility\IPluginConfigData.vb" />
|
||||
<Compile Include="rbtnHiddenLine.Designer.vb">
|
||||
<DependentUpon>rbtnHiddenLine.vb</DependentUpon>
|
||||
</Compile>
|
||||
|
||||
@@ -17,7 +17,7 @@ Imports System.Runtime.InteropServices
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("Egalware s.r.l.")>
|
||||
<Assembly: AssemblyProduct("EgtUILib")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2014-2022 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2014-2026 by Egalware s.r.l.")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
@@ -35,5 +35,5 @@ Imports System.Runtime.InteropServices
|
||||
' È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
|
||||
' utilizzando l'asterisco (*) come descritto di seguito:
|
||||
|
||||
<Assembly: AssemblyVersion("2.4.6.1")>
|
||||
<Assembly: AssemblyFileVersion("2.4.6.1")>
|
||||
<Assembly: AssemblyVersion("3.1.4.1")>
|
||||
<Assembly: AssemblyFileVersion("3.1.4.1")>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
Public Module ConstPlugin
|
||||
|
||||
Public Const PLUGIN_CONFIGURATION_DATA As String = "ConfigurationData"
|
||||
|
||||
Public Const PLUGIN_LEFT_TRAY As String = "LeftTray"
|
||||
Public Const PLUGIN_RIGHT_TRAY As String = "RightTray"
|
||||
|
||||
End Module
|
||||
@@ -0,0 +1,8 @@
|
||||
Public Interface IPluginControl
|
||||
|
||||
ReadOnly Property DockSide As DockStyle
|
||||
|
||||
Event UpdateProjectName(ProjectName As String)
|
||||
Event UpdateUI()
|
||||
|
||||
End Interface
|
||||
@@ -0,0 +1,38 @@
|
||||
Imports System.Collections.Generic
|
||||
|
||||
Public Interface IPluginConfigData
|
||||
|
||||
ReadOnly Property ControlList As List(Of PluginControl)
|
||||
|
||||
End Interface
|
||||
|
||||
' visibilita' dei pannelli grafici
|
||||
Public Enum ViewPanelStates As Integer
|
||||
NEVER = 0
|
||||
ONLYDRAW = 1
|
||||
ONLYMACHINING = 2
|
||||
ALWAYS = 3
|
||||
End Enum
|
||||
|
||||
Public Class PluginControl
|
||||
|
||||
Private m_ViewPanelState As ViewPanelStates
|
||||
Public ReadOnly Property ViewPanelState As ViewPanelStates
|
||||
Get
|
||||
Return m_ViewPanelState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_Name As String
|
||||
Public ReadOnly Property Name As String
|
||||
Get
|
||||
Return m_Name
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(Name As String, ViewPanelState As ViewPanelStates)
|
||||
m_Name = Name
|
||||
m_ViewPanelState = ViewPanelState
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
Generated
+25
-17
@@ -24,11 +24,12 @@ Partial Class Scene
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Me.MenuScene = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.cmdSelectAll = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.cmdSelectAllVisible = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.cmdSelectAll = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.cmdDeselectAll = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.sepSel1 = New System.Windows.Forms.ToolStripSeparator()
|
||||
Me.cmdWinSelect = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.cmdColorSelect = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.cmdSelectPart = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.cmdSelectLayer = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.cmdSelectPath = New System.Windows.Forms.ToolStripMenuItem()
|
||||
@@ -51,23 +52,17 @@ Partial Class Scene
|
||||
Me.cmdExcludeSurfFromSnap = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.sepSelPnt2 = New System.Windows.Forms.ToolStripSeparator()
|
||||
Me.cmdStopDrag = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.MenuScene.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
Me.MenuScene.SuspendLayout
|
||||
Me.SuspendLayout
|
||||
'
|
||||
'MenuScene
|
||||
'
|
||||
Me.MenuScene.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cmdSelectAllVisible, Me.cmdSelectAll, Me.cmdDeselectAll, Me.sepSel1, Me.cmdWinSelect, Me.cmdSelectPart, Me.cmdSelectLayer, Me.cmdSelectPath, Me.cmdSelectPathAuto, Me.cmdSelectEntity, Me.cmdRestartDrag, Me.cmdSketchPoint, Me.cmdGridPoint, Me.cmdEndPoint, Me.cmdMidPoint, Me.cmdCenterPoint, Me.cmdCentroid, Me.cmdNearPoint, Me.cmdIntersectionPoint, Me.cmdTangentPoint, Me.cmdPerpendicularPoint, Me.cmdMinDistPoint, Me.sepSelPnt1, Me.cmdExcludeSurfFromSel, Me.cmdExcludeSurfFromSnap, Me.sepSelPnt2, Me.cmdStopDrag})
|
||||
Me.MenuScene.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cmdSelectAllVisible, Me.cmdSelectAll, Me.cmdDeselectAll, Me.sepSel1, Me.cmdWinSelect, Me.cmdSelectPart, Me.cmdSelectLayer, Me.cmdSelectPath, Me.cmdSelectPathAuto, Me.cmdColorSelect, Me.cmdSelectEntity, Me.cmdRestartDrag, Me.cmdSketchPoint, Me.cmdGridPoint, Me.cmdEndPoint, Me.cmdMidPoint, Me.cmdCenterPoint, Me.cmdCentroid, Me.cmdNearPoint, Me.cmdIntersectionPoint, Me.cmdTangentPoint, Me.cmdPerpendicularPoint, Me.cmdMinDistPoint, Me.sepSelPnt1, Me.cmdExcludeSurfFromSel, Me.cmdExcludeSurfFromSnap, Me.sepSelPnt2, Me.cmdStopDrag})
|
||||
Me.MenuScene.Name = "ContextMenuStrip1"
|
||||
Me.MenuScene.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional
|
||||
Me.MenuScene.ShowCheckMargin = True
|
||||
Me.MenuScene.ShowImageMargin = False
|
||||
Me.MenuScene.Size = New System.Drawing.Size(193, 572)
|
||||
'
|
||||
'cmdSelectAll
|
||||
'
|
||||
Me.cmdSelectAll.Name = "cmdSelectAll"
|
||||
Me.cmdSelectAll.Size = New System.Drawing.Size(192, 22)
|
||||
Me.cmdSelectAll.Text = "Select All"
|
||||
Me.MenuScene.ShowCheckMargin = true
|
||||
Me.MenuScene.ShowImageMargin = false
|
||||
Me.MenuScene.Size = New System.Drawing.Size(193, 594)
|
||||
'
|
||||
'cmdSelectAllVisible
|
||||
'
|
||||
@@ -75,9 +70,16 @@ Partial Class Scene
|
||||
Me.cmdSelectAllVisible.Size = New System.Drawing.Size(192, 22)
|
||||
Me.cmdSelectAllVisible.Text = "Select All Visible"
|
||||
'
|
||||
'cmdSelectAll
|
||||
'
|
||||
Me.cmdSelectAll.Name = "cmdSelectAll"
|
||||
Me.cmdSelectAll.Size = New System.Drawing.Size(192, 22)
|
||||
Me.cmdSelectAll.Text = "Select All"
|
||||
'
|
||||
'cmdDeselectAll
|
||||
'
|
||||
Me.cmdDeselectAll.Name = "cmdDeselectAll"
|
||||
Me.cmdDeselectAll.ShortcutKeyDisplayString = "End"
|
||||
Me.cmdDeselectAll.Size = New System.Drawing.Size(192, 22)
|
||||
Me.cmdDeselectAll.Text = "Deselect All"
|
||||
'
|
||||
@@ -93,6 +95,12 @@ Partial Class Scene
|
||||
Me.cmdWinSelect.Size = New System.Drawing.Size(192, 22)
|
||||
Me.cmdWinSelect.Text = "Select Window"
|
||||
'
|
||||
'cmdColorSelect
|
||||
'
|
||||
Me.cmdColorSelect.Name = "cmdColorSelect"
|
||||
Me.cmdColorSelect.Size = New System.Drawing.Size(192, 22)
|
||||
Me.cmdColorSelect.Text = "Select Color"
|
||||
'
|
||||
'cmdSelectPart
|
||||
'
|
||||
Me.cmdSelectPart.Name = "cmdSelectPart"
|
||||
@@ -239,14 +247,14 @@ Partial Class Scene
|
||||
'
|
||||
'Scene
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6!, 13!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ContextMenuStrip = Me.MenuScene
|
||||
Me.Cursor = System.Windows.Forms.Cursors.Cross
|
||||
Me.Margin = New System.Windows.Forms.Padding(0)
|
||||
Me.Name = "Scene"
|
||||
Me.MenuScene.ResumeLayout(False)
|
||||
Me.ResumeLayout(False)
|
||||
Me.MenuScene.ResumeLayout(false)
|
||||
Me.ResumeLayout(false)
|
||||
|
||||
End Sub
|
||||
Friend WithEvents MenuScene As System.Windows.Forms.ContextMenuStrip
|
||||
@@ -277,5 +285,5 @@ End Sub
|
||||
Friend WithEvents cmdExcludeSurfFromSel As System.Windows.Forms.ToolStripMenuItem
|
||||
Friend WithEvents cmdSelectEntity As System.Windows.Forms.ToolStripMenuItem
|
||||
Friend WithEvents cmdSelectAllVisible As System.Windows.Forms.ToolStripMenuItem
|
||||
|
||||
Friend WithEvents cmdColorSelect As ToolStripMenuItem
|
||||
End Class
|
||||
|
||||
@@ -20,9 +20,16 @@ Public Class Scene
|
||||
|
||||
'---- Constants -------
|
||||
Public Const DIM_SEL As Integer = 13
|
||||
Public Enum MODKEY As Integer
|
||||
NONE = 0
|
||||
SHIFT = 1
|
||||
CTRL = 2
|
||||
ALT = 3
|
||||
End Enum
|
||||
|
||||
'---- Members ---------
|
||||
Private m_nGseContext As Integer
|
||||
Private m_bEnabled As Boolean = True
|
||||
Private m_nStatus As ST = ST.NULL
|
||||
Private m_nOldStatus As ST = ST.NULL
|
||||
Private Enum ST As Integer
|
||||
@@ -41,6 +48,7 @@ Public Class Scene
|
||||
GETDIST2
|
||||
SELPOINT
|
||||
SELPOINTZ
|
||||
SELCOLOR
|
||||
End Enum
|
||||
Private m_nSnapType As SP = SP.PT_GRID ' tipo di snap in selezione punto
|
||||
Private m_bAlsoSelDir As Boolean = False ' abilita anche selezione direzione quando selezione punto
|
||||
@@ -69,6 +77,7 @@ Public Class Scene
|
||||
Private m_DefColor As Color3d
|
||||
Private m_nLineWidth As Integer
|
||||
Private m_MarkColor As Color3d
|
||||
Private m_Mark2Color As Color3d
|
||||
Private m_SelSurfColor As Color3d
|
||||
Private m_bZwOutline As Boolean
|
||||
Private m_ZwColor As Color3d
|
||||
@@ -84,6 +93,7 @@ Public Class Scene
|
||||
SetStyle(ControlStyles.UserPaint, True)
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint, True)
|
||||
m_nGseContext = 0
|
||||
m_bEnabled = True
|
||||
m_nStatus = ST.SEL
|
||||
m_nOldStatus = ST.SEL
|
||||
m_nSnapType = SP.PT_GRID
|
||||
@@ -110,6 +120,7 @@ Public Class Scene
|
||||
m_DefColor.Setup(255, 165, 0)
|
||||
m_nLineWidth = 1
|
||||
m_MarkColor.Setup(255, 255, 0)
|
||||
m_Mark2Color.Setup(255, 96, 96)
|
||||
m_SelSurfColor.Setup(255, 255, 192)
|
||||
m_bZwOutline = True
|
||||
m_ZwColor.Setup(0, 0, 0)
|
||||
@@ -164,6 +175,10 @@ Public Class Scene
|
||||
m_MarkColor = DefColor
|
||||
End Sub
|
||||
|
||||
Public Sub SetMark2Material(ByRef DefColor As Color3d)
|
||||
m_Mark2Color = DefColor
|
||||
End Sub
|
||||
|
||||
Public Sub SetSelSurfMaterial(ByRef DefColor As Color3d)
|
||||
m_SelSurfColor = DefColor
|
||||
End Sub
|
||||
@@ -190,7 +205,7 @@ Public Class Scene
|
||||
EgtInitScene( Handle, m_nDriver, m_b2Buff, m_nColorBits, m_nDepthBits)
|
||||
EgtSetBackground( m_BackTopColor, m_BackBotColor)
|
||||
EgtSetLineAttribs( m_nLineWidth)
|
||||
EgtSetMarkAttribs( m_MarkColor)
|
||||
EgtSetMarkAttribs( m_MarkColor, m_Mark2Color)
|
||||
EgtSetSelSurfAttribs( m_SelSurfColor)
|
||||
EgtSetWinRectAttribs( m_bZwOutline, m_ZwColor)
|
||||
EgtSetGeoLineAttribs( m_DstLnColor)
|
||||
@@ -208,16 +223,24 @@ Public Class Scene
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub Enable( bEnable As Boolean)
|
||||
m_bEnabled = bEnable
|
||||
End Sub
|
||||
|
||||
Public Function IsEnabled() As Boolean
|
||||
Return m_bEnabled
|
||||
End Function
|
||||
|
||||
Public Function GetCtx() As Integer
|
||||
Return m_nGseContext
|
||||
End Function
|
||||
|
||||
Protected Overrides Sub OnPaint(e As PaintEventArgs)
|
||||
MyBase.OnPaint(e)
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Se contesto non valido, esco subito
|
||||
If m_nGseContext = 0 Then
|
||||
Return
|
||||
End If
|
||||
If m_nGseContext = 0 Then Return
|
||||
' Salvo il contesto corrente e imposto quello della scena
|
||||
Dim nOldGseCtx = EgtGetCurrentContext()
|
||||
If nOldGseCtx <> m_nGseContext Then
|
||||
@@ -237,10 +260,10 @@ Public Class Scene
|
||||
|
||||
Protected Overrides Sub OnResize(e As System.EventArgs)
|
||||
MyBase.OnResize(e)
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Se contesto non valido, esco subito
|
||||
If m_nGseContext = 0 Then
|
||||
Return
|
||||
End If
|
||||
If m_nGseContext = 0 Then Return
|
||||
' Salvo il contesto corrente e imposto quello della scena
|
||||
Dim nOldGseCtx = EgtGetCurrentContext()
|
||||
If nOldGseCtx <> m_nGseContext Then
|
||||
@@ -260,12 +283,14 @@ Public Class Scene
|
||||
Public Event OnMouseSelectedAll(sender As Object, bOnlyVisible As Boolean)
|
||||
Public Event OnMouseDeselectedAll(sender As Object)
|
||||
Public Event OnMouseSelectedObj(sender As Object, nId As Integer, bLast As Boolean)
|
||||
Public Event OnMouseSelectedColor(sender As Object, nId As Integer)
|
||||
Public Event OnMouseSelectedPart(sender As Object, nId As Integer)
|
||||
Public Event OnMouseSelectedLayer(sender As Object, nId As Integer)
|
||||
Public Event OnMouseSelectedPath(sender As Object, nId As Integer, bHaltOnFork As Boolean)
|
||||
Public Event OnMouseAnalyzed(sender As Object, nId As Integer)
|
||||
Public Event OnMouseAnalyzedEx(sender As Object, nId As Integer, nSub As Integer, ptP As Point3d)
|
||||
Public Event OnMouseAnalyzedEx(sender As Object, nId As Integer, nSub As Integer, ptP As Point3d, nModKey As Integer)
|
||||
Public Event OnMousePointFromSelection(sender As Object, nId As Integer, PtP As Point3d, nAux As Integer)
|
||||
Public Event OnStartingMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs, ByRef bContinue As Boolean)
|
||||
Public Event OnMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
Public Event OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
Public Event OnMouseMoveScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||
@@ -279,18 +304,42 @@ Public Class Scene
|
||||
Public Event OnMouseSelectedDir(sender As Object, VtDir As Vector3d)
|
||||
Public Event OnMouseMoveSelPoint(sender As Object, PtP As Point3d)
|
||||
Public Event OnChangedSnapPointType(sender As Object, nSpType As SP, bForced As Boolean)
|
||||
Public Event OnStartingMouseSelectingObj(sender As Object)
|
||||
Public Event OnMouseSelectingObj(sender As Object, nId As Integer, ByRef bOk As Boolean)
|
||||
|
||||
'---- Mouse -----------
|
||||
Private m_bSetFocusOnMove As Boolean = True
|
||||
Private m_dSfBordPuXm As Double = 0.15
|
||||
Private m_dSfBordPuXp As Double = 0.15
|
||||
Private m_dSfBordPuYm As Double = 0.15
|
||||
Private m_dSfBordPuYp As Double = 0.15
|
||||
|
||||
Public Sub SetFocusOnMove(bVal As Boolean)
|
||||
Public Sub SetFocusOnMove(bVal As Boolean, Optional dBordPuXm As Double = 0.15, Optional dBordPuXp As Double = 0.15,
|
||||
Optional dBordPuYm As Double = 0.15, Optional dBordPuYp As Double = 0.15)
|
||||
m_bSetFocusOnMove = bVal
|
||||
m_dSfBordPuXm = dBordPuXm
|
||||
m_dSfBordPuXp = dBordPuXp
|
||||
m_dSfBordPuYm = dBordPuYm
|
||||
m_dSfBordPuYp = dBordPuYp
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub OnMouseDown(e As System.Windows.Forms.MouseEventArgs)
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Imposto il contesto della scena
|
||||
EgtSetCurrentContext(m_nGseContext)
|
||||
' Evento preliminare che può essere gestito da altri
|
||||
Dim bContinue As Boolean = True
|
||||
RaiseEvent OnStartingMouseDownScene(Me, e, bContinue)
|
||||
if Not bContinue Then
|
||||
if e.Button <> Windows.Forms.MouseButtons.Left AndAlso
|
||||
e.Button <> Windows.Forms.MouseButtons.Middle AndAlso
|
||||
e.Button <> Windows.Forms.MouseButtons.Right Then
|
||||
MyBase.OnMouseDown(e)
|
||||
End If
|
||||
Focus()
|
||||
Return
|
||||
End If
|
||||
' --- Pressione tasto sinistro ---
|
||||
If e.Button = Windows.Forms.MouseButtons.Left Then
|
||||
' se stato WINSEL oppure SEL e premuto SHIFT allora inizio selezione a finestra
|
||||
@@ -315,8 +364,8 @@ Public Class Scene
|
||||
End If
|
||||
m_nStatus = ST.SEL
|
||||
End If
|
||||
' se stato SEL, SELPART, SELLAYER
|
||||
ElseIf m_nStatus = ST.SEL Or m_nStatus = ST.SELPART Or m_nStatus = ST.SELLAYER Then
|
||||
' se stato SEL, SELCOLOR, SELPART, SELLAYER
|
||||
ElseIf m_nStatus = ST.SEL Or m_nStatus = ST.SELCOLOR Or m_nStatus = ST.SELPART Or m_nStatus = ST.SELLAYER Then
|
||||
' SEL + Ctrl + Alt --> SELLAYER
|
||||
If m_nStatus = ST.SEL And (ModifierKeys And Keys.Control) = Keys.Control And (ModifierKeys And Keys.Alt) = Keys.Alt Then m_nStatus = ST.SELLAYER
|
||||
' SEL + Alt --> SELPART
|
||||
@@ -328,6 +377,8 @@ Public Class Scene
|
||||
Select Case m_nStatus
|
||||
Case ST.SEL
|
||||
RaiseEvent OnMouseSelectedObj(Me, nId, True)
|
||||
Case ST.SELCOLOR
|
||||
RaiseEvent OnMouseSelectedColor(Me, nId)
|
||||
Case ST.SELPART
|
||||
RaiseEvent OnMouseSelectedPart(Me, nId)
|
||||
Case ST.SELLAYER
|
||||
@@ -358,6 +409,14 @@ Public Class Scene
|
||||
m_PrevPoint = e.Location
|
||||
' se stato ANALYZE
|
||||
ElseIf m_nStatus = ST.ANALYZE Then
|
||||
Dim nModKey As Integer = MODKEY.NONE
|
||||
If (ModifierKeys And Keys.Shift) = Keys.Shift Then
|
||||
nModKey = MODKEY.SHIFT
|
||||
ElseIf (ModifierKeys And Keys.Control) = Keys.Control Then
|
||||
nModKey = MODKEY.CTRL
|
||||
ElseIf (ModifierKeys And Keys.Alt) = Keys.Alt Then
|
||||
nModKey = MODKEY.ALT
|
||||
End If
|
||||
EgtSetObjFilterForSelWin(m_bZeroDimForSel, m_bCurveForSel, m_bSurfForSel, m_bVolumeForSel, m_bExtraForSel)
|
||||
Dim nId As Integer = ChooseOneSelectedObj(e.Location, m_nStatus)
|
||||
If nId <> GDB_ID.NULL Then
|
||||
@@ -367,7 +426,7 @@ Public Class Scene
|
||||
Dim PtTemp As Point3d
|
||||
Dim nAux As Integer = -1
|
||||
EgtGetPointFromSelect(nId, e.Location, PtTemp, nAux)
|
||||
RaiseEvent OnMouseAnalyzedEx( Me, nId, nAux, PtTemp)
|
||||
RaiseEvent OnMouseAnalyzedEx( Me, nId, nAux, PtTemp, nModKey)
|
||||
End If
|
||||
' se stato GETDIST (primo punto per misura di distanza)
|
||||
ElseIf m_nStatus = ST.GETDIST Then
|
||||
@@ -512,6 +571,8 @@ Public Class Scene
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub OnMouseUp(e As System.Windows.Forms.MouseEventArgs)
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' salvo il contesto corrente e imposto quello della scena
|
||||
Dim nOldGseCtx = EgtGetCurrentContext()
|
||||
If nOldGseCtx <> m_nGseContext Then EgtSetCurrentContext(m_nGseContext)
|
||||
@@ -530,6 +591,7 @@ Public Class Scene
|
||||
Dim nSel As Integer
|
||||
EgtSelect(Center, nH, nW, nSel)
|
||||
' filtro custom e notifico per ogni entità selezionata
|
||||
RaiseEvent OnStartingMouseSelectingObj(Me)
|
||||
Dim nLastId = GDB_ID.NULL
|
||||
Dim nId = EgtGetFirstObjInSelWin()
|
||||
While nId <> GDB_ID.NULL
|
||||
@@ -577,16 +639,17 @@ Public Class Scene
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub OnMouseMove(e As System.Windows.Forms.MouseEventArgs)
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Salvo il contesto corrente e imposto quello della scena
|
||||
Dim nOldGseCtx = EgtGetCurrentContext()
|
||||
If nOldGseCtx <> m_nGseContext Then
|
||||
EgtSetCurrentContext(m_nGseContext)
|
||||
End If
|
||||
' Se sono abbastanza all'interno della scena (15% della dimensione), imposto il focus
|
||||
' Se sono abbastanza all'interno della scena (default 15% della dimensione), imposto il focus
|
||||
If m_bSetFocusOnMove Then
|
||||
Const BordPu As Double = 0.15
|
||||
If e.Location.X > BordPu * Size.Width AndAlso e.Location.X < (1 - BordPu) * Size.Width AndAlso
|
||||
e.Location.Y > BordPu * Size.Height AndAlso e.Location.Y < (1 - BordPu) * Size.Height Then
|
||||
If e.Location.X > m_dSfBordPuXm * Size.Width AndAlso e.Location.X < (1 - m_dSfBordPuXp) * Size.Width AndAlso
|
||||
e.Location.Y > m_dSfBordPuYm * Size.Height AndAlso e.Location.Y < (1 - m_dSfBordPuYp) * Size.Height Then
|
||||
Focus()
|
||||
End If
|
||||
End If
|
||||
@@ -667,6 +730,8 @@ Public Class Scene
|
||||
End Sub
|
||||
|
||||
Protected Overrides Sub OnMouseWheel(e As System.Windows.Forms.MouseEventArgs)
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' devo essere in uno stato ripristinabile
|
||||
If Not IsRestorableCurrStatus() Then
|
||||
Return
|
||||
@@ -700,6 +765,7 @@ Public Class Scene
|
||||
EgtSelect(WinXY, DIM_SEL, DIM_SEL, nSel)
|
||||
' Filtro le entità nel mirino e le inserisco in lista
|
||||
Dim vId As New List(Of Integer)
|
||||
RaiseEvent OnStartingMouseSelectingObj(Me)
|
||||
Dim nId = EgtGetFirstObjInSelWin()
|
||||
While nId <> GDB_ID.NULL
|
||||
Dim bOk As Boolean = True
|
||||
@@ -916,7 +982,8 @@ Public Class Scene
|
||||
|
||||
Private Sub PrepareMenuScene()
|
||||
' per selezione oggetti
|
||||
If m_nStatus = ST.SEL Or m_nStatus = ST.WINSEL Or m_nStatus = ST.SELPART Or m_nStatus = ST.SELLAYER Or m_nStatus = ST.SELPATH Or m_nStatus = ST.SELPATHAUTO Then
|
||||
If m_nStatus = ST.SEL Or m_nStatus = ST.WINSEL Or m_nStatus = ST.SELCOLOR Or
|
||||
m_nStatus = ST.SELPART Or m_nStatus = ST.SELLAYER Or m_nStatus = ST.SELPATH Or m_nStatus = ST.SELPATHAUTO Then
|
||||
For Each i As ToolStripItem In MenuScene.Items
|
||||
Select Case i.Name
|
||||
Case "cmdSelectAllVisible"
|
||||
@@ -934,6 +1001,10 @@ Public Class Scene
|
||||
i.Text = EgtMsg(1005) ' Select Window
|
||||
i.Visible = True
|
||||
DirectCast(i, ToolStripMenuItem).Checked = (m_nStatus = ST.WINSEL)
|
||||
Case "cmdColorSelect"
|
||||
i.Text = EgtMsg(1006) ' Select Color
|
||||
i.Visible = True
|
||||
DirectCast(i, ToolStripMenuItem).Checked = (m_nStatus = ST.SELCOLOR)
|
||||
Case "cmdSelectPart"
|
||||
i.Text = EgtMsg(1007) ' Select Part
|
||||
i.Visible = True
|
||||
@@ -1074,6 +1145,8 @@ Public Class Scene
|
||||
RaiseEvent OnMouseDeselectedAll(Me)
|
||||
ElseIf e.ClickedItem.Name = "cmdWinSelect" Then
|
||||
m_nStatus = ST.WINSEL
|
||||
ElseIf e.ClickedItem.Name = "cmdColorSelect" Then
|
||||
m_nStatus = ST.SELCOLOR
|
||||
ElseIf e.ClickedItem.Name = "cmdSelectPart" Then
|
||||
m_nStatus = ST.SELPART
|
||||
ElseIf e.ClickedItem.Name = "cmdSelectLayer" Then
|
||||
@@ -1154,6 +1227,8 @@ Public Class Scene
|
||||
|
||||
'-------------------------------- KeyDown --------------------------------------------------------
|
||||
Private Sub Scene_KeyDown(sender As System.Object, e As KeyEventArgs) Handles MyBase.KeyDown
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Con selezione punti e drag abilitato
|
||||
If (m_nStatus = ST.GETDIST Or m_nStatus = ST.GETDIST2 Or m_nStatus = ST.SELPOINT) And m_bDragOn Then
|
||||
' Con 'S' imposto Punto Sketch
|
||||
@@ -1214,7 +1289,7 @@ Public Class Scene
|
||||
Private Function IsRestorableCurrStatus() As Boolean
|
||||
Select Case m_nStatus
|
||||
Case ST.NULL, ST.SEL, ST.ANALYZE, ST.SELPART, ST.SELLAYER,
|
||||
ST.SELPATH, ST.SELPATHAUTO, ST.GETDIST, ST.GETDIST2, ST.SELPOINT, ST.SELPOINTZ
|
||||
ST.SELPATH, ST.SELPATHAUTO, ST.GETDIST, ST.GETDIST2, ST.SELPOINT, ST.SELPOINTZ, ST.SELCOLOR
|
||||
Return True
|
||||
Case Else
|
||||
Return False
|
||||
@@ -1234,7 +1309,7 @@ Public Class Scene
|
||||
Cursor = Cursors.Default
|
||||
Return True
|
||||
ElseIf m_nOldStatus = ST.SEL Or m_nOldStatus = ST.SELPART Or m_nOldStatus = ST.SELLAYER Or
|
||||
m_nOldStatus = ST.SELPATH Or m_nOldStatus = ST.SELPATHAUTO Then
|
||||
m_nOldStatus = ST.SELPATH Or m_nOldStatus = ST.SELPATHAUTO Or m_nOldStatus = ST.SELCOLOR Then
|
||||
m_nStatus = m_nOldStatus
|
||||
Cursor = New Cursor(Me.GetType(), "Select.cur")
|
||||
Return True
|
||||
@@ -1456,76 +1531,130 @@ Public Class Scene
|
||||
|
||||
'---- Zoom Buttons ----
|
||||
Public Sub ZoomAll()
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Eseguo
|
||||
EgtZoom(ZM.ALL)
|
||||
End Sub
|
||||
|
||||
Public Sub ZoomIn()
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Eseguo
|
||||
EgtZoom(ZM.IN_)
|
||||
End Sub
|
||||
|
||||
Public Sub ZoomOut()
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Eseguo
|
||||
EgtZoom(ZM.OUT)
|
||||
End Sub
|
||||
|
||||
Public Sub ZoomSel()
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Eseguo
|
||||
EgtZoomObject(GDB_ID.SEL)
|
||||
End Sub
|
||||
|
||||
'---- Rendering Buttons ----
|
||||
Public Sub WireFrame()
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Eseguo
|
||||
EgtSetShowMode(SM.WIREFRAME)
|
||||
End Sub
|
||||
|
||||
Public Sub HiddenLine()
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Eseguo
|
||||
EgtSetShowMode(SM.HIDDENLINE)
|
||||
End Sub
|
||||
|
||||
Public Sub Shading()
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Eseguo
|
||||
EgtSetShowMode(SM.SHADING)
|
||||
End Sub
|
||||
|
||||
'---- LookFrom Buttons ----
|
||||
Public Sub TopView()
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Eseguo
|
||||
EgtSetView(VT.TOP)
|
||||
End Sub
|
||||
|
||||
Public Sub FrontView()
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Eseguo
|
||||
EgtSetView(VT.FRONT)
|
||||
End Sub
|
||||
|
||||
Public Sub BackView()
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Eseguo
|
||||
EgtSetView(VT.BACK)
|
||||
End Sub
|
||||
|
||||
Public Sub LeftView()
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Eseguo
|
||||
EgtSetView(VT.LEFT)
|
||||
End Sub
|
||||
|
||||
Public Sub RightView()
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Eseguo
|
||||
EgtSetView(VT.RIGHT)
|
||||
End Sub
|
||||
|
||||
Public Sub BottomView()
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Eseguo
|
||||
EgtSetView(VT.BOTTOM)
|
||||
End Sub
|
||||
|
||||
Public Sub IsoViewSW()
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Eseguo
|
||||
EgtSetView(VT.ISO_SW)
|
||||
End Sub
|
||||
|
||||
Public Sub IsoViewSE()
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Eseguo
|
||||
EgtSetView(VT.ISO_SE)
|
||||
End Sub
|
||||
|
||||
Public Sub IsoViewNE()
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Eseguo
|
||||
EgtSetView(VT.ISO_NE)
|
||||
End Sub
|
||||
|
||||
Public Sub IsoViewNW()
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Eseguo
|
||||
EgtSetView(VT.ISO_NW)
|
||||
End Sub
|
||||
|
||||
Public Sub CPlaneView()
|
||||
' Verifico abilitazione scena
|
||||
if Not m_bEnabled Then Return
|
||||
' Eseguo
|
||||
EgtSetView(VT.CPLANE)
|
||||
End Sub
|
||||
|
||||
|
||||
Reference in New Issue
Block a user