2b91dc0c7f
- primo commit.
159 lines
6.8 KiB
VB.net
159 lines
6.8 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 reali
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtSetLog(ByVal nDebug As Integer, ByVal sLogFile As String) 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
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtInit(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 EgtExit() As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtSetDefaultMaterial(ByVal nRed As Integer, ByVal nGreen As Integer, ByVal nBlue As Integer) As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtSetBackground(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 EgtNewFile() As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtOpenFile(ByVal sFilePath As String) As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtTestImportExt(ByVal sFilePath As String) As Integer
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtImportDxf(ByVal sFilePath As String) As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtImportStl(ByVal sFilePath As String) As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtDraw() As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtResize(ByVal nW As Integer, ByVal nH As Integer) As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtSetShowMode(ByVal nShowMode As Integer) As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtSetShowCurveDirection(ByVal bShow As Boolean) As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtZoom(ByVal nZoom As Integer) As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtZoomOnPoint(ByVal nWinX As Integer, ByVal nWinY As Integer, ByVal dCoeff As Double) As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtSetWinRect(ByVal nPrevX As Integer, ByVal nPrevY As Integer, ByVal nCurrX As Integer, ByVal nCurrY As Integer) As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtResetWinRect() As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtZoomWin(ByVal nPrevX As Integer, ByVal nPrevY As Integer, ByVal nCurrX As Integer, ByVal nCurrY As Integer) As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtSetView(ByVal nView As Integer) As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtPanCamera(ByVal nPrevX As Integer, ByVal nPrevY As Integer, ByVal nCurrX As Integer, ByVal nCurrY As Integer) As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtRotateCamera(ByVal nPrevX As Integer, ByVal nPrevY As Integer, ByVal nCurrX As Integer, ByVal nCurrY As Integer) As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtGetCameraDir(ByRef nDir As Integer) As Boolean
|
|
End Function
|
|
<DllImport(EgtInterface, CharSet:=CharSet.Unicode)>
|
|
Public Shared Function EgtUnProject(ByVal nWinX As Integer, ByVal nWinY As Integer, ByRef ptP As Point3d) 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 FILE DA IMPORTARE
|
|
Public Const FT_NULL As Integer = 0
|
|
Public Const FT_DXF As Integer = 1
|
|
Public Const FT_STL As Integer = 2
|
|
|
|
End Class
|