TestEIn 1.5j5 :

- aggiunti operatori e trasformazioni su Vector, Point e Frame3d
- modifiche a funzioni di apertura file di Scene
- nuova gestione toolbar tipo RibbonBar
- gestione parametro open file su linea di comando.
This commit is contained in:
Dario Sassi
2014-10-20 14:29:13 +00:00
parent c44e61f5ac
commit 7e6a613e7a
35 changed files with 1999 additions and 473 deletions
+466 -24
View File
@@ -2,47 +2,353 @@
Public Class EgtInterface
Structure Point3d
Dim x, y, z As Double
Sub New(ByVal dX As Double, ByVal dY As Double, ByVal dZ As Double)
x = dX
y = dY
z = dZ
End Sub
Shared Function Media(ByRef ptP1 As Point3d, ByRef ptP2 As Point3d) As Point3d
Dim ptMedia As New Point3d(0.5 * (ptP1.x + ptP2.x), 0.5 * (ptP1.y + ptP2.y), 0.5 * (ptP1.z + ptP2.z))
Return ptMedia
End Function
End Structure
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
Shared Function FromPointDiff(ByRef ptP1 As Point3d, ByRef ptP2 As Point3d) As Vector3d
Dim vtV As New Vector3d
vtV.x = ptP1.x - ptP2.x
vtV.y = ptP1.y - ptP2.y
vtV.z = ptP1.z - ptP2.z
Sub New(ByRef VtV As Vector3d)
x = VtV.x
y = VtV.y
z = VtV.z
End Sub
' 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
' Normalizzazione
Function Normalize(Optional ByVal dEps As Double = EPS_SMALL) As Boolean
Return EgtVectorNormalize(x, y, z, dEps)
End Function
'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
' Versore Asse X
Shared Function X_AX() As Vector3d
Dim vtZ As New Vector3d(1, 0, 0)
Return vtZ
End Function
' Versore Asse Y
Shared Function Y_AX() As Vector3d
Dim vtZ As New Vector3d(0, 1, 0)
Return vtZ
End Function
' Versore Asse Z
Shared Function Z_AX() As Vector3d
Dim vtZ As New Vector3d(0, 0, 1)
Return vtZ
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
' 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
' Punto Origine
Shared Function ORIG() As Point3d
Dim ptP As New Point3d(0, 0, 0)
Return ptP
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
' 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
' 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
End Class
Structure Color
Dim R, G, B, A As Integer
Sub New(ByVal nRed As Integer, ByVal nGreen As Integer, ByVal nBlue As Integer, Optional ByVal nAlpha As Integer = 100)
@@ -51,6 +357,12 @@ Structure Color
B = nBlue
A = nAlpha
End Sub
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
End Structure
#If PLATFORM = "x64" Then
@@ -90,6 +402,118 @@ Public Shared Function EgtFreeMemory(ByVal sB As IntPtr) As Boolean
End Function
'---------- Geo Base -----------------------------------------------------------
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared Function EgtVectorMirror(ByRef X As Double, ByRef Y As Double, ByRef Z As Double,
ByRef VtNorm As Vector3d) As Boolean
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared Function EgtPointTranslate(ByRef X As Double, ByRef Y As Double, ByRef Z As Double,
ByRef VtMove As Vector3d) As Boolean
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Shared 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
'---------- GeomDb -------------------------------------------------------------
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Shared Function EgtInitGeomDB() As Integer
@@ -390,15 +814,23 @@ Public Shared Function EgtRotateGroup(ByVal nId As Integer, ByRef PtAx As Point3
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Shared Function EgtScale(ByVal nId As Integer, ByRef PtOrig As Point3d,
ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d,
Private Shared 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) As Boolean
End Function
Public Shared Function EgtScale(ByVal nId As Integer, ByRef Frame As Frame3d,
ByVal dCoeffX As Double, ByVal dCoeffY As Double, ByVal dCoeffZ As Double) As Boolean
Return EgtScale(nId, Frame.Orig(), Frame.VersX(), Frame.VersY(), Frame.VersZ(), dCoeffX, dCoeffY, dCoeffZ)
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Shared Function EgtScaleGlob(ByVal nId As Integer, ByRef PtOrig As Point3d,
ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d,
Private Shared Function EgtScaleGlob(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 Shared Function EgtScaleGlob(ByVal nId As Integer, ByRef Frame As Frame3d,
ByVal dCoeffX As Double, ByVal dCoeffY As Double, ByVal dCoeffZ As Double) As Boolean
Return EgtScaleGlob(nId, Frame.Orig(), Frame.VersX(), Frame.VersY(), Frame.VersZ(), dCoeffX, dCoeffY, dCoeffZ)
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
@@ -406,6 +838,10 @@ Public Shared Function EgtScaleGroup(ByVal nId As Integer, ByRef PtOrig As Point
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 Shared 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
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Shared Function EgtMirror(ByVal nId As Integer, ByRef PtOn As Point3d, ByRef VtNorm As Vector3d) As Boolean
@@ -611,7 +1047,9 @@ Public Shared Function EgtLuaGetLastError(ByRef sError As String) As Boolean
Return bOk
End Function
'Costanti : GEOMETRIA
Public Const EPS_SMALL As Double = 0.001
Public Const EPS_ZERO As Double = 0.000000099999999999999995
'Costanti : TIPO DI FILE
Public Const FT_NULL As Integer = 0
Public Const FT_NGE As Integer = 1
@@ -619,6 +1057,8 @@ Public Const FT_NFE As Integer = 2
Public Const FT_DXF As Integer = 11
Public Const FT_STL As Integer = 12
Public Const FT_CNC As Integer = 13
Public Const FT_TSC As Integer = 101
Public Const FT_LUA As Integer = 102
'Costanti : FORMATO FILE NGE
Public Const NGE_TEXT As Integer = 0
Public Const NGE_BIN As Integer = 1
@@ -675,9 +1115,11 @@ Public Const SP_END As Integer = 0
Public Const SP_MID As Integer = 1
Public Const SP_CENTER As Integer = 2
Public Const SP_NEAR As Integer = 3
'Costanti : falg per BBOX
'Costanti : flag per BBOX
Public Const BBF_STANDARD As Integer = 0
Public Const BBF_ONLY_VISIBLE As Integer = 1
Public Const BBF_IGNORE_TEXT As Integer = 2
Public Const BBF_IGNORE_DIM As Integer = 3
Public Const BBF_EXACT As Integer = 4
End Class
+737 -325
View File
File diff suppressed because it is too large Load Diff
+33 -2
View File
@@ -128,7 +128,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADS
DAAAAk1TRnQBSQFMAgEBDAEAAUgBAQFIAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
DAAAAk1TRnQBSQFMAgEBDAEAAfABBAHwAQQBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAAUADAAEBAQABCAYAARAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@@ -183,6 +183,38 @@
Af8BwAEDAf4BfwGhAR0B4wH/AcABAwL/AbIBcQHxAf8BwAEDAf4BfwF5AYIB+AH/AcABAwH+AX8BcgES
AfwBZwHAAQMB/wE/AUABcgH+AScBwAEDAf8BnwEZARIB/wEHAcABAwH5AZ8BsgENAf8BhwHAAQMB+QGf
AbIBDQH+AQcBwAEDAfwBPwHbARsB/gEHAcABAwL/AucC/wHAAQMC/wH4AR8K/ws=
</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnOpen.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGwAAAAd0SU1FB94KERY7G+iJBrIAAAXeSURBVFhHxZYLUFRVGMf/+SDFfJWGvNSxpnLG
qUmmtEjEBwWTj3GcVBxttGEDRUFhEUVABGVRwN0AV0ENloeAbCa6Y6gZGqbloxrAQDGTR7y0ZYGcxtT5
+s5ll7kLa03m0J35ncf/3nv+3/3uOfdcGI3G/xWbYl9iU3xc4Og1EU7vJjJ5cJqdiDEzpgMYwDxl63qB
TfFxgJPPy5Kpwzuz4fiWN0a7+3BAyRzEhxyAHZynbzIH08/qPnnncYG7+wA4zgzGsMkvsMEIM8MxarIb
ZyMXjjOWwtU7n7WhjJ3VvZZGXSg8KwKxSlC5BqslgrGmMghrq4IRVLUOwd/5YwoPYDOlZt3ezECmP2MH
p1l+UhCuc49w34EZbHWfKC6thVv1RgRQq76cOkqJOs4SdTIdXxO1c990nKheY6iNhKJkGWbyIIMYqyD4
6MdYpRgus2Mw1ucQXOcVY9zC43zOmekdwOVVCKb6DAO1FRMZC4ja9Gx6hNtct+UT3dER3c4i+lll+CUc
/tmLMJkHsmMeObkEfIiAhjHiyYX5aGaQ1TWi4NQGU8dXbCbM2bCtsMvcyPXtPCaTqGUfUfN+oltJZZ1J
CLiuRJigJhQbapQIF1wLQ8T1tYjm1xdzYwNiKxLgz4bPMEOYwcKc6T0JL3yM9dRxmo0PdWXgNzN3hDk/
fUs6m6cSNSYzSUSte1jbTdSkYVQmqo+spRvLDXRNUUY/TNXS+fEqKkFE0Xzo2PA5xmriyZGK8wqESAFY
jI0i7QcZTnsrP3VTGlEDG9fHM1uJ6qK43sjZCCOq9DRQ5TQDXRypfXgOiQ9Koe48CXWHASn6ldCyea/3
LkcqSj9CKLV/yebClJ+6OdkkGYvUX5ijtawOaYUEIpBTLK2Oq7wyeIWsrw5FSHUwQqvXQWl5LTf4Vcj5
MQCqMgU051ZgT8VqkZkJ0lyQAji1HEoynWDzHDbn1DZE15oMiKjPhaplKxR0K6OWmg/zuf/ONQ3CdUtQ
NGQIHLoD+GIZwshU0vXETTtN989A2ViAbd9vQQI18Byoia+lb70NT4KsBcgP8sBSe3s4iQkpBWDwxQYp
AyLtjfGmxkJEV6Vg+4McrKFGXgmXl5TZGuzfUpOK+Ch3qF1c8OLQoRjFAQySAji6COHUzhkQs/3ieFWF
FnFlkdhGv/J8+CmsnMqm5tF5L0N3LbXftNZEX65Z2t+Yz52eoFXPQv57r+BtfnrnMWOkpWkvBaBfiI1k
5K9dSwY/MLbq/BBLdbzuRQBn3+Cbx2u7OeOWR2cZS1+0T/U4b9FldUkItMqp2MymY5nhjPhIDZQCKFyA
CDLyJKlanHdJjW2fBSJaSv2lBQY6NkAlccJZ241Fs+jyvuCodf/3QuzY7omCiQ6YxKbiqyh9ypmuOZA/
lwO4nU3NesRkKxBHdRkmuqmpvX8ECQ8Fxdgh1WYkXWg99EeR7oucAA/4jxiBcWwqdsT+wlcgFbr3sZla
s01XdiHupJLbTUVEx+xU9w8j6d5hJDKWWmqbdak2I7/GSrt1AGlb3KGb9BImsrGYeL234yxvRP55HIsL
FDzxGnKJyhWGP/TQ3NNDLeqesN5Tk1+nNp9X3y2CZpc39CumYb7TSOndi32h916Q6YOoq1qEnArlydh4
0CQG6jyE1Lty9D36cmTnpPvM/SuJ2L9pCjSuz0P8qDzLDJSbdwewzwtRJ5SIotrUcipGBA+ibS9guO7k
WvQtdGtyhN7V3m3RjAexN9YTn7/mhNfZ2JERu2HvHxlRZMzBjmxfqOjmznJTIfbwYHvNpIvaZKan3l5o
rZmvkc6VxiA3wA1BbOrKiH+C7oknRypyPsCqOC9kCGI9kB47HenRHti/2RNZn8xFZpovdKlLkJU2D7rk
+TiQwtss17oEwRxusy40JjN7JXSfLkee36vwG/40JrDxP2/HfIh/OPGOxNbp8oQQ33oxZq+fEDldRddH
QQQh3tOTQhiLMf/+t82W2JfYFPsSm2JfYlPsS2yKfYcRfwGdQeXe8RCveQAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="OpenFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
@@ -194,7 +226,6 @@
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>34</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAQAMDAAAAAACACoDgAARgAAACAgAAAAAAgAqAgAAO4OAAAYGAAAAAAIAMgGAACWFwAAEBAAAAAA
+175 -27
View File
@@ -10,12 +10,13 @@ Public Class Form1
Private m_sIniFile As String = String.Empty
Private m_sCurrFile As String = String.Empty
Private m_bModified As Boolean = False
Private m_nMarkObj As Integer = GDB_ID_NULL
'-------------------------------- Form ------------------------------------------------------------
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
'Title
Me.Text = "EgalTech TestEIn"
EmitTitle()
'Impostazione path Ini file
m_sIniFile = Application.StartupPath & "\TestEIn.ini"
'Inizializzazione generale di EgtInterface
@@ -30,19 +31,52 @@ Public Class Form1
Dim sDefFont As String = String.Empty
GetPrivateProfileString("GeomDB", "DefaultFont", "", sDefFont, m_sIniFile)
EgtSetFont(sNfeDir, sDefFont)
' imposto colore di default
Dim DefColor As New Color(0, 0, 0)
GetPrivateProfileColor("GeomDB", "DefaultColor", DefColor, m_sIniFile)
Scene1.SetDefaultMaterial(DefColor)
' imposto colori sfondo
Dim nTopRed As Integer = 192
Dim nTopGreen As Integer = 192
Dim nTopBlue As Integer = 192
GetPrivateProfileColor("Scene", "BackTop", nTopRed, nTopGreen, nTopBlue, m_sIniFile)
Dim nBotRed As Integer = 192
Dim nBotGreen As Integer = 192
Dim nBotBlue As Integer = 192
GetPrivateProfileColor("Scene", "BackBottom", nBotRed, nBotGreen, nBotBlue, m_sIniFile)
Scene1.SetViewBackground(nTopRed, nTopGreen, nTopBlue, nBotRed, nBotGreen, nBotBlue)
Dim BackTopColor As New Color(192, 192, 192)
GetPrivateProfileColor("Scene", "BackTop", BackTopColor, m_sIniFile)
Dim BackBotColor As New Color(192, 192, 192)
GetPrivateProfileColor("Scene", "BackBottom", BackBotColor, m_sIniFile)
Scene1.SetViewBackground(BackTopColor, BackBotColor)
' imposto colore di evidenziazione
Dim MarkColor As New Color(255, 255, 0)
GetPrivateProfileColor("Scene", "Mark", MarkColor, m_sIniFile)
Scene1.SetMarkMaterial(MarkColor)
' imposto tipo e colore del rettangolo di zoom
Dim bOutline As Boolean = True
Dim ZwColor As Color
ZwColor.Setup(0, 0, 0)
GetPrivateProfileZoomWin("Scene", "ZoomWin", bOutline, ZwColor, m_sIniFile)
Scene1.SetZoomWinAttribs(bOutline, ZwColor)
' imposto colore della linea di distanza
Dim DstLnColor As Color
DstLnColor.Setup(255, 0, 0)
GetPrivateProfileColor("Scene", "DistLine", DstLnColor, m_sIniFile)
Scene1.SetDistLineMaterial(DstLnColor)
' imposto parametri OpenGL
Dim nDriver As Integer = GetPrivateProfileInt("OpenGL", "Driver", 3, m_sIniFile)
Dim b2Buff As Boolean = (GetPrivateProfileInt("OpenGL", "DoubleBuffer", 1, m_sIniFile) <> 0)
Dim nColorBits As Integer = GetPrivateProfileInt("OpenGL", "ColorBits", 32, m_sIniFile)
Dim nDepthBits As Integer = GetPrivateProfileInt("OpenGL", "DepthBits", 32, m_sIniFile)
Scene1.SetViewAttributes(nDriver, b2Buff, nColorBits, nDepthBits)
' inizializzo scena
Scene1.Init()
rbtShading.Checked = True
' modo di visualizzazione
Dim nShowMode As Integer = GetPrivateProfileInt("Scene", "ShowMode", SM_SHADING, m_sIniFile)
If nShowMode = SM_WIREFRAME Then
rbtWireFrame.Checked = True
ElseIf nShowMode = SM_HIDDENLINE Then
rbtHiddenLine.Checked = True
Else
rbtShading.Checked = True
End If
' visualizzazione direzione curve
Dim nShowCurveDir As Integer = GetPrivateProfileInt("Scene", "CurveDir", 0, m_sIniFile)
chkCurveDir.Checked = (nShowCurveDir <> 0)
' ObjTree non selezionato
m_nOldIdTree = GDB_ID_NULL
' aggiungo voce per about box nel menù di sistema
Dim hSysMenu As IntPtr = GetSystemMenu(Handle, False)
@@ -63,13 +97,37 @@ Public Class Form1
Me.Size = New Size(nWidth, nHeight)
WindowState = IIf(nFlag = 1, FormWindowState.Maximized, FormWindowState.Normal)
End If
' Recupero eventuali parametri da linea di comando
For Each s As String In My.Application.CommandLineArgs
If Not String.IsNullOrWhiteSpace(s) Then
Dim nFileType As Integer = EgtGetFileType(s)
Select Case nFileType
Case FT_NGE, FT_NFE
Scene1.OpenProject(s, False)
Case FT_DXF, FT_STL, FT_CNC
Scene1.ImportProject(s, False)
Case FT_TSC, FT_LUA
Scene1.Exec(s, False)
End Select
Exit For
End If
Next
End Sub
Private Sub Form1_FormClosing(sender As System.Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
'Salvo posizione Form
' gestisco eventuale file corrente modificato
If Not ManageModified() Then
e.Cancel = True
Return
End If
' Salvo modo di visualizzazione
WritePrivateProfileString("Scene", "ShowMode", EgtGetShowMode(), m_sIniFile)
' Salvo stato visualizzazione direzione curve
WritePrivateProfileString("Scene", "CurveDir", IIf(EgtGetShowCurveDirection(), 1, 0), m_sIniFile)
' Salvo posizione Form
Dim nFlag As Integer = IIf(Me.WindowState = FormWindowState.Maximized, 1, 0)
WritePrivateProfileWinPos("General", "WinPlace", nFlag, Me.Left, Me.Top, Me.Width, Me.Height, m_sIniFile)
'Terminazione generale di EgtInterface
' Terminazione generale di EgtInterface
EgtExit()
End Sub
@@ -106,7 +164,8 @@ Public Class Form1
Private Sub OnNewProject(ByVal sender As Object) Handles Scene1.OnNewProject
m_sCurrFile = String.Empty
Me.Text = "EgalTech TestEIn"
m_bModified = False
EmitTitle()
ClearObjTree()
End Sub
@@ -116,18 +175,22 @@ Public Class Form1
Private Sub OnOpenProject(ByVal sender As Object, ByVal sFile As String) Handles Scene1.OnOpenProject
m_sCurrFile = sFile
Me.Text = Path.GetFileName(m_sCurrFile) & " - EgalTech TestEIn"
m_bModified = False
EmitTitle()
WritePrivateProfileString("General", "LastNgeDir", Path.GetDirectoryName(m_sCurrFile), m_sIniFile)
LoadObjTree()
End Sub
Private Sub OnSavingProject(ByVal sender As Object, ByVal sFile As String) Handles Scene1.OnSavingProject
m_sCurrFile = sFile
Me.Text = Path.GetFileName(m_sCurrFile) & " - EgalTech TestEIn"
EmitTitle()
WritePrivateProfileString("General", "LastNgeDir", Path.GetDirectoryName(m_sCurrFile), m_sIniFile)
' ripristino stato eventuale oggetto marcato
m_nMarkObj = RevertOldIdInObjTree()
End Sub
Private Sub OnSavedProject(ByVal sender As Object) Handles Scene1.OnSavedProject
m_bModified = False
' rimarco eventuale oggetto smarcato
SelectIdInObjTree(m_nMarkObj)
End Sub
@@ -137,12 +200,15 @@ Public Class Form1
End Sub
Private Sub OnImportedProject(ByVal sender As Object, ByVal sFile As String) Handles Scene1.OnImportedProject
m_sCurrFile = Path.ChangeExtension(sFile, "nge")
Me.Text = Path.GetFileName(m_sCurrFile) & " - EgalTech TestEIn"
WritePrivateProfileString("General", "LastImpDir", Path.GetDirectoryName(sFile), m_sIniFile)
m_sCurrFile = sFile
m_bModified = True
EmitTitle()
LoadObjTree()
End Sub
Private Sub OnExportingProject(ByVal sender As Object, ByVal sFile As String) Handles Scene1.OnExportingProject
WritePrivateProfileString("General", "LastExpDir", Path.GetDirectoryName(sFile), m_sIniFile)
' ripristino stato eventuale oggetto marcato
m_nMarkObj = RevertOldIdInObjTree()
End Sub
@@ -153,28 +219,53 @@ Public Class Form1
End Sub
Private Sub OnExecutingScript(ByVal sender As Object, ByVal sFile As String) Handles Scene1.OnExecutingScript
WritePrivateProfileString("General", "LastLuaDir", Path.GetDirectoryName(sFile), m_sIniFile)
ClearObjTree()
End Sub
Private Sub OnExecutedScript(ByVal sender As Object) Handles Scene1.OnExecutedScript
m_bModified = True
LoadObjTree()
End Sub
'-------------------------------- Buttons --------------------------------------------------------
Private Sub btnNew_Click(sender As System.Object, e As System.EventArgs) Handles btnNew.Click
' gestisco eventuale file corrente modificato
If Not ManageModified() Then
Return
End If
' eseguo
Scene1.NewProject()
End Sub
Private Sub btnOpen_Click(sender As System.Object, e As System.EventArgs) Handles btnOpen.Click
Scene1.OpenProject()
' gestisco eventuale file corrente modificato
If Not ManageModified() Then
Return
End If
' eseguo
Dim sDir As String = String.Empty
GetPrivateProfileString("General", "LastNgeDir", "", sDir, m_sIniFile)
Scene1.OpenProject(sDir)
End Sub
Private Sub btnSave_Click(sender As System.Object, e As System.EventArgs) Handles btnSave.Click
Scene1.SaveProject(m_sCurrFile)
End Sub
Private Sub btnSaveAs_Click(sender As System.Object, e As System.EventArgs) Handles btnSaveAs.Click
Scene1.SaveAsProject(m_sCurrFile)
End Sub
Private Sub btnImport_Click(sender As System.Object, e As System.EventArgs) Handles btnImport.Click
Scene1.ImportProject()
' gestisco eventuale file corrente modificato
If Not ManageModified() Then
Return
End If
' eseguo
Dim sDir As String = String.Empty
GetPrivateProfileString("General", "LastImpDir", "", sDir, m_sIniFile)
Scene1.ImportProject(sDir)
End Sub
Private Sub btnExport_Click(sender As System.Object, e As System.EventArgs) Handles btnExport.Click
@@ -182,7 +273,9 @@ Public Class Form1
End Sub
Private Sub btnExec_Click(sender As System.Object, e As System.EventArgs) Handles btnExec.Click
Scene1.Exec()
Dim sDir As String = String.Empty
GetPrivateProfileString("General", "LastLuaDir", "", sDir, m_sIniFile)
Scene1.Exec(sDir)
End Sub
Private Sub rbtWireFrame_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles rbtWireFrame.CheckedChanged
@@ -254,8 +347,21 @@ Public Class Form1
Private Sub btnRight_Click(sender As System.Object, e As System.EventArgs) Handles btnRight.Click
EgtSetView(CT_RIGHT)
End Sub
Private Sub btnIso_Click(sender As System.Object, e As System.EventArgs) Handles btnIso.Click
EgtSetView(CT_ISO_SW)
Private Sub btnIsoSW_Click(sender As System.Object, e As System.EventArgs) Handles btnIsoSW.Click
Scene1.IsoViewSW()
End Sub
Private Sub btnIsoSE_Click(sender As System.Object, e As System.EventArgs) Handles btnIsoSE.Click
Scene1.IsoViewSE()
End Sub
Private Sub btnIsoNE_Click(sender As System.Object, e As System.EventArgs) Handles btnIsoNE.Click
Scene1.IsoViewNE()
End Sub
Private Sub btnIsoNW_Click(sender As System.Object, e As System.EventArgs) Handles btnIsoNW.Click
Scene1.IsoViewNW()
End Sub
Private Sub btnRotP90_Click(sender As System.Object, e As System.EventArgs) Handles btnRotP90.Click
@@ -278,15 +384,15 @@ Public Class Form1
' recupero il box del gruppo in globale
Dim PtMinPre As New Point3d
Dim PtMaxPre As New Point3d
EgtGetBBoxGlob(nId, BBF_IGNORE_TEXT, PtMinPre, PtMaxPre)
EgtGetBBoxGlob(nId, BBF_IGNORE_TEXT + BBF_EXACT, PtMinPre, PtMaxPre)
' ruoto attorno al punto minimo
EgtRotateGlob(nId, PtMinPre, Vector3d.Z_AX, dAngRotDeg)
' calcolo nuovo box in globale
Dim PtMinPost As New Point3d
Dim PtMaxPost As New Point3d
EgtGetBBoxGlob(nId, BBF_IGNORE_TEXT, PtMinPost, PtMaxPost)
EgtGetBBoxGlob(nId, BBF_IGNORE_TEXT + BBF_EXACT, PtMinPost, PtMaxPost)
' eseguo traslazione per riavere lo stesso punto minimo
Dim VtMove As Vector3d = Vector3d.FromPointDiff(PtMinPre, PtMinPost)
Dim VtMove As Vector3d = PtMinPre - PtMinPost
EgtMoveGlob(nId, VtMove)
End Sub
@@ -296,7 +402,7 @@ Public Class Form1
' recupero il box del gruppo in globale
Dim PtMin As New Point3d
Dim PtMax As New Point3d
EgtGetBBoxGlob(nId, BBF_IGNORE_TEXT, PtMin, PtMax)
EgtGetBBoxGlob(nId, BBF_IGNORE_TEXT + BBF_EXACT, PtMin, PtMax)
Dim PtCen As Point3d = Point3d.Media(PtMin, PtMax)
' mirror rispetto a Y centrato nel box
EgtMirrorGlob(nId, PtCen, Vector3d.X_AX)
@@ -508,4 +614,46 @@ Public Class Form1
Return False
End If
End Function
'-------------------------------- Utilities ------------------------------------------------------
Private Function ManageModified() As Boolean
' se non modificato, procedo normalmente
If Not m_bModified Then
Return True
End If
' chiedo cosa fare
Dim sMsg As String = "Salvare le modifiche"
If Not String.IsNullOrEmpty(m_sCurrFile) Then
sMsg += " a " + m_sCurrFile
End If
sMsg += " ?"
Dim nRes = MessageBox.Show(sMsg, "", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question)
Select Case nRes
Case Windows.Forms.DialogResult.Yes
Scene1.SaveProject(m_sCurrFile)
Return True
Case Windows.Forms.DialogResult.No
Return True
Case Else
Return False
End Select
End Function
Private Sub EmitTitle()
' nome file
Dim sTitle As String = m_sCurrFile
If String.IsNullOrEmpty(m_sCurrFile) Then
sTitle = "New"
End If
' indicazione di modificato
If m_bModified Then
sTitle += "*"
End If
' dati del prodotto
sTitle += " - EgalTech TestEGr"
' emissione del titolo
Me.Text = sTitle
End Sub
End Class
+39 -7
View File
@@ -1,9 +1,18 @@
Imports System.Runtime.InteropServices
Imports System.Text
Imports TestEIn.EgtInterface
Public Class GenInterface
'-------------------------------- IniFile --------------------------------------------------------
'-------------------------------- IniFile : Get --------------------------------------------------
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode)>
Public Shared Function GetPrivateProfileInt(
ByVal lpAppName As String,
ByVal lpKeyName As String,
ByVal nDefault As Integer,
ByVal lpFileName As String) As Integer
End Function
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode)>
Private Shared Function GetPrivateProfileString(
ByVal lpAppName As String,
@@ -28,17 +37,38 @@ End Function
Public Shared Function GetPrivateProfileColor(
ByVal lpAppName As String,
ByVal lpKeyName As String,
ByRef nRed As Integer,
ByRef nGreen As Integer,
ByRef nBlue As Integer,
ByRef Col As Color,
ByVal lpFileName As String) As Boolean
Dim sVal As String = String.Empty
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
Dim sItems() As String = sVal.Split(",".ToCharArray)
If sItems.Count() >= 3 Then
nRed = Int(sItems(0))
nGreen = Int(sItems(1))
nBlue = Int(sItems(2))
Col.R = Int(sItems(0))
Col.G = Int(sItems(1))
Col.B = Int(sItems(2))
If sItems.Count() >= 4 Then
Col.A = Int(sItems(3))
End If
Return True
End If
Return False
End Function
Public Shared Function GetPrivateProfileZoomWin(
ByVal lpAppName As String,
ByVal lpKeyName As String,
ByRef bOutline As Boolean,
ByRef Col As Color,
ByVal lpFileName As String) As Boolean
Dim sVal As String = String.Empty
GetPrivateProfileString(lpAppName, lpKeyName, "", sVal, lpFileName)
Dim sItems() As String = sVal.Split(",".ToCharArray)
If sItems.Count() >= 5 Then
bOutline = (Int(sItems(0)) <> 0)
Col.R = Int(sItems(1))
Col.G = Int(sItems(2))
Col.B = Int(sItems(3))
Col.A = Int(sItems(4))
Return True
End If
Return False
@@ -67,6 +97,8 @@ Public Shared Function GetPrivateProfileWinPos(
Return False
End Function
'-------------------------------- IniFile : Write ------------------------------------------------
<DllImport("kernel32.dll", CharSet:=CharSet.Unicode)>
Public Shared Function WritePrivateProfileString(
ByVal lpAppName As String,
+2 -2
View File
@@ -43,5 +43,5 @@ Imports System.Runtime.InteropServices
' utilizzando l'asterisco (*) come descritto di seguito:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.5.10.4")>
<Assembly: AssemblyFileVersion("1.5.10.4")>
<Assembly: AssemblyVersion("1.5.10.5")>
<Assembly: AssemblyFileVersion("1.5.10.5")>
+250
View File
@@ -59,5 +59,255 @@ Namespace My.Resources
resourceCulture = value
End Set
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property _New() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("New", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property Analyze() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("Analyze", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property CurveDir() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("CurveDir", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property Exec() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("Exec", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property Export() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("Export", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property GetDist() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("GetDist", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property Import() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("Import", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property LookFromBACK() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("LookFromBACK", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property LookFromFRONT() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("LookFromFRONT", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property LookFromISO_NE() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("LookFromISO_NE", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property LookFromISO_NW() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("LookFromISO_NW", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property LookFromISO_SE() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("LookFromISO_SE", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property LookFromISO_SW() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("LookFromISO_SW", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property LookFromLEFT() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("LookFromLEFT", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property LookFromRIGHT() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("LookFromRIGHT", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property LookFromTOP() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("LookFromTOP", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property Open() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("Open", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property RenderingHL() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("RenderingHL", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property RenderingSH() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("RenderingSH", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property RenderingWF() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("RenderingWF", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property Save() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("Save", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property SaveAs() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("SaveAs", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property ZoomAll() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("ZoomAll", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property ZoomIn() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("ZoomIn", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
'''<summary>
''' Cerca una risorsa localizzata di tipo System.Drawing.Bitmap.
'''</summary>
Friend ReadOnly Property ZoomOut() As System.Drawing.Bitmap
Get
Dim obj As Object = ResourceManager.GetObject("ZoomOut", resourceCulture)
Return CType(obj,System.Drawing.Bitmap)
End Get
End Property
End Module
End Namespace
+84 -5
View File
@@ -46,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
@@ -60,6 +60,7 @@
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
@@ -68,9 +69,10 @@
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
@@ -85,9 +87,10 @@
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
@@ -109,9 +112,85 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="New" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\New.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LookFromBACK" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\LookFromBACK.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Analyze" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Analyze.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LookFromISO_SE" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\LookFromISO_SE.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Import" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Import.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ZoomAll" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ZoomAll.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ZoomIn" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ZoomIn.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LookFromLEFT" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\LookFromLEFT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Exec" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Exec.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Save" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Save.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LookFromRIGHT" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\LookFromRIGHT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LookFromISO_SW" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\LookFromISO_SW.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="RenderingSH" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\RenderingSH.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LookFromISO_NE" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\LookFromISO_NE.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SaveAs" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\SaveAs.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="RenderingWF" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\RenderingWF.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LookFromTOP" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\LookFromTOP.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Export" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Export.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="RenderingHL" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\RenderingHL.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="GetDist" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\GetDist.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LookFromISO_NW" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\LookFromISO_NW.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ZoomOut" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ZoomOut.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="LookFromFRONT" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\LookFromFRONT.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="CurveDir" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\CurveDir.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 455 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 441 B

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

+137 -81
View File
@@ -24,19 +24,18 @@ Public Class Scene
Private m_nSnapType As Integer
Private m_PrevPoint As Point
Private m_ptPrev As Point3d
Private m_nDefMatRed As Integer
Private m_nDefMatGreen As Integer
Private m_nDefMatBlue As Integer
Private m_nDriver As Integer
Private m_b2Buff As Boolean
Private m_nColorBits As Integer
Private m_nDepthBits As Integer
Private m_nBackTopRed As Integer
Private m_nBackTopGreen As Integer
Private m_nBackTopBlue As Integer
Private m_nBackBotRed As Integer
Private m_nBackBotGreen As Integer
Private m_nBackBotBlue As Integer
Private m_BackTopColor As Color
Private m_BackBotColor As Color
Private m_DefColor As Color
Private m_MarkColor As Color
Private m_bZwOutline As Boolean
Private m_ZwColor As Color
Private m_DstLnColor As Color
'---- Constructor -----
Sub New()
@@ -52,29 +51,21 @@ Public Class Scene
m_nOldStatus = ST.NULL
m_nSnapType = SP_END
m_PrevPoint = Point.Empty
m_nDefMatRed = 255
m_nDefMatGreen = 165
m_nDefMatBlue = 0
m_nDriver = 3
m_b2Buff = True
m_nColorBits = 24
m_nDepthBits = 32
m_nBackTopRed = 140
m_nBackTopGreen = 154
m_nBackTopBlue = 168
m_nBackBotRed = 40
m_nBackBotGreen = 44
m_nBackBotBlue = 48
m_BackTopColor.Setup(140, 154, 168)
m_BackBotColor.Setup(40, 44, 48)
m_DefColor.Setup(255, 165, 0)
m_MarkColor.Setup(255, 255, 0)
m_bZwOutline = True
m_ZwColor.Setup(0, 0, 0)
m_DstLnColor.Setup(255, 0, 0)
Cursor = Cursors.Default
End Sub
'---- Initials --------
Public Sub SetDefaultMaterial(ByVal nRed As Integer, ByVal nGreen As Integer, ByVal nBlue As Integer)
m_nDefMatRed = nRed
m_nDefMatGreen = nGreen
m_nDefMatBlue = nBlue
End Sub
Public Sub SetViewAttributes(ByVal nDriver As Integer, ByVal b2Buff As Boolean, ByVal nColorBits As Integer, ByVal nDepthBits As Integer)
m_nDriver = nDriver
m_b2Buff = b2Buff
@@ -82,14 +73,26 @@ Public Class Scene
m_nDepthBits = nDepthBits
End Sub
Public Sub SetViewBackground(ByVal nTopRed As Integer, ByVal nTopGreen As Integer, ByVal nTopBlue As Integer,
ByVal nBottomRed As Integer, ByVal nBottomGreen As Integer, ByVal nBottomBlue As Integer)
m_nBackTopRed = nTopRed
m_nBackTopGreen = nTopGreen
m_nBackTopBlue = nTopBlue
m_nBackBotRed = nBottomRed
m_nBackBotGreen = nBottomGreen
m_nBackBotBlue = nBottomBlue
Public Sub SetViewBackground(ByRef BackTopColor As Color, ByRef BackBotColor As Color)
m_BackTopColor = BackTopColor
m_BackBotColor = BackBotColor
End Sub
Public Sub SetDefaultMaterial(ByRef DefColor As Color)
m_DefColor = DefColor
End Sub
Public Sub SetMarkMaterial(ByRef DefColor As Color)
m_MarkColor = DefColor
End Sub
Public Sub SetZoomWinAttribs(ByVal bZwOutline As Boolean, ByRef ZwColor As Color)
m_bZwOutline = bZwOutline
m_ZwColor = ZwColor
End Sub
Public Sub SetDistLineMaterial(ByRef DstLnColor As Color)
m_DstLnColor = DstLnColor
End Sub
'Mettere EgtInit, EgtSetKey e EgtSetFont nell'evento Load del Form, prima di inizializzare la o le Scene
@@ -97,10 +100,13 @@ Public Class Scene
Public Sub Init()
m_nGseContext = EgtInitGeomDB()
EgtSetDefaultMaterial(m_nDefMatRed, m_nDefMatGreen, m_nDefMatBlue)
EgtSetDefaultMaterial(m_DefColor.R, m_DefColor.G, m_DefColor.B)
EgtInitScene(Handle, m_nDriver, m_b2Buff, m_nColorBits, m_nDepthBits)
EgtSetBackground(m_nBackTopRed, m_nBackTopGreen, m_nBackTopBlue,
m_nBackBotRed, m_nBackBotGreen, m_nBackBotBlue)
EgtSetBackground(m_BackTopColor.R, m_BackTopColor.G, m_BackTopColor.B,
m_BackBotColor.R, m_BackBotColor.G, m_BackBotColor.B)
EgtSetMarkAttribs(m_MarkColor.R, m_MarkColor.G, m_MarkColor.B)
EgtSetWinRectAttribs(m_bZwOutline, m_ZwColor.R, m_ZwColor.G, m_ZwColor.B, m_ZwColor.A)
EgtSetGeoLineAttribs(m_DstLnColor.R, m_DstLnColor.G, m_DstLnColor.B)
EgtInitTscExec()
End Sub
@@ -467,34 +473,61 @@ Public Class Scene
Return bOk
End Function
Public Function OpenProject()
'Scelta file con dialogo
Dim OpenFileDialog As New OpenFileDialog
OpenFileDialog.Title = "Open"
OpenFileDialog.Filter = "New geometry EgalTech(*.nge)|*.nge" &
"|New font EgalTech(*.nfe)|*.nfe" &
"|All Files (*.*)|*.*"
OpenFileDialog.FilterIndex = 1
If OpenFileDialog.ShowDialog <> Windows.Forms.DialogResult.OK Then
Return True
Public Function OpenProject(Optional ByVal sDir As String = "", Optional ByVal bWithDlg As Boolean = True) As Boolean
Dim sFile As String = sDir
' Scelta file con dialogo
If bWithDlg Then
Dim OpenFileDialog As New OpenFileDialog
OpenFileDialog.Title = "Open"
OpenFileDialog.Filter = "New geometry EgalTech(*.nge)|*.nge" &
"|New font EgalTech(*.nfe)|*.nfe" &
"|All Files (*.*)|*.*"
OpenFileDialog.FilterIndex = 1
OpenFileDialog.InitialDirectory = sDir
If OpenFileDialog.ShowDialog <> Windows.Forms.DialogResult.OK Then
Return True
End If
sFile = OpenFileDialog.FileName
End If
'Prima del caricamento
RaiseEvent OnOpeningProject(Me)
'Caricamento del progetto
Cursor = Cursors.WaitCursor
Dim bOk As Boolean = EgtOpenFile(OpenFileDialog.FileName)
EgtZoom(m_nGseContext, ZM_ALL)
Dim bOk As Boolean = EgtOpenFile(sFile)
EgtZoom(ZM_ALL)
Cursor = Cursors.Default
'Gestione risultato
If bOk Then
RaiseEvent OnOpenProject(Me, OpenFileDialog.FileName)
RaiseEvent OnOpenProject(Me, sFile)
Else
MessageBox.Show("Error opening file", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
Return bOk
End Function
Public Function SaveProject(Optional ByVal sFile As String = "")
Public Function SaveProject(Optional ByVal sFile As String = "") As Boolean
If String.IsNullOrEmpty(sFile) Or EgtGetFileType(sFile) <> FT_NGE Then
Return SaveAsProject(sFile)
Else
'Prima del salvataggio
RaiseEvent OnSavingProject(Me, sFile)
'Salvataggio del progetto
Cursor = Cursors.WaitCursor
Dim bOk As Boolean = EgtSaveFile(sFile, NGE_CMPTEXT)
Cursor = Cursors.Default
'Gestione risultato
If bOk Then
RaiseEvent OnSavedProject(Me)
Else
MessageBox.Show("Error saving file", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
Return bOk
End If
End Function
Public Function SaveAsProject(Optional ByVal sFile As String = "") As Boolean
'Eventuale sistemazione estensione
sFile = Path.ChangeExtension(sFile, "nge")
'Assegnazione nome file con dialogo
Dim SaveFileDialog As New SaveFileDialog
SaveFileDialog.Title = "Save"
@@ -518,20 +551,25 @@ Public Class Scene
Return bOk
End Function
Public Function ImportProject()
Public Function ImportProject(Optional ByVal sDir As String = "", Optional ByVal bWithDlg As Boolean = True) As Boolean
Dim sFile As String = sDir
'Scelta file con dialogo
Dim OpenFileDialog As New OpenFileDialog
OpenFileDialog.Title = "Import"
OpenFileDialog.Filter = "Drawing Exchange Fmt(*.dxf)|*.dxf" &
"|Stereolithography (*.stl)|*.stl" &
"|Part program ISO (*.cnc)|*.cnc" &
"|All Files (*.*)|*.*"
OpenFileDialog.FilterIndex = 1
If OpenFileDialog.ShowDialog <> Windows.Forms.DialogResult.OK Then
Return True
If bWithDlg Then
Dim OpenFileDialog As New OpenFileDialog
OpenFileDialog.Title = "Import"
OpenFileDialog.Filter = "Drawing Exchange Fmt(*.dxf)|*.dxf" &
"|Stereolithography (*.stl)|*.stl" &
"|Part program ISO (*.cnc)|*.cnc" &
"|All Files (*.*)|*.*"
OpenFileDialog.FilterIndex = 4
OpenFileDialog.InitialDirectory = sDir
If OpenFileDialog.ShowDialog <> Windows.Forms.DialogResult.OK Then
Return True
End If
sFile = OpenFileDialog.FileName
End If
'Riconoscimento tipo file
Dim nFileType As Integer = EgtGetFileType(OpenFileDialog.FileName)
Dim nFileType As Integer = EgtGetFileType(sFile)
If nFileType <> FT_DXF And nFileType <> FT_STL And nFileType <> FT_CNC Then
MessageBox.Show("File type unknown", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Return False
@@ -543,30 +581,31 @@ Public Class Scene
Dim bOk As Boolean = EgtNewFile()
'Importazione
If nFileType = FT_DXF Then
bOk = bOk And EgtImportDxf(OpenFileDialog.FileName)
bOk = bOk And EgtImportDxf(sFile)
ElseIf nFileType = FT_STL Then
bOk = bOk And EgtImportStl(OpenFileDialog.FileName)
bOk = bOk And EgtImportStl(sFile)
ElseIf nFileType = FT_CNC Then
bOk = bOk And EgtImportCnc(OpenFileDialog.FileName)
bOk = bOk And EgtImportCnc(sFile)
End If
EgtZoom(m_nGseContext, ZM_ALL)
EgtZoom(ZM_ALL)
Cursor = Cursors.Default
'Gestione risultato
If bOk Then
RaiseEvent OnImportedProject(Me, OpenFileDialog.FileName)
RaiseEvent OnImportedProject(Me, sFile)
Else
MessageBox.Show("Error importing file", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
Return bOk
End Function
Public Function ExportProject(Optional ByVal sFile As String = "")
Public Function ExportProject(Optional ByVal sFile As String = "") As Boolean
'Assegnazione nome file con dialogo
Dim SaveFileDialog As New SaveFileDialog
SaveFileDialog.Title = "Export"
SaveFileDialog.Filter = "Drawing Exchange Fmt(*.dxf)|*.dxf" &
"|Stereolithography (*.stl)|*.stl" &
"|All Files (*.*)|*.*"
SaveFileDialog.FilterIndex = 3
SaveFileDialog.FileName = sFile
If SaveFileDialog.ShowDialog <> Windows.Forms.DialogResult.OK Then
Return True
@@ -597,34 +636,39 @@ Public Class Scene
Return bOk
End Function
Public Function Exec()
Public Function Exec(Optional ByVal sDir As String = "", Optional ByVal bWithDlg As Boolean = True) As Boolean
Dim sFile As String = sDir
'Scelta file con dialogo
Dim OpenFileDialog As New OpenFileDialog
OpenFileDialog.Title = "Exec Script"
OpenFileDialog.Filter = "Lua commands(*.lua)|*.lua" &
"|Test commands(*.tsc)|*.tsc" &
"|All Files (*.*)|*.*"
OpenFileDialog.FilterIndex = 1
If OpenFileDialog.ShowDialog <> Windows.Forms.DialogResult.OK Then
Return True
If bWithDlg Then
Dim OpenFileDialog As New OpenFileDialog
OpenFileDialog.Title = "Exec Script"
OpenFileDialog.Filter = "Lua commands(*.lua)|*.lua" &
"|Test commands(*.tsc)|*.tsc" &
"|All Files (*.*)|*.*"
OpenFileDialog.FilterIndex = 1
OpenFileDialog.InitialDirectory = sDir
If OpenFileDialog.ShowDialog <> Windows.Forms.DialogResult.OK Then
Return True
End If
sFile = OpenFileDialog.FileName
End If
'Ne verifico il tipo
Dim sExt As String = UCase(Path.GetExtension(OpenFileDialog.FileName))
Dim sExt As String = UCase(Path.GetExtension(sFile))
If (sExt <> ".LUA" And sExt <> ".TSC") Then
MessageBox.Show("Script type unknow", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Return False
End If
'Prima dell'esecuzione
RaiseEvent OnExecutingScript(Me, OpenFileDialog.FileName)
RaiseEvent OnExecutingScript(Me, sFile)
'Esecuzione
Cursor = Cursors.WaitCursor
Dim bOk As Boolean = False
If (sExt = ".LUA") Then
bOk = EgtLuaExecFile(OpenFileDialog.FileName)
bOk = EgtLuaExecFile(sFile)
Else
bOk = EgtTscExecFile(OpenFileDialog.FileName)
bOk = EgtTscExecFile(sFile)
End If
EgtZoom(m_nGseContext, ZM_ALL)
EgtZoom(ZM_ALL)
Cursor = Cursors.Default
'Gestione risultato
If bOk Then
@@ -696,10 +740,22 @@ Public Class Scene
EgtSetView(CT_TOP)
End Sub
Public Sub IsoView()
Public Sub IsoViewSW()
EgtSetView(CT_ISO_SW)
End Sub
Public Sub IsoViewSE()
EgtSetView(CT_ISO_SE)
End Sub
Public Sub IsoViewNE()
EgtSetView(CT_ISO_NE)
End Sub
Public Sub IsoViewNW()
EgtSetView(CT_ISO_NW)
End Sub
Public Sub FrontView()
EgtSetView(CT_FRONT)
End Sub
+76
View File
@@ -128,6 +128,7 @@
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Messaging" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
@@ -260,6 +261,81 @@
<ItemGroup>
<EmbeddedResource Include="Resources\Analyze.cur" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Resources\Open.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\New.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Save.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Exec.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Import.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Export.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\SaveAs.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\RenderingHL.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\RenderingWF.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\RenderingSH.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\ZoomAll.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\ZoomIn.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\ZoomOut.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\LookFromTOP.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\LookFromFRONT.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\LookFromRIGHT.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\LookFromBACK.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\LookFromLEFT.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\LookFromISO_SW.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\LookFromISO_SE.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\LookFromISO_NE.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\LookFromISO_NW.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\GetDist.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Analyze.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\CurveDir.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\TestEIn\TestEInR32.exe