From e11590b58c083daa893ac145d3bdf8aa98956437 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 17 Dec 2018 11:33:40 +0000 Subject: [PATCH] TestEIn 1.9l2 : - ricompilazione per aggiornamento. --- Controller.vb | 33 ++++-- EgtInterface.vb | 207 +++++++++++++++++++++++-------------- My Project/AssemblyInfo.vb | 4 +- 3 files changed, 158 insertions(+), 86 deletions(-) diff --git a/Controller.vb b/Controller.vb index f0b7a15..3440989 100644 --- a/Controller.vb +++ b/Controller.vb @@ -197,6 +197,11 @@ Public Class Controller End Enum Private m_nInpType As IBT = IBT.TY_NULL + ' Import + Private m_dDxfScale As Double = 1 + Private m_dStlScale As Double = 1 + Private m_dImgScale As Double = 1 + ' Image export Private m_nImgWidth As Integer = 400 Private m_nImgHeight As Integer = 300 @@ -302,11 +307,11 @@ Public Class Controller EnableCommandLog() Dim nFileType As Integer = EgtGetFileType(sFile) If nFileType = FT.DXF Then - bOk = EgtImportDxf(sFile, 1) + bOk = EgtImportDxf(sFile, m_dDxfScale) ElseIf nFileType = FT.STL Then - bOk = EgtImportStl(sFile, 1) + bOk = EgtImportStl(sFile, m_dStlScale) ElseIf nFileType = FT.IMG Then - bOk = ImportPicture(sFile, 1) + bOk = ImportPicture(sFile, m_dImgScale) Else bOk = EgtInsertFile(sFile) End If @@ -480,13 +485,13 @@ Public Class Controller Case FT.CSF bOk = bOk And EgtImportCsf(sFile) Case FT.DXF - bOk = bOk And EgtImportDxf(sFile, 1) + bOk = bOk And EgtImportDxf(sFile, m_dDxfScale) Case FT.IMG - bOk = bOk And ImportPicture(sFile, 1) + bOk = bOk And ImportPicture(sFile, m_dImgScale) Case FT.PNT bOk = bOk And EgtImportPnt(sFile, nFlag) Case FT.STL - bOk = bOk And EgtImportStl(sFile, 1) + bOk = bOk And EgtImportStl(sFile, m_dStlScale) End Select EgtResetCurrPartLayer() DisableCommandLog() @@ -498,6 +503,18 @@ Public Class Controller Return bOk End Function + Public Sub SetScaleForDxfImport(dScale As Double) + m_dDxfScale = dScale + End Sub + + Public Sub SetScaleForStlImport(dScale As Double) + m_dStlScale = dScale + End Sub + + Public Sub SetScaleForImageImport(dScale As Double) + m_dImgScale = dScale + End Sub + Private Function ImportPicture(sFile As String, dScaleFactor As Double) As Boolean ' Creo pezzo e layer Dim nLayId As Integer = EgtCreateGroup(EgtCreateGroup(GDB_ID.ROOT)) @@ -5102,7 +5119,7 @@ Public Class Controller Dim vtPlaN As Vector3d Dim dPlaDist As Double If EgtCurveIsFlat(nId, vtPlaN, dPlaDist) Then - RaiseEvent OutputInfo(Me, EgtMsg(2056)) ' Distance too big + RaiseEvent OutputInfo(Me, EgtMsg(2056)) ' Distance too big Else RaiseEvent OutputInfo(Me, EgtMsg(2057)) ' Curve not flat (in its plane) End If @@ -5120,7 +5137,7 @@ Public Class Controller Dim nSide As Integer Dim ptMin As Point3d Dim nId As Integer = EgtGetLastSelectedObj() - If EgtGetMinDistPntSidePointCurve(m_ptLast.Loc(nId), nId, EgtGetGridVersZ().Loc(nId), dDist, ptMin, nSide) Then + If EgtPointCurveDistSide(m_ptLast.Loc(nId), nId, EgtGetGridVersZ().Loc(nId), nId, dDist, ptMin, nSide) Then ' calcolo la distanza tra m_ptLast e ptMin sul piano griglia m_ptP1 = ptMin.Glob(nId) Dim vtDiff As Vector3d = m_ptLast - m_ptP1 diff --git a/EgtInterface.vb b/EgtInterface.vb index fa14f55..b1e73d5 100644 --- a/EgtInterface.vb +++ b/EgtInterface.vb @@ -6028,37 +6028,6 @@ Public Function EgtClosedCurveClassify(nId1 As Integer, nId2 As Integer) As Inte End If End Function - -Private Function EgtGetMinDistPointCurve_32(ByRef ptP As Point3d, nId As Integer, ByRef dDist As Double, ByRef dU As Double) As Boolean -End Function - -Private Function EgtGetMinDistPointCurve_64(ByRef ptP As Point3d, nId As Integer, ByRef dDist As Double, ByRef dU As Double) As Boolean -End Function -Public Function EgtGetMinDistPointCurve(ByRef ptP As Point3d, nId As Integer, ByRef dDist As Double, ByRef dU As Double) As Boolean - If IntPtr.Size = 4 Then - Return EgtGetMinDistPointCurve_32(ptP, nId, dDist, dU) - Else - Return EgtGetMinDistPointCurve_64(ptP, nId, dDist, dU) - End If -End Function - - -Private Function EgtGetMinDistPntSidePointCurve_32(ByRef ptP As Point3d, nId As Integer, ByRef vtN As Vector3d, - ByRef dDist As Double, ByRef ptMin As Point3d, ByRef nSide As Integer) As Boolean -End Function - -Private Function EgtGetMinDistPntSidePointCurve_64(ByRef ptP As Point3d, nId As Integer, ByRef vtN As Vector3d, - ByRef dDist As Double, ByRef ptMin As Point3d, ByRef nSide As Integer) As Boolean -End Function -Public Function EgtGetMinDistPntSidePointCurve(ByRef ptP As Point3d, nId As Integer, ByRef vtN As Vector3d, - ByRef dDist As Double, ByRef ptMin As Point3d, ByRef nSide As Integer) As Boolean - If IntPtr.Size = 4 Then - Return EgtGetMinDistPntSidePointCurve_32(ptP, nId, vtN, dDist, ptMin, nSide) - Else - Return EgtGetMinDistPntSidePointCurve_64(ptP, nId, vtN, dDist, ptMin, nSide) - End If -End Function - Private Function EgtArcRadius_32(nId As Integer, ByRef dRad As Double) As Boolean End Function @@ -6301,43 +6270,6 @@ Public Function EgtSurfTmFacetsContact(nId As Integer, nF1 As Integer, nF2 As In Return EgtSurfTmFacetsContact(nId, nF1, nF2, nId, bAdjac, PtP1, PtP2, dAng) End Function - -Private Function EgtSurfTmLineInters_32(nId As Integer, ByRef ptP As Point3d, ByRef vtDir As Vector3d, nRefId As Integer, - ByRef pvFlagInters As IntPtr, ByRef pvParInters As IntPtr, ByRef nCount As Integer) As Boolean -End Function - -Private Function EgtSurfTmLineInters_64(nId As Integer, ByRef ptP As Point3d, ByRef vtDir As Vector3d, nRefId As Integer, - ByRef pvFlagInters As IntPtr, ByRef pvParInters As IntPtr, ByRef nCount As Integer) As Boolean -End Function -Public Function EgtSurfTmLineInters(nId As Integer, ptP As Point3d, vtDir As Vector3d, nRefId As Integer, ByRef vInters As List(Of FlagPar)) As Boolean - Dim pvFlagInters As IntPtr - Dim pvParInters As IntPtr - Dim nCount As Integer - Dim bOk As Boolean - If IntPtr.Size = 4 Then - bOk = EgtSurfTmLineInters_32(nId, ptP, vtDir, nRefId, pvFlagInters, pvParInters, nCount) - Else - bOk = EgtSurfTmLineInters_64(nId, ptP, vtDir, nRefId, pvFlagInters, pvParInters, nCount) - End If - vInters.Clear() - If bOk And nCount > 0 Then - Dim vnFlag(nCount) As Integer - Marshal.Copy(pvFlagInters, vnFlag, 0, nCount) - Dim vnPar(nCount) As Double - vInters.Capacity = nCount - Marshal.Copy(pvParInters, vnPar, 0, nCount) - For i As Integer = 0 To nCount - 1 - vInters.Add(New FlagPar(vnFlag(i), vnPar(i))) - Next - EgtFreeMemory(pvFlagInters) - EgtFreeMemory(pvParInters) - End If - Return bOk -End Function -Public Function EgtSurfTmLineInters(nId As Integer, ptP As Point3d, vtDir As Vector3d, ByRef vInters As List(Of FlagPar)) As Boolean - Return EgtSurfTmLineInters(nId, ptP, vtDir, nId, vInters) -End Function - Private Function EgtTextNormVersor_32(nId As Integer, nRefId As Integer, ByRef VtNorm As Vector3d) As Boolean End Function @@ -6458,6 +6390,95 @@ Private Function EgtVectorToIdLoc(ByRef VtV As Vector3d, nId As Integer) As Bool End Function +'---------- Geo Dist ----------------------------------------------------------- + +Private Function EgtPointCurveDist_32(ByRef ptP As Point3d, nId As Integer, nRefId As Integer, ByRef dDist As Double, ByRef dU As Double) As Boolean +End Function + +Private Function EgtPointCurveDist_64(ByRef ptP As Point3d, nId As Integer, nRefId As Integer, ByRef dDist As Double, ByRef dU As Double) As Boolean +End Function +Public Function EgtPointCurveDist(ByRef ptP As Point3d, nId As Integer, nRefId As Integer, ByRef dDist As Double, ByRef dU As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtPointCurveDist_32(ptP, nId, nRefId, dDist, dU) + Else + Return EgtPointCurveDist_64(ptP, nId, nRefId, dDist, dU) + End If +End Function + + +Private Function EgtPointCurveDistSide_32(ByRef ptP As Point3d, nId As Integer, ByRef vtN As Vector3d, nRefId As Integer, + ByRef dDist As Double, ByRef ptMin As Point3d, ByRef nSide As Integer) As Boolean +End Function + +Private Function EgtPointCurveDistSide_64(ByRef ptP As Point3d, nId As Integer, ByRef vtN As Vector3d, nRefId As Integer, + ByRef dDist As Double, ByRef ptMin As Point3d, ByRef nSide As Integer) As Boolean +End Function +Public Function EgtPointCurveDistSide(ByRef ptP As Point3d, nId As Integer, ByRef vtN As Vector3d, nRefId As Integer, + ByRef dDist As Double, ByRef ptMin As Point3d, ByRef nSide As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtPointCurveDistSide_32(ptP, nId, vtN, nRefId, dDist, ptMin, nSide) + Else + Return EgtPointCurveDistSide_64(ptP, nId, vtN, nRefId, dDist, ptMin, nSide) + End If +End Function + + +Private Function EgtPointSurfTmDist_32(ByRef ptP As Point3d, nId As Integer, ByRef vtN As Vector3d, nRefId As Integer, + ByRef dDist As Double, ByRef ptMin As Point3d, ByRef nTria As Integer) As Boolean +End Function + +Private Function EgtPointSurfTmDist_64(ByRef ptP As Point3d, nId As Integer, ByRef vtN As Vector3d, nRefId As Integer, + ByRef dDist As Double, ByRef ptMin As Point3d, ByRef nTria As Integer) As Boolean +End Function +Public Function EgtPointSurfTmDist(ByRef ptP As Point3d, nId As Integer, ByRef vtN As Vector3d, nRefId As Integer, + ByRef dDist As Double, ByRef ptMin As Point3d, ByRef nTria As Integer) As Boolean + If IntPtr.Size = 4 Then + Return EgtPointSurfTmDist_32(ptP, nId, vtN, nRefId, dDist, ptMin, nTria) + Else + Return EgtPointSurfTmDist_64(ptP, nId, vtN, nRefId, dDist, ptMin, nTria) + End If +End Function + + +'---------- Geo Inters --------------------------------------------------------- + +Private Function EgtLineSurfTmInters_32(ByRef ptP As Point3d, ByRef vtDir As Vector3d, nId As Integer, nRefId As Integer, + ByRef pvFlagInters As IntPtr, ByRef pvParInters As IntPtr, ByRef nCount As Integer) As Boolean +End Function + +Private Function EgtLineSurfTmInters_64(ByRef ptP As Point3d, ByRef vtDir As Vector3d, nId As Integer, nRefId As Integer, + ByRef pvFlagInters As IntPtr, ByRef pvParInters As IntPtr, ByRef nCount As Integer) As Boolean +End Function +Public Function EgtLineSurfTmInters(ptP As Point3d, vtDir As Vector3d, nId As Integer, nRefId As Integer, ByRef vInters As List(Of FlagPar)) As Boolean + Dim pvFlagInters As IntPtr + Dim pvParInters As IntPtr + Dim nCount As Integer + Dim bOk As Boolean + If IntPtr.Size = 4 Then + bOk = EgtLineSurfTmInters_32(ptP, vtDir, nId, nRefId, pvFlagInters, pvParInters, nCount) + Else + bOk = EgtLineSurfTmInters_64(ptP, vtDir, nId, nRefId, pvFlagInters, pvParInters, nCount) + End If + vInters.Clear() + If bOk And nCount > 0 Then + Dim vnFlag(nCount) As Integer + Marshal.Copy(pvFlagInters, vnFlag, 0, nCount) + Dim vnPar(nCount) As Double + vInters.Capacity = nCount + Marshal.Copy(pvParInters, vnPar, 0, nCount) + For i As Integer = 0 To nCount - 1 + vInters.Add(New FlagPar(vnFlag(i), vnPar(i))) + Next + EgtFreeMemory(pvFlagInters) + EgtFreeMemory(pvParInters) + End If + Return bOk +End Function +Public Function EgtLineSurfTmInters(ptP As Point3d, vtDir As Vector3d, nId As Integer, ByRef vInters As List(Of FlagPar)) As Boolean + Return EgtLineSurfTmInters(ptP, vtDir, nId, nId, vInters) +End Function + + '---------- Nestings ----------------------------------------------------------- Private Function EgtCreateFlatParts_32(nType As Integer) As Boolean @@ -8317,6 +8338,20 @@ End Function Return bOk End Function + + Private Function EgtTdbGetCurrToolMaxDepth_32(ByRef dVal As Double) As Boolean + End Function + + Private Function EgtTdbGetCurrToolMaxDepth_64(ByRef dVal As Double) As Boolean + End Function + Public Function EgtTdbGetCurrToolMaxDepth(ByRef dVal As Double) As Boolean + If IntPtr.Size = 4 Then + Return EgtTdbGetCurrToolMaxDepth_32(dVal) + Else + Return EgtTdbGetCurrToolMaxDepth_64(dVal) + End If + End Function + Private Function EgtTdbReload_32() As Boolean End Function @@ -9008,6 +9043,20 @@ End Function End If End Function + + Private Function EgtSetOperationName_32(nId As Integer, sName As String) As Boolean + End Function + + Private Function EgtSetOperationName_64(nId As Integer, sName As String) As Boolean + End Function + Public Function EgtSetOperationName(nId As Integer, sName As String) As Boolean + If IntPtr.Size = 4 Then + Return EgtSetOperationName_32(nId, sName) + Else + Return EgtSetOperationName_64(nId, sName) + End If + End Function + Private Function EgtGetOperationName_32(nId As Integer, ByRef psName As IntPtr) As Boolean End Function @@ -11939,6 +11988,20 @@ Public Enum GDB_ST As Integer ON_ = 1 SEL = 2 End Enum +'Costanti : FLAG PER BBOX +Public Enum GDB_BB As Integer + STANDARD = 0 + ONLY_VISIBLE = 1 + EXACT = 2 + IGNORE_TEXT = 4 + IGNORE_DIM = 8 +End Enum +'Costanti : INFO DI SISTEMA +Public Const GDB_SI_SOURCE As String = "!SOU" +Public Const GDB_SI_BASE As String = "!BAS" +Public Const GDB_SI_LIST As String = "!LST" +Public Const GDB_SI_COPY As String = "!COP" +Public Const GDB_SI_MGRPONLY As String = "!MGO" 'Costanti : TIPO VISUALIZZAZIONE Public Enum SM As Integer WIREFRAME = 0 @@ -12001,14 +12064,6 @@ Public Enum TXR_REP As Integer REPEAT = 1 MIRROR = 2 End Enum -'Costanti : flag per BBOX -Public Enum GDB_BB As Integer - STANDARD = 0 - ONLY_VISIBLE = 1 - EXACT = 2 - IGNORE_TEXT = 4 - IGNORE_DIM = 8 -End Enum 'Costanti : tipo di offset Public Enum OFF_TYPE As Integer FILLET = 0 diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 4f866ee..2c233f7 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: ' - - + +