Imports System.Runtime.InteropServices Public Class EgtInterface Structure Point3d Dim x, y, z As Double End Structure #If PLATFORM = "x64" Then #If DEBUG Then Const EgtInterface As String = "EgtInterfaceD64.dll" #Else Const EgtInterface As String = "EgtInterfaceR64.dll" #End If #Else #If DEBUG Then Const EgtInterface As String = "EgtInterfaceD32.dll" #Else Const EgtInterface As String = "EgtInterfaceR32.dll" #End If #End If 'API 'General Public Shared Function EgtInit(ByVal nDebug As Integer, ByVal sLogFile As String) As Boolean End Function Public Shared Function EgtExit() As Boolean End Function Public Shared Function EgtSetFont(ByVal sNfeFontDir As String, ByVal sDefaultFont As String) As Boolean End Function Public Shared Function EgtFreeMemory(ByVal sB As IntPtr) As Boolean End Function 'GeomDB Public Shared Function EgtInitGeomDB() As Integer End Function Public Shared Function EgtSetDefaultMaterial(ByVal nCtx As Integer, ByVal nRed As Integer, ByVal nGreen As Integer, ByVal nBlue As Integer) As Boolean End Function Public Shared Function EgtNewFile(ByVal nCtx As Integer) As Boolean End Function Public Shared Function EgtOpenFile(ByVal nCtx As Integer, ByVal sFilePath As String) As Boolean End Function Public Shared Function EgtSaveFile(ByVal nCtx As Integer, ByVal sFilePath As String, ByVal nFlag As Integer) As Boolean End Function Public Shared Function EgtGetFileType(ByVal sFilePath As String) As Integer End Function Public Shared Function EgtImportDxf(ByVal nCtx As Integer, ByVal sFilePath As String) As Boolean End Function Public Shared Function EgtImportStl(ByVal nCtx As Integer, ByVal sFilePath As String) As Boolean End Function Public Shared Function EgtExportDxf(ByVal nCtx As Integer, ByVal nId As Integer, ByVal sFilePath As String) As Boolean End Function Public Shared Function EgtExportStl(ByVal nCtx As Integer, ByVal nId As Integer, ByVal sFilePath As String) As Boolean End Function 'GeomDB Objects Public Shared Function EgtExistsObj(ByVal nCtx As Integer, ByVal nGroupId As Integer) As Boolean End Function Public Shared Function EgtGetFirstInGroup(ByVal nCtx As Integer, ByVal nGroupId As Integer) As Integer End Function Public Shared Function EgtGetNext(ByVal nCtx As Integer, ByVal nId As Integer) As Integer End Function Public Shared Function EgtGetLastInGroup(ByVal nCtx As Integer, ByVal nGroupId As Integer) As Integer End Function Public Shared Function EgtGetPrev(ByVal nCtx As Integer, ByVal nId As Integer) As Integer End Function Public Shared Function EgtGetType(ByVal nCtx As Integer, ByVal nId As Integer) As Integer End Function Private Shared Function EgtGetTitle(ByVal nCtx As Integer, ByVal nId As Integer, ByRef psTitle As IntPtr) As Boolean End Function Public Shared Function EgtGetTitle(ByVal nCtx As Integer, ByVal nId As Integer, ByRef sTitle As String) As Boolean Dim psTitle As IntPtr Dim bOk As Boolean = EgtGetTitle(nCtx, nId, psTitle) sTitle = Marshal.PtrToStringUni(psTitle) EgtFreeMemory(psTitle) Return bOk End Function Private Shared Function EgtGroupDump(ByVal nCtx As Integer, ByVal nId As Integer, ByRef psDump As IntPtr) As Boolean End Function Public Shared Function EgtGroupDump(ByVal nCtx As Integer, ByVal nId As Integer, ByRef sDump As String) As Boolean Dim psDump As IntPtr Dim bOk As Boolean = EgtGroupDump(nCtx, nId, psDump) sDump = Marshal.PtrToStringUni(psDump) EgtFreeMemory(psDump) Return bOk End Function Private Shared Function EgtGeoObjDump(ByVal nCtx As Integer, ByVal nId As Integer, ByRef psDump As IntPtr) As Boolean End Function Public Shared Function EgtGeoObjDump(ByVal nCtx As Integer, ByVal nId As Integer, ByRef sDump As String) As Boolean Dim psDump As IntPtr Dim bOk As Boolean = EgtGeoObjDump(nCtx, nId, psDump) sDump = Marshal.PtrToStringUni(psDump) EgtFreeMemory(psDump) Return bOk End Function 'GeomDB Obj attributes Public Shared Function EgtSetLevel(ByVal nCtx As Integer, ByVal nId As Integer, ByVal nLevel As Integer) As Boolean End Function Public Shared Function EgtRevertLevel(ByVal nCtx As Integer, ByVal nId As Integer) As Boolean End Function Public Shared Function EgtGetLevel(ByVal nCtx As Integer, ByVal nId As Integer, ByRef nLevel As Integer) As Boolean End Function Public Shared Function EgtGetCalcLevel(ByVal nCtx As Integer, ByVal nId As Integer, ByRef nLevel As Integer) As Boolean End Function Public Shared Function EgtSetMode(ByVal nCtx As Integer, ByVal nId As Integer, ByVal nMode As Integer) As Boolean End Function Public Shared Function EgtRevertMode(ByVal nCtx As Integer, ByVal nId As Integer) As Boolean End Function Public Shared Function EgtGetMode(ByVal nCtx As Integer, ByVal nId As Integer, ByRef nMode As Integer) As Boolean End Function Public Shared Function EgtGetCalcMode(ByVal nCtx As Integer, ByVal nId As Integer, ByRef nMode As Integer) As Boolean End Function Public Shared Function EgtSetStatus(ByVal nCtx As Integer, ByVal nId As Integer, ByVal nStat As Integer) As Boolean End Function Public Shared Function EgtRevertStatus(ByVal nCtx As Integer, ByVal nId As Integer) As Boolean End Function Public Shared Function EgtGetStatus(ByVal nCtx As Integer, ByVal nId As Integer, ByRef nStat As Integer) As Boolean End Function Public Shared Function EgtGetCalcStatus(ByVal nCtx As Integer, ByVal nId As Integer, ByRef nStat As Integer) As Boolean End Function Public Shared Function EgtSetMark(ByVal nCtx As Integer, ByVal nId As Integer) As Boolean End Function Public Shared Function EgtResetMark(ByVal nCtx As Integer, ByVal nId As Integer) As Boolean End Function Public Shared Function EgtGetMark(ByVal nCtx As Integer, ByVal nId As Integer, ByRef bMark As Boolean) As Boolean End Function Public Shared Function EgtGetCalcMark(ByVal nCtx As Integer, ByVal nId As Integer, ByRef bMark As Boolean) As Boolean End Function Public Shared Function EgtSetName(ByVal nCtx As Integer, ByVal nId As Integer, ByVal sName As String) As Boolean End Function Private Shared Function EgtGetName(ByVal nCtx As Integer, ByVal nId As Integer, ByRef psName As IntPtr) As Boolean End Function Public Shared Function EgtGetName(ByVal nCtx As Integer, ByVal nId As Integer, ByRef sName As String) As Boolean Dim psName As IntPtr Dim bOk As Boolean = EgtGetName(nCtx, nId, psName) sName = Marshal.PtrToStringUni(psName) EgtFreeMemory(psName) Return bOk End Function Public Shared Function EgtExistsName(ByVal nCtx As Integer, ByVal nId As Integer) As Boolean End Function Public Shared Function EgtRemoveName(ByVal nCtx As Integer, ByVal nId As Integer) As Boolean End Function Public Shared Function EgtSetInfo(ByVal nCtx As Integer, ByVal nId As Integer, ByVal sKey As String, ByVal sInfo As String) As Boolean End Function Private Shared Function EgtGetInfo(ByVal nCtx As Integer, ByVal nId As Integer, ByVal sKey As String, ByRef psInfo As IntPtr) As Boolean End Function Public Shared Function EgtGetInfo(ByVal nCtx As Integer, ByVal nId As Integer, ByVal sKey As String, ByRef sInfo As String) As Boolean Dim psInfo As IntPtr Dim bOk As Boolean = EgtGetInfo(nCtx, nId, sKey, psInfo) sInfo = Marshal.PtrToStringUni(psInfo) EgtFreeMemory(psInfo) Return bOk End Function Public Shared Function EgtExistsInfo(ByVal nCtx As Integer, ByVal nId As Integer, ByVal sKey As String) As Boolean End Function Public Shared Function EgtRemoveInfo(ByVal nCtx As Integer, ByVal nId As Integer, ByVal sKey As String) As Boolean End Function 'Scene Public Shared Function EgtInitScene(ByVal nCtx As Integer, ByVal hWnd As IntPtr, ByVal nDriver As Integer, ByVal b2Buff As Boolean, ByVal nColorBits As Integer, ByVal nDepthBits As Integer) As Boolean End Function Public Shared Function EgtSetBackground(ByVal nCtx As Integer, ByVal nTopRed As Integer, ByVal nTopGreen As Integer, ByVal nTopBlue As Integer, ByVal nBottomRed As Integer, ByVal nBottomGreen As Integer, ByVal nBottomBlue As Integer, Optional ByVal bRedraw As Boolean = True) As Boolean End Function Public Shared Function EgtDraw(ByVal nCtx As Integer) As Boolean End Function Public Shared Function EgtResize(ByVal nCtx As Integer, ByVal nW As Integer, ByVal nH As Integer) As Boolean End Function Public Shared Function EgtSetShowMode(ByVal nCtx As Integer, ByVal nShowMode As Integer, Optional ByVal bRedraw As Boolean = True) As Boolean End Function Public Shared Function EgtSetShowCurveDirection(ByVal nCtx As Integer, ByVal bShow As Boolean, Optional ByVal bRedraw As Boolean = True) As Boolean End Function Public Shared Function EgtZoom(ByVal nCtx As Integer, ByVal nZoom As Integer, Optional ByVal bRedraw As Boolean = True) As Boolean End Function Private Shared Function EgtZoomOnPoint(ByVal nCtx As Integer, ByVal nWinX As Integer, ByVal nWinY As Integer, ByVal dCoeff As Double, ByVal bRedraw As Boolean) As Boolean End Function Public Shared Function EgtZoomOnPoint(ByVal nCtx As Integer, ByVal Curr As Point, ByVal dCoeff As Double, Optional ByVal bRedraw As Boolean = True) As Boolean Return EgtZoomOnPoint(nCtx, Curr.X, Curr.Y, dCoeff, bRedraw) End Function Private Shared Function EgtSetWinRect(ByVal nCtx As Integer, 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 Shared Function EgtSetWinRect(ByVal nCtx As Integer, ByVal Prev As Point, ByVal Curr As Point, Optional ByVal bRedraw As Boolean = True) As Boolean Return EgtSetWinRect(nCtx, Prev.X, Prev.Y, Curr.X, Curr.Y, bRedraw) End Function Public Shared Function EgtResetWinRect(ByVal nCtx As Integer, Optional ByVal bRedraw As Boolean = True) As Boolean End Function Private Shared Function EgtZoomWin(ByVal nCtx As Integer, 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 Shared Function EgtZoomWin(ByVal nCtx As Integer, ByVal Prev As Point, ByVal Curr As Point, Optional ByVal bRedraw As Boolean = True) As Boolean Return EgtZoomWin(nCtx, Prev.X, Prev.Y, Curr.X, Curr.Y, bRedraw) End Function Public Shared Function EgtSetView(ByVal nCtx As Integer, ByVal nView As Integer, Optional ByVal bRedraw As Boolean = True) As Boolean End Function Private Shared Function EgtPanCamera(ByVal nCtx As Integer, 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 Shared Function EgtPanCamera(ByVal nCtx As Integer, ByVal Prev As Point, ByVal Curr As Point, Optional ByVal bRedraw As Boolean = True) As Boolean Return EgtPanCamera(nCtx, Prev.X, Prev.Y, Curr.X, Curr.Y, bRedraw) End Function Private Shared Function EgtRotateCamera(ByVal nCtx As Integer, 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 Shared Function EgtRotateCamera(ByVal nCtx As Integer, ByVal Prev As Point, ByVal Curr As Point, Optional ByVal bRedraw As Boolean = True) As Boolean Return EgtRotateCamera(nCtx, Prev.X, Prev.Y, Curr.X, Curr.Y, bRedraw) End Function Public Shared Function EgtGetCameraDir(ByVal nCtx As Integer, ByRef nDir As Integer) As Boolean End Function Private Shared Function EgtUnProjectPoint(ByVal nCtx As Integer, ByVal nWinX As Integer, ByVal nWinY As Integer, ByRef ptP As Point3d) As Boolean End Function Public Shared Function EgtUnProjectPoint(ByVal nCtx As Integer, ByVal Curr As Point, ByRef ptP As Point3d) As Boolean Return EgtUnProjectPoint(nCtx, Curr.X, Curr.Y, ptP) End Function 'TscExecutor Public Shared Function EgtInitTscExec(ByVal nCtx As Integer) As Boolean End Function Public Shared Function EgtTscFileExec(ByVal nCtx As Integer, ByVal sFilePath As String) As Boolean End Function Public Shared Function EgtTscLineExec(ByVal nCtx As Integer, ByVal sLine As String) As Boolean End Function 'Costanti : TIPO DI FILE Public Const FT_NULL As Integer = 0 Public Const FT_NGE As Integer = 1 Public Const FT_NFE As Integer = 2 Public Const FT_DXF As Integer = 11 Public Const FT_STL As Integer = 12 'Costanti : FORMATO FILE NGE Public Const NGE_TEXT As Integer = 0 Public Const NGE_BIN As Integer = 1 Public Const NGE_CMPTEXT As Integer = 2 'Costanti : ID GEOMDB Public Const GDB_ID_ROOT As Integer = 0 Public Const GDB_ID_NULL As Integer = -1 'Costanti : TIPO OGGETTI Public Const TY_NONE As Integer = 0 Public Const TY_GROUP As Integer = 2 Public Const TY_GEO_VECTOR As Integer = 128 Public Const TY_GEO_POINT As Integer = 129 Public Const TY_GEO_FRAME As Integer = 130 Public Const TY_CRV_LINE As Integer = 256 Public Const TY_CRV_ARC As Integer = 257 Public Const TY_CRV_BEZ As Integer = 258 Public Const TY_CRV_COMPO As Integer = 259 Public Const TY_SRF_MESH As Integer = 512 Public Const TY_EXT_TEXT As Integer = 1024 'Costanti : LIVELLO DI UN OGGETTO Public Const GDB_LV_USER As Integer = 1 Public Const GDB_LV_SYSTEM As Integer = 2 Public Const GDB_LV_TEMP As Integer = 3 'Costanti : MODO DI UN OGGETTO Public Const GDB_MD_STD As Integer = 1 Public Const GDB_MD_LOCKED As Integer = 2 Public Const GDB_MD_HIDDEN As Integer = 3 'Costanti : STATO DI UN OGGETTO Public Const GDB_ST_OFF As Integer = 0 Public Const GDB_ST_ON As Integer = 1 Public Const GDB_ST_SEL As Integer = 2 'Costanti : TIPO VISUALIZZAZIONE Public Const SM_WIREFRAME As Integer = 0 Public Const SM_HIDDENLINE As Integer = 1 Public Const SM_SHADING As Integer = 2 'Costanti : TIPO ZOOM Public Const ZM_ALL As Integer = 1 Public Const ZM_IN As Integer = 2 Public Const ZM_OUT As Integer = 3 'Costanti : TIPO VISTA Public Const CT_NONE As Integer = 0 Public Const CT_TOP As Integer = 1 Public Const CT_FRONT As Integer = 2 Public Const CT_RIGHT As Integer = 3 Public Const CT_BACK As Integer = 4 Public Const CT_LEFT As Integer = 5 Public Const CT_BOTTOM As Integer = 6 Public Const CT_ISO_SW As Integer = 7 Public Const CT_ISO_SE As Integer = 8 Public Const CT_ISO_NE As Integer = 9 Public Const CT_ISO_NW As Integer = 10 End Class