TestEIn :

- modifiche per poter escludere superfici da snap punti.
This commit is contained in:
Dario Sassi
2015-03-12 15:50:07 +00:00
parent 75aabfcf99
commit ce1999b7bc
3 changed files with 58 additions and 26 deletions
+5
View File
@@ -1906,6 +1906,11 @@ End Function
Public Function EgtGetLastSnapDir(ByRef VtDir As Vector3d) As Boolean
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtSetObjFilterForSnap(ByVal bZeroDim As Boolean, ByVal bCurve As Boolean,
ByVal bSurf As Boolean, ByVal bVolume As Boolean, ByVal bExtra As Boolean) As Boolean
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtSetShowMode(ByVal nShowMode As SM, Optional ByVal bRedraw As Boolean = True) As Boolean
End Function
+41 -26
View File
@@ -36,6 +36,7 @@ Partial Class Scene
Me.cmdEndPoint = New System.Windows.Forms.ToolStripMenuItem()
Me.cmdMidPoint = New System.Windows.Forms.ToolStripMenuItem()
Me.cmdCenterPoint = New System.Windows.Forms.ToolStripMenuItem()
Me.cmdCentroid = New System.Windows.Forms.ToolStripMenuItem()
Me.cmdNearPoint = New System.Windows.Forms.ToolStripMenuItem()
Me.cmdIntersectionPoint = New System.Windows.Forms.ToolStripMenuItem()
Me.cmdTangentPoint = New System.Windows.Forms.ToolStripMenuItem()
@@ -43,135 +44,147 @@ Partial Class Scene
Me.cmdMinDistPoint = New System.Windows.Forms.ToolStripMenuItem()
Me.sepSelPnt1 = New System.Windows.Forms.ToolStripSeparator()
Me.cmdStopDrag = New System.Windows.Forms.ToolStripMenuItem()
Me.cmdCentroid = New System.Windows.Forms.ToolStripMenuItem()
Me.sepSelPnt2 = New System.Windows.Forms.ToolStripSeparator()
Me.cmdExcludeSurfForSnap = New System.Windows.Forms.ToolStripMenuItem()
Me.MenuScene.SuspendLayout()
Me.SuspendLayout()
'
'MenuScene
'
Me.MenuScene.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cmdSelectAll, Me.cmdDeselectAll, Me.sepSel1, Me.cmdWinSelect, Me.cmdSelectLayer, Me.cmdSelectPart, 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.cmdStopDrag})
Me.MenuScene.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cmdSelectAll, Me.cmdDeselectAll, Me.sepSel1, Me.cmdWinSelect, Me.cmdSelectLayer, Me.cmdSelectPart, 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.Name = "ContextMenuStrip1"
Me.MenuScene.ShowCheckMargin = True
Me.MenuScene.ShowImageMargin = False
Me.MenuScene.Size = New System.Drawing.Size(179, 434)
Me.MenuScene.Size = New System.Drawing.Size(184, 462)
'
'cmdSelectAll
'
Me.cmdSelectAll.Name = "cmdSelectAll"
Me.cmdSelectAll.Size = New System.Drawing.Size(178, 22)
Me.cmdSelectAll.Size = New System.Drawing.Size(183, 22)
Me.cmdSelectAll.Text = "Select All"
'
'cmdDeselectAll
'
Me.cmdDeselectAll.Name = "cmdDeselectAll"
Me.cmdDeselectAll.Size = New System.Drawing.Size(178, 22)
Me.cmdDeselectAll.Size = New System.Drawing.Size(183, 22)
Me.cmdDeselectAll.Text = "Deselect All"
'
'sepSel1
'
Me.sepSel1.Name = "sepSel1"
Me.sepSel1.Size = New System.Drawing.Size(175, 6)
Me.sepSel1.Size = New System.Drawing.Size(180, 6)
'
'cmdWinSelect
'
Me.cmdWinSelect.Name = "cmdWinSelect"
Me.cmdWinSelect.Size = New System.Drawing.Size(178, 22)
Me.cmdWinSelect.Size = New System.Drawing.Size(183, 22)
Me.cmdWinSelect.Text = "Select Window"
'
'cmdSelectLayer
'
Me.cmdSelectLayer.Name = "cmdSelectLayer"
Me.cmdSelectLayer.Size = New System.Drawing.Size(178, 22)
Me.cmdSelectLayer.Size = New System.Drawing.Size(183, 22)
Me.cmdSelectLayer.Text = "Select Layer"
'
'cmdSelectPart
'
Me.cmdSelectPart.Name = "cmdSelectPart"
Me.cmdSelectPart.Size = New System.Drawing.Size(178, 22)
Me.cmdSelectPart.Size = New System.Drawing.Size(183, 22)
Me.cmdSelectPart.Text = "Select Part"
'
'cmdRestartDrag
'
Me.cmdRestartDrag.Name = "cmdRestartDrag"
Me.cmdRestartDrag.Size = New System.Drawing.Size(178, 22)
Me.cmdRestartDrag.Size = New System.Drawing.Size(183, 22)
Me.cmdRestartDrag.Text = "Drag On"
'
'cmdSketchPoint
'
Me.cmdSketchPoint.Name = "cmdSketchPoint"
Me.cmdSketchPoint.Size = New System.Drawing.Size(178, 22)
Me.cmdSketchPoint.Size = New System.Drawing.Size(183, 22)
Me.cmdSketchPoint.Text = "Sketch Point"
'
'cmdGridPoint
'
Me.cmdGridPoint.Name = "cmdGridPoint"
Me.cmdGridPoint.Size = New System.Drawing.Size(178, 22)
Me.cmdGridPoint.Size = New System.Drawing.Size(183, 22)
Me.cmdGridPoint.Text = "Grid Point"
'
'cmdEndPoint
'
Me.cmdEndPoint.Name = "cmdEndPoint"
Me.cmdEndPoint.Size = New System.Drawing.Size(178, 22)
Me.cmdEndPoint.Size = New System.Drawing.Size(183, 22)
Me.cmdEndPoint.Text = "End Point"
'
'cmdMidPoint
'
Me.cmdMidPoint.Name = "cmdMidPoint"
Me.cmdMidPoint.Size = New System.Drawing.Size(178, 22)
Me.cmdMidPoint.Size = New System.Drawing.Size(183, 22)
Me.cmdMidPoint.Text = "Mid Point"
'
'cmdCenterPoint
'
Me.cmdCenterPoint.Name = "cmdCenterPoint"
Me.cmdCenterPoint.Size = New System.Drawing.Size(178, 22)
Me.cmdCenterPoint.Size = New System.Drawing.Size(183, 22)
Me.cmdCenterPoint.Text = "Center"
'
'cmdCentroid
'
Me.cmdCentroid.Name = "cmdCentroid"
Me.cmdCentroid.Size = New System.Drawing.Size(183, 22)
Me.cmdCentroid.Text = "Centroid"
'
'cmdNearPoint
'
Me.cmdNearPoint.Name = "cmdNearPoint"
Me.cmdNearPoint.Size = New System.Drawing.Size(178, 22)
Me.cmdNearPoint.Size = New System.Drawing.Size(183, 22)
Me.cmdNearPoint.Text = "Near Point"
'
'cmdIntersectionPoint
'
Me.cmdIntersectionPoint.Name = "cmdIntersectionPoint"
Me.cmdIntersectionPoint.Size = New System.Drawing.Size(178, 22)
Me.cmdIntersectionPoint.Size = New System.Drawing.Size(183, 22)
Me.cmdIntersectionPoint.Text = "Intersection Point"
'
'cmdTangentPoint
'
Me.cmdTangentPoint.Name = "cmdTangentPoint"
Me.cmdTangentPoint.Size = New System.Drawing.Size(178, 22)
Me.cmdTangentPoint.Size = New System.Drawing.Size(183, 22)
Me.cmdTangentPoint.Text = "Tangent Point"
'
'cmdPerpendicularPoint
'
Me.cmdPerpendicularPoint.Name = "cmdPerpendicularPoint"
Me.cmdPerpendicularPoint.Size = New System.Drawing.Size(178, 22)
Me.cmdPerpendicularPoint.Size = New System.Drawing.Size(183, 22)
Me.cmdPerpendicularPoint.Text = "Perpendicular Point"
'
'cmdMinDistPoint
'
Me.cmdMinDistPoint.Name = "cmdMinDistPoint"
Me.cmdMinDistPoint.Size = New System.Drawing.Size(178, 22)
Me.cmdMinDistPoint.Size = New System.Drawing.Size(183, 22)
Me.cmdMinDistPoint.Text = "Min Dist Point"
'
'sepSelPnt1
'
Me.sepSelPnt1.Name = "sepSelPnt1"
Me.sepSelPnt1.Size = New System.Drawing.Size(175, 6)
Me.sepSelPnt1.Size = New System.Drawing.Size(180, 6)
'
'cmdStopDrag
'
Me.cmdStopDrag.Name = "cmdStopDrag"
Me.cmdStopDrag.Size = New System.Drawing.Size(178, 22)
Me.cmdStopDrag.Size = New System.Drawing.Size(183, 22)
Me.cmdStopDrag.Text = "Drag Off"
'
'cmdCentroid
'sepSelPnt2
'
Me.cmdCentroid.Name = "cmdCentroid"
Me.cmdCentroid.Size = New System.Drawing.Size(178, 22)
Me.cmdCentroid.Text = "Centroid"
Me.sepSelPnt2.Name = "sepSelPnt2"
Me.sepSelPnt2.Size = New System.Drawing.Size(180, 6)
'
'cmdExcludeSurfForSnap
'
Me.cmdExcludeSurfForSnap.Name = "cmdExcludeSurfForSnap"
Me.cmdExcludeSurfForSnap.Size = New System.Drawing.Size(183, 22)
Me.cmdExcludeSurfForSnap.Text = "ToolStripMenuItem1"
'
'Scene
'
@@ -204,5 +217,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 sepSelPnt2 As System.Windows.Forms.ToolStripSeparator
End Class
+12
View File
@@ -42,6 +42,7 @@ Public Class Scene
End Enum
Private m_nSnapType As SP ' tipo di snap in selezione punto
Private m_bAlsoSelDir As Boolean ' abilita anche selezione direzione quando selezione punto
Private m_bExcludeSurfForSnap As Boolean ' abilita anche le superfici come sorgenti per snap a punto
Private m_PrevPoint As Point
Private m_ptPrev As Point3d
Private m_ptGrid As Point3d
@@ -73,6 +74,7 @@ Public Class Scene
m_nOldStatus = ST.SEL
m_nSnapType = SP.PT_GRID
m_bAlsoSelDir = False
m_bExcludeSurfForSnap = False
m_PrevPoint = Point.Empty
m_bGridCursorPos = False
m_nDriver = 3
@@ -765,6 +767,12 @@ Public Class Scene
i.Visible = False
End If
Case "sepSelPnt1"
i.Visible = True
Case "cmdExcludeSurfForSnap"
i.Text = EgtMsg(1123) ' Exclude Surfaces
i.Visible = True
DirectCast(i, ToolStripMenuItem).Checked = m_bExcludeSurfForSnap
Case "sepSelPnt2"
i.Visible = (m_nStatus <> ST.GETDIST And m_nStatus <> ST.GETDIST2)
Case "cmdStopDrag"
i.Text = EgtMsg(1201) ' Drag Off
@@ -842,6 +850,10 @@ Public Class Scene
ElseIf e.ClickedItem.Name = "cmdMinDistPoint" Then
m_nSnapType = SP.PT_MINDIST
RaiseEvent OnChangedSnapPointType(Me, m_nSnapType)
' esclusione superfici da punto snap
ElseIf e.ClickedItem.Name = "cmdExcludeSurfForSnap" Then
m_bExcludeSurfForSnap = Not m_bExcludeSurfForSnap
EgtSetObjFilterForSnap(True, True, Not m_bExcludeSurfForSnap, True, True)
' Sospensione drag
ElseIf e.ClickedItem.Name = "cmdStopDrag" Then
m_bDragOn = False