diff --git a/Controller.vb b/Controller.vb index 49933e0..cf964c2 100644 --- a/Controller.vb +++ b/Controller.vb @@ -518,6 +518,19 @@ Public Class Controller EgtDraw() End Sub + Public Sub MouseSelectedPath(ByVal nId As Integer, ByVal bHaltOnFork As Boolean) + ' verifico sia parte di un layer + Dim nLayerId = EgtGetParent(nId) + If EgtGetParent(EgtGetParent(nLayerId)) <> GDB_ID.ROOT Then + Return + End If + ' eseguo la selezione ed aggiorno + EnableCommandLog() + EgtSelectPathObjs(nId, bHaltOnFork) + DisableCommandLog() + EgtDraw() + End Sub + Public Sub MouseSelectedPoint(ByVal PtP As Point3d, ByVal nSep As SEP, ByVal nId As Integer, ByVal bDone As Boolean) SetDataFromSelPoint(PtP, nSep, nId) ' avanzo di un passo @@ -2520,7 +2533,6 @@ Public Class Controller End If End Sub - Public Sub ContinueArcPDP() ' verifico di essere in modalità continua If Not m_bContinue Then @@ -3647,21 +3659,11 @@ Public Class Controller If GetCurrLayer() = GDB_ID.NULL Then Return False End If - ' creo vettore di curve selezionate - Dim nCrvNum As Integer = 0 - Dim nCrvIds(EgtGetSelectedObjNbr() - 1) As Integer - Dim nId As Integer = EgtGetFirstSelectedObj() - While nId <> GDB_ID.NULL - Select Case EgtGetType(nId) - Case GDB_TY.CRV_LINE, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_COMPO - nCrvIds(nCrvNum) = nId - nCrvNum = nCrvNum + 1 - End Select - nId = EgtGetNextSelectedObj() - End While ' creo la curva composita (concatenando le curve selezionate) EnableCommandLog() - EgtCreateCurveCompoByChain(GetCurrLayer(), nCrvNum, nCrvIds, New Point3d, True, REF_TY.GRID) + Dim nCrvIds(0) As Integer + nCrvIds(0) = GDB_ID.SEL + EgtCreateCurveCompoByChain(GetCurrLayer(), 1, nCrvIds, New Point3d, True, REF_TY.GRID) DisableCommandLog() ' reset stato scena m_Scene.ResetStatus() diff --git a/EgtInterface.vb b/EgtInterface.vb index 62546f6..6cc79fd 100644 --- a/EgtInterface.vb +++ b/EgtInterface.vb @@ -1217,6 +1217,10 @@ End Function Public Function EgtDeselectLayerObjs(ByVal nLayerId As Integer) As Boolean End Function + +Public Function EgtSelectPathObjs(ByVal nId As Integer, ByVal bHaltOnFork As Boolean) As Boolean +End Function + '---------- GeomDb Objects ----------------------------------------------------- diff --git a/Form1.vb b/Form1.vb index 939812f..9e00d6f 100644 --- a/Form1.vb +++ b/Form1.vb @@ -364,6 +364,10 @@ Public Class Form1 m_Controller.MouseSelectedLayer(nId) End Sub + Private Sub OnMouseSelectedPath(ByVal sender As Object, ByVal nId As Integer, ByVal bHaltOnFork As Boolean) Handles Scene1.OnMouseSelectedPath + m_Controller.MouseSelectedPath(nId, bHaltOnFork) + End Sub + Private Sub OnMousePointFromSelection(ByVal sender As Object, ByVal PtP As Point3d, ByVal nAux As Integer) Handles Scene1.OnMousePointFromSelection m_Controller.SetPointFromSelection(PtP, nAux) End Sub diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 9e4ef05..e00da79 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/Resources/Analyze.cur b/Resources/Analyze.cur index 55f1c4c..ac9f75d 100644 Binary files a/Resources/Analyze.cur and b/Resources/Analyze.cur differ diff --git a/Resources/GetDist.cur b/Resources/GetDist.cur index 540dd3c..155bf17 100644 Binary files a/Resources/GetDist.cur and b/Resources/GetDist.cur differ diff --git a/Resources/Pan.cur b/Resources/Pan.cur index 3909397..125b9b4 100644 Binary files a/Resources/Pan.cur and b/Resources/Pan.cur differ diff --git a/Resources/Pointer.cur b/Resources/Pointer.cur index 6298d96..1d76163 100644 Binary files a/Resources/Pointer.cur and b/Resources/Pointer.cur differ diff --git a/Resources/Rotate.cur b/Resources/Rotate.cur index aa40976..6ef2965 100644 Binary files a/Resources/Rotate.cur and b/Resources/Rotate.cur differ diff --git a/Resources/SelPoint.cur b/Resources/SelPoint.cur index 3cf9dee..602e891 100644 Binary files a/Resources/SelPoint.cur and b/Resources/SelPoint.cur differ diff --git a/Resources/Select.cur b/Resources/Select.cur index eec3c5a..65060b7 100644 Binary files a/Resources/Select.cur and b/Resources/Select.cur differ diff --git a/Resources/WinSelect.cur b/Resources/WinSelect.cur index ed015fe..03aab7d 100644 Binary files a/Resources/WinSelect.cur and b/Resources/WinSelect.cur differ diff --git a/Resources/ZoomWin.cur b/Resources/ZoomWin.cur index b1be252..df68340 100644 Binary files a/Resources/ZoomWin.cur and b/Resources/ZoomWin.cur differ diff --git a/Scene.Designer.vb b/Scene.Designer.vb index 7cd371a..c93c559 100644 --- a/Scene.Designer.vb +++ b/Scene.Designer.vb @@ -28,8 +28,10 @@ Partial Class Scene Me.cmdDeselectAll = New System.Windows.Forms.ToolStripMenuItem() Me.sepSel1 = New System.Windows.Forms.ToolStripSeparator() Me.cmdWinSelect = New System.Windows.Forms.ToolStripMenuItem() - Me.cmdSelectLayer = 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() + Me.cmdSelectPathAuto = New System.Windows.Forms.ToolStripMenuItem() Me.cmdRestartDrag = New System.Windows.Forms.ToolStripMenuItem() Me.cmdSketchPoint = New System.Windows.Forms.ToolStripMenuItem() Me.cmdGridPoint = New System.Windows.Forms.ToolStripMenuItem() @@ -51,65 +53,77 @@ Partial Class Scene ' '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.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.cmdExcludeSurfForSnap, Me.sepSelPnt2, Me.cmdStopDrag}) Me.MenuScene.Name = "ContextMenuStrip1" Me.MenuScene.ShowCheckMargin = True Me.MenuScene.ShowImageMargin = False - Me.MenuScene.Size = New System.Drawing.Size(193, 462) + Me.MenuScene.Size = New System.Drawing.Size(193, 484) ' 'cmdSelectAll ' Me.cmdSelectAll.Name = "cmdSelectAll" - Me.cmdSelectAll.Size = New System.Drawing.Size(183, 22) + Me.cmdSelectAll.Size = New System.Drawing.Size(192, 22) Me.cmdSelectAll.Text = "Select All" ' 'cmdDeselectAll ' Me.cmdDeselectAll.Name = "cmdDeselectAll" - Me.cmdDeselectAll.Size = New System.Drawing.Size(183, 22) + Me.cmdDeselectAll.Size = New System.Drawing.Size(192, 22) Me.cmdDeselectAll.Text = "Deselect All" ' 'sepSel1 ' Me.sepSel1.Name = "sepSel1" - Me.sepSel1.Size = New System.Drawing.Size(180, 6) + Me.sepSel1.Size = New System.Drawing.Size(189, 6) ' 'cmdWinSelect ' Me.cmdWinSelect.Name = "cmdWinSelect" - Me.cmdWinSelect.Size = New System.Drawing.Size(183, 22) + Me.cmdWinSelect.Size = New System.Drawing.Size(192, 22) Me.cmdWinSelect.Text = "Select Window" ' - 'cmdSelectLayer - ' - Me.cmdSelectLayer.Name = "cmdSelectLayer" - 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(183, 22) + Me.cmdSelectPart.Size = New System.Drawing.Size(192, 22) Me.cmdSelectPart.Text = "Select Part" ' + 'cmdSelectLayer + ' + Me.cmdSelectLayer.Name = "cmdSelectLayer" + Me.cmdSelectLayer.Size = New System.Drawing.Size(192, 22) + Me.cmdSelectLayer.Text = "Select Layer" + ' + 'cmdSelectPath + ' + Me.cmdSelectPath.Name = "cmdSelectPath" + Me.cmdSelectPath.Size = New System.Drawing.Size(192, 22) + Me.cmdSelectPath.Text = "Select Path" + ' + 'cmdSelectPathAuto + ' + Me.cmdSelectPathAuto.Name = "cmdSelectPathAuto" + Me.cmdSelectPathAuto.Size = New System.Drawing.Size(192, 22) + Me.cmdSelectPathAuto.Text = "Select Path Auto" + ' 'cmdRestartDrag ' Me.cmdRestartDrag.Name = "cmdRestartDrag" - Me.cmdRestartDrag.Size = New System.Drawing.Size(183, 22) + Me.cmdRestartDrag.Size = New System.Drawing.Size(192, 22) Me.cmdRestartDrag.Text = "Drag On" ' 'cmdSketchPoint ' Me.cmdSketchPoint.Name = "cmdSketchPoint" Me.cmdSketchPoint.ShortcutKeyDisplayString = "S" - Me.cmdSketchPoint.Size = New System.Drawing.Size(183, 22) + Me.cmdSketchPoint.Size = New System.Drawing.Size(192, 22) Me.cmdSketchPoint.Text = "Sketch Point" ' 'cmdGridPoint ' Me.cmdGridPoint.Name = "cmdGridPoint" Me.cmdGridPoint.ShortcutKeyDisplayString = "G" - Me.cmdGridPoint.Size = New System.Drawing.Size(183, 22) + Me.cmdGridPoint.Size = New System.Drawing.Size(192, 22) Me.cmdGridPoint.Text = "Grid Point" ' 'cmdEndPoint @@ -178,23 +192,23 @@ Partial Class Scene 'sepSelPnt1 ' Me.sepSelPnt1.Name = "sepSelPnt1" - Me.sepSelPnt1.Size = New System.Drawing.Size(180, 6) + Me.sepSelPnt1.Size = New System.Drawing.Size(189, 6) ' 'cmdExcludeSurfForSnap ' Me.cmdExcludeSurfForSnap.Name = "cmdExcludeSurfForSnap" - Me.cmdExcludeSurfForSnap.Size = New System.Drawing.Size(183, 22) + Me.cmdExcludeSurfForSnap.Size = New System.Drawing.Size(192, 22) Me.cmdExcludeSurfForSnap.Text = "ToolStripMenuItem1" ' 'sepSelPnt2 ' Me.sepSelPnt2.Name = "sepSelPnt2" - Me.sepSelPnt2.Size = New System.Drawing.Size(180, 6) + Me.sepSelPnt2.Size = New System.Drawing.Size(189, 6) ' 'cmdStopDrag ' Me.cmdStopDrag.Name = "cmdStopDrag" - Me.cmdStopDrag.Size = New System.Drawing.Size(183, 22) + Me.cmdStopDrag.Size = New System.Drawing.Size(192, 22) Me.cmdStopDrag.Text = "Drag Off" ' 'Scene @@ -202,6 +216,8 @@ Partial Class Scene Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) 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) @@ -230,5 +246,7 @@ End Sub Friend WithEvents cmdCentroid As System.Windows.Forms.ToolStripMenuItem Friend WithEvents cmdExcludeSurfForSnap 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 End Class diff --git a/Scene.vb b/Scene.vb index 69a0ce0..7f32915 100644 --- a/Scene.vb +++ b/Scene.vb @@ -34,6 +34,8 @@ Public Class Scene WINSEL SELPART SELLAYER + SELPATH + SELPATHAUTO ANALYZE GETDIST GETDIST2 @@ -191,6 +193,7 @@ Public Class Scene Public Event OnMouseSelectedObj(ByVal sender As Object, ByVal nId As Integer, ByVal bLast As Boolean) Public Event OnMouseSelectedPart(ByVal sender As Object, ByVal nId As Integer) Public Event OnMouseSelectedLayer(ByVal sender As Object, ByVal nId As Integer) + Public Event OnMouseSelectedPath(ByVal sender As Object, ByVal nId As Integer, ByVal bHaltOnFork As Boolean) Public Event OnMouseAnalyzed(ByVal sender As Object, ByVal nId As Integer) Public Event OnMousePointFromSelection(ByVal sender As Object, ByVal PtP As Point3d, ByVal nAux As Integer) Public Event OnMouseDownScene(ByVal sender As Object) @@ -204,6 +207,8 @@ Public Class Scene Public Event OnChangedSnapPointType(ByVal sender As Object, ByVal nSpType As SP) '---- Mouse ----------- + ' Per correggere un problema con hot point cursore, nei file cur sono stati spostati di 4 pixel in Y + Protected Overrides Sub OnMouseDown(e As System.Windows.Forms.MouseEventArgs) ' Imposto il contesto della scena come corrente EgtSetCurrentContext(m_nGseContext) @@ -215,9 +220,9 @@ Public Class Scene Cursor = New Cursor(Me.GetType(), "WinSelect.cur") m_PrevPoint = e.Location m_nStatus = ST.WINSEL - ' se stato SEL, SELPART, SELLAYER o ANALYZE - ElseIf m_nStatus = ST.SEL Or m_nStatus = ST.SELPART Or - m_nStatus = ST.SELLAYER Or m_nStatus = ST.ANALYZE Then + ' se stato SEL, SELPART, SELLAYER, SELPATH, SELPATHAUTO o ANALYZE + ElseIf m_nStatus = ST.SEL Or m_nStatus = ST.SELPART Or m_nStatus = ST.SELLAYER Or + m_nStatus = ST.SELPATH Or m_nStatus = ST.SELPATHAUTO Or m_nStatus = ST.ANALYZE Then If m_nStatus <> ST.ANALYZE Then Cursor = New Cursor(Me.GetType(), "Select.cur") Else @@ -249,6 +254,12 @@ Public Class Scene Case ST.SELLAYER RaiseEvent OnMouseSelectedLayer(Me, nId) m_nStatus = ST.SEL + Case ST.SELPATH + RaiseEvent OnMouseSelectedPath(Me, nId, True) + m_nStatus = ST.SEL + Case ST.SELPATHAUTO + RaiseEvent OnMouseSelectedPath(Me, nId, False) + m_nStatus = ST.SEL Case Else RaiseEvent OnMouseAnalyzed(Me, nId) End Select @@ -699,6 +710,12 @@ Public Class Scene ElseIf i.Name = "cmdSelectLayer" Then i.Text = EgtMsg(1009) ' Select Layer i.Visible = True + ElseIf i.Name = "cmdSelectPath" Then + i.Text = EgtMsg(1011) ' Select Path + i.Visible = True + ElseIf i.Name = "cmdSelectPathAuto" Then + i.Text = EgtMsg(1013) ' Select Path Auto + i.Visible = True Else i.Visible = False End If @@ -811,6 +828,10 @@ Public Class Scene m_nStatus = ST.SELPART ElseIf e.ClickedItem.Name = "cmdSelectLayer" Then m_nStatus = ST.SELLAYER + ElseIf e.ClickedItem.Name = "cmdSelectPath" Then + m_nStatus = ST.SELPATH + ElseIf e.ClickedItem.Name = "cmdSelectPathAuto" Then + m_nStatus = ST.SELPATHAUTO ' Riabilitazione drag sospeso ElseIf e.ClickedItem.Name = "cmdRestartDrag" Then EgtResetGeoLine() @@ -921,7 +942,8 @@ Public Class Scene '---- Status management ------------- Private Function IsRestorableCurrStatus() As Boolean Select Case m_nStatus - Case ST.NULL, ST.SEL, ST.ANALYZE, ST.SELPART, ST.SELLAYER, ST.GETDIST, ST.GETDIST2, ST.SELPOINT, ST.SELPOINTZ + Case ST.NULL, ST.SEL, ST.ANALYZE, ST.SELPART, ST.SELLAYER, + ST.SELPATH, ST.SELPATHAUTO, ST.GETDIST, ST.GETDIST2, ST.SELPOINT, ST.SELPOINTZ Return True Case Else Return False @@ -940,7 +962,8 @@ Public Class Scene m_nStatus = m_nOldStatus Cursor = Cursors.Default Return True - ElseIf m_nOldStatus = ST.SEL Or m_nOldStatus = ST.SELPART Or m_nOldStatus = ST.SELLAYER Then + 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_nStatus = m_nOldStatus Cursor = New Cursor(Me.GetType(), "Select.cur") Return True diff --git a/TestEIn.vbproj b/TestEIn.vbproj index a884c54..8211b35 100644 --- a/TestEIn.vbproj +++ b/TestEIn.vbproj @@ -494,9 +494,6 @@ - - -