Files
TestEIn/EgtInterface.vb
T
Dario Sassi 960ec01efb TestEIn 1.5i1 :
- modifiche con aggiunta di Exec TSC.
2014-09-01 17:09:19 +00:00

241 lines
10 KiB
VB.net

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 di test
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function Summ(ByVal dA As Double, ByVal dB As Double) As Double
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function Summ2(ByRef dA As Double, ByVal dB As Double) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function Append(ByVal sA As String, ByRef sB As IntPtr) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function FreeMemory(ByVal sB As IntPtr) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function SetPoint(ByRef ptP As Point3d) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function OutText(ByVal hW As IntPtr, ByVal sA As String) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function DrawCross(ByVal hW As IntPtr, ByVal nX As Integer, ByVal nY As Integer, ByVal nDim As Integer) As Boolean
End Function
Public Shared Function Append(ByVal sA As String, ByRef sB As String) As Boolean
Dim sD As IntPtr
Dim bOk As Boolean = Append(sA, sD)
sB = Marshal.PtrToStringUni(sD)
FreeMemory(sD)
Return bOk
End Function
'API
'General
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtInit(ByVal nDebug As Integer, ByVal sLogFile As String) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtExit() As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtSetFont(ByVal sNfeFontDir As String, ByVal sDefaultFont As String) As Boolean
End Function
'GeomDB
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtInitGeomDB() As Integer
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtSetDefaultMaterial(ByVal nCtx As Integer, ByVal nRed As Integer, ByVal nGreen As Integer, ByVal nBlue As Integer) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtNewFile(ByVal nCtx As Integer) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtOpenFile(ByVal nCtx As Integer, ByVal sFilePath As String) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtSaveFile(ByVal nCtx As Integer, ByVal sFilePath As String, ByVal nFlag As Integer) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtGetFileType(ByVal sFilePath As String) As Integer
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtImportDxf(ByVal nCtx As Integer, ByVal sFilePath As String) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtImportStl(ByVal nCtx As Integer, ByVal sFilePath As String) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtExportDxf(ByVal nCtx As Integer, ByVal nId As Integer, ByVal sFilePath As String) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtExportStl(ByVal nCtx As Integer, ByVal nId As Integer, ByVal sFilePath As String) As Boolean
End Function
'Scene
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
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
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
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) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtDraw(ByVal nCtx As Integer) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtResize(ByVal nCtx As Integer, ByVal nW As Integer, ByVal nH As Integer) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtSetShowMode(ByVal nCtx As Integer, ByVal nShowMode As Integer, ByVal bRedraw As Boolean) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtSetShowCurveDirection(ByVal nCtx As Integer, ByVal bShow As Boolean, ByVal bRedraw As Boolean) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtZoom(ByVal nCtx As Integer, ByVal nZoom As Integer, ByVal bRedraw As Boolean) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
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, ByVal bRedraw As Boolean) As Boolean
Return EgtZoomOnPoint(nCtx, Curr.X, Curr.Y, dCoeff, bRedraw)
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
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, ByVal bRedraw As Boolean) As Boolean
Return EgtSetWinRect(nCtx, Prev.X, Prev.Y, Curr.X, Curr.Y, bRedraw)
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtResetWinRect(ByVal nCtx As Integer, ByVal bRedraw As Boolean) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
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, ByVal bRedraw As Boolean) As Boolean
Return EgtZoomWin(nCtx, Prev.X, Prev.Y, Curr.X, Curr.Y, bRedraw)
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtSetView(ByVal nCtx As Integer, ByVal nView As Integer, ByVal bRedraw As Boolean) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
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, ByVal bRedraw As Boolean) As Boolean
Return EgtPanCamera(nCtx, Prev.X, Prev.Y, Curr.X, Curr.Y, bRedraw)
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
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, ByVal bRedraw As Boolean) As Boolean
Return EgtRotateCamera(nCtx, Prev.X, Prev.Y, Curr.X, Curr.Y, bRedraw)
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtGetCameraDir(ByVal nCtx As Integer, ByRef nDir As Integer) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
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
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtInitTscExec(ByVal nCtx As Integer) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtTscFileExec(ByVal nCtx As Integer, ByVal sFilePath As String) As Boolean
End Function
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
Public Shared Function EgtTscLineExec(ByVal nCtx As Integer, ByVal sLine As String) As Boolean
End Function
'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
'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 GRUPPO RADICE
Public Const GDB_ID_ROOT As Integer = 0
End Class