diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index b597c94..173c8d7 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -46,5 +46,5 @@ Imports System.Runtime.InteropServices ' utilizzando l'asterisco (*) come descritto di seguito: ' - - + + diff --git a/Scene.Designer.vb b/Scene.Designer.vb index 677f42d..8dcb0a5 100644 --- a/Scene.Designer.vb +++ b/Scene.Designer.vb @@ -45,7 +45,7 @@ Partial Class Scene Me.cmdPerpendicularPoint = New System.Windows.Forms.ToolStripMenuItem() Me.cmdMinDistPoint = New System.Windows.Forms.ToolStripMenuItem() Me.sepSelPnt1 = New System.Windows.Forms.ToolStripSeparator() - Me.cmdExcludeSurfForSnap = New System.Windows.Forms.ToolStripMenuItem() + Me.cmdExcludeSurf = New System.Windows.Forms.ToolStripMenuItem() Me.sepSelPnt2 = New System.Windows.Forms.ToolStripSeparator() Me.cmdStopDrag = New System.Windows.Forms.ToolStripMenuItem() Me.MenuScene.SuspendLayout() @@ -53,7 +53,7 @@ Partial Class Scene ' 'MenuScene ' - Me.MenuScene.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cmdSelectAll, Me.cmdDeselectAll, Me.sepSel1, Me.cmdWinSelect, Me.cmdSelectPart, Me.cmdSelectLayer, Me.cmdSelectPath, Me.cmdSelectPathAuto, 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.cmdExcludeSurfForSnap, Me.sepSelPnt2, Me.cmdStopDrag}) + Me.MenuScene.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cmdSelectAll, Me.cmdDeselectAll, Me.sepSel1, Me.cmdWinSelect, Me.cmdSelectPart, Me.cmdSelectLayer, Me.cmdSelectPath, Me.cmdSelectPathAuto, 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.cmdExcludeSurf, Me.sepSelPnt2, Me.cmdStopDrag}) Me.MenuScene.Name = "ContextMenuStrip1" Me.MenuScene.RenderMode = System.Windows.Forms.ToolStripRenderMode.Professional Me.MenuScene.ShowCheckMargin = True @@ -197,11 +197,11 @@ Partial Class Scene Me.sepSelPnt1.Name = "sepSelPnt1" Me.sepSelPnt1.Size = New System.Drawing.Size(189, 6) ' - 'cmdExcludeSurfForSnap + 'cmdExcludeSurf ' - Me.cmdExcludeSurfForSnap.Name = "cmdExcludeSurfForSnap" - Me.cmdExcludeSurfForSnap.Size = New System.Drawing.Size(192, 22) - Me.cmdExcludeSurfForSnap.Text = "ToolStripMenuItem1" + Me.cmdExcludeSurf.Name = "cmdExcludeSurf" + Me.cmdExcludeSurf.Size = New System.Drawing.Size(192, 22) + Me.cmdExcludeSurf.Text = "ExcludeSurf" ' 'sepSelPnt2 ' @@ -247,7 +247,7 @@ End Sub Friend WithEvents cmdPerpendicularPoint As System.Windows.Forms.ToolStripMenuItem Friend WithEvents cmdMinDistPoint As System.Windows.Forms.ToolStripMenuItem Friend WithEvents cmdCentroid As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents cmdExcludeSurfForSnap As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents cmdExcludeSurf As System.Windows.Forms.ToolStripMenuItem Friend WithEvents sepSelPnt2 As System.Windows.Forms.ToolStripSeparator Friend WithEvents cmdSelectPath As System.Windows.Forms.ToolStripMenuItem Friend WithEvents cmdSelectPathAuto As System.Windows.Forms.ToolStripMenuItem diff --git a/Scene.vb b/Scene.vb index 7071aa5..eee1dcc 100644 --- a/Scene.vb +++ b/Scene.vb @@ -45,7 +45,7 @@ Public Class Scene 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 Private m_bAlsoDragIntersForSnap As Boolean = False ' abilita intersezione con drag per snap a punto - Private m_bAlsoSurfForSnap As Boolean = False ' abilita anche le superfici come sorgenti per snap a punto + Private m_bAlsoSurfForSelSnap As Boolean = False ' abilita anche le superfici come selezione e per snap a punto Private m_PrevPoint As Point Private m_ptPrev As Point3d Private m_ptGrid As Point3d @@ -77,7 +77,7 @@ Public Class Scene m_nOldStatus = ST.SEL m_nSnapType = SP.PT_GRID m_bAlsoSelDir = False - m_bAlsoSurfForSnap = True + m_bAlsoSurfForSelSnap = True m_PrevPoint = Point.Empty m_bGridCursorPos = False m_nDriver = 3 @@ -263,7 +263,7 @@ Public Class Scene End If ' se stato SEL, SELPART, SELLAYER ElseIf m_nStatus = ST.SEL Or m_nStatus = ST.SELPART Or m_nStatus = ST.SELLAYER Then - EgtSetObjFilterForSelect(True, True, True, True, True) + EgtSetObjFilterForSelect(True, True, m_bAlsoSurfForSelSnap, True, True) Dim nId As Integer = ChooseOneSelectedObj(e.Location) If nId <> GDB_ID.NULL Then ' evento per entità selezionate @@ -300,14 +300,14 @@ Public Class Scene m_PrevPoint = e.Location ' se stato ANALYZE ElseIf m_nStatus = ST.ANALYZE Then - EgtSetObjFilterForSelect(True, True, True, True, True) + EgtSetObjFilterForSelect(True, True, m_bAlsoSurfForSelSnap, True, True) Dim nId As Integer = ChooseOneSelectedObj(e.Location) If nId <> GDB_ID.NULL Then RaiseEvent OnMouseAnalyzed(Me, nId) End If ' se stato GETDIST (primo punto per misura di distanza) ElseIf m_nStatus = ST.GETDIST Then - EgtSetObjFilterForSelect(True, True, m_bAlsoSurfForSnap, True, True) + EgtSetObjFilterForSelect(True, True, m_bAlsoSurfForSelSnap, True, True) If EgtGetGraphicSnapPoint(m_nSnapType, e.Location, DIM_SEL, DIM_SEL, m_ptPrev) Then ' salvo il punto di riferimento Dim ptWin As Point3d @@ -317,7 +317,7 @@ Public Class Scene End If ' se stato GETDIST2(secondo punto per misura di distanza) ElseIf m_nStatus = ST.GETDIST2 Then - EgtSetObjFilterForSelect(True, True, m_bAlsoSurfForSnap, True, True) + EgtSetObjFilterForSelect(True, True, m_bAlsoSurfForSelSnap, True, True) Dim ptSel As Point3d If EgtGetGraphicSnapPoint(m_nSnapType, e.Location, DIM_SEL, DIM_SEL, ptSel) Then ' disegno la linea (coordinate geo globali) @@ -343,7 +343,7 @@ Public Class Scene End If ' se stato selezione punto ElseIf m_nStatus = ST.SELPOINT Then - EgtSetObjFilterForSelect(True, True, m_bAlsoSurfForSnap, True, True) + EgtSetObjFilterForSelect(True, True, m_bAlsoSurfForSelSnap, True, True) If Not m_bDragOn Then ' rendo selezionabile gruppo di drag EgtUnselectableRemove(m_nDragGroup) @@ -449,6 +449,7 @@ Public Class Scene e.Button = Windows.Forms.MouseButtons.Middle Then If m_nStatus = ST.WINSEL Then EgtResetWinRect(True) + EgtSetObjFilterForSelect(True, True, m_bAlsoSurfForSelSnap, True, True) ' determino entità selezionate Dim Center As Point Center.X = 0.5 * (e.Location.X + m_PrevPoint.X) @@ -607,7 +608,7 @@ Public Class Scene End If ' calcolo coefficiente Const WHEEL_DELTA As Double = 120 - Dim dCoeff As Double = 1 - 0.10000000000000001 * Abs(e.Delta) / WHEEL_DELTA + Dim dCoeff As Double = 1 - 0.1 * Abs(e.Delta) / WHEEL_DELTA If e.Delta < 0 Then dCoeff = 1 / dCoeff End If @@ -805,32 +806,39 @@ Public Class Scene ' per selezione oggetti If m_nStatus = ST.SEL Then For Each i As ToolStripItem In MenuScene.Items - If i.Name = "cmdSelectAll" Then + Select Case i.Name + Case "cmdSelectAll" i.Text = EgtMsg(1001) ' Select All i.Visible = True - ElseIf i.Name = "cmdDeselectAll" Then + Case "cmdDeselectAll" i.Text = EgtMsg(1003) ' Deselect All i.Visible = True - ElseIf i.Name = "sepSel1" Then + Case "sepSel1" i.Visible = True - ElseIf i.Name = "cmdWinSelect" Then + Case "cmdWinSelect" i.Text = EgtMsg(1005) ' Select Window i.Visible = True - ElseIf i.Name = "cmdSelectPart" Then + Case "cmdSelectPart" i.Text = EgtMsg(1007) ' Select Part i.Visible = True - ElseIf i.Name = "cmdSelectLayer" Then + Case "cmdSelectLayer" i.Text = EgtMsg(1009) ' Select Layer i.Visible = True - ElseIf i.Name = "cmdSelectPath" Then + Case "cmdSelectPath" i.Text = EgtMsg(1011) ' Select Path i.Visible = True - ElseIf i.Name = "cmdSelectPathAuto" Then + Case "cmdSelectPathAuto" i.Text = EgtMsg(1013) ' Select Path Auto i.Visible = True - Else + Case "sepSelPnt1" + i.Visible = True + Case "cmdExcludeSurf" + i.Text = EgtMsg(1123) ' Exclude Surfaces + i.Visible = True + DirectCast(i, ToolStripMenuItem).Checked = Not m_bAlsoSurfForSelSnap + Case Else i.Visible = False - End If + End Select Next MenuScene.Visible = True ' per selezione punti @@ -897,10 +905,10 @@ Public Class Scene End If Case "sepSelPnt1" i.Visible = True - Case "cmdExcludeSurfForSnap" + Case "cmdExcludeSurf" i.Text = EgtMsg(1123) ' Exclude Surfaces i.Visible = True - DirectCast(i, ToolStripMenuItem).Checked = Not m_bAlsoSurfForSnap + DirectCast(i, ToolStripMenuItem).Checked = Not m_bAlsoSurfForSelSnap Case "sepSelPnt2" i.Visible = (m_nStatus <> ST.GETDIST And m_nStatus <> ST.GETDIST2) Case "cmdStopDrag" @@ -984,8 +992,8 @@ Public Class Scene m_nSnapType = SP.PT_MINDIST RaiseEvent OnChangedSnapPointType(Me, m_nSnapType, True) ' esclusione superfici da punto snap - ElseIf e.ClickedItem.Name = "cmdExcludeSurfForSnap" Then - m_bAlsoSurfForSnap = Not m_bAlsoSurfForSnap + ElseIf e.ClickedItem.Name = "cmdExcludeSurf" Then + m_bAlsoSurfForSelSnap = Not m_bAlsoSurfForSelSnap ' Sospensione drag ElseIf e.ClickedItem.Name = "cmdStopDrag" Then m_bDragOn = False @@ -1184,7 +1192,7 @@ Public Class Scene End Sub Public Sub SetSurfForSelPoint(ByVal bVal As Boolean) - m_bAlsoSurfForSnap = bVal + m_bAlsoSurfForSelSnap = bVal End Sub '---- Drag Group ------