'---------------------------------------------------------------------------- ' EgalTech 2014-2015 '---------------------------------------------------------------------------- ' File : EgtInterface.vb Data : 27.01.15 Versione : 1.6a6 ' Contenuto : Modulo EgtInterface (interfaccia verso il motore EgalTech). ' ' ' ' Modifiche : 04.11.14 DS Creazione modulo. ' ' '---------------------------------------------------------------------------- Imports System.Runtime.InteropServices Public Module EgtInterface Structure Vector3d ' Membri Dim x, y, z As Double ' Costruttori Sub New(ByVal dX As Double, ByVal dY As Double, ByVal dZ As Double) x = dX y = dY z = dZ End Sub Sub New(ByRef VtV As Vector3d) x = VtV.x y = VtV.y z = VtV.z End Sub ' Calcolatori da componenti polari / sferici Shared Function FromSpherical(ByVal dLen As Double, ByVal dAngVertDeg As Double, ByVal dAngOrizzDeg As Double) As Vector3d Dim dAngVertRad As Double = dAngVertDeg * Math.PI / 180 Dim dAngOrizzRad As Double = dAngOrizzDeg * Math.PI / 180 Dim dSinAngVert As Double = Math.Sin(dAngVertRad) Dim vtV As New Vector3d(dLen * dSinAngVert * Math.Cos(dAngOrizzRad), dLen * dSinAngVert * Math.Sin(dAngOrizzRad), dLen * Math.Cos(dAngVertRad)) Return vtV End Function Shared Function FromPolar(ByVal dLen As Double, ByVal dAngOrizzDeg As Double) As Vector3d Dim dAngOrizzRad As Double = dAngOrizzDeg * Math.PI / 180 Dim vtV As New Vector3d(dLen * Math.Cos(dAngOrizzRad), dLen * Math.Sin(dAngOrizzRad), 0) Return vtV End Function ' Vettore opposto Shared Operator -(ByVal VtV1 As Vector3d) As Vector3d Dim vtV As New Vector3d(-VtV1.x, -VtV1.y, -VtV1.z) Return vtV End Operator ' Somma Shared Operator +(ByVal VtV1 As Vector3d, ByVal VtV2 As Vector3d) As Vector3d Dim vtV As New Vector3d(VtV1.x + VtV2.x, VtV1.y + VtV2.y, VtV1.z + VtV2.z) Return vtV End Operator ' Sottrazione Shared Operator -(ByVal VtV1 As Vector3d, ByVal VtV2 As Vector3d) As Vector3d Dim vtV As New Vector3d(VtV1.x - VtV2.x, VtV1.y - VtV2.y, VtV1.z - VtV2.z) Return vtV End Operator ' Prodotto con un numero Shared Operator *(ByVal dNum As Double, ByVal VtV2 As Vector3d) As Vector3d Dim vtV As New Vector3d(dNum * VtV2.x, dNum * VtV2.y, dNum * VtV2.z) Return vtV End Operator Shared Operator *(ByVal VtV1 As Vector3d, ByVal dNum As Double) As Vector3d Dim vtV As New Vector3d(dNum * VtV1.x, dNum * VtV1.y, dNum * VtV1.z) Return vtV End Operator ' Divisione per un numero Shared Operator /(ByVal VtV1 As Vector3d, ByVal dDiv As Double) As Vector3d Dim dMul As Double = 1 / dDiv Dim vtV As New Vector3d(dMul * VtV1.x, dMul * VtV1.y, dMul * VtV1.z) Return vtV End Operator ' Prodotto scalare Shared Operator *(ByVal VtV1 As Vector3d, ByVal VtV2 As Vector3d) As Double Return (VtV1.x * VtV2.x + VtV1.y * VtV2.y + VtV1.z * VtV2.z) End Operator ' Prodotto scalare nel piano XY Shared Function ScalarXY(ByVal VtV1 As Vector3d, ByVal VtV2 As Vector3d) As Double Return (VtV1.x * VtV2.x + VtV1.y * VtV2.y) End Function ' Prodotto vettoriale Shared Operator ^(ByVal VtV1 As Vector3d, ByVal VtV2 As Vector3d) As Vector3d Dim vtV As New Vector3d(VtV1.y * VtV2.z - VtV1.z * VtV2.y, VtV1.z * VtV2.x - VtV1.x * VtV2.z, VtV1.x * VtV2.y - VtV1.y * VtV2.x) Return vtV End Operator ' Prodotto vettoriale nel piano XY Shared Function CrossXY(ByVal VtV1 As Vector3d, ByVal VtV2 As Vector3d) As Double Return (VtV1.x * VtV2.y - VtV1.y * VtV2.x) End Function ' Quadrato della lunghezza Function SqLen() As Double Return (x * x + y * y + z * z) End Function ' Lunghezza Function Len() As Double Return Math.Sqrt(x * x + y * y + z * z) End Function ' Verifica di vettore quasi nullo Function IsSmall() As Boolean Return ((x * x + y * y + z * z) < EPS_SMALL * EPS_SMALL) End Function ' Normalizzazione Function Normalize(Optional ByVal dEps As Double = EPS_SMALL) As Boolean Return EgtVectorNormalize(x, y, z, dEps) End Function ' Ritorna la rappresentazione in coordinate sferiche Sub ToSpherical(ByRef dLen As Double, ByRef dAngVertDeg As Double, ByRef dAngOrizzDeg As Double) ' lunghezza dLen = Len() ' angoli ' se vettore nullo If dLen < EPS_ZERO Then dAngVertDeg = 0 dAngOrizzDeg = 0 ' se diretto come Z ElseIf Math.Abs(x) < EPS_ZERO And Math.Abs(y) < EPS_ZERO Then dAngVertDeg = IIf(z > 0, 0, 180) dAngOrizzDeg = 0 ' se altrimenti nel piano XY ElseIf Math.Abs(z) < EPS_ZERO Then dAngVertDeg = 90 dAngOrizzDeg = Math.Atan2(y, x) * 180 / Math.PI If dAngOrizzDeg < 0 Then dAngOrizzDeg += 360 End If ' caso generico Else dAngVertDeg = Math.Acos(z / dLen) * 180 / Math.PI dAngOrizzDeg = Math.Atan2(y, x) * 180 / Math.PI If dAngOrizzDeg < 0 Then dAngOrizzDeg += 360 End If End If End Sub ' Rotazione Function Rotate(ByRef VtAx As Vector3d, ByVal dAngRotDeg As Double) As Boolean Return EgtVectorRotate(x, y, z, VtAx, dAngRotDeg) End Function ' Scalatura Function Scale(ByRef frRef As Frame3d, ByVal dCoeffX As Double, ByVal dCoeffY As Double, ByVal dCoeffZ As Double) As Boolean Return EgtVectorScale(x, y, z, frRef.Orig(), frRef.VersX(), frRef.VersY(), frRef.VersZ(), dCoeffX, dCoeffY, dCoeffZ) End Function ' Mirror Function Mirror(ByRef PtOn As Point3d, ByRef VtNorm As Vector3d) As Boolean Return EgtVectorMirror(x, y, z, VtNorm) End Function ' Shear Function Shear(ByRef PtOn As Point3d, ByRef VtNorm As Vector3d, ByRef VtDir As Vector3d, ByVal dCoeff As Double) As Boolean Return EgtVectorShear(x, y, z, VtNorm, VtDir, dCoeff) End Function ' Cambio di riferimento : dal riferimento al globale Function ToGlob(ByRef frRef As Frame3d) As Boolean If frRef.IsValid Then Return EgtVectorToGlob(x, y, z, frRef.Orig(), frRef.VersX(), frRef.VersY(), frRef.VersZ()) Else Return False End If End Function ' Cambio di riferimento : dal globale al riferimento Function ToLoc(ByRef frRef As Frame3d) As Boolean If frRef.IsValid Then Return EgtVectorToLoc(x, y, z, frRef.Orig(), frRef.VersX(), frRef.VersY(), frRef.VersZ()) Else Return False End If End Function ' Cambio di riferimento : dal primo riferimento al secondo Function LocToLoc(ByRef frSou As Frame3d, ByRef frDest As Frame3d) As Boolean If frSou.IsValid And frDest.IsValid Then Return EgtVectorLocToLoc(x, y, z, frSou.Orig(), frSou.VersX(), frSou.VersY(), frSou.VersZ(), frDest.Orig(), frDest.VersX(), frDest.VersY(), frDest.VersZ()) Else Return False End If End Function ' Restituisce vettore in globale partendo da espressione nel riferimento dell'oggetto Function Glob(ByVal nId As Integer) As Vector3d Dim vtV As New Vector3d(x, y, z) EgtVectorToIdGlob(vtV, nId) Return vtV End Function ' Restituisce vettore nel riferimento dell'oggetto partendo da espressione in globale Function Loc(ByVal nId As Integer) As Vector3d Dim vtV As New Vector3d(x, y, z) EgtVectorToIdLoc(vtV, nId) Return vtV End Function ' Restituisce vettore nel riferimento del 2°oggetto partendo da espressione nel riferimento del 1° oggetto Function LocLoc(ByVal nIdSou As Integer, ByVal nIdDest As Integer) As Vector3d Dim vtV As New Vector3d(x, y, z) If EgtVectorToIdGlob(vtV, nIdSou) And EgtVectorToIdLoc(vtV, nIdDest) Then Return vtV Else Return Me End If End Function ' vettore nullo Shared Function NULL() As Vector3d Return New Vector3d(0, 0, 0) End Function ' Versore Asse X Shared Function X_AX() As Vector3d Return New Vector3d(1, 0, 0) End Function ' Versore Asse Y Shared Function Y_AX() As Vector3d Return New Vector3d(0, 1, 0) End Function ' Versore Asse Z Shared Function Z_AX() As Vector3d Return New Vector3d(0, 0, 1) End Function End Structure Structure Point3d ' Membri Dim x, y, z As Double ' Costruttori Sub New(ByVal dX As Double, ByVal dY As Double, ByVal dZ As Double) x = dX y = dY z = dZ End Sub Sub New(ByRef PtP As Point3d) x = PtP.x y = PtP.y z = PtP.z End Sub ' Somma di un punto e un vettore Shared Operator +(ByVal PtP1 As Point3d, ByVal VtV2 As Vector3d) As Point3d Dim ptP As New Point3d(PtP1.x + VtV2.x, PtP1.y + VtV2.y, PtP1.z + VtV2.z) Return ptP End Operator Shared Operator +(ByVal VtV1 As Vector3d, ByVal PtP2 As Point3d) As Point3d Dim ptP As New Point3d(VtV1.x + PtP2.x, VtV1.y + PtP2.y, VtV1.z + PtP2.z) Return ptP End Operator ' Differenza di due punti (produce un vettore) Shared Operator -(ByVal PtP1 As Point3d, ByVal PtP2 As Point3d) As Vector3d Dim vtV As New Vector3d(PtP1.x - PtP2.x, PtP1.y - PtP2.y, PtP1.z - PtP2.z) Return vtV End Operator ' Media pesata di due punti (con 0 è il primo, con 1 il secondo, con 0.5 il medio, ...) Shared Function Media(ByRef ptP1 As Point3d, ByRef ptP2 As Point3d, Optional ByVal dCoeff As Double = 0.5) As Point3d Dim ptMedia As New Point3d((1 - dCoeff) * ptP1.x + dCoeff * ptP2.x, (1 - dCoeff) * ptP1.y + dCoeff * ptP2.y, (1 - dCoeff) * ptP1.z + dCoeff * ptP2.z) Return ptMedia End Function ' Quadrato della distanza Shared Function SqDist(ByRef ptP1 As Point3d, ByRef ptP2 As Point3d) As Double Return (ptP2 - ptP1).SqLen() End Function ' Distanza Shared Function Dist(ByRef ptP1 As Point3d, ByRef ptP2 As Point3d) As Double Return (ptP2 - ptP1).Len() End Function ' Sono lo stesso punto approssimativamente Shared Function SameApprox(ByRef ptP1 As Point3d, ByRef ptP2 As Point3d) As Boolean Return (ptP2 - ptP1).SqLen() < EPS_SMALL * EPS_SMALL End Function ' Traslazione Function Move(ByRef VtMove As Vector3d) As Boolean Return EgtPointTranslate(x, y, z, VtMove) End Function ' Rotazione Function Rotate(ByRef PtAx As Point3d, ByRef VtAx As Vector3d, ByVal dAngRotDeg As Double) As Boolean Return EgtPointRotate(x, y, z, PtAx, VtAx, dAngRotDeg) End Function ' Scalatura Function Scale(ByRef frRef As Frame3d, ByVal dCoeffX As Double, ByVal dCoeffY As Double, ByVal dCoeffZ As Double) As Boolean Return EgtPointScale(x, y, z, frRef.Orig(), frRef.VersX(), frRef.VersY(), frRef.VersZ(), dCoeffX, dCoeffY, dCoeffZ) End Function ' Mirror Function Mirror(ByRef PtOn As Point3d, ByRef VtNorm As Vector3d) As Boolean Return EgtPointMirror(x, y, z, PtOn, VtNorm) End Function ' Shear Function Shear(ByRef PtOn As Point3d, ByRef VtNorm As Vector3d, ByRef VtDir As Vector3d, ByVal dCoeff As Double) As Boolean Return EgtPointShear(x, y, z, PtOn, VtNorm, VtDir, dCoeff) End Function ' Cambio di riferimento : dal riferimento al globale Function ToGlob(ByRef frRef As Frame3d) As Boolean If frRef.IsValid Then Return EgtPointToGlob(x, y, z, frRef.Orig(), frRef.VersX(), frRef.VersY(), frRef.VersZ()) Else Return False End If End Function ' Cambio di riferimento : dal globale al riferimento Function ToLoc(ByRef frRef As Frame3d) As Boolean If frRef.IsValid Then Return EgtPointToLoc(x, y, z, frRef.Orig(), frRef.VersX(), frRef.VersY(), frRef.VersZ()) Else Return False End If End Function ' Cambio di riferimento : dal primo riferimento al secondo Function LocToLoc(ByRef frSou As Frame3d, ByRef frDest As Frame3d) As Boolean If frSou.IsValid And frDest.IsValid Then Return EgtPointLocToLoc(x, y, z, frSou.Orig(), frSou.VersX(), frSou.VersY(), frSou.VersZ(), frDest.Orig(), frDest.VersX(), frDest.VersY(), frDest.VersZ()) Else Return False End If End Function ' Restituisce punto in globale partendo da espressione nel riferimento dell'oggetto Function Glob(ByVal nId As Integer) As Point3d Dim ptP As New Point3d(x, y, z) EgtPointToIdGlob(ptP, nId) Return ptP End Function ' Restituisce punto nel riferimento dell'oggetto partendo da espressione in globale Function Loc(ByVal nId As Integer) As Point3d Dim ptP As New Point3d(x, y, z) EgtPointToIdLoc(ptP, nId) Return ptP End Function ' Restituisce punto nel riferimento del 2°oggetto partendo da espressione nel riferimento del 1° oggetto Function LocLoc(ByVal nIdSou As Integer, ByVal nIdDest As Integer) As Point3d Dim ptP As New Point3d(x, y, z) If EgtPointToIdGlob(ptP, nIdSou) And EgtPointToIdLoc(ptP, nIdDest) Then Return ptP Else Return Me End If End Function ' Punto Origine Shared Function ORIG() As Point3d Return New Point3d(0, 0, 0) End Function End Structure Class Frame3d ' Membri Private PtOrig As Point3d Private VtDirX, VtDirY, VtDirZ As Vector3d Private bOk As Boolean ' Costruttori Sub New() PtOrig = Point3d.ORIG VtDirX = Vector3d.X_AX VtDirY = Vector3d.Y_AX VtDirZ = Vector3d.Z_AX bOk = True End Sub Sub New(ByRef PtOri As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d) PtOrig = PtOri VtDirX = VtX VtDirY = VtY VtDirZ = VtZ bOk = VtDirX.Normalize() And VtDirY.Normalize() And VtDirZ.Normalize() And Verify() End Sub Sub New(ByRef PtOri As Point3d) PtOrig = PtOri VtDirX = Vector3d.X_AX VtDirY = Vector3d.Y_AX VtDirZ = Vector3d.Z_AX bOk = True End Sub Sub New(ByRef frFrame As Frame3d) PtOrig = frFrame.Orig() VtDirX = frFrame.VersX() VtDirY = frFrame.VersY() VtDirZ = frFrame.VersZ() bOk = True End Sub ' Inizializzatori Public Function Setup(ByRef PtOri As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d) As Boolean PtOrig = PtOri VtDirX = VtX VtDirY = VtY VtDirZ = VtZ bOk = VtDirX.Normalize() And VtDirY.Normalize() And VtDirZ.Normalize() And Verify() Return bOk End Function Public Function Setup(ByRef PtOri As Point3d) As Boolean PtOrig = PtOri VtDirX = Vector3d.X_AX VtDirY = Vector3d.Y_AX VtDirZ = Vector3d.Z_AX bOk = True Return bOk End Function Public Function Setup(ByRef PtOri As Point3d, ByRef PtOnX As Point3d, ByRef PtNearY As Point3d) As Boolean Return EgtFrameFrom3Points(PtOri, PtOnX, PtNearY, PtOrig, VtDirX, VtDirY, VtDirZ) End Function Public Function Setup(ByRef PtOri As Point3d, ByRef VtZ As Vector3d) As Boolean Return EgtFrameOCS(PtOri, VtZ, PtOrig, VtDirX, VtDirY, VtDirZ) End Function ' Cambio origine Public Function ChangeOrigin(ByRef PtOri As Point3d) As Boolean PtOrig = PtOri Return True End Function ' Verifica Private Function Verify() As Boolean ' verifica della ortogonalità dei versori e del senso destrorso Dim dOrtXY As Double = VtDirX * VtDirY Dim dOrtYZ As Double = VtDirY * VtDirZ Dim dOrtZX As Double = VtDirZ * VtDirX Dim vtTmp As Vector3d = VtDirX ^ VtDirY Dim dRight As Double = vtTmp * VtDirZ If Math.Abs(dOrtXY) > EPS_ZERO Or Math.Abs(dOrtYZ) > EPS_ZERO Or Math.Abs(dOrtZX) > EPS_ZERO Or dRight < EPS_ZERO Then Return False Else Return True End If End Function Public Function IsValid() As Boolean Return bOk End Function ' Restituzione componenti Function Orig() As Point3d Return PtOrig End Function Function VersX() As Vector3d Return VtDirX End Function Function VersY() As Vector3d Return VtDirY End Function Function VersZ() As Vector3d Return VtDirZ End Function ' Traslazione Function Move(ByRef VtMove As Vector3d) As Boolean If bOk Then Return EgtFrameTranslate(PtOrig, VtDirX, VtDirY, VtDirZ, VtMove) Else Return False End If End Function ' Rotazione Function Rotate(ByRef PtAx As Point3d, ByRef VtAx As Vector3d, ByVal dAngRotDeg As Double) As Boolean If bOk Then Return EgtFrameRotate(PtOrig, VtDirX, VtDirY, VtDirZ, PtAx, VtAx, dAngRotDeg) Else Return False End If End Function ' Cambio di riferimento : dal riferimento al globale Function ToGlob(ByRef frRef As Frame3d) As Boolean If bOk And frRef.IsValid Then Return EgtFrameToGlob(PtOrig, VtDirX, VtDirY, VtDirZ, frRef.Orig(), frRef.VersX(), frRef.VersY(), frRef.VersZ()) Else Return False End If End Function ' Cambio di riferimento : dal globale al riferimento Function ToLoc(ByRef frRef As Frame3d) As Boolean If bOk And frRef.IsValid Then Return EgtFrameToLoc(PtOrig, VtDirX, VtDirY, VtDirZ, frRef.Orig(), frRef.VersX(), frRef.VersY(), frRef.VersZ()) Else Return False End If End Function ' Cambio di riferimento : dal primo riferimento al secondo Function LocToLoc(ByRef frSou As Frame3d, ByRef frDest As Frame3d) As Boolean If frSou.IsValid And frDest.IsValid Then Return EgtFrameLocToLoc(PtOrig, VtDirX, VtDirY, VtDirZ, frSou.Orig(), frSou.VersX(), frSou.VersY(), frSou.VersZ(), frDest.Orig(), frDest.VersX(), frDest.VersY(), frDest.VersZ()) Else Return False End If End Function ' Riferimento Globale o Identità Shared Function GLOB() As Frame3d Return New Frame3d End Function End Class Structure Color3d ' Membri Dim R, G, B, A As Integer ' Costruttori Sub New(ByVal nRed As Integer, ByVal nGreen As Integer, ByVal nBlue As Integer, Optional ByVal nAlpha As Integer = 100) R = nRed G = nGreen B = nBlue A = nAlpha End Sub Sub New(ByRef colSou As Color3d) R = colSou.R G = colSou.G B = colSou.B A = colSou.A End Sub ' Inizializzatori Sub Setup(ByVal nRed As Integer, ByVal nGreen As Integer, ByVal nBlue As Integer, Optional ByVal nAlpha As Integer = 100) R = nRed G = nGreen B = nBlue A = nAlpha End Sub ' Conversione a System.Drawing.Color Function ToColor() As System.Drawing.Color Return System.Drawing.Color.FromArgb(A * 255 / 100, R, G, B) End Function ' Conversione da System.Drawing.Color Sub FromColor(ByVal SysCol As System.Drawing.Color) R = SysCol.R G = SysCol.G B = SysCol.B A = SysCol.A * 100 / 255 End Sub End Structure #If PLATFORM = "x64" Then #If DEBUG Then Const EgtIntDll As String = "EgtInterfaceD64.dll" #Else Const EgtIntDll As String = "EgtInterfaceR64.dll" #End If #Else #If DEBUG Then Const EgtIntDll As String = "EgtInterfaceD32.dll" #Else Const EgtIntDll As String = "EgtInterfaceR32.dll" #End If #End If '---------- General ------------------------------------------------------------ Public Function EgtInit(ByVal nDebug As Integer, ByVal sLogFile As String, Optional ByVal sLogMsg As String = "") As Boolean End Function Public Function EgtExit() As Boolean End Function Public Function EgtSetKey(ByVal sKey As String) As Boolean End Function Public Function EgtSetFont(ByVal sNfeFontDir As String, ByVal sDefaultFont As String) As Boolean End Function Private Function EgtGetNfeFontDir(ByRef psNfeFontDir As IntPtr) As Boolean End Function Public Function EgtGetNfeFontDir(ByRef sNfeFontDir As String) As Boolean Dim psNfeFontDir As IntPtr Dim bOk As Boolean = EgtGetNfeFontDir(psNfeFontDir) If bOk Then sNfeFontDir = Marshal.PtrToStringUni(psNfeFontDir) EgtFreeMemory(psNfeFontDir) Else sNfeFontDir = String.Empty End If Return bOk End Function Private Function EgtGetDefaultFont(ByRef psDefaultFont As IntPtr) As Boolean End Function Public Function EgtGetDefaultFont(ByRef sDefaultFont As String) As Boolean Dim psDefaultFont As IntPtr Dim bOk As Boolean = EgtGetDefaultFont(psDefaultFont) If bOk Then sDefaultFont = Marshal.PtrToStringUni(psDefaultFont) EgtFreeMemory(psDefaultFont) Else sDefaultFont = String.Empty End If Return bOk End Function Public Function EgtSetLuaLibs(ByVal sLuaLibsDir As String) As Boolean End Function Public Function EgtSetCommandLogger(ByVal sLogFile As String) As Boolean End Function Public Sub EgtEnableCommandLogger() End Sub Public Sub EgtDisableCommandLogger() End Sub Private Function EgtGetVersionInfo(ByRef psVerInfo As IntPtr) As Boolean End Function Public Function EgtGetVersionInfo(ByRef sVerInfo As String) As Boolean Dim psVerInfo As IntPtr Dim bOk As Boolean = EgtGetVersionInfo(psVerInfo) If bOk Then sVerInfo = Marshal.PtrToStringUni(psVerInfo) EgtFreeMemory(psVerInfo) Else sVerInfo = String.Empty End If Return bOk End Function Private Function EgtGetOsInfo(ByRef psOsInfo As IntPtr) As Boolean End Function Public Function EgtGetOsInfo(ByRef sOsInfo As String) As Boolean Dim psOsInfo As IntPtr Dim bOk As Boolean = EgtGetOsInfo(psOsInfo) If bOk Then sOsInfo = Marshal.PtrToStringUni(psOsInfo) EgtFreeMemory(psOsInfo) Else sOsInfo = String.Empty End If Return bOk End Function Private Function EgtGetCpuInfo(ByRef psCpuInfo As IntPtr) As Boolean End Function Public Function EgtGetCpuInfo(ByRef sCpuInfo As String) As Boolean Dim psCpuInfo As IntPtr Dim bOk As Boolean = EgtGetCpuInfo(psCpuInfo) If bOk Then sCpuInfo = Marshal.PtrToStringUni(psCpuInfo) EgtFreeMemory(psCpuInfo) Else sCpuInfo = String.Empty End If Return bOk End Function Private Function EgtGetMemoryInfo(ByRef psMemInfo As IntPtr) As Boolean End Function Public Function EgtGetMemoryInfo(ByRef sMemInfo As String) As Boolean Dim psMemInfo As IntPtr Dim bOk As Boolean = EgtGetMemoryInfo(psMemInfo) If bOk Then sMemInfo = Marshal.PtrToStringUni(psMemInfo) EgtFreeMemory(psMemInfo) Else sMemInfo = String.Empty End If Return bOk End Function Public Function EgtFreeMemory(ByVal sB As IntPtr) As Boolean End Function Public Function EgtOutLog(ByVal sMag As String) As Boolean End Function '---------- GeomDb ------------------------------------------------------------- Public Function EgtInitGeomDB() As Integer End Function Public Function EgtSetCurrentContext(ByVal nCtx As Integer) As Boolean End Function Public Function EgtResetCurrentContext() As Boolean End Function Public Function EgtGetCurrentContext() As Integer End Function Public Function EgtSetDefaultMaterial(ByRef DefCol As Color3d) As Boolean End Function Private Function EgtSetGridFrame(ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d) As Boolean End Function Public Function EgtSetGridFrame(ByRef frRef As Frame3d) As Boolean Return EgtSetGridFrame(frRef.Orig(), frRef.VersX(), frRef.VersY(), frRef.VersZ()) End Function Private Function EgtGetGridFrame(ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d) As Boolean End Function Public Function EgtGetGridFrame() As Frame3d Dim PtOrig As Point3d Dim VtDirX, VtDirY, VtDirZ As Vector3d If Not EgtGetGridFrame(PtOrig, VtDirX, VtDirY, VtDirZ) Then Dim frRef As New Frame3d Return frRef Else Dim frRef As New Frame3d(PtOrig, VtDirX, VtDirY, VtDirZ) Return frRef End If End Function Public Function EgtGetGridOrigin() As Point3d Dim PtOrig As Point3d Dim VtDirX, VtDirY, VtDirZ As Vector3d EgtGetGridFrame(PtOrig, VtDirX, VtDirY, VtDirZ) Return PtOrig End Function Public Function EgtGetGridVersX() As Vector3d Dim PtOrig As Point3d Dim VtDirX, VtDirY, VtDirZ As Vector3d EgtGetGridFrame(PtOrig, VtDirX, VtDirY, VtDirZ) Return VtDirX End Function Public Function EgtGetGridVersY() As Vector3d Dim PtOrig As Point3d Dim VtDirX, VtDirY, VtDirZ As Vector3d EgtGetGridFrame(PtOrig, VtDirX, VtDirY, VtDirZ) Return VtDirY End Function Public Function EgtGetGridVersZ() As Vector3d Dim PtOrig As Point3d Dim VtDirX, VtDirY, VtDirZ As Vector3d EgtGetGridFrame(PtOrig, VtDirX, VtDirY, VtDirZ) Return VtDirZ End Function Public Function EgtSetCurrFilePath(ByVal sFilePath As String) As Boolean End Function Private Function EgtGetCurrFilePath(ByRef psFilePath As IntPtr) As Boolean End Function Public Function EgtGetCurrFilePath(ByRef sFilePath As String) As Boolean Dim psFilePath As IntPtr Dim bOk As Boolean = EgtGetCurrFilePath(psFilePath) If bOk Then sFilePath = Marshal.PtrToStringUni(psFilePath) EgtFreeMemory(psFilePath) Else sFilePath = String.Empty End If Return bOk End Function Public Function EgtEnableModified() As Boolean End Function Public Function EgtDisableModified() As Boolean End Function Public Function EgtSetModified() As Boolean End Function Public Function EgtResetModified() As Boolean End Function Public Function EgtGetModified() As Boolean End Function Public Function EgtNewFile() As Boolean End Function Public Function EgtOpenFile(ByVal sFilePath As String) As Boolean End Function Public Function EgtInsertFile(ByVal sFilePath As String) As Boolean End Function Public Function EgtSaveFile(ByVal sFilePath As String, ByVal nFlag As NGE) As Boolean End Function '---------- Exchange ----------------------------------------------------------- Public Function EgtGetFileType(ByVal sFilePath As String) As Integer End Function Public Function EgtImportDxf(ByVal sFilePath As String) As Boolean End Function Public Function EgtImportStl(ByVal sFilePath As String) As Boolean End Function Public Function EgtImportCnc(ByVal sFilePath As String) As Boolean End Function Public Function EgtExportDxf(ByVal nId As Integer, ByVal sFilePath As String) As Boolean End Function Public Function EgtExportStl(ByVal nId As Integer, ByVal sFilePath As String) As Boolean End Function '---------- Tsc Executor ------------------------------------------------------- Public Function EgtInitTscExec() As Boolean End Function Public Function EgtTscExecFile(ByVal sFilePath As String) As Boolean End Function Public Function EgtTscExecLine(ByVal sLine As String) As Boolean End Function '---------- LUA Executor ------------------------------------------------------- Public Function EgtLuaEvalNumExpr(ByVal sLine As String, ByRef dVal As Double) As Boolean End Function Private Function EgtLuaEvalStringExpr(ByVal sLine As String, ByRef psVal As IntPtr) As Boolean End Function Public Function EgtLuaEvalStringExpr(ByVal sLine As String, ByRef sVal As String) As Boolean Dim psVal As IntPtr Dim bOk As Boolean = EgtLuaEvalStringExpr(sLine, psVal) If bOk Then sVal = Marshal.PtrToStringUni(psVal) EgtFreeMemory(psVal) Else sVal = String.Empty End If Return bOk End Function Public Function EgtLuaExecLine(ByVal sLine As String) As Boolean End Function Public Function EgtLuaExecFile(ByVal sFilePath As String) As Boolean End Function Public Function EgtLuaRequire(ByVal sFilePath As String) As Boolean End Function Private Function EgtLuaGetLastError(ByRef psError As IntPtr) As Boolean End Function Public Function EgtLuaGetLastError(ByRef sError As String) As Boolean Dim psError As IntPtr Dim bOk As Boolean = EgtLuaGetLastError(psError) If bOk Then sError = Marshal.PtrToStringUni(psError) EgtFreeMemory(psError) Else sError = String.Empty End If Return bOk End Function '---------- GeomDb Objects Create ---------------------------------------------- Private Function EgtCreateGroup(ByVal nParentId As Integer, ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d, ByVal nRefType As REF_TY) As Integer End Function Public Function EgtCreateGroup(ByVal nParentId As Integer, ByRef frRef As Frame3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer Return EgtCreateGroup(nParentId, frRef.Orig(), frRef.VersX(), frRef.VersY(), frRef.VersZ(), nRefType) End Function Public Function EgtCreateGroup(ByVal nParentId As Integer) As Integer Return EgtCreateGroup(nParentId, Point3d.ORIG(), Vector3d.X_AX, Vector3d.Y_AX, Vector3d.Z_AX, REF_TY.LOC) End Function Public Function EgtCreateGeoPoint(ByVal nParentId As Integer, ByRef PtP As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateGeoVector(ByVal nParentId As Integer, ByRef vtV As Vector3d, ByRef PtB As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Private Function EgtCreateGeoFrame(ByVal nParentId As Integer, ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d, ByVal nRefType As REF_TY) As Integer End Function Public Function EgtCreateGeoFrame(ByVal nParentId As Integer, ByRef frRef As Frame3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer Return EgtCreateGeoFrame(nParentId, frRef.Orig(), frRef.VersX(), frRef.VersY(), frRef.VersZ(), nRefType) End Function Public Function EgtCreateCurveLine(ByVal nParentId As Integer, ByRef PtStart As Point3d, ByRef PtEnd As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateCurveLineEx(ByVal nParentId As Integer, ByRef PtStart As Point3d, ByVal nSepS As SEP, ByVal nIdS As Integer, ByRef PtEnd As Point3d, ByVal nSepE As SEP, ByVal nIdE As Integer, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateCurveLinePVL(ByVal nParentId As Integer, ByRef PtStart As Point3d, ByRef VtDir As Vector3d, ByVal dLen As Double, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateCurveCircle(ByVal nParentId As Integer, ByRef PtCen As Point3d, ByRef VtNorm As Vector3d, ByVal dRad As Double, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateCurveCircleCPN(ByVal nParentId As Integer, ByRef PtCen As Point3d, ByRef PtOn As Point3d, ByRef VtNorm As Vector3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateCurveCircleCPNEx(ByVal nParentId As Integer, ByRef PtCen As Point3d, ByRef PtOn As Point3d, ByVal nSepO As SEP, ByVal nIdO As Integer, ByRef VtNorm As Vector3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateCurveArc3P(ByVal nParentId As Integer, ByRef PtStart As Point3d, ByRef PtMid As Point3d, ByRef PtEnd As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateCurveArcC2PN(ByVal nParentId As Integer, ByRef PtCen As Point3d, ByRef PtStart As Point3d, ByRef PtEnd As Point3d, ByRef VtNorm As Vector3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateCurveArcC2PNEx(ByVal nParentId As Integer, ByRef PtCen As Point3d, ByRef PtStart As Point3d, ByVal nSepS As SEP, ByVal nIdS As Integer, ByRef PtEnd As Point3d, ByRef VtNorm As Vector3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateCurveArc2PVN(ByVal nParentId As Integer, ByRef PtStart As Point3d, ByRef PtEnd As Point3d, ByRef VtDirS As Vector3d, ByRef VtNorm As Vector3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateCurveArc2PVNEx(ByVal nParentId As Integer, ByRef PtStart As Point3d, ByRef PtEnd As Point3d, ByVal nSepE As SEP, ByVal nIdE As Integer, ByRef VtDirS As Vector3d, ByRef VtNorm As Vector3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateCurveCompoByChain(ByVal nParentId As Integer, ByVal nNumCrv As Integer, ByVal nCrvId() As Integer, ByRef PtNearStart As Point3d, ByVal bCrvErase As Boolean, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateRectangle3P(ByVal nParentId As Integer, ByRef PtStart As Point3d, ByRef PtCross As Point3d, ByRef PtDir As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreatePolygonFromRadius(ByVal nParentId As Integer, ByVal nNumSides As Integer, ByRef PtCen As Point3d, ByRef PtCorn As Point3d, ByRef VtNorm As Vector3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreatePolygonFromApothem(ByVal nParentId As Integer, ByVal nNumSides As Integer, ByRef PtCen As Point3d, ByRef PtMid As Point3d, ByRef VtNorm As Vector3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreatePolygonFromSide(ByVal nParentId As Integer, ByVal nNumSides As Integer, ByRef PtStart As Point3d, ByRef PtFin As Point3d, ByRef VtNorm As Vector3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateSurfTmByFlatContour(ByVal nParentId As Integer, ByVal nCrvId As Integer, ByVal dLinTol As Double) As Integer End Function Public Function EgtCreateSurfTmByRegion(ByVal nParentId As Integer, ByVal nNumCrv As Integer, ByVal nCrvId() As Integer, ByVal dLinTol As Double) As Integer End Function Public Function EgtCreateSurfTmByExtrusion(ByVal nParentId As Integer, ByVal nNumCrv As Integer, ByVal nCrvId() As Integer, ByRef VtExtr As Vector3d, ByVal dLinTol As Double, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateSurfTmByRegionExtrusion(ByVal nParentId As Integer, ByVal nNumCrv As Integer, ByVal nCrvId() As Integer, ByRef VtExtr As Vector3d, ByVal dLinTol As Double, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateSurfTmByRevolve(ByVal nParentId As Integer, ByVal nCrvId As Integer, ByRef PtAx As Point3d, ByRef VtAx As Vector3d, ByVal bCapEnds As Boolean, ByVal dLinTol As Double, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateSurfTmByScrewing(ByVal nParentId As Integer, ByVal nCrvId As Integer, ByRef PtAx As Point3d, ByRef VtAx As Vector3d, ByVal dAngRotDeg As Double, ByVal dMove As Double, ByVal dLinTol As Double, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateSurfTmRuled(ByVal nParentId As Integer, ByVal nCrvId1 As Integer, ByVal nCrvId2 As Integer, ByVal dLinTol As Double) As Integer End Function Public Function EgtCreateSurfTmBySewing(ByVal nParentId As Integer, ByVal nNumSrf As Integer, ByVal nSrfId() As Integer, ByVal bSrfErase As Boolean) As Integer End Function Public Function EgtCreateText(ByVal nParentId As Integer, ByRef ptP As Point3d, ByVal dAngRotDeg As Double, ByVal sText As String, ByVal dH As Double, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateTextEx(ByVal nParentId As Integer, ByRef ptP As Point3d, ByRef vtN As Vector3d, ByRef vtD As Vector3d, ByVal sText As String, ByVal sFont As String, ByVal bItalic As Boolean, ByVal dH As Double, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function Public Function EgtCreateTextAdv(ByVal nParentId As Integer, ByRef ptP As Point3d, ByRef vtN As Vector3d, ByRef vtD As Vector3d, ByVal sText As String, ByVal sFont As String, ByVal nW As Integer, ByVal bItalic As Boolean, ByVal dH As Double, ByVal dRat As Double, ByVal dAddAdv As Double, ByVal nInsPos As Integer, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer End Function '---------- GeomDb Objects Modify ---------------------------------------------- Private Function EgtChangeGroupFrame(ByVal nId As Integer, ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d, ByVal nRefType As REF_TY) As Boolean End Function Public Function EgtChangeGroupFrame(ByVal nId As Integer, ByRef frRef As Frame3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Boolean Return EgtChangeGroupFrame(nId, frRef.Orig(), frRef.VersX(), frRef.VersY(), frRef.VersZ(), nRefType) End Function Public Function EgtChangeVectorBase(ByVal nId As Integer, ByRef PtBase As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Boolean End Function Public Function EgtInvertSurface(ByVal nId As Integer) As Boolean End Function Public Function EgtFlipText(ByVal nId As Integer) As Boolean End Function Public Function EgtMirrorText(ByVal nId As Integer, ByVal bOnL As Boolean) As Boolean End Function Public Function EgtExplodeText(ByVal nId As Integer) As Boolean End Function '---------- GeomDb Curves Modify ----------------------------------------------- Public Function EgtInvertCurve(ByVal nId As Integer) As Boolean End Function Public Function EgtChangeClosedCurveStartPoint(ByVal nId As Integer, ByRef PtStart As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Boolean End Function Public Function EgtModifyCurveStartPoint(ByVal nId As Integer, ByRef PtStart As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Boolean End Function Public Function EgtModifyCurveEndPoint(ByVal nId As Integer, ByRef PtEnd As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Boolean End Function Public Function EgtModifyCurveExtrusion(ByVal nId As Integer, ByRef VtExtr As Vector3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Boolean End Function Public Function EgtModifyCurveThickness(ByVal nId As Integer, ByVal bTh As Double) As Boolean End Function Public Function EgtExtendCurveStartByLen(ByVal nId As Integer, ByVal dLen As Double) As Boolean End Function Public Function EgtExtendCurveEndByLen(ByVal nId As Integer, ByVal dLen As Double) As Boolean End Function Public Function EgtTrimExtendCurveByLen(ByVal nId As Integer, ByVal dLen As Double, ByRef PtNear As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Boolean End Function Public Function EgtSplitCurve(ByVal nId As Integer, ByVal nParts As Integer) As Boolean End Function Public Function EgtSplitCurveAtPoint(ByVal nId As Integer, ByRef PtOn As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Boolean End Function Public Function EgtOffsetCurve(ByVal nId As Integer, ByVal dDist As Double, ByVal nType As OFF_TYPE) As Boolean End Function Public Function EgtModifyCurveCircleCPN(ByVal nId As Integer, ByRef PtOn As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Boolean End Function Public Function EgtModifyCurveArcRadius(ByVal nId As Integer, ByVal dRad As Double) As Boolean End Function Public Function EgtModifyCurveArcC2PN(ByVal nId As Integer, ByRef PtEnd As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Boolean End Function Public Function EgtModifyCurveArc3P(ByVal nId As Integer, ByRef PtMid As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Boolean End Function Public Function EgtExplodeCurveCompo(ByVal nId As Integer) As Boolean End Function Public Function EgtExplodeCurveBezier(ByVal nId As Integer, ByVal bArcsVsLines As Boolean, ByVal dLinTol As Double) As Boolean End Function '---------- GeomDb Parts & Layers ---------------------------------------------- Public Function EgtGetCurrPart() As Integer End Function Public Function EgtGetCurrLayer() As Integer End Function Public Function EgtSetCurrPartLayer(ByVal nPartId As Integer, ByVal nLayerId As Integer) As Integer End Function Public Function EgtResetCurrPartLayer() As Integer End Function Public Function EgtGetFirstVisiblePart() As Integer End Function Public Function EgtGetNextVisiblePart(ByVal nPartId As Integer) As Integer End Function Public Function EgtGetFirstVisibleLayer(ByVal nPartId As Integer) As Integer End Function Public Function EgtGetNextVisibleLayer(ByVal nLayerId As Integer) As Integer End Function Public Function EgtSelectPartObjs(ByVal nPartId As Integer) As Boolean End Function Public Function EgtDeselectPartObjs(ByVal nPartId As Integer) As Boolean End Function Public Function EgtSelectLayerObjs(ByVal nLayerId As Integer) As Boolean End Function Public Function EgtDeselectLayerObjs(ByVal nLayerId As Integer) As Boolean End Function '---------- GeomDb Objects ----------------------------------------------------- Public Function EgtExistsObj(ByVal nId As Integer) As Boolean End Function Public Function EgtGetParent(ByVal nId As Integer) As Integer End Function Private Function EgtGetGroupGlobFrame(ByVal nId As Integer, ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d) As Boolean End Function Public Function EgtGetGroupGlobFrame(ByVal nId As Integer, ByRef frGRef As Frame3d) As Boolean Dim PtOrig As Point3d Dim VtDirX, VtDirY, VtDirZ As Vector3d If Not EgtGetGroupGlobFrame(nId, PtOrig, VtDirX, VtDirY, VtDirZ) Then Return False Else Return frGRef.Setup(PtOrig, VtDirX, VtDirY, VtDirZ) End If End Function Public Function EgtGetGroupObjs(ByVal nGroupId As Integer) As Integer End Function Public Function EgtGetFirstInGroup(ByVal nGroupId As Integer) As Integer End Function Public Function EgtGetNext(ByVal nId As Integer) As Integer End Function Public Function EgtGetLastInGroup(ByVal nGroupId As Integer) As Integer End Function Public Function EgtGetPrev(ByVal nId As Integer) As Integer End Function Public Function EgtGetFirstGroupInGroup(ByVal nGroupId As Integer) As Integer End Function Public Function EgtGetNextGroup(ByVal nId As Integer) As Integer End Function Public Function EgtGetLastGroupInGroup(ByVal nGroupId As Integer) As Integer End Function Public Function EgtGetPrevGroup(ByVal nId As Integer) As Integer End Function Public Function EgtGetBBox(ByVal nId As Integer, ByVal nFlag As Integer, ByRef PtMin As Point3d, ByRef PtMax As Point3d) As Boolean End Function Public Function EgtGetBBoxGlob(ByVal nId As Integer, ByVal nFlag As Integer, ByRef PtMin As Point3d, ByRef PtMax As Point3d) As Boolean End Function Public Function EgtCopy(ByVal nId As Integer, ByVal nRefId As Integer, Optional ByVal nSonBeforeAfter As GDB_POS = GDB_POS.SON) As Integer End Function Public Function EgtCopyGlob(ByVal nId As Integer, ByVal nRefId As Integer, Optional ByVal nSonBeforeAfter As GDB_POS = GDB_POS.SON) As Integer End Function Public Function EgtRelocate(ByVal nId As Integer, ByVal nRefId As Integer, Optional ByVal nSonBeforeAfter As GDB_POS = GDB_POS.SON) As Integer End Function Public Function EgtRelocateGlob(ByVal nId As Integer, ByVal nRefId As Integer, Optional ByVal nSonBeforeAfter As GDB_POS = GDB_POS.SON) As Integer End Function Public Function EgtErase(ByVal nId As Integer) As Boolean End Function Public Function EgtEmptyGroup(ByVal nId As Integer) As Boolean End Function Public Function EgtGetType(ByVal nId As Integer) As GDB_TY End Function Private Function EgtGetTitle(ByVal nId As Integer, ByRef psTitle As IntPtr) As Boolean End Function Public Function EgtGetTitle(ByVal nId As Integer, ByRef sTitle As String) As Boolean Dim psTitle As IntPtr Dim bOk As Boolean = EgtGetTitle(nId, psTitle) If bOk Then sTitle = Marshal.PtrToStringUni(psTitle) EgtFreeMemory(psTitle) Else sTitle = String.Empty End If Return bOk End Function Private Function EgtGroupDump(ByVal nId As Integer, ByRef psDump As IntPtr) As Boolean End Function Public Function EgtGroupDump(ByVal nId As Integer, ByRef sDump As String) As Boolean Dim psDump As IntPtr Dim bOk As Boolean = EgtGroupDump(nId, psDump) If bOk Then sDump = Marshal.PtrToStringUni(psDump) EgtFreeMemory(psDump) Else sDump = String.Empty End If Return bOk End Function Private Function EgtGeoObjDump(ByVal nId As Integer, ByRef psDump As IntPtr) As Boolean End Function Public Function EgtGeoObjDump(ByVal nId As Integer, ByRef sDump As String) As Boolean Dim psDump As IntPtr Dim bOk As Boolean = EgtGeoObjDump(nId, psDump) If bOk Then sDump = Marshal.PtrToStringUni(psDump) EgtFreeMemory(psDump) Else sDump = String.Empty End If Return bOk End Function '---------- GeomDb Obj Attributes ---------------------------------------------- Public Function EgtSetLevel(ByVal nId As Integer, ByVal nLevel As Integer) As Boolean End Function Public Function EgtRevertLevel(ByVal nId As Integer) As Boolean End Function Public Function EgtGetLevel(ByVal nId As Integer, ByRef nLevel As Integer) As Boolean End Function Public Function EgtGetCalcLevel(ByVal nId As Integer, ByRef nLevel As Integer) As Boolean End Function Public Function EgtSetMode(ByVal nId As Integer, ByVal nMode As Integer) As Boolean End Function Public Function EgtRevertMode(ByVal nId As Integer) As Boolean End Function Public Function EgtGetMode(ByVal nId As Integer, ByRef nMode As Integer) As Boolean End Function Public Function EgtGetCalcMode(ByVal nId As Integer, ByRef nMode As Integer) As Boolean End Function Public Function EgtSetStatus(ByVal nId As Integer, ByVal nStat As Integer) As Boolean End Function Public Function EgtRevertStatus(ByVal nId As Integer) As Boolean End Function Public Function EgtGetStatus(ByVal nId As Integer, ByRef nStat As Integer) As Boolean End Function Public Function EgtGetCalcStatus(ByVal nId As Integer, ByRef nStat As Integer) As Boolean End Function Public Function EgtIsVisibleObj(ByVal nId As Integer) As Boolean Dim nStat As GDB_ST = GDB_ST.ON_ Return EgtGetCalcStatus(nId, nStat) AndAlso nStat <> GDB_ST.OFF End Function Public Function EgtSetMark(ByVal nId As Integer) As Boolean End Function Public Function EgtResetMark(ByVal nId As Integer) As Boolean End Function Public Function EgtGetMark(ByVal nId As Integer, ByRef bMark As Boolean) As Boolean End Function Public Function EgtGetCalcMark(ByVal nId As Integer, ByRef bMark As Boolean) As Boolean End Function Public Function EgtSetColor(ByVal nId As Integer, ByRef ColObj As Color3d, Optional ByVal bSetAlpha As Boolean = True) As Boolean End Function Public Function EgtSetAlpha(ByVal nId As Integer, ByVal nAlpha As Integer) As Boolean End Function Public Function EgtResetColor(ByVal nId As Integer) As Boolean End Function Public Function EgtGetColor(ByVal nId As Integer, ByRef ColObj As Color3d) As Boolean End Function Public Function EgtGetCalcColor(ByVal nId As Integer, ByRef ColObj As Color3d) As Boolean End Function Public Function EgtSetName(ByVal nId As Integer, ByVal sName As String) As Boolean End Function Private Function EgtGetName(ByVal nId As Integer, ByRef psName As IntPtr) As Boolean End Function Public Function EgtGetName(ByVal nId As Integer, ByRef sName As String) As Boolean Dim psName As IntPtr Dim bOk As Boolean = EgtGetName(nId, psName) If bOk Then sName = Marshal.PtrToStringUni(psName) EgtFreeMemory(psName) Else sName = String.Empty End If Return bOk End Function Public Function EgtExistsName(ByVal nId As Integer) As Boolean End Function Public Function EgtRemoveName(ByVal nId As Integer) As Boolean End Function Public Function EgtSetInfo(ByVal nId As Integer, ByVal sKey As String, ByVal sInfo As String) As Boolean End Function Private Function EgtGetInfo(ByVal nId As Integer, ByVal sKey As String, ByRef psInfo As IntPtr) As Boolean End Function Public Function EgtGetInfo(ByVal nId As Integer, ByVal sKey As String, ByRef sInfo As String) As Boolean Dim psInfo As IntPtr Dim bOk As Boolean = EgtGetInfo(nId, sKey, psInfo) If bOk Then sInfo = Marshal.PtrToStringUni(psInfo) EgtFreeMemory(psInfo) Else sInfo = String.Empty End If Return bOk End Function Private Function EgtGetInfoInt(ByVal nId As Integer, ByVal sKey As String, ByRef nInfo As Integer) As Boolean End Function Public Function EgtGetInfo(ByVal nId As Integer, ByVal sKey As String, ByRef nInfo As Integer) As Boolean Return EgtGetInfoInt(nId, sKey, nInfo) End Function Public Function EgtExistsInfo(ByVal nId As Integer, ByVal sKey As String) As Boolean End Function Public Function EgtRemoveInfo(ByVal nId As Integer, ByVal sKey As String) As Boolean End Function '---------- GeomDb Obj Selection ----------------------------------------------- Public Function EgtSelectObj(ByVal nId As Integer) As Boolean End Function Public Function EgtDeselectObj(ByVal nId As Integer) As Boolean End Function Public Function EgtSelectAll(Optional ByVal bOnlyIfVisible As Boolean = False) As Boolean End Function Public Function EgtDeselectAll() As Boolean End Function Public Function EgtSelectGroupObjs(ByVal nGroupId As Integer) As Boolean End Function Public Function EgtDeselectGroupObjs(ByVal nGroupId As Integer) As Boolean End Function Public Function EgtIsSelectedObj(ByVal nId As Integer) As Boolean End Function Public Function EgtGetSelectedObjNbr() As Integer End Function Public Function EgtGetFirstSelectedObj() As Integer End Function Public Function EgtGetNextSelectedObj() As Integer End Function Public Function EgtGetLastSelectedObj() As Integer End Function Public Function EgtGetPrevSelectedObj() As Integer End Function '---------- GeomDb Obj Transform ----------------------------------------------- Public Function EgtMove(ByVal nId As Integer, ByRef VtMove As Vector3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Boolean End Function Public Function EgtRotate(ByVal nId As Integer, ByRef PtAx As Point3d, ByRef VtAx As Vector3d, ByVal dAngRotDeg As Double, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Boolean End Function Private Function EgtScale(ByVal nId As Integer, ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d, ByVal dCoeffX As Double, ByVal dCoeffY As Double, ByVal dCoeffZ As Double, ByVal nRefType As REF_TY) As Boolean End Function Public Function EgtScale(ByVal nId As Integer, ByRef Frame As Frame3d, ByVal dCoeffX As Double, ByVal dCoeffY As Double, ByVal dCoeffZ As Double, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Boolean Return EgtScale(nId, Frame.Orig(), Frame.VersX(), Frame.VersY(), Frame.VersZ(), dCoeffX, dCoeffY, dCoeffZ, nRefType) End Function Public Function EgtMirror(ByVal nId As Integer, ByRef PtOn As Point3d, ByRef VtNorm As Vector3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Boolean End Function Public Function EgtShear(ByVal nId As Integer, ByRef PtOn As Point3d, ByRef VtNorm As Vector3d, ByRef VtDir As Vector3d, ByVal dCoeff As Double, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Boolean End Function Public Function EgtMoveGroup(ByVal nId As Integer, ByRef VtMove As Vector3d) As Boolean End Function Public Function EgtRotateGroup(ByVal nId As Integer, ByRef PtAx As Point3d, ByRef VtAx As Vector3d, ByVal dAngRotDeg As Double) As Boolean End Function Private Function EgtScaleGroup(ByVal nId As Integer, ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d, ByVal dCoeffX As Double, ByVal dCoeffY As Double, ByVal dCoeffZ As Double) As Boolean End Function Public Function EgtScaleGroup(ByVal nId As Integer, ByRef Frame As Frame3d, ByVal dCoeffX As Double, ByVal dCoeffY As Double, ByVal dCoeffZ As Double) As Boolean Return EgtScaleGroup(nId, Frame.Orig(), Frame.VersX(), Frame.VersY(), Frame.VersZ(), dCoeffX, dCoeffY, dCoeffZ) End Function Public Function EgtMirrorGroup(ByVal nId As Integer, ByRef PtOn As Point3d, ByRef VtNorm As Vector3d) As Boolean End Function Public Function EgtShearGroup(ByVal nId As Integer, ByRef PtOn As Point3d, ByRef VtNorm As Vector3d, ByRef VtDir As Vector3d, ByVal dCoeff As Double) As Boolean End Function '---------- GeomDb Snap Vector/Point/Frame ------------------------------------- Public Function EgtStartPoint(ByVal nId As Integer, ByVal nRefId As Integer, ByRef PtP As Point3d) As Boolean End Function Public Function EgtStartPoint(ByVal nId As Integer, ByRef PtP As Point3d) As Boolean Return EgtStartPoint(nId, nId, PtP) End Function Public Function EgtEndPoint(ByVal nId As Integer, ByVal nRefId As Integer, ByRef PtP As Point3d) As Boolean End Function Public Function EgtEndPoint(ByVal nId As Integer, ByRef PtP As Point3d) As Boolean Return EgtEndPoint(nId, nId, PtP) End Function Public Function EgtMidPoint(ByVal nId As Integer, ByVal nRefId As Integer, ByRef PtP As Point3d) As Boolean End Function Public Function EgtMidPoint(ByVal nId As Integer, ByRef PtP As Point3d) As Boolean Return EgtMidPoint(nId, nId, PtP) End Function Public Function EgtCenterPoint(ByVal nId As Integer, ByVal nRefId As Integer, ByRef PtP As Point3d) As Boolean End Function Public Function EgtCenterPoint(ByVal nId As Integer, ByRef PtP As Point3d) As Boolean Return EgtCenterPoint(nId, nId, PtP) End Function Public Function EgtCentroid(ByVal nId As Integer, ByVal nRefId As Integer, ByRef PtP As Point3d) As Boolean End Function Public Function EgtCentroid(ByVal nId As Integer, ByRef PtP As Point3d) As Boolean Return EgtCentroid(nId, nId, PtP) End Function Public Function EgtAtParamPoint(ByVal nId As Integer, ByVal dU As Double, ByVal nRefId As Integer, ByRef PtP As Point3d) As Boolean End Function Public Function EgtAtParamPoint(ByVal nId As Integer, ByVal dU As Double, ByRef PtP As Point3d) As Boolean Return EgtAtParamPoint(nId, dU, nId, PtP) End Function Public Function EgtNearPoint(ByVal nId As Integer, ByRef PtNear As Point3d, ByVal nRefId As Integer, ByRef PtP As Point3d) As Boolean End Function Public Function EgtNearPoint(ByVal nId As Integer, ByRef PtNear As Point3d, ByRef PtP As Point3d) As Boolean Return EgtNearPoint(nId, PtNear, nId, PtP) End Function Public Function EgtIntersectionPoint(ByVal nId1 As Integer, ByVal nId2 As Integer, ByRef PtNear As Point3d, ByVal nRefId As Integer, ByRef PtP As Point3d) As Boolean End Function Public Function EgtIntersectionPoint(ByVal nId1 As Integer, ByVal nId2 As Integer, ByRef PtNear As Point3d, ByRef PtP As Point3d) As Boolean Return EgtIntersectionPoint(nId1, nId2, PtNear, nId1, PtP) End Function Public Function EgtStartVector(ByVal nId As Integer, ByVal nRefId As Integer, ByRef VtV As Vector3d) As Boolean End Function Public Function EgtStartVector(ByVal nId As Integer, ByRef VtV As Vector3d) As Boolean Return EgtStartVector(nId, nId, VtV) End Function Public Function EgtEndVector(ByVal nId As Integer, ByVal nRefId As Integer, ByRef VtV As Vector3d) As Boolean End Function Public Function EgtEndVector(ByVal nId As Integer, ByRef VtV As Vector3d) As Boolean Return EgtEndVector(nId, nId, VtV) End Function Public Function EgtMidVector(ByVal nId As Integer, ByVal nRefId As Integer, ByRef VtV As Vector3d) As Boolean End Function Public Function EgtMidVector(ByVal nId As Integer, ByRef VtV As Vector3d) As Boolean Return EgtMidVector(nId, nId, VtV) End Function Public Function EgtAtParamVector(ByVal nId As Integer, ByVal dU As Double, ByVal nRefId As Integer, ByRef VtV As Vector3d) As Boolean End Function Public Function EgtAtParamVector(ByVal nId As Integer, ByVal dU As Double, ByRef VtV As Vector3d) As Boolean Return EgtAtParamVector(nId, dU, nId, VtV) End Function Public Function EgtCurveLength(ByVal nId As Integer, ByRef dLen As Double) As Boolean End Function Public Function EgtCurveLengthAtPoint(ByVal nId As Integer, ByRef ptOn As Point3d, ByRef dLen As Double) As Boolean End Function Public Function EgtCurveExtrusion(ByVal nId As Integer, ByVal nRefId As Integer, ByRef VtExtr As Vector3d) As Boolean End Function Public Function EgtCurveExtrusion(ByVal nId As Integer, ByRef VtExtr As Vector3d) As Boolean Return EgtCurveExtrusion(nId, nId, VtExtr) End Function Public Function EgtCurveThickness(ByVal nId As Integer, ByRef dThick As Double) As Boolean End Function Public Function EgtGetMinDistPointCurve(ByRef ptP As Point3d, ByVal nId As Integer, ByRef dDist As Double) As Boolean End Function Public Function EgtGetMinDistPntSidePointCurve(ByRef ptP As Point3d, ByVal 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 EgtCurveArcNormVersor(ByVal nId As Integer, ByVal nRefId As Integer, ByRef VtNorm As Vector3d) As Boolean End Function Public Function EgtCurveArcNormVersor(ByVal nId As Integer, ByRef VtNorm As Vector3d) As Boolean Return EgtCurveArcNormVersor(nId, nId, VtNorm) End Function Public Function EgtSurfTmFacetFromTria(ByVal nId As Integer, ByVal nT As Integer) As Integer End Function Public Function EgtSurfTmFacetNearestEndPoint(ByVal nId As Integer, ByVal nF As Integer, ByRef PtNear As Point3d, ByVal nRefId As Integer, ByRef PtP As Point3d, ByRef VtNorm As Vector3d) As Boolean End Function Public Function EgtSurfTmFacetNearestEndPoint(ByVal nId As Integer, ByVal nF As Integer, ByRef PtNear As Point3d, ByRef PtP As Point3d, ByRef VtNorm As Vector3d) As Boolean Return EgtSurfTmFacetNearestEndPoint(nId, nF, PtNear, nId, PtP, VtNorm) End Function Public Function EgtSurfTmFacetCenter(ByVal nId As Integer, ByVal nF As Integer, ByVal nRefId As Integer, ByRef PtP As Point3d, ByRef VtNorm As Vector3d) As Boolean End Function Public Function EgtSurfTmFacetCenter(ByVal nId As Integer, ByVal nF As Integer, ByRef PtP As Point3d, ByRef VtNorm As Vector3d) As Boolean Return EgtSurfTmFacetCenter(nId, nF, nId, PtP, VtNorm) End Function Public Function EgtSurfTmFacetNormVersor(ByVal nId As Integer, ByVal nF As Integer, ByVal nRefId As Integer, ByRef VtNorm As Vector3d) As Boolean End Function Public Function EgtSurfTmFacetNormVersor(ByVal nId As Integer, ByVal nF As Integer, ByRef VtNorm As Vector3d) As Boolean Return EgtSurfTmFacetNormVersor(nId, nF, nId, VtNorm) End Function Public Function EgtExtTextNormVersor(ByVal nId As Integer, ByVal nRefId As Integer, ByRef VtNorm As Vector3d) As Boolean End Function Public Function EgtExtTextNormVersor(ByVal nId As Integer, ByRef VtNorm As Vector3d) As Boolean Return EgtExtTextNormVersor(nId, nId, VtNorm) End Function Private Function EgtPointToIdGlob(ByRef PtP As Point3d, ByVal nId As Integer) As Boolean End Function Private Function EgtPointToIdLoc(ByRef PtP As Point3d, ByVal nId As Integer) As Boolean End Function Private Function EgtVectorToIdGlob(ByRef VtV As Vector3d, ByVal nId As Integer) As Boolean End Function Private Function EgtVectorToIdLoc(ByRef VtV As Vector3d, ByVal nId As Integer) As Boolean End Function '---------- Scene -------------------------------------------------------------- Public Function EgtInitScene(ByVal hWnd As IntPtr, ByVal nDriver As Integer, ByVal b2Buff As Boolean, ByVal nColorBits As Integer, ByVal nDepthBits As Integer) As Boolean End Function Private Function EgtGetSceneInfo(ByRef psInfo As IntPtr) As Boolean End Function Public Function EgtGetSceneInfo(ByRef sInfo As String) As Boolean Dim psInfo As IntPtr Dim bOk As Boolean = EgtGetSceneInfo(psInfo) If bOk Then sInfo = Marshal.PtrToStringUni(psInfo) EgtFreeMemory(psInfo) Else sInfo = String.Empty End If Return bOk End Function Public Function EgtSetBackground(ByRef colTop As Color3d, ByRef colBottom As Color3d, Optional ByVal bRedraw As Boolean = True) As Boolean End Function Public Function EgtSetMarkAttribs(ByRef colMark As Color3d) As Boolean End Function Public Function EgtSetSelSurfAttribs(ByRef colSelSurf As Color3d) As Boolean End Function Public Function EgtSetGeoLineAttribs(ByRef colGl As Color3d) As Boolean End Function Public Function EgtSetGeoTriaAttribs(ByRef colGt As Color3d) As Boolean End Function Public Function EgtSetWinRectAttribs(ByVal bOutline As Boolean, ByRef colWr As Color3d) As Boolean End Function Public Function EgtSetGlobFrameShow(ByVal bShow As Boolean) As Boolean End Function Public Function EgtSetGridShow(ByVal bShowGrid As Boolean, ByVal bShowFrame As Boolean) As Boolean End Function Public Function EgtSetGridGeo(ByVal dSnapStep As Double, ByVal nMinLineSstep As Integer, ByVal nMajLineSstep As Integer, ByVal nExtSstep As Integer) As Boolean End Function Public Function EgtSetGridColor(ByRef colMinLine As Color3d, ByRef colMajLine As Color3d) As Boolean End Function Public Function EgtResize(ByVal nW As Integer, ByVal nH As Integer) As Boolean End Function Public Function EgtDraw() As Boolean End Function Private Function EgtSelect(ByVal nWinX As Integer, ByVal nWinY As Integer, ByVal nSelW As Integer, ByVal nSelH As Integer, ByRef nSel As Integer) As Boolean End Function Public Function EgtSelect(ByVal Curr As Point, ByVal nSelW As Integer, ByVal nSelH As Integer, ByRef nSel As Integer) As Boolean Return EgtSelect(Curr.X, Curr.Y, nSelW, nSelH, nSel) End Function Public Function EgtGetFirstObjInSelWin() As Integer End Function Public Function EgtGetNextObjInSelWin() As Integer End Function Public Function EgtUnselectableAdd(ByVal nId As Integer) As Boolean End Function Public Function EgtUnselectableRemove(ByVal nId As Integer) As Boolean End Function Public Function EgtUnselectableClearAll() As Boolean End Function Private Function EgtGetPointFromSelect(ByVal nSelId As Integer, ByVal nWinX As Integer, ByVal nWinY As Integer, ByRef ptP As Point3d, ByRef nAux As Integer) As Boolean End Function Public Function EgtGetPointFromSelect(ByVal nSelId As Integer, ByVal PtWin As Point, ByRef ptP As Point3d, ByRef nAux As Integer) As Boolean Return EgtGetPointFromSelect(nSelId, PtWin.X, PtWin.Y, ptP, nAux) End Function Private Function EgtGetGraphicSnapPoint(ByVal nSnap As Integer, ByVal nWinX As Integer, ByVal nWinY As Integer, ByVal nSelW As Integer, ByVal nSelH As Integer, ByRef ptP As Point3d) As Boolean End Function Public Function EgtGetGraphicSnapPoint(ByVal nSnap As Integer, ByVal PtWin As Point, ByVal nSelW As Integer, ByVal nSelH As Integer, ByRef ptP As Point3d) As Boolean Return EgtGetGraphicSnapPoint(nSnap, PtWin.X, PtWin.Y, nSelW, nSelH, ptP) End Function Private Function EgtGetGridSnapPointZ(ByVal bSketch As Boolean, ByVal nWinX As Integer, ByVal nWinY As Integer, ByRef ptGrid As Point3d, ByRef ptP As Point3d) As Boolean End Function Public Function EgtGetGridSnapPointZ(ByVal bSketch As Boolean, ByVal PtWin As Point, ByVal ptGrid As Point3d, ByRef ptP As Point3d) As Boolean Return EgtGetGridSnapPointZ(bSketch, PtWin.X, PtWin.Y, ptGrid, ptP) End Function Public Function EgtGetLastSnapId() As Integer End Function Public Function EgtGetLastSnapDir(ByRef VtDir As Vector3d) As Boolean End Function 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 Public Function EgtSetShowMode(ByVal nShowMode As SM, Optional ByVal bRedraw As Boolean = True) As Boolean End Function Public Function EgtGetShowMode() As Integer End Function Public Function EgtSetShowCurveDirection(ByVal bShow As Boolean, Optional ByVal bRedraw As Boolean = True) As Boolean End Function Public Function EgtGetShowCurveDirection() As Boolean End Function Public Function EgtSetShowTriaAdv(ByVal bAdvanced As Boolean, Optional ByVal bRedraw As Boolean = True) As Boolean End Function Public Function EgtGetShowTriaAdv() As Boolean End Function Public Function EgtZoom(ByVal nZoom As ZM, Optional ByVal bRedraw As Boolean = True) As Boolean End Function Private Function EgtZoomOnPoint(ByVal nWinX As Integer, ByVal nWinY As Integer, ByVal dCoeff As Double, ByVal bRedraw As Boolean) As Boolean End Function Public Function EgtZoomOnPoint(ByVal Curr As Point, ByVal dCoeff As Double, Optional ByVal bRedraw As Boolean = True) As Boolean Return EgtZoomOnPoint(Curr.X, Curr.Y, dCoeff, bRedraw) End Function Public Function EgtSetGeoLine(ByRef ptP1 As Point3d, ByRef ptP2 As Point3d, Optional ByVal bRedraw As Boolean = True) As Boolean End Function Public Function EgtResetGeoLine(Optional ByVal bRedraw As Boolean = True) As Boolean End Function Public Function EgtSetGeoTria(ByRef ptP1 As Point3d, ByRef ptP2 As Point3d, ByRef ptP3 As Point3d, Optional ByVal bRedraw As Boolean = True) As Boolean End Function Public Function EgtResetGeoTria(Optional ByVal bRedraw As Boolean = True) As Boolean End Function Private Function EgtSetWinRect(ByVal nPrevX As Integer, ByVal nPrevY As Integer, ByVal nCurrX As Integer, ByVal nCurrY As Integer, ByVal bRedraw As Boolean) As Boolean End Function Public Function EgtSetWinRect(ByVal Prev As Point, ByVal Curr As Point, Optional ByVal bRedraw As Boolean = True) As Boolean Return EgtSetWinRect(Prev.X, Prev.Y, Curr.X, Curr.Y, bRedraw) End Function Public Function EgtResetWinRect(Optional ByVal bRedraw As Boolean = True) As Boolean End Function Private Function EgtZoomWin(ByVal nPrevX As Integer, ByVal nPrevY As Integer, ByVal nCurrX As Integer, ByVal nCurrY As Integer, ByVal bRedraw As Boolean) As Boolean End Function Public Function EgtZoomWin(ByVal Prev As Point, ByVal Curr As Point, Optional ByVal bRedraw As Boolean = True) As Boolean Return EgtZoomWin(Prev.X, Prev.Y, Curr.X, Curr.Y, bRedraw) End Function Public Function EgtSetView(ByVal nView As VT, Optional ByVal bRedraw As Boolean = True) As Boolean End Function Private Function EgtPanView(ByVal nPrevX As Integer, ByVal nPrevY As Integer, ByVal nCurrX As Integer, ByVal nCurrY As Integer, ByVal bRedraw As Boolean) As Boolean End Function Public Function EgtPanView(ByVal Prev As Point, ByVal Curr As Point, Optional ByVal bRedraw As Boolean = True) As Boolean Return EgtPanView(Prev.X, Prev.Y, Curr.X, Curr.Y, bRedraw) End Function Private Function EgtRotateView(ByVal nPrevX As Integer, ByVal nPrevY As Integer, ByVal nCurrX As Integer, ByVal nCurrY As Integer, ByVal bRedraw As Boolean) As Boolean End Function Public Function EgtRotateView(ByVal Prev As Point, ByVal Curr As Point, Optional ByVal bRedraw As Boolean = True) As Boolean Return EgtRotateView(Prev.X, Prev.Y, Curr.X, Curr.Y, bRedraw) End Function Public Function EgtGetView(ByRef nDir As Integer) As Boolean End Function Public Function EgtGetGenericView(ByRef dAngVertDeg As Double, ByRef dAngHorizDeg As Double) As Boolean End Function Public Function EgtProjectPoint(ByRef ptP As Point3d, ByRef ptWin As Point3d) As Boolean End Function Private Function EgtUnProjectPoint(ByVal nWinX As Integer, ByVal nWinY As Integer, ByRef ptP As Point3d) As Boolean End Function Public Function EgtUnProjectPoint(ByVal Curr As Point, ByRef ptP As Point3d) As Boolean Return EgtUnProjectPoint(Curr.X, Curr.Y, ptP) End Function '---------- Geo Base ----------------------------------------------------------- Private Function EgtVectorNormalize(ByRef X As Double, ByRef Y As Double, ByRef Z As Double, Optional ByVal dEps As Double = EPS_SMALL) As Boolean End Function Private Function EgtVectorRotate(ByRef X As Double, ByRef Y As Double, ByRef Z As Double, ByRef VtAx As Vector3d, ByVal dAngRotDeg As Double) As Boolean End Function Private Function EgtVectorScale(ByRef X As Double, ByRef Y As Double, ByRef Z As Double, ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d, ByVal dCoeffX As Double, ByVal dCoeffY As Double, ByVal dCoeffZ As Double) As Boolean End Function Private Function EgtVectorMirror(ByRef X As Double, ByRef Y As Double, ByRef Z As Double, ByRef VtNorm As Vector3d) As Boolean End Function Private Function EgtVectorShear(ByRef X As Double, ByRef Y As Double, ByRef Z As Double, ByRef VtNorm As Vector3d, ByRef VtDir As Vector3d, ByVal dCoeff As Double) As Boolean End Function Private Function EgtVectorToGlob(ByRef X As Double, ByRef Y As Double, ByRef Z As Double, ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d) As Boolean End Function Private Function EgtVectorToLoc(ByRef X As Double, ByRef Y As Double, ByRef Z As Double, ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d) As Boolean End Function Private Function EgtVectorLocToLoc(ByRef X As Double, ByRef Y As Double, ByRef Z As Double, ByRef PtO1 As Point3d, ByRef VtX1 As Vector3d, ByRef VtY1 As Vector3d, ByRef VtZ1 As Vector3d, ByRef PtO2 As Point3d, ByRef VtX2 As Vector3d, ByRef VtY2 As Vector3d, ByRef VtZ2 As Vector3d) As Boolean End Function Public Function EgtGetVectorRotation(ByRef VtS As Vector3d, ByRef VtE As Vector3d, ByRef VtAx As Vector3d, ByRef dAngRotDeg As Double, ByRef bDet As Boolean) As Boolean End Function Private Function EgtPointTranslate(ByRef X As Double, ByRef Y As Double, ByRef Z As Double, ByRef VtMove As Vector3d) As Boolean End Function Private Function EgtPointRotate(ByRef X As Double, ByRef Y As Double, ByRef Z As Double, ByRef PtAx As Point3d, ByRef VtAx As Vector3d, ByVal dAngRotDeg As Double) As Boolean End Function Private Function EgtPointScale(ByRef X As Double, ByRef Y As Double, ByRef Z As Double, ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d, ByVal dCoeffX As Double, ByVal dCoeffY As Double, ByVal dCoeffZ As Double) As Boolean End Function Private Function EgtPointMirror(ByRef X As Double, ByRef Y As Double, ByRef Z As Double, ByRef PtOn As Point3d, ByRef VtNorm As Vector3d) As Boolean End Function Private Function EgtPointShear(ByRef X As Double, ByRef Y As Double, ByRef Z As Double, ByRef PtOn As Point3d, ByRef VtNorm As Vector3d, ByRef VtDir As Vector3d, ByVal dCoeff As Double) As Boolean End Function Private Function EgtPointToGlob(ByRef X As Double, ByRef Y As Double, ByRef Z As Double, ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d) As Boolean End Function Private Function EgtPointToLoc(ByRef X As Double, ByRef Y As Double, ByRef Z As Double, ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d) As Boolean End Function Private Function EgtPointLocToLoc(ByRef X As Double, ByRef Y As Double, ByRef Z As Double, ByRef PtO1 As Point3d, ByRef VtX1 As Vector3d, ByRef VtY1 As Vector3d, ByRef VtZ1 As Vector3d, ByRef PtO2 As Point3d, ByRef VtX2 As Vector3d, ByRef VtY2 As Vector3d, ByRef VtZ2 As Vector3d) As Boolean End Function Private Function EgtFrameFrom3Points(ByRef PtO As Point3d, ByRef PtOnX As Point3d, ByRef PtOnY As Point3d, ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d) As Boolean End Function Private Function EgtFrameOCS(ByRef PtO As Point3d, ByRef VtDirZ As Vector3d, ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d) As Boolean End Function Private Function EgtFrameTranslate(ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d, ByRef VtMove As Vector3d) As Boolean End Function Private Function EgtFrameRotate(ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d, ByRef PtAx As Point3d, ByRef VtAx As Vector3d, ByVal dAngRotDeg As Double) As Boolean End Function Private Function EgtFrameToGlob(ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d, ByRef PtO1 As Point3d, ByRef VtX1 As Vector3d, ByRef VtY1 As Vector3d, ByRef VtZ1 As Vector3d) As Boolean End Function Private Function EgtFrameToLoc(ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d, ByRef PtO1 As Point3d, ByRef VtX1 As Vector3d, ByRef VtY1 As Vector3d, ByRef VtZ1 As Vector3d) As Boolean End Function Private Function EgtFrameLocToLoc(ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d, ByRef PtO1 As Point3d, ByRef VtX1 As Vector3d, ByRef VtY1 As Vector3d, ByRef VtZ1 As Vector3d, ByRef PtO2 As Point3d, ByRef VtX2 As Vector3d, ByRef VtY2 As Vector3d, ByRef VtZ2 As Vector3d) As Boolean End Function '---------- Messages ----------------------------------------------------------- Public Function EgtLoadMessages(ByVal sMsgFilePath As String) As Boolean End Function Private Function EgtGetMsg(ByVal nId As Integer) As IntPtr End Function Public Function EgtMsg(ByVal nId As Integer) As String Return Marshal.PtrToStringUni(EgtGetMsg(nId)) ' Non è necessario liberare la memoria nativa perchè usa un buffer statico End Function '---------- Costanti ----------------------------------------------------------- 'Costanti : GEOMETRIA Public Const EPS_SMALL As Double = 0.001 Public Const EPS_ZERO As Double = 0.0000001 Public Const EPS_STM As Double = 0.05 Public Const EPS_STM_DRAG As Double = 0.5 'Costanti : TIPO DI FILE Public Enum FT As Integer NULL = 0 NGE = 1 NFE = 2 DXF = 11 STL = 12 CNC = 13 TSC = 101 LUA = 102 End Enum 'Costanti : FORMATO FILE NGE Public Enum NGE As Integer TEXT = 0 BIN = 1 CMPTEXT = 2 End Enum 'Costanti : ID GEOMDB Public Enum GDB_ID As Integer ROOT = 0 NULL = -1 SEL = -2 GRID = -3 End Enum 'Costanti : TIPO OGGETTI Public Enum GDB_TY As Integer NONE = 0 GROUP = 2 GEO_VECTOR = 128 GEO_POINT = 129 GEO_FRAME = 130 CRV_LINE = 256 CRV_ARC = 257 CRV_BEZ = 258 CRV_COMPO = 259 SRF_MESH = 512 VOL_ZMAP = 1024 EXT_TEXT = 2048 End Enum 'Costanti : TIPO RIFERIMENTO DI DATI GEOMETRICI Public Enum REF_TY As Integer GLOB = 0 LOC = 1 GRID = 2 End Enum 'Costanti : POSIZIONE DI COPIA DI UN OGGETTO Public Enum GDB_POS As Integer BEFORE = -1 SON = 0 AFTER = 1 End Enum 'Costanti : LIVELLO DI UN OGGETTO Public Enum GDB_LV As Integer USER = 1 SYSTEM = 2 TEMP = 3 End Enum 'Costanti : MODO DI UN OGGETTO Public Enum GDB_MD As Integer STD = 1 LOCKED = 2 HIDDEN = 3 End Enum 'Costanti : STATO DI UN OGGETTO Public Enum GDB_ST As Integer OFF = 0 ON_ = 1 SEL = 2 End Enum 'Costanti : TIPO VISUALIZZAZIONE Public Enum SM As Integer WIREFRAME = 0 HIDDENLINE = 1 SHADING = 2 End Enum 'Costanti : TIPO ZOOM Public Enum ZM As Integer ALL = 1 IN_ = 2 OUT = 3 End Enum 'Costanti : TIPO VISTA Public Enum VT As Integer NONE = 0 TOP = 1 FRONT = 2 RIGHT = 3 BACK = 4 LEFT = 5 BOTTOM = 6 ISO_SW = 7 ISO_SE = 8 ISO_NE = 9 ISO_NW = 10 CPLANE = 11 End Enum 'Costanti : TIPO SNAP POINT Public Enum SP As Integer PT_NONE = 0 PT_SKETCH = 1 PT_GRID = 2 PT_END = 3 PT_MID = 4 CENTER = 5 CENTROID = 6 PT_NEAR = 7 PT_INTERS = 8 PT_TANGENT = 9 PT_PERPENDICULAR = 10 PT_MINDIST = 11 End Enum 'Costanti : TIPO SELECTED POINT Public Enum SEP As Integer PT_STD = 0 PT_TG = 1 PT_PERP = 2 PT_MINDIST = 3 End Enum 'Costanti : flag per BBOX Public Enum BBF As Integer STANDARD = 0 ONLY_VISIBLE = 1 IGNORE_TEXT = 2 IGNORE_DIM = 4 EXACT = 8 End Enum 'Costanti : tipo di offset Public Enum OFF_TYPE As Integer FILLET = 0 CHAMFER = 1 EXTEND = 2 MEDIA_INTDZ = 4 FORCE_OPEN = 8 NO_VERTLINE = 16 End Enum 'Costanti : posizione di inserimento per testi Public Enum INS_POS As Integer TL = 1 TC = 2 TR = 3 ML = 4 MC = 5 MR = 6 BL = 7 BC = 8 BR = 9 End Enum 'Costanti : interruzione di riga Public Const LINE_BREAK As String = "
" End Module