From 756021ca09c024f39213cfc3b659e772bf90364e Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 17 Mar 2015 11:13:19 +0000 Subject: [PATCH] TestEIn 1.6c3 : - gestione selezione per percorso. --- Controller.vb | 30 ++++++++++--------- EgtInterface.vb | 4 +++ Form1.vb | 4 +++ My Project/AssemblyInfo.vb | 4 +-- Resources/Analyze.cur | Bin 326 -> 326 bytes Resources/GetDist.cur | Bin 326 -> 326 bytes Resources/Pan.cur | Bin 326 -> 326 bytes Resources/Pointer.cur | Bin 326 -> 326 bytes Resources/Rotate.cur | Bin 326 -> 326 bytes Resources/SelPoint.cur | Bin 326 -> 326 bytes Resources/Select.cur | Bin 326 -> 326 bytes Resources/WinSelect.cur | Bin 326 -> 326 bytes Resources/ZoomWin.cur | Bin 326 -> 326 bytes Scene.Designer.vb | 60 ++++++++++++++++++++++++------------- Scene.vb | 33 ++++++++++++++++---- TestEIn.vbproj | 3 -- 16 files changed, 93 insertions(+), 45 deletions(-) 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 55f1c4c76d2ad042f534b848749e2f435e5f6647..ac9f75d6c5f824e82181c3bbfcdf00c4f8759f10 100644 GIT binary patch delta 22 dcmX@cbc~6Yfq{vEkwHO$fq|bvcq6YRBLFD90{Z{} delta 22 dcmX@cbc~6Yfq{vEkwHO$fq|cae 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 @@ - - -