From 5b09566dbe954052c0fa22f34e2cab6639099fdb Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Thu, 3 Jan 2019 08:13:18 +0000 Subject: [PATCH] TestEIn 1.9l4 : - modifiche per aggiornamento. --- Controller.vb | 41 ++++++++++++++++++++++--- EgtInterface.vb | 62 ++++++++++++++++++++++++++++++++------ My Project/AssemblyInfo.vb | 6 ++-- Scene.vb | 4 +++ 4 files changed, 95 insertions(+), 18 deletions(-) diff --git a/Controller.vb b/Controller.vb index 3440989..d8d7a83 100644 --- a/Controller.vb +++ b/Controller.vb @@ -137,6 +137,7 @@ Public Class Controller Private m_nLastCmd As CMD = CMD.NULL Private m_nStep As Integer = 0 Private m_bContinue As Boolean = False + Private m_nContinueId As Integer = GDB_ID.NULL Private m_ptP1 As Point3d Private m_sepP1 As SEP Private m_nIdP1 As Integer @@ -1004,6 +1005,7 @@ Public Class Controller Public Sub ResetStatus(Optional bRedraw As Boolean = True) m_nStep = 0 m_bContinue = False + m_nContinueId = GDB_ID.NULL m_sepP1 = SEP.PT_STD m_sepP2 = SEP.PT_STD m_sepLast = SEP.PT_STD @@ -1012,12 +1014,17 @@ Public Class Controller Public Sub SetContinue() m_bContinue = True + m_nContinueId = GDB_ID.NULL End Sub Public Function GetContinue() As Boolean Return m_bContinue End Function + Public Function GetContinueId() As Integer + Return m_nContinueId + End Function + Public Function RepeatLastCommand() As Boolean Return ExecuteCommand(m_nLastCmd) End Function @@ -2350,8 +2357,21 @@ Public Class Controller ' creo la linea (i punti sono in globale) EnableCommandLog() Dim nId As Integer = EgtCreateLineEx(GetCurrLayer(), - m_ptP1.Loc(GDB_ID.GRID), m_sepP1, m_nIdP1, - m_ptLast.Loc(GDB_ID.GRID), m_sepLast, m_nIdLast, GDB_RT.GRID) + m_ptP1.Loc(GDB_ID.GRID), m_sepP1, m_nIdP1, + m_ptLast.Loc(GDB_ID.GRID), m_sepLast, m_nIdLast, GDB_RT.GRID) + ' se richiesta curva composita e creazione riuscita + If m_bContinue And nId <> GDB_ID.NULL Then + If m_nContinueId = GDB_ID.NULL Then + m_nContinueId = EgtCreateCurveCompo(GetCurrLayer(), nId, True) + nId = m_nContinueId + Else + If EgtAddCurveCompoCurve(m_nContinueId, nId, True) Then + nId = m_nContinueId + Else + nId = GDB_ID.NULL + End If + End If + End If DisableCommandLog() If nId <> GDB_ID.NULL Then m_ptCont = m_ptLast @@ -2913,6 +2933,19 @@ Public Class Controller EnableCommandLog() Dim nId = EgtCreateArc2PDEx(GetCurrLayer(), m_ptP1.Loc(GDB_ID.GRID), m_ptLast.Loc(GDB_ID.GRID), m_sepLast, m_nIdLast, m_dLast, GDB_RT.GRID) + ' se richiesta curva composita e creazione riuscita + If m_bContinue And nId <> GDB_ID.NULL Then + If m_nContinueId = GDB_ID.NULL Then + m_nContinueId = EgtCreateCurveCompo(GetCurrLayer(), nId, True) + nId = m_nContinueId + Else + If EgtAddCurveCompoCurve(m_nContinueId, nId, True) Then + nId = m_nContinueId + Else + nId = GDB_ID.NULL + End If + End If + End If DisableCommandLog() If nId <> GDB_ID.NULL Then m_ptCont = m_ptLast @@ -4273,9 +4306,7 @@ Public Class Controller End If ' creo la curva composita (concatenando le curve selezionate) EnableCommandLog() - Dim nCrvIds(0) As Integer - nCrvIds(0) = GDB_ID.SEL - EgtCreateCurveCompoByChain(GetCurrLayer(), 1, nCrvIds, New Point3d, Not m_bLast, GDB_RT.GRID) + EgtCreateCurveCompoByChain(GetCurrLayer(), 1, {GDB_ID.SEL}, New Point3d, Not m_bLast, GDB_RT.GRID) DisableCommandLog() ' reset stato scena m_Scene.ResetStatus() diff --git a/EgtInterface.vb b/EgtInterface.vb index b1e73d5..1a52498 100644 --- a/EgtInterface.vb +++ b/EgtInterface.vb @@ -2575,6 +2575,23 @@ Public Function EgtCreateCurveChamfer(nParentId As Integer, nCrv1 As Integer, By End If End Function + +Private Function EgtCreateCurveCompo_32(nParentId As Integer, nNumCrv As Integer, nCrvId() As Integer, bCrvErase As Boolean) As Integer +End Function + +Private Function EgtCreateCurveCompo_64(nParentId As Integer, nNumCrv As Integer, nCrvId() As Integer, bCrvErase As Boolean) As Integer +End Function +Public Function EgtCreateCurveCompo(nParentId As Integer, nCrvId() As Integer, bCrvErase As Boolean) As Integer + If IntPtr.Size = 4 Then + Return EgtCreateCurveCompo_32(nParentId, nCrvId.Count(), nCrvId, bCrvErase) + Else + Return EgtCreateCurveCompo_64(nParentId, nCrvId.Count(), nCrvId, bCrvErase) + End If +End Function +Public Function EgtCreateCurveCompo(nParentId As Integer, nCrvId As Integer, bCrvErase As Boolean) As Integer + Return EgtCreateCurveCompo(nParentId, {nCrvId}, bCrvErase) +End Function + Private Function EgtCreateCurveCompoByChain_32(nParentId As Integer, nNumCrv As Integer, nCrvId() As Integer, ByRef PtNearStart As Point3d, bCrvErase As Boolean, Optional nRefType As GDB_RT = GDB_RT.LOC) As Integer @@ -2591,6 +2608,10 @@ Public Function EgtCreateCurveCompoByChain(nParentId As Integer, nNumCrv As Inte Return EgtCreateCurveCompoByChain_64(nParentId, nNumCrv, nCrvId, PtNearStart, bCrvErase, nRefType) End If End Function +Public Function EgtCreateCurveCompoByChain(nParentId As Integer, nCrvId() As Integer, + ByRef PtNearStart As Point3d, bCrvErase As Boolean, Optional nRefType As GDB_RT = GDB_RT.LOC) As Integer + Return EgtCreateCurveCompoByChain(nParentId, nCrvId.Count(), nCrvId, PtNearStart, bCrvErase, nRefType) +End Function Private Function EgtCreateCurveCompoByReorder_32(nParentId As Integer, nNumCrv As Integer, nCrvId() As Integer, @@ -2608,6 +2629,10 @@ Public Function EgtCreateCurveCompoByReorder(nParentId As Integer, nNumCrv As In Return EgtCreateCurveCompoByReorder_64(nParentId, nNumCrv, nCrvId, PtNearStart, bCrvErase, nRefType) End If End Function +Public Function EgtCreateCurveCompoByReorder(nParentId As Integer, nCrvId() As Integer, + ByRef PtNearStart As Point3d, bCrvErase As Boolean, Optional nRefType As GDB_RT = GDB_RT.LOC) As Integer + Return EgtCreateCurveCompoByReorder_32(nParentId, nCrvId.Count(), nCrvId, PtNearStart, bCrvErase, nRefType) +End Function Private Function EgtCreateRectangle2P_32(nParentId As Integer, @@ -3409,6 +3434,20 @@ Public Function EgtCloseCurveCompo(nId As Integer) As Boolean End If End Function + +Private Function EgtAddCurveCompoCurve_32(nId As Integer, nAddCrvId As Integer, bEraseOrig As Boolean) As Boolean +End Function + +Private Function EgtAddCurveCompoCurve_64(nId As Integer, nAddCrvId As Integer, bEraseOrig As Boolean) As Boolean +End Function +Public Function EgtAddCurveCompoCurve(nId As Integer, nAddCrvId As Integer, bEraseOrig As Boolean) As Boolean + If IntPtr.Size = 4 Then + Return EgtAddCurveCompoCurve_32(nId, nAddCrvId, bEraseOrig) + Else + Return EgtAddCurveCompoCurve_64(nId, nAddCrvId, bEraseOrig) + End If +End Function + Private Function EgtAddCurveCompoLine_32(nId As Integer, ByRef PtNew As Point3d, Optional nRefType As GDB_RT = GDB_RT.LOC) As Boolean End Function @@ -6481,17 +6520,20 @@ End Function '---------- Nestings ----------------------------------------------------------- -Private Function EgtCreateFlatParts_32(nType As Integer) As Boolean +Private Function EgtCreateFlatParts_32(nType As Integer, dToler As Double) As Boolean End Function -Private Function EgtCreateFlatParts_64(nType As Integer) As Boolean +Private Function EgtCreateFlatParts_64(nType As Integer, dToler As Double) As Boolean +End Function +Public Function EgtCreateFlatParts(nType As Integer, dToler As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtCreateFlatParts_32(nType, dToler) + Else + Return EgtCreateFlatParts_64(nType, dToler) + End If End Function Public Function EgtCreateFlatParts(nType As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtCreateFlatParts_32(nType) - Else - Return EgtCreateFlatParts_64(nType) - End If + Return EgtCreateFlatParts(nType, 0.10000000000000001) End Function @@ -11898,12 +11940,12 @@ End Function '---------- Costanti ----------------------------------------------------------- 'Costanti : GEOMETRIA Public Const ONEMM As Double = 1.0 -Public Const ONEINCH As Double = 25.4 +Public Const ONEINCH As Double = 25.399999999999999 Public Const EPS_SMALL As Double = 0.001 -Public Const EPS_ZERO As Double = 0.0000001 +Public Const EPS_ZERO As Double = 0.000000099999999999999995 Public Const EPS_ANG_SMALL As Double = 0.001 Public Const INFINITO As Double = 10000000000.0 -Public Const EPS_STM As Double = 0.05 +Public Const EPS_STM As Double = 0.050000000000000003 Public Const EPS_STM_DRAG As Double = 0.5 'Cosatnti : TIPO DI CHIAVE Public Enum KEY_TYPE As Integer diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 2c233f7..1625d02 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -27,7 +27,7 @@ Imports System.Runtime.InteropServices #End If - + @@ -46,5 +46,5 @@ Imports System.Runtime.InteropServices ' utilizzando l'asterisco (*) come descritto di seguito: ' - - + + diff --git a/Scene.vb b/Scene.vb index a18c9fa..0f2515a 100644 --- a/Scene.vb +++ b/Scene.vb @@ -1443,6 +1443,10 @@ Public Class Scene EgtZoom(ZM.OUT) End Sub + Public Sub ZoomSel() + EgtZoomObject(GDB_ID.SEL) + End Sub + '---- Rendering Buttons ---- Public Sub WireFrame() EgtSetShowMode(SM.WIREFRAME)