TestEIn 1.6a3 :

- aggiunto disegno poligoni
- aggiunto mirror 3D
- in testo avanzato ora si può impostare anche italic
- gestione tipo riferimento dati geometrici GLOB, LOC, GRID
- gestione CmdLog con più istanze in esecuzione
This commit is contained in:
Dario Sassi
2015-01-19 18:25:07 +00:00
parent eb69af9280
commit c688b715ea
11 changed files with 583 additions and 370 deletions
+263 -96
View File
@@ -1,8 +1,8 @@
'----------------------------------------------------------------------------
' EgalTech 2014-2014
' EgalTech 2014-2015
'----------------------------------------------------------------------------
' File : Controller.vb Data : 04.11.14 Versione : 1.5k1
' Contenuto : Classe Controller (parte di MCV).
' File : Controller.vb Data : 04.11.14 Versione : 1.6a3
' Contenuto : Classe Controller (parte di MVC).
'
'
'
@@ -66,6 +66,7 @@ Public Class Controller
ARC3P
ARCPDP
RECTANGLE2P
POLYGONSIDE
TEXT
TEXTPLUS
PLANE
@@ -88,6 +89,7 @@ Public Class Controller
ROTATE
ROTATE3D
MIRROR
MIRROR3D
SCALE
SCALE3D
OFFSET
@@ -109,6 +111,7 @@ Public Class Controller
Private m_ptP2 As Point3d
Private m_sepP2 As SEP
Private m_nIdP2 As Integer
Private m_ptP3 As Point3d
Private m_ptLast As Point3d
Private m_sepLast As SEP
Private m_nIdLast As Integer
@@ -127,6 +130,7 @@ Public Class Controller
Private Enum IBT As Integer
TY_NULL = 0
TY_STRING
TY_INTEGER
TY_DOUBLE
TY_DIRECTION
TY_LENGTH
@@ -238,6 +242,7 @@ Public Class Controller
' disabilito drag da mouse
m_Scene.DisableDrag()
EgtResetGeoLine()
EgtResetGeoTria()
' aggiorno drag
ExecuteDrag()
End Sub
@@ -246,6 +251,11 @@ Public Class Controller
RaiseEvent SetInputBoxText(sText)
End Sub
Private Sub SetInputBoxInteger(ByVal nVal As Integer)
Dim sText As String = nVal.ToString()
RaiseEvent SetInputBoxText(sText)
End Sub
Private Function DoubleToString(ByVal dVal As Double, ByVal nNumDec As UInteger) As String
Dim sFormat As String = "F" + nNumDec.ToString()
Dim sVal As String = dVal.ToString(sFormat, CultureInfo.InvariantCulture)
@@ -278,9 +288,7 @@ Public Class Controller
Private Sub SetInputBoxPoint3d(ByVal ptVal As Point3d)
' converto da coordinate globali a griglia
Dim frGrid As New Frame3d
EgtGetGridFrame(frGrid)
ptVal.ToLoc(frGrid)
ptVal = ptVal.Loc(GDB_ID.GRID)
' visualizzo
Dim sText As New StringBuilder(128)
sText.Append(DoubleToString(ptVal.x, 4))
@@ -298,6 +306,8 @@ Public Class Controller
m_sLast = sText
End If
Return True
Case IBT.TY_INTEGER
Return TextToInteger(sText, m_nLast)
Case IBT.TY_DOUBLE, IBT.TY_DIRECTION, IBT.TY_LENGTH, IBT.TY_SPECIALDOUBLE
Return TextToDouble(sText, m_dLast)
Case IBT.TY_3DOUBLE
@@ -305,19 +315,24 @@ Public Class Controller
Case IBT.TY_POINT3D
Dim d3Val(3) As Double
If TextTo3Double(sText, d3Val) Then
m_ptLast.x = d3Val(0)
m_ptLast.y = d3Val(1)
m_ptLast.z = d3Val(2)
' converto da riferimento griglia a globale
Dim frGrid As New Frame3d
EgtGetGridFrame(frGrid)
m_ptLast.ToGlob(frGrid)
m_ptLast = New Point3d(d3Val(0), d3Val(1), d3Val(2)).Glob(GDB_ID.GRID)
Return True
End If
End Select
Return False
End Function
Private Function TextToInteger(ByRef sText As String, ByRef nVal As Integer) As Boolean
Dim dVal As Double
If EgtLuaEvalNumExpr(sText, dVal) Then
nVal = CInt(dVal)
Return True
Else
Return False
End If
End Function
Private Function TextToDouble(ByRef sText As String, ByRef dVal As Double) As Boolean
Return EgtLuaEvalNumExpr(sText, dVal)
End Function
@@ -497,6 +512,9 @@ Public Class Controller
' Rectangle 2P
Case CMD.RECTANGLE2P
Return ProcessRectangle2P()
' Polygon Side
Case CMD.POLYGONSIDE
Return ProcessPolygonSide()
' Text
Case CMD.TEXT
Return ProcessText()
@@ -563,6 +581,9 @@ Public Class Controller
' Mirror
Case CMD.MIRROR
Return ProcessMirror()
' Mirror 3d
Case CMD.MIRROR3D
Return ProcessMirror3D()
' Scale
Case CMD.SCALE
Return ProcessScale()
@@ -598,6 +619,8 @@ Public Class Controller
DragArcPDP()
Case CMD.RECTANGLE2P
DragRectangle2P()
Case CMD.POLYGONSIDE
DragPolygonSide()
Case CMD.TEXT
DragText()
Case CMD.TEXTPLUS
@@ -620,6 +643,8 @@ Public Class Controller
DragRotate3D()
Case CMD.MIRROR
DragMirror()
Case CMD.MIRROR3D
DragMirror3D()
Case CMD.SCALE
DragScale()
Case CMD.SCALE3D
@@ -696,8 +721,7 @@ Public Class Controller
m_nInpType = IBT.TY_DOUBLE
Case 1
' recupero il piano di griglia corrente
Dim frCurr As New Frame3d
EgtGetGridFrame(frCurr)
Dim frCurr As New Frame3d(EgtGetGridFrame())
' cambio l'elevazione dell'origine
frCurr.Move(EgtGetGridVersZ() * m_dLast)
' imposto nuova griglia
@@ -728,8 +752,7 @@ Public Class Controller
m_nInpType = IBT.TY_POINT3D
Case 1
' recupero il piano di griglia corrente
Dim frCurr As New Frame3d
EgtGetGridFrame(frCurr)
Dim frCurr As New Frame3d(EgtGetGridFrame())
' ne modifico l'origine
frCurr.Move(m_ptLast - frCurr.Orig())
' imposto nuova griglia
@@ -775,8 +798,7 @@ Public Class Controller
Dim bDet As Boolean = True
EgtGetVectorRotation((m_ptP2 - m_ptP1), (m_ptLast - m_ptP1), EgtGetGridVersZ(), dAngRotDeg, bDet)
' eseguo rotazione
Dim frCurr As New Frame3d
EgtGetGridFrame(frCurr)
Dim frCurr As New Frame3d(EgtGetGridFrame())
frCurr.Rotate(m_ptP1, EgtGetGridVersZ(), dAngRotDeg)
EnableCommandLog()
EgtSetGridFrame(frCurr)
@@ -826,8 +848,7 @@ Public Class Controller
Case 3
' eseguo rotazione
Dim VtAx As Vector3d = m_ptP2 - m_ptP1
Dim frCurr As New Frame3d
EgtGetGridFrame(frCurr)
Dim frCurr As New Frame3d(EgtGetGridFrame())
frCurr.Rotate(m_ptP1, VtAx, m_dLast)
EnableCommandLog()
EgtSetGridFrame(frCurr)
@@ -1409,7 +1430,7 @@ Public Class Controller
Case 1
' creo il punto (i dati sono in globale)
EnableCommandLog()
If EgtCreateGeoPoint(GetCurrLayer(), m_ptLast.Loc(GetCurrLayer())) <> GDB_ID.NULL Then
If EgtCreateGeoPoint(GetCurrLayer(), m_ptLast.Loc(GDB_ID.GRID), REF_TY.GRID) <> GDB_ID.NULL Then
m_ptCont = m_ptLast
End If
DisableCommandLog()
@@ -1464,8 +1485,9 @@ Public Class Controller
m_Scene.ResetStatus(False)
' creo la linea (i punti sono in globale)
EnableCommandLog()
Dim nId As Integer = EgtCreateCurveLineEx(GetCurrLayer(), m_ptP1.Loc(GetCurrLayer()), m_sepP1, m_nIdP1,
m_ptLast.Loc(GetCurrLayer()), m_sepLast, m_nIdLast)
Dim nId As Integer = EgtCreateCurveLineEx(GetCurrLayer(),
m_ptP1.Loc(GDB_ID.GRID), m_sepP1, m_nIdP1,
m_ptLast.Loc(GDB_ID.GRID), m_sepLast, m_nIdLast, REF_TY.GRID)
DisableCommandLog()
If nId <> GDB_ID.NULL Then
m_ptCont = m_ptLast
@@ -1491,14 +1513,14 @@ Public Class Controller
' se punti entrambi già definiti
If m_sepP1 = SEP.PT_STD And m_sepLast = SEP.PT_STD Then
If nId = GDB_ID.NULL Then
EgtCreateCurveLine(m_Scene.GetDragGroup(), m_ptP1, m_ptLast)
EgtCreateCurveLine(m_Scene.GetDragGroup(), m_ptP1, m_ptLast, REF_TY.GLOB)
Else
EgtModifyCurveEndPoint(nId, m_ptLast)
End If
' altrimenti, uno dei punti tangente o normale
Else
EgtErase(nId)
EgtCreateCurveLineEx(m_Scene.GetDragGroup(), m_ptP1, m_sepP1, m_nIdP1, m_ptLast, m_sepLast, m_nIdLast)
EgtCreateCurveLineEx(m_Scene.GetDragGroup(), m_ptP1, m_sepP1, m_nIdP1, m_ptLast, m_sepLast, m_nIdLast, REF_TY.GLOB)
End If
EgtDraw()
End If
@@ -1546,8 +1568,8 @@ Public Class Controller
m_Scene.ResetStatus(False)
' creo la linea (i punti sono in globale)
EnableCommandLog()
Dim nId As Integer = EgtCreateCurveLinePVL(GetCurrLayer(), m_ptP1.Loc(GetCurrLayer()),
m_vtCont.Loc(GetCurrLayer()), m_dLast)
Dim nId As Integer = EgtCreateCurveLinePVL(GetCurrLayer(), m_ptP1.Loc(GDB_ID.GRID),
m_vtCont.Loc(GDB_ID.GRID), m_dLast, REF_TY.GRID)
DisableCommandLog()
If nId <> GDB_ID.NULL Then
m_ptCont = m_ptLast
@@ -1573,7 +1595,7 @@ Public Class Controller
Dim nId As Integer = EgtGetFirstInGroup(m_Scene.GetDragGroup())
If nId = GDB_ID.NULL Then
' creo la linea di direzione
EgtCreateCurveLinePVL(m_Scene.GetDragGroup(), m_ptP1, vtDirS, m_dAux)
EgtCreateCurveLinePVL(m_Scene.GetDragGroup(), m_ptP1, vtDirS, m_dAux, REF_TY.GLOB)
Else
Dim ptP2 As Point3d = m_ptP1 + vtDirS * m_dAux
EgtModifyCurveEndPoint(nId, ptP2)
@@ -1584,7 +1606,7 @@ Public Class Controller
Dim nId As Integer = EgtGetFirstInGroup(m_Scene.GetDragGroup())
If nId = GDB_ID.NULL Then
' creo la linea di direzione
EgtCreateCurveLinePVL(m_Scene.GetDragGroup(), m_ptP1, m_vtCont, m_dLast)
EgtCreateCurveLinePVL(m_Scene.GetDragGroup(), m_ptP1, m_vtCont, m_dLast, REF_TY.GLOB)
Else
Dim ptP2 As Point3d = m_ptP1 + m_vtCont * m_dLast
EgtModifyCurveEndPoint(nId, ptP2)
@@ -1617,8 +1639,8 @@ Public Class Controller
m_Scene.ResetStatus(False)
' creo la circonferenza (i punti sono in globale)
EnableCommandLog()
Dim nId As Integer = EgtCreateCurveCircleCPN(GetCurrLayer(), m_ptP1.Loc(GetCurrLayer()),
m_ptLast.Loc(GetCurrLayer()), EgtGetGridVersZ().Loc(GetCurrLayer()))
Dim nId As Integer = EgtCreateCurveCircleCPN(GetCurrLayer(), m_ptP1.Loc(GDB_ID.GRID),
m_ptLast.Loc(GDB_ID.GRID), Vector3d.Z_AX, REF_TY.GRID)
DisableCommandLog()
EgtDraw()
' aggiorno stato
@@ -1636,7 +1658,7 @@ Public Class Controller
' durante la creazione di oggetti il gruppo di Drag ha riferimento globale
Dim nId As Integer = EgtGetFirstInGroup(m_Scene.GetDragGroup())
If nId = GDB_ID.NULL Then
EgtCreateCurveCircleCPN(m_Scene.GetDragGroup(), m_ptP1, m_ptLast, EgtGetGridVersZ())
EgtCreateCurveCircleCPN(m_Scene.GetDragGroup(), m_ptP1, m_ptLast, EgtGetGridVersZ(), REF_TY.GLOB)
Else
EgtModifyCurveCircleCPN(nId, m_ptLast)
End If
@@ -1671,8 +1693,8 @@ Public Class Controller
m_Scene.ResetStatus(False)
' creo la circonferenza (i punti sono in globale)
EnableCommandLog()
Dim nId As Integer = EgtCreateCurveCircle(GetCurrLayer(), m_ptP1.Loc(GetCurrLayer()),
EgtGetGridVersZ().Loc(GetCurrLayer()), 0.5 * m_dLast)
Dim nId As Integer = EgtCreateCurveCircle(GetCurrLayer(), m_ptP1.Loc(GDB_ID.GRID),
Vector3d.Z_AX, 0.5 * m_dLast, REF_TY.GRID)
DisableCommandLog()
EgtDraw()
' aggiorno stato
@@ -1690,7 +1712,7 @@ Public Class Controller
' durante la creazione di oggetti il gruppo di Drag ha riferimento globale
Dim nId As Integer = EgtGetFirstInGroup(m_Scene.GetDragGroup())
If nId = GDB_ID.NULL Then
EgtCreateCurveCircle(m_Scene.GetDragGroup(), m_ptP1, EgtGetGridVersZ(), 0.5 * m_dLast)
EgtCreateCurveCircle(m_Scene.GetDragGroup(), m_ptP1, EgtGetGridVersZ(), 0.5 * m_dLast, REF_TY.GLOB)
Else
EgtModifyCurveArcRadius(nId, 0.5 * m_dLast)
End If
@@ -1728,8 +1750,8 @@ Public Class Controller
m_Scene.ResetStatus(False)
' creo l'arco (i punti sono in globale)
EnableCommandLog()
Dim nId = EgtCreateCurveArcC2PN(GetCurrLayer(), m_ptP1.Loc(GetCurrLayer()), m_ptP2.Loc(GetCurrLayer()),
m_ptLast.Loc(GetCurrLayer()), EgtGetGridVersZ().Loc(GetCurrLayer()))
Dim nId = EgtCreateCurveArcC2PN(GetCurrLayer(), m_ptP1.Loc(GDB_ID.GRID), m_ptP2.Loc(GDB_ID.GRID),
m_ptLast.Loc(GDB_ID.GRID), Vector3d.Z_AX, REF_TY.GRID)
DisableCommandLog()
If nId <> GDB_ID.NULL Then
Dim PtP As Point3d
@@ -1763,7 +1785,7 @@ Public Class Controller
nId = GDB_ID.NULL
End If
If nId = GDB_ID.NULL Then
EgtCreateCurveArcC2PN(m_Scene.GetDragGroup(), m_ptP1, m_ptP2, m_ptLast, EgtGetGridVersZ())
EgtCreateCurveArcC2PN(m_Scene.GetDragGroup(), m_ptP1, m_ptP2, m_ptLast, EgtGetGridVersZ(), REF_TY.GLOB)
Else
EgtModifyCurveArcC2PN(nId, m_ptLast)
End If
@@ -1802,8 +1824,8 @@ Public Class Controller
m_Scene.ResetStatus(False)
' creo l'arco (i punti sono in globale)
EnableCommandLog()
Dim nId = EgtCreateCurveArc3P(GetCurrLayer(), m_ptP1.Loc(GetCurrLayer()),
m_ptLast.Loc(GetCurrLayer()), m_ptP2.Loc(GetCurrLayer()))
Dim nId = EgtCreateCurveArc3P(GetCurrLayer(), m_ptP1.Loc(GDB_ID.GRID),
m_ptLast.Loc(GDB_ID.GRID), m_ptP2.Loc(GDB_ID.GRID), REF_TY.GRID)
DisableCommandLog()
If nId <> GDB_ID.NULL Then
m_ptCont = m_ptP2
@@ -1827,7 +1849,7 @@ Public Class Controller
' durante la creazione di oggetti il gruppo di Drag ha riferimento globale
Dim nId As Integer = EgtGetFirstInGroup(m_Scene.GetDragGroup())
If nId = GDB_ID.NULL Then
EgtCreateCurveLine(m_Scene.GetDragGroup(), m_ptP1, m_ptLast)
EgtCreateCurveLine(m_Scene.GetDragGroup(), m_ptP1, m_ptLast, REF_TY.GLOB)
Else
EgtModifyCurveEndPoint(nId, m_ptLast)
End If
@@ -1841,13 +1863,13 @@ Public Class Controller
End If
If nId = GDB_ID.NULL Then
' creazione arco 3P, in alcuni casi crea una retta
EgtCreateCurveArc3P(m_Scene.GetDragGroup(), m_ptP1, m_ptLast, m_ptP2)
EgtCreateCurveArc3P(m_Scene.GetDragGroup(), m_ptP1, m_ptLast, m_ptP2, REF_TY.GLOB)
Else
' se modifica arco 3P impossibile, provo con una retta
If (Not EgtModifyCurveArc3P(nId, m_ptLast) AndAlso
(m_ptLast - m_ptP1) * (m_ptP2 - m_ptLast) > EPS_ZERO) Then
EgtErase(nId)
EgtCreateCurveLine(m_Scene.GetDragGroup(), m_ptP1, m_ptP2)
EgtCreateCurveLine(m_Scene.GetDragGroup(), m_ptP1, m_ptP2, REF_TY.GLOB)
End If
End If
EgtDraw()
@@ -1891,8 +1913,8 @@ Public Class Controller
Dim vtDirS As Vector3d = GlobDirFromGridAng(m_dLast)
' creo l'arco (i punti sono in globale)
EnableCommandLog()
Dim nId = EgtCreateCurveArc2PVN(GetCurrLayer(), m_ptP1.Loc(GetCurrLayer()), m_ptLast.Loc(GetCurrLayer()),
vtDirS.Loc(GetCurrLayer()), EgtGetGridVersZ().Loc(GetCurrLayer()))
Dim nId = EgtCreateCurveArc2PVN(GetCurrLayer(), m_ptP1.Loc(GDB_ID.GRID), m_ptLast.Loc(GDB_ID.GRID),
vtDirS.Loc(GDB_ID.GRID), Vector3d.Z_AX, REF_TY.GRID)
DisableCommandLog()
If nId <> GDB_ID.NULL Then
m_ptCont = m_ptLast
@@ -1919,7 +1941,7 @@ Public Class Controller
Dim nId As Integer = EgtGetFirstInGroup(m_Scene.GetDragGroup())
If nId = GDB_ID.NULL Then
' creo la linea di direzione
EgtCreateCurveLinePVL(m_Scene.GetDragGroup(), m_ptP1, vtDirS, m_dAux)
EgtCreateCurveLinePVL(m_Scene.GetDragGroup(), m_ptP1, vtDirS, m_dAux, REF_TY.GLOB)
Else
Dim ptP2 As Point3d = m_ptP1 + vtDirS * m_dAux
EgtModifyCurveEndPoint(nId, ptP2)
@@ -1937,14 +1959,14 @@ Public Class Controller
' se arco da creare
If nId = GDB_ID.NULL Then
' creo l'arco (i punti sono in globale), in alcuni casi particolari crea una retta
EgtCreateCurveArc2PVN(m_Scene.GetDragGroup(), m_ptP1, m_ptLast, vtDirS, EgtGetGridVersZ())
EgtCreateCurveArc2PVN(m_Scene.GetDragGroup(), m_ptP1, m_ptLast, vtDirS, EgtGetGridVersZ(), REF_TY.GLOB)
' altrimenti da modificare
Else
' se modifica arco impossibile, provo con una retta
If (Not EgtModifyCurveEndPoint(nId, m_ptLast) AndAlso
(m_ptLast - m_ptP1) * vtDirS > EPS_ZERO) Then
EgtErase(nId)
EgtCreateCurveLine(m_Scene.GetDragGroup(), m_ptP1, m_ptLast)
EgtCreateCurveLine(m_Scene.GetDragGroup(), m_ptP1, m_ptLast, REF_TY.GLOB)
End If
End If
EgtDraw()
@@ -1970,7 +1992,7 @@ Public Class Controller
m_nStep = 2
RaiseEvent PrepareInputBox("RECTANGLE 2P", "Insert End Point", "", False, True)
m_nInpType = IBT.TY_POINT3D
SetInputBoxPoint3d(m_ptLast.Loc(GetCurrLayer()))
SetInputBoxPoint3d(m_ptLast.Loc(GDB_ID.GRID))
Case 2
' reset scena
m_Scene.ResetStatus(False)
@@ -1978,8 +2000,8 @@ Public Class Controller
Dim vtGridX As Vector3d = EgtGetGridVersX()
Dim ptDir As Point3d = m_ptP1 + ((m_ptLast - m_ptP1) * vtGridX * vtGridX)
EnableCommandLog()
Dim nId As Integer = EgtCreateRectangle3P(GetCurrLayer(), m_ptP1.Loc(GetCurrLayer()),
m_ptLast.Loc(GetCurrLayer()), ptDir.Loc(GetCurrLayer()))
Dim nId As Integer = EgtCreateRectangle3P(GetCurrLayer(), m_ptP1.Loc(GDB_ID.GRID),
m_ptLast.Loc(GDB_ID.GRID), ptDir.Loc(GDB_ID.GRID), REF_TY.GRID)
DisableCommandLog()
EgtDraw()
' aggiorno stato
@@ -2001,7 +2023,64 @@ Public Class Controller
' creo il rettangolo (drag è in globale)
Dim vtGridX As Vector3d = EgtGetGridVersX()
Dim ptDir As Point3d = m_ptP1 + ((m_ptLast - m_ptP1) * vtGridX * vtGridX)
EgtCreateRectangle3P(m_Scene.GetDragGroup(), m_ptP1, m_ptLast, ptDir)
EgtCreateRectangle3P(m_Scene.GetDragGroup(), m_ptP1, m_ptLast, ptDir, REF_TY.GLOB)
EgtDraw()
End If
End Sub
Private Function ProcessPolygonSide() As Boolean
Select Case m_nStep
Case 0
' deve esistere un gruppo corrente e devo poter creare il gruppo di drag
If GetCurrLayer() = GDB_ID.NULL Or Not m_Scene.CreateDragGroup() Then
Return False
End If
' imposto stato a numero lati per PolygonSide
m_nStep = 1
' abilito dialogo
RaiseEvent PrepareInputBox("POLYGON SIDE", "Insert Side Nbr", "", False, False)
m_nInpType = IBT.TY_INTEGER
m_nLast = 3
SetInputBoxInteger(m_nLast)
Case 1
m_Scene.SetStatusSelPoint()
m_nStep = 2
RaiseEvent PrepareInputBox("POLYGON SIDE", "Insert Side Start Point", "", False, False)
m_nInpType = IBT.TY_POINT3D
SetInputBoxPoint3d(m_ptCont)
Case 2
m_ptP1 = m_ptLast
m_nStep = 3
RaiseEvent PrepareInputBox("POLYGON SIDE", "Insert Side End Point", "", False, True)
m_nInpType = IBT.TY_POINT3D
SetInputBoxPoint3d(m_ptLast.Loc(GDB_ID.GRID))
Case 3
' reset scena
m_Scene.ResetStatus(False)
' creo il poligono (i punti sono in globale)
EnableCommandLog()
Dim nId As Integer = EgtCreatePolygonFromSide(GetCurrLayer(), m_nLast, m_ptP1.Loc(GDB_ID.GRID),
m_ptLast.Loc(GDB_ID.GRID), Vector3d.Z_AX, REF_TY.GRID)
DisableCommandLog()
EgtDraw()
' aggiorno stato
m_nStep = 0
SetModified()
Case Else
m_nStep = 0
Return False
End Select
Return True
End Function
Private Sub DragPolygonSide()
' il gruppo di Drag ha riferimento globale
If m_nStep = 3 Then
' recupero possibile entità già nel gruppo di drag
Dim nId As Integer = EgtGetFirstInGroup(m_Scene.GetDragGroup())
EgtErase(nId)
' creo il poligono (drag è in globale)
EgtCreatePolygonFromSide(m_Scene.GetDragGroup(), m_nLast, m_ptP1, m_ptLast, Vector3d.Z_AX().Glob(GDB_ID.GRID), REF_TY.GLOB)
EgtDraw()
End If
End Sub
@@ -2036,9 +2115,9 @@ Public Class Controller
m_Scene.ResetStatus(False)
' creo l'entità testo (i punti sono in globale)
EnableCommandLog()
Dim nId As Integer = EgtCreateTextEx(GetCurrLayer(), m_ptP1.Loc(GetCurrLayer()),
EgtGetGridVersZ().Loc(GetCurrLayer()), EgtGetGridVersX().Loc(GetCurrLayer()),
m_sLast, "", False, m_dLast)
Dim nId As Integer = EgtCreateTextEx(GetCurrLayer(), m_ptP1.Loc(GDB_ID.GRID),
Vector3d.Z_AX, Vector3d.X_AX,
m_sLast, "", False, m_dLast, REF_TY.GRID)
DisableCommandLog()
EgtDraw()
' aggiorno stato
@@ -2059,7 +2138,7 @@ Public Class Controller
EgtErase(nId)
' creo il testo (drag è in globale)
EgtCreateTextEx(m_Scene.GetDragGroup(), m_ptP1, EgtGetGridVersZ(), EgtGetGridVersX(),
m_sLast, "", False, 10)
m_sLast, "", False, 10, REF_TY.GLOB)
EgtDraw()
ElseIf m_nStep = 3 Then
' recupero possibile entità già nel gruppo di drag
@@ -2067,7 +2146,7 @@ Public Class Controller
EgtErase(nId)
' creo il testo (drag è in globale)
EgtCreateTextEx(m_Scene.GetDragGroup(), m_ptP1, EgtGetGridVersZ(), EgtGetGridVersX(),
m_sLast, "", False, m_dLast)
m_sLast, "", False, m_dLast, REF_TY.GLOB)
EgtDraw()
End If
End Sub
@@ -2104,9 +2183,12 @@ Public Class Controller
m_sLast = String.Empty
Case 3
m_nStep = 4
RaiseEvent PrepareInputBox("TEXT+", "Insert Height", "", True, True)
RaiseEvent PrepareInputBox("TEXT+", "Insert Height", "Italic", True, True)
m_nInpType = IBT.TY_DOUBLE
SetInputBoxDouble(10)
m_dLast = 10
SetInputBoxDouble(m_dLast)
m_bLast = False
RaiseEvent SetInputBoxCheck(m_bLast)
LoadFonts()
Dim sDefaultFont As String = String.Empty
EgtGetDefaultFont(sDefaultFont)
@@ -2124,9 +2206,9 @@ Public Class Controller
End If
' creo l'entità testo (i punti sono in globale)
EnableCommandLog()
Dim nId As Integer = EgtCreateTextEx(GetCurrLayer(), m_ptP1.Loc(GetCurrLayer()),
EgtGetGridVersZ().Loc(GetCurrLayer()), (m_ptP2 - m_ptP1).Loc(GetCurrLayer()),
m_sLast, sFont, False, m_dLast)
Dim nId As Integer = EgtCreateTextEx(GetCurrLayer(), m_ptP1.Loc(GDB_ID.GRID),
Vector3d.Z_AX, (m_ptP2 - m_ptP1).Loc(GDB_ID.GRID),
m_sLast, sFont, m_bLast, m_dLast, REF_TY.GRID)
DisableCommandLog()
EgtDraw()
' aggiorno stato
@@ -2152,7 +2234,7 @@ Public Class Controller
EgtErase(nId)
' creo il testo (drag è in globale)
EgtCreateTextEx(m_Scene.GetDragGroup(), m_ptP1, EgtGetGridVersZ(), (m_ptP2 - m_ptP1),
m_sLast, "", False, 10)
m_sLast, "", False, 10, REF_TY.GLOB)
EgtDraw()
ElseIf m_nStep = 4 Then
' linea di base
@@ -2167,7 +2249,7 @@ Public Class Controller
End If
' creo il testo (drag è in globale)
EgtCreateTextEx(m_Scene.GetDragGroup(), m_ptP1, EgtGetGridVersZ(), (m_ptP2 - m_ptP1),
m_sLast, sFont, False, m_dLast)
m_sLast, sFont, m_bLast, m_dLast, REF_TY.GLOB)
EgtDraw()
End If
End Sub
@@ -2211,9 +2293,9 @@ Public Class Controller
' reset scena
m_Scene.ResetStatus(False)
' creo la superficie di estrusione (a partire da un contorno selezionato)
Dim VtExtr As Vector3d = EgtGetGridVersZ().Loc(GetCurrLayer()) * m_dLast
Dim VtExtr As Vector3d = Vector3d.Z_AX * m_dLast
EnableCommandLog()
EgtCreateSurfTriMeshByExtrusion(GetCurrLayer(), EgtGetLastSelectedObj(), VtExtr, EPS_STM)
EgtCreateSurfTriMeshByExtrusion(GetCurrLayer(), EgtGetLastSelectedObj(), VtExtr, EPS_STM, REF_TY.GRID)
DisableCommandLog()
EgtDraw()
' aggiorno stato
@@ -2232,7 +2314,7 @@ Public Class Controller
EgtErase(EgtGetFirstInGroup(m_Scene.GetDragGroup()))
' creo la superficie di estrusione (a partire da un contorno selezionato)
Dim VtExtr As Vector3d = EgtGetGridVersZ() * m_dLast
EgtCreateSurfTriMeshByExtrusion(m_Scene.GetDragGroup(), EgtGetLastSelectedObj(), VtExtr, EPS_STM_DRAG)
EgtCreateSurfTriMeshByExtrusion(m_Scene.GetDragGroup(), EgtGetLastSelectedObj(), VtExtr, EPS_STM_DRAG, REF_TY.GLOB)
EgtDraw()
End If
End Sub
@@ -2263,8 +2345,8 @@ Public Class Controller
EnableCommandLog()
Dim vtAx As Vector3d = m_ptLast - m_ptP1
EgtCreateSurfTriMeshByScrewing(GetCurrLayer(), EgtGetLastSelectedObj(),
m_ptP1.Loc(GetCurrLayer()), vtAx.Loc(GetCurrLayer()),
360, 0, EPS_STM)
m_ptP1.Loc(GDB_ID.GRID), vtAx.Loc(GDB_ID.GRID),
360, 0, EPS_STM, REF_TY.GRID)
DisableCommandLog()
EgtDraw()
' aggiorno stato
@@ -2327,8 +2409,8 @@ Public Class Controller
EnableCommandLog()
Dim vtAx As Vector3d = m_ptP2 - m_ptP1
EgtCreateSurfTriMeshByScrewing(GetCurrLayer(), EgtGetLastSelectedObj(),
m_ptP1.Loc(GetCurrLayer()), vtAx.Loc(GetCurrLayer()),
m_dPrev, m_dLast, EPS_STM)
m_ptP1.Loc(GDB_ID.GRID), vtAx.Loc(GDB_ID.GRID),
m_dPrev, m_dLast, EPS_STM, REF_TY.GRID)
DisableCommandLog()
EgtDraw()
' aggiorno stato
@@ -2352,7 +2434,7 @@ Public Class Controller
' creo la superficie di rivoluzione (i punti sono in globale)
Dim vtAx As Vector3d = m_ptP2 - m_ptP1
EgtCreateSurfTriMeshByScrewing(m_Scene.GetDragGroup(), EgtGetLastSelectedObj(),
m_ptP1, vtAx, m_dLast, 0, EPS_STM_DRAG)
m_ptP1, vtAx, m_dLast, 0, EPS_STM_DRAG, REF_TY.GLOB)
EgtDraw()
ElseIf m_nStep = 4 Then
EgtSetGeoLine(m_ptP1, m_ptP2)
@@ -2361,7 +2443,7 @@ Public Class Controller
' creo la superficie di rivoluzione (i punti sono in globale)
Dim vtAx As Vector3d = m_ptP2 - m_ptP1
EgtCreateSurfTriMeshByScrewing(m_Scene.GetDragGroup(), EgtGetLastSelectedObj(),
m_ptP1, vtAx, m_dPrev, m_dLast, EPS_STM_DRAG)
m_ptP1, vtAx, m_dPrev, m_dLast, EPS_STM_DRAG, REF_TY.GLOB)
EgtDraw()
End If
End Sub
@@ -3034,7 +3116,7 @@ Public Class Controller
EgtMirrorGlob(nCopyId, m_ptP1, VtNorm)
nId = EgtGetNextSelectedObj()
End While
' eseguo rotazione
' eseguo mirror
Else
EgtMirrorGlob(GDB_ID.SEL, m_ptP1, VtNorm)
End If
@@ -3071,6 +3153,89 @@ Public Class Controller
End If
End Sub
Private Function ProcessMirror3D() As Boolean
Select Case m_nStep
Case 0
' verifico condizioni e preparo per il drag
If Not PrepareTransform() Then
Return False
End If
m_Scene.SetStatusSelPoint()
' imposto stato a primo punto per Mirror
m_nStep = 1
' abilito dialogo
RaiseEvent PrepareInputBox("MIRROR 3D", "Insert First Point", "Copy", False, False)
m_nInpType = IBT.TY_POINT3D
RaiseEvent SetInputBoxCheck(False)
Case 1
m_ptP1 = m_ptLast
m_ptP2 = m_ptP1
m_nStep = 2
m_Scene.EnableDrag()
RaiseEvent PrepareInputBox("MIRROR 3D", "Insert Second Point", "Copy", False, True)
m_nInpType = IBT.TY_POINT3D
Case 2
m_ptP2 = m_ptLast
m_ptP3 = m_ptP2
m_nStep = 3
m_Scene.EnableDrag()
RaiseEvent PrepareInputBox("MIRROR 3D", "Insert Third Point", "Copy", False, True)
m_nInpType = IBT.TY_POINT3D
Case 3
m_Scene.ResetStatus(False)
' esecuzione
Dim VtNorm As Vector3d = (m_ptLast - m_ptP1) ^ (m_ptP2 - m_ptP1)
If VtNorm.Len > EPS_SMALL Then
EnableCommandLog()
' eseguo copia e mirror
If m_bLast Then
Dim nId As Integer = EgtGetFirstSelectedObj()
While nId <> GDB_ID.NULL
Dim nCopyId As Integer = EgtCopyGlob(nId, GetCurrLayer())
EgtMirrorGlob(nCopyId, m_ptP1, VtNorm)
nId = EgtGetNextSelectedObj()
End While
' eseguo mirror
Else
EgtMirrorGlob(GDB_ID.SEL, m_ptP1, VtNorm)
End If
DisableCommandLog()
End If
EgtDraw()
' aggiorno stato
m_nStep = 0
SetModified()
Case Else
m_nStep = 0
Return False
End Select
Return True
End Function
Private Sub DragMirror3D()
If m_nStep = 2 Then
' linea di mirror
EgtSetGeoLine(m_ptP1, m_ptLast)
ElseIf m_nStep = 3 Then
' triangolo di mirror
EgtResetGeoLine()
EgtSetGeoTria(m_ptP1, m_ptP2, m_ptLast)
' ripristino lo stato iniziale, tramite annullo mirror precedente
Dim VtNorm As Vector3d = (m_ptP3 - m_ptP1) ^ (m_ptP2 - m_ptP1)
If VtNorm.Len > EPS_SMALL Then
EgtMirrorGlob(m_Scene.GetDragGroup(), m_ptP1, VtNorm)
End If
' eseguo mirror
VtNorm = (m_ptLast - m_ptP1) ^ (m_ptP2 - m_ptP1)
If VtNorm.Len > EPS_SMALL Then
EgtMirrorGlob(m_Scene.GetDragGroup(), m_ptP1, VtNorm)
End If
' salvo il punto
m_ptP3 = m_ptLast
EgtDraw()
End If
End Sub
Private Function ProcessScale() As Boolean
Select Case m_nStep
Case 0
@@ -3096,8 +3261,7 @@ Public Class Controller
Case 2
m_Scene.ResetStatus(False)
' calcolo parametri di scalatura
Dim frScale As New Frame3d
EgtGetGridFrame(frScale)
Dim frScale As New Frame3d(EgtGetGridFrame())
frScale.ChangeOrigin(m_ptP1)
EnableCommandLog()
' eseguo copia e scalatura
@@ -3131,8 +3295,7 @@ Public Class Controller
Return
End If
' calcolo parametri di scalatura
Dim frScale As New Frame3d
EgtGetGridFrame(frScale)
Dim frScale As New Frame3d(EgtGetGridFrame())
frScale.ChangeOrigin(m_ptP1)
Dim dScale As Double = m_dLast / m_dPrev
' eseguo scalatura
@@ -3172,8 +3335,7 @@ Public Class Controller
Case 2
m_Scene.ResetStatus(False)
' calcolo parametri di scalatura
Dim frScale As New Frame3d
EgtGetGridFrame(frScale)
Dim frScale As New Frame3d(EgtGetGridFrame())
frScale.ChangeOrigin(m_ptP1)
EnableCommandLog()
' eseguo copia e scalatura
@@ -3216,8 +3378,7 @@ Public Class Controller
m_d3Prev(2) = 1
End If
' calcolo parametri di scalatura
Dim frScale As New Frame3d
EgtGetGridFrame(frScale)
Dim frScale As New Frame3d(EgtGetGridFrame())
frScale.ChangeOrigin(m_ptP1)
Dim d3Scale(3) As Double
d3Scale(0) = m_d3Last(0) / m_d3Prev(0)
@@ -3345,16 +3506,12 @@ Public Class Controller
End Function
Private Function GridLenFromGlobLen(ByVal vtLen As Vector3d) As Double
Dim frGrid As New Frame3d
EgtGetGridFrame(frGrid)
vtLen.ToLoc(frGrid)
vtLen.ToLoc(EgtGetGridFrame())
Return Math.Sqrt(vtLen.x * vtLen.x + vtLen.y * vtLen.y)
End Function
Private Function GridAngFromGlobDir(ByVal vtDir As Vector3d) As Double
Dim frGrid As New Frame3d
EgtGetGridFrame(frGrid)
vtDir.ToLoc(frGrid)
vtDir.ToLoc(EgtGetGridFrame())
Dim dLen As Double
Dim dAngVertDeg As Double
Dim dAngOrizzDeg As Double
@@ -3363,11 +3520,9 @@ Public Class Controller
End Function
Private Function GlobDirFromGridAng(ByVal dGridAngDeg As Double) As Vector3d
Dim frGrid As New Frame3d
EgtGetGridFrame(frGrid)
Dim vtDir As Vector3d = Vector3d.X_AX()
vtDir.Rotate(Vector3d.Z_AX, dGridAngDeg)
vtDir.ToGlob(frGrid)
vtDir.ToGlob(EgtGetGridFrame())
Return vtDir
End Function
@@ -3512,13 +3667,20 @@ Public Class Controller
'-------------------------------- Registrazione Comandi (in Lua) ---------------------------------
Private m_bCommandLog As Boolean = False
Public Sub SetCommandLog(ByVal bCmdLog As Boolean, ByRef sCmdLogDir As String)
Public Function SetCommandLog(ByVal bCmdLog As Boolean, ByRef sCmdLogDir As String) As Boolean
' imposto stato
m_bCommandLog = bCmdLog
' se necessario inizializzo logger
If m_bCommandLog Then
Dim sBackup = sCmdLogDir & "\EInCmdLua.bak.log"
Dim sFile = sCmdLogDir & "\EInCmdLua.log"
Const sCmdLog As String = "EInCmdLua.log"
Const sCmdBak As String = sCmdLog & ".bak"
Dim sFile = sCmdLogDir & "\" & sCmdLog
Dim sBackup = sCmdLogDir & "\" & sCmdBak
' se logger già in uso, non faccio alcunchè e non lo avvio
If FileInUse(sFile) Then
m_bCommandLog = False
Return False
End If
' backup di eventuale log già presente
If My.Computer.FileSystem.FileExists(sFile) Then
' cancello eventuale vecchio backup
@@ -3526,12 +3688,17 @@ Public Class Controller
My.Computer.FileSystem.DeleteFile(sBackup)
End If
' rinomino il file
My.Computer.FileSystem.RenameFile(sFile, "EInCmdLua.bak.log")
My.Computer.FileSystem.RenameFile(sFile, sCmdBak)
End If
' avvio logger
EgtSetCommandLogger(sFile)
End If
End Sub
Return True
End Function
Public Function GetCommandLog() As Boolean
Return m_bCommandLog
End Function
Private Sub EnableCommandLog()
If m_bCommandLog Then
+94 -41
View File
@@ -1,4 +1,17 @@
Imports System.Runtime.InteropServices
'----------------------------------------------------------------------------
' EgalTech 2014-2015
'----------------------------------------------------------------------------
' File : EgtInterface.vb Data : 18.01.15 Versione : 1.6a3
' Contenuto : Modulo EgtInterface (interfaccia verso il motore EgalTech).
'
'
'
' Modifiche : 04.11.14 DS Creazione modulo.
'
'
'----------------------------------------------------------------------------
Imports System.Runtime.InteropServices
Public Module EgtInterface
@@ -193,23 +206,19 @@ Structure Vector3d
End Function
' vettore nullo
Shared Function NULL() As Vector3d
Dim vtV As New Vector3d(0, 0, 0)
Return vtV
Return New Vector3d(0, 0, 0)
End Function
' Versore Asse X
Shared Function X_AX() As Vector3d
Dim vtZ As New Vector3d(1, 0, 0)
Return vtZ
Return New Vector3d(1, 0, 0)
End Function
' Versore Asse Y
Shared Function Y_AX() As Vector3d
Dim vtZ As New Vector3d(0, 1, 0)
Return vtZ
Return New Vector3d(0, 1, 0)
End Function
' Versore Asse Z
Shared Function Z_AX() As Vector3d
Dim vtZ As New Vector3d(0, 0, 1)
Return vtZ
Return New Vector3d(0, 0, 1)
End Function
End Structure
@@ -330,8 +339,7 @@ Structure Point3d
End Function
' Punto Origine
Shared Function ORIG() As Point3d
Dim ptP As New Point3d(0, 0, 0)
Return ptP
Return New Point3d(0, 0, 0)
End Function
End Structure
@@ -362,6 +370,13 @@ Class Frame3d
VtDirZ = Vector3d.Z_AX
bOk = True
End Sub
Sub New(ByRef frFrame As Frame3d)
PtOrig = frFrame.Orig()
VtDirX = frFrame.VersX()
VtDirY = frFrame.VersY()
VtDirZ = frFrame.VersZ()
bOk = True
End Sub
' Inizializzatori
Public Function Setup(ByRef PtOri As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d) As Boolean
PtOrig = PtOri
@@ -469,8 +484,7 @@ Class Frame3d
End Function
' Riferimento Globale o Identità
Shared Function GLOB() As Frame3d
Dim frRef As New Frame3d
Return frRef
Return New Frame3d
End Function
End Class
@@ -737,13 +751,15 @@ End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Function EgtGetGridFrame(ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d) As Boolean
End Function
Public Function EgtGetGridFrame(ByRef frRef As Frame3d) As Boolean
Public Function EgtGetGridFrame() As Frame3d
Dim PtOrig As Point3d
Dim VtDirX, VtDirY, VtDirZ As Vector3d
If Not EgtGetGridFrame(PtOrig, VtDirX, VtDirY, VtDirZ) Then
Return False
Dim frRef As New Frame3d
Return frRef
Else
Return frRef.Setup(PtOrig, VtDirX, VtDirY, VtDirZ)
Dim frRef As New Frame3d(PtOrig, VtDirX, VtDirY, VtDirZ)
Return frRef
End If
End Function
@@ -819,61 +835,74 @@ End Function
'---------- GeomDb Objects Create ----------------------------------------------
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Function EgtCreateGroup(ByVal nParentId As Integer,
ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d) As Integer
ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d, ByVal nRefType As REF_TY) As Integer
End Function
Public Function EgtCreateGroup(ByVal nParentId As Integer, ByRef frRef As Frame3d) As Integer
Return EgtCreateGroup(nParentId, frRef.Orig(), frRef.VersX(), frRef.VersY(), frRef.VersZ())
Public Function EgtCreateGroup(ByVal nParentId As Integer, ByRef frRef As Frame3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
Return EgtCreateGroup(nParentId, frRef.Orig(), frRef.VersX(), frRef.VersY(), frRef.VersZ(), nRefType)
End Function
Public Function EgtCreateGroup(ByVal nParentId As Integer) As Integer
Return EgtCreateGroup(nParentId, Point3d.ORIG(), Vector3d.X_AX(), Vector3d.Y_AX(), Vector3d.Z_AX())
Return EgtCreateGroup(nParentId, Point3d.ORIG(), Vector3d.X_AX, Vector3d.Y_AX, Vector3d.Z_AX, REF_TY.LOC)
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtCreateGeoPoint(ByVal nParentId As Integer,
ByRef PtP As Point3d) As Integer
ByRef PtP As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtCreateGeoVector(ByVal nParentId As Integer,
ByRef vtV As Vector3d, ByRef PtB As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Function EgtCreateGeoFrame(ByVal nParentId As Integer,
ByRef PtOrig As Point3d, ByRef VtX As Vector3d, ByRef VtY As Vector3d, ByRef VtZ As Vector3d, ByVal nRefType As REF_TY) As Integer
End Function
Public Function EgtCreateGeoFrame(ByVal nParentId As Integer, ByRef frRef As Frame3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
Return EgtCreateGeoFrame(nParentId, frRef.Orig(), frRef.VersX(), frRef.VersY(), frRef.VersZ(), nRefType)
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtCreateCurveLine(ByVal nParentId As Integer,
ByRef PtStart As Point3d, ByRef PtEnd As Point3d) As Integer
ByRef PtStart As Point3d, ByRef PtEnd As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtCreateCurveLineEx(ByVal nParentId As Integer,
ByRef PtStart As Point3d, ByVal nSepS As SEP, ByVal nIdS As Integer,
ByRef PtEnd As Point3d, ByVal nSepE As SEP, ByVal nIdE As Integer) As Integer
ByRef PtStart As Point3d, ByVal nSepS As SEP, ByVal nIdS As Integer,
ByRef PtEnd As Point3d, ByVal nSepE As SEP, ByVal nIdE As Integer, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtCreateCurveLinePVL(ByVal nParentId As Integer,
ByRef PtStart As Point3d, ByRef VtDir As Vector3d, ByVal dLen As Double) As Integer
ByRef PtStart As Point3d, ByRef VtDir As Vector3d, ByVal dLen As Double, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtCreateCurveCircle(ByVal nParentId As Integer,
ByRef PtCen As Point3d, ByRef VtNorm As Vector3d, ByVal dRad As Double) As Integer
ByRef PtCen As Point3d, ByRef VtNorm As Vector3d, ByVal dRad As Double, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtCreateCurveCircleCPN(ByVal nParentId As Integer,
ByRef PtCen As Point3d, ByRef PtOn As Point3d, ByRef VtNorm As Vector3d) As Integer
ByRef PtCen As Point3d, ByRef PtOn As Point3d, ByRef VtNorm As Vector3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtCreateCurveArc3P(ByVal nParentId As Integer,
ByRef PtStart As Point3d, ByRef PtMid As Point3d, ByRef PtEnd As Point3d) As Integer
ByRef PtStart As Point3d, ByRef PtMid As Point3d, ByRef PtEnd As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtCreateCurveArcC2PN(ByVal nParentId As Integer,
ByRef PtCen As Point3d, ByRef PtStart As Point3d, ByRef PtEnd As Point3d,
ByRef VtNorm As Vector3d) As Integer
ByRef PtCen As Point3d, ByRef PtStart As Point3d, ByRef PtEnd As Point3d,
ByRef VtNorm As Vector3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtCreateCurveArc2PVN(ByVal nParentId As Integer,
ByRef PtStart As Point3d, ByRef PtEnd As Point3d, ByRef VtDirS As Vector3d,
ByRef VtNorm As Vector3d) As Integer
ByRef PtStart As Point3d, ByRef PtEnd As Point3d, ByRef VtDirS As Vector3d,
ByRef VtNorm As Vector3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
@@ -882,12 +911,13 @@ End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtCreateRectangle3P(ByVal nParentId As Integer,
ByRef PtStart As Point3d, ByRef PtCross As Point3d, ByRef PtDir As Point3d) As Integer
ByRef PtStart As Point3d, ByRef PtCross As Point3d,
ByRef PtDir As Point3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtCreatePolygonFromSide(ByVal nParentId As Integer,
ByVal nNumSides As Integer, ByRef PtStart As Point3d, ByRef PtFin As Point3d) As Integer
Public Function EgtCreatePolygonFromSide(ByVal nParentId As Integer, ByVal nNumSides As Integer, ByRef PtStart As Point3d,
ByRef PtFin As Point3d, ByRef VtNorm As Vector3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
@@ -895,13 +925,15 @@ Public Function EgtCreateSurfTriMeshByContour(ByVal nParentId As Integer, ByVal
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtCreateSurfTriMeshByExtrusion(ByVal nParentId As Integer, ByVal nCrvId As Integer, ByRef VtExtr As Vector3d, ByVal dLinTol As Double) As Integer
Public Function EgtCreateSurfTriMeshByExtrusion(ByVal nParentId As Integer, ByVal nCrvId As Integer, ByRef VtExtr As Vector3d,
ByVal dLinTol As Double, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtCreateSurfTriMeshByScrewing(ByVal nParentId As Integer, ByVal nCrvId As Integer,
ByRef PtAx As Point3d, ByRef VtAx As Vector3d,
ByVal dAngRotDeg As Double, ByVal dMove As Double, ByVal dLinTol As Double) As Integer
ByRef PtAx As Point3d, ByRef VtAx As Vector3d,
ByVal dAngRotDeg As Double, ByVal dMove As Double,
ByVal dLinTol As Double, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
@@ -910,18 +942,20 @@ End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtCreateText(ByVal nParentId As Integer, ByRef ptP As Point3d, ByVal dAngRotDeg As Double,
ByVal sText As String, ByVal dH As Double) As Integer
ByVal sText As String, ByVal dH As Double, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtCreateTextEx(ByVal nParentId As Integer, ByRef ptP As Point3d, ByRef vtN As Vector3d, ByRef vtD As Vector3d,
ByVal sText As String, ByVal sFont As String, ByVal bItalic As Boolean, ByVal dH As Double) As Integer
ByVal sText As String, ByVal sFont As String, ByVal bItalic As Boolean, ByVal dH As Double,
Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtCreateTextAdv(ByVal nParentId As Integer, ByRef ptP As Point3d, ByRef vtN As Vector3d, ByRef vtD As Vector3d,
ByVal sText As String, ByVal sFont As String, ByVal nW As Integer, ByVal bItalic As Boolean,
ByVal dH As Double, ByVal dRat As Double, ByVal dAddAdv As Double, ByVal nInsPos As Integer) As Integer
ByVal dH As Double, ByVal dRat As Double, ByVal dAddAdv As Double, ByVal nInsPos As Integer,
Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
End Function
'---------- GeomDb Objects Modify ----------------------------------------------
@@ -1590,6 +1624,10 @@ End Function
Public Function EgtSetGeoLineAttribs(ByRef colGl As Color3d) As Boolean
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtSetGeoTriaAttribs(ByRef colGt As Color3d) As Boolean
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtSetWinRectAttribs(ByVal bOutline As Boolean, ByRef colWr As Color3d) As Boolean
End Function
@@ -1720,6 +1758,14 @@ End Function
Public Function EgtResetGeoLine(Optional ByVal bRedraw As Boolean = True) As Boolean
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtSetGeoTria(ByRef ptP1 As Point3d, ByRef ptP2 As Point3d, ByRef ptP3 As Point3d, Optional ByVal bRedraw As Boolean = True) As Boolean
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Public Function EgtResetGeoTria(Optional ByVal bRedraw As Boolean = True) As Boolean
End Function
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
Private Function EgtSetWinRect(ByVal nPrevX As Integer, ByVal nPrevY As Integer, ByVal nCurrX As Integer, ByVal nCurrY As Integer, ByVal bRedraw As Boolean) As Boolean
End Function
@@ -1852,6 +1898,7 @@ Public Enum GDB_ID As Integer
ROOT = 0
NULL = -1
SEL = -2
GRID = -3
End Enum
'Costanti : TIPO OGGETTI
Public Enum GDB_TY As Integer
@@ -1867,6 +1914,12 @@ Public Enum GDB_TY As Integer
SRF_MESH = 512
EXT_TEXT = 1024
End Enum
'Costanti : TIPO RIFERIMENTO DI DATI GEOMETRICI
Public Enum REF_TY As Integer
GLOB = 0
LOC = 1
GRID = 2
End Enum
'Costanti : POSIZIONE DI COPIA DI UN OGGETTO
Public Enum GDB_POS As Integer
BEFORE = -1
+53 -74
View File
@@ -95,6 +95,7 @@ Partial Class Form1
Me.InputCombo = New System.Windows.Forms.ComboBox()
Me.TabControl2 = New System.Windows.Forms.TabControl()
Me.TabDraw = New System.Windows.Forms.TabPage()
Me.btnPolygonSide = New System.Windows.Forms.Button()
Me.btnText = New System.Windows.Forms.Button()
Me.btnRectangle2P = New System.Windows.Forms.Button()
Me.btnCircleCD = New System.Windows.Forms.Button()
@@ -128,9 +129,6 @@ Partial Class Form1
Me.btnRotate = New System.Windows.Forms.Button()
Me.btnMove = New System.Windows.Forms.Button()
Me.TabTest = New System.Windows.Forms.TabPage()
Me.XbtnRotM90 = New System.Windows.Forms.Button()
Me.XbtnRotP90 = New System.Windows.Forms.Button()
Me.XbtnMirror = New System.Windows.Forms.Button()
Me.StatusStrip1 = New System.Windows.Forms.StatusStrip()
Me.tsStatusOnL = New System.Windows.Forms.ToolStripStatusLabel()
Me.tsStatusOutput = New System.Windows.Forms.ToolStripStatusLabel()
@@ -140,6 +138,7 @@ Partial Class Form1
Me.tsStatusCursorPos = New System.Windows.Forms.ToolStripStatusLabel()
Me.tsStatusUnits = New System.Windows.Forms.ToolStripStatusLabel()
Me.tsStatusOnR = New System.Windows.Forms.ToolStripStatusLabel()
Me.tsStatusReg = New System.Windows.Forms.ToolStripStatusLabel()
Me.ContextMenuTreeView1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.cmdSelectPartLayObj = New System.Windows.Forms.ToolStripMenuItem()
Me.cmdDeselectPartLayObj = New System.Windows.Forms.ToolStripMenuItem()
@@ -174,7 +173,6 @@ Partial Class Form1
Me.TabConstruct.SuspendLayout()
Me.TabEdit.SuspendLayout()
Me.TabTransform.SuspendLayout()
Me.TabTest.SuspendLayout()
Me.StatusStrip1.SuspendLayout()
Me.ContextMenuTreeView1.SuspendLayout()
Me.SuspendLayout()
@@ -199,18 +197,18 @@ Partial Class Form1
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle())
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22.0!))
Me.TableLayoutPanel1.Size = New System.Drawing.Size(1096, 601)
Me.TableLayoutPanel1.Size = New System.Drawing.Size(1096, 641)
Me.TableLayoutPanel1.TabIndex = 0
'
'Scene1
'
Me.Scene1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Scene1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.Scene1.Cursor = System.Windows.Forms.Cursors.Default
Me.Scene1.Dock = System.Windows.Forms.DockStyle.Fill
Me.Scene1.Location = New System.Drawing.Point(89, 82)
Me.Scene1.Margin = New System.Windows.Forms.Padding(0)
Me.Scene1.Name = "Scene1"
Me.Scene1.Size = New System.Drawing.Size(787, 497)
Me.Scene1.Size = New System.Drawing.Size(787, 537)
Me.Scene1.TabIndex = 1
'
'TabControl1
@@ -1062,27 +1060,28 @@ Partial Class Form1
Me.TableLayoutPanel3.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 30.0!))
Me.TableLayoutPanel3.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 160.0!))
Me.TableLayoutPanel3.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 70.0!))
Me.TableLayoutPanel3.Size = New System.Drawing.Size(220, 497)
Me.TableLayoutPanel3.Size = New System.Drawing.Size(220, 537)
Me.TableLayoutPanel3.TabIndex = 9
'
'tBoxInfo
'
Me.tBoxInfo.BackColor = System.Drawing.SystemColors.ControlLightLight
Me.tBoxInfo.Dock = System.Windows.Forms.DockStyle.Fill
Me.tBoxInfo.Location = New System.Drawing.Point(1, 201)
Me.tBoxInfo.Location = New System.Drawing.Point(1, 229)
Me.tBoxInfo.Margin = New System.Windows.Forms.Padding(1, 0, 1, 0)
Me.tBoxInfo.Multiline = True
Me.tBoxInfo.Name = "tBoxInfo"
Me.tBoxInfo.ReadOnly = True
Me.tBoxInfo.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
Me.tBoxInfo.Size = New System.Drawing.Size(218, 65)
Me.tBoxInfo.Size = New System.Drawing.Size(218, 77)
Me.tBoxInfo.TabIndex = 24
'
'tboxCmd
'
Me.tboxCmd.BackColor = System.Drawing.SystemColors.Window
Me.tboxCmd.Dock = System.Windows.Forms.DockStyle.Fill
Me.tboxCmd.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.tboxCmd.Location = New System.Drawing.Point(1, 426)
Me.tboxCmd.Location = New System.Drawing.Point(1, 466)
Me.tboxCmd.Margin = New System.Windows.Forms.Padding(1, 0, 1, 0)
Me.tboxCmd.Multiline = True
Me.tboxCmd.Name = "tboxCmd"
@@ -1103,7 +1102,7 @@ Partial Class Form1
Me.TreeView1.Margin = New System.Windows.Forms.Padding(1, 0, 1, 0)
Me.TreeView1.Name = "TreeView1"
Me.TreeView1.SelectedImageIndex = 0
Me.TreeView1.Size = New System.Drawing.Size(218, 151)
Me.TreeView1.Size = New System.Drawing.Size(218, 179)
Me.TreeView1.StateImageList = Me.ImageList2
Me.TreeView1.TabIndex = 0
'
@@ -1206,7 +1205,7 @@ Partial Class Form1
Me.InputBox.Controls.Add(Me.InputCombo)
Me.InputBox.Dock = System.Windows.Forms.DockStyle.Fill
Me.InputBox.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.InputBox.Location = New System.Drawing.Point(1, 269)
Me.InputBox.Location = New System.Drawing.Point(1, 309)
Me.InputBox.Margin = New System.Windows.Forms.Padding(1, 3, 1, 3)
Me.InputBox.Name = "InputBox"
Me.InputBox.Size = New System.Drawing.Size(218, 154)
@@ -1289,12 +1288,13 @@ Partial Class Form1
Me.TabControl2.Multiline = True
Me.TabControl2.Name = "TabControl2"
Me.TabControl2.SelectedIndex = 0
Me.TabControl2.Size = New System.Drawing.Size(89, 497)
Me.TabControl2.Size = New System.Drawing.Size(89, 537)
Me.TabControl2.TabIndex = 10
'
'TabDraw
'
Me.TabDraw.BackColor = System.Drawing.SystemColors.Control
Me.TabDraw.Controls.Add(Me.btnPolygonSide)
Me.TabDraw.Controls.Add(Me.btnText)
Me.TabDraw.Controls.Add(Me.btnRectangle2P)
Me.TabDraw.Controls.Add(Me.btnCircleCD)
@@ -1308,10 +1308,27 @@ Partial Class Form1
Me.TabDraw.Location = New System.Drawing.Point(23, 4)
Me.TabDraw.Name = "TabDraw"
Me.TabDraw.Padding = New System.Windows.Forms.Padding(3)
Me.TabDraw.Size = New System.Drawing.Size(62, 489)
Me.TabDraw.Size = New System.Drawing.Size(62, 529)
Me.TabDraw.TabIndex = 0
Me.TabDraw.Text = "Draw"
'
'btnPolygonSide
'
Me.btnPolygonSide.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control
Me.btnPolygonSide.FlatAppearance.BorderSize = 0
Me.btnPolygonSide.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control
Me.btnPolygonSide.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption
Me.btnPolygonSide.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnPolygonSide.Image = CType(resources.GetObject("btnPolygonSide.Image"), System.Drawing.Image)
Me.btnPolygonSide.ImageAlign = System.Drawing.ContentAlignment.TopCenter
Me.btnPolygonSide.Location = New System.Drawing.Point(0, 432)
Me.btnPolygonSide.Name = "btnPolygonSide"
Me.btnPolygonSide.Size = New System.Drawing.Size(56, 48)
Me.btnPolygonSide.TabIndex = 40
Me.btnPolygonSide.Text = "Polygon"
Me.btnPolygonSide.TextAlign = System.Drawing.ContentAlignment.BottomCenter
Me.btnPolygonSide.UseVisualStyleBackColor = False
'
'btnText
'
Me.btnText.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control
@@ -1321,7 +1338,7 @@ Partial Class Form1
Me.btnText.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnText.Image = CType(resources.GetObject("btnText.Image"), System.Drawing.Image)
Me.btnText.ImageAlign = System.Drawing.ContentAlignment.TopCenter
Me.btnText.Location = New System.Drawing.Point(0, 432)
Me.btnText.Location = New System.Drawing.Point(0, 480)
Me.btnText.Name = "btnText"
Me.btnText.Size = New System.Drawing.Size(56, 48)
Me.btnText.TabIndex = 39
@@ -1491,7 +1508,7 @@ Partial Class Form1
Me.TabConstruct.Controls.Add(Me.btnPlane)
Me.TabConstruct.Location = New System.Drawing.Point(23, 4)
Me.TabConstruct.Name = "TabConstruct"
Me.TabConstruct.Size = New System.Drawing.Size(62, 489)
Me.TabConstruct.Size = New System.Drawing.Size(62, 529)
Me.TabConstruct.TabIndex = 4
Me.TabConstruct.Text = "Construct"
'
@@ -1578,7 +1595,7 @@ Partial Class Form1
Me.TabEdit.Controls.Add(Me.btnDelete)
Me.TabEdit.Location = New System.Drawing.Point(23, 4)
Me.TabEdit.Name = "TabEdit"
Me.TabEdit.Size = New System.Drawing.Size(62, 489)
Me.TabEdit.Size = New System.Drawing.Size(62, 529)
Me.TabEdit.TabIndex = 3
Me.TabEdit.Text = "Edit"
'
@@ -1766,7 +1783,7 @@ Partial Class Form1
Me.TabTransform.Controls.Add(Me.btnMove)
Me.TabTransform.Location = New System.Drawing.Point(23, 4)
Me.TabTransform.Name = "TabTransform"
Me.TabTransform.Size = New System.Drawing.Size(62, 489)
Me.TabTransform.Size = New System.Drawing.Size(62, 529)
Me.TabTransform.TabIndex = 2
Me.TabTransform.Text = "Transform"
'
@@ -1858,58 +1875,13 @@ Partial Class Form1
'TabTest
'
Me.TabTest.BackColor = System.Drawing.SystemColors.Control
Me.TabTest.Controls.Add(Me.XbtnRotM90)
Me.TabTest.Controls.Add(Me.XbtnRotP90)
Me.TabTest.Controls.Add(Me.XbtnMirror)
Me.TabTest.Location = New System.Drawing.Point(23, 4)
Me.TabTest.Name = "TabTest"
Me.TabTest.Padding = New System.Windows.Forms.Padding(3)
Me.TabTest.Size = New System.Drawing.Size(62, 489)
Me.TabTest.Size = New System.Drawing.Size(62, 529)
Me.TabTest.TabIndex = 1
Me.TabTest.Text = "Test"
'
'XbtnRotM90
'
Me.XbtnRotM90.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control
Me.XbtnRotM90.FlatAppearance.BorderSize = 0
Me.XbtnRotM90.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control
Me.XbtnRotM90.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption
Me.XbtnRotM90.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.XbtnRotM90.Location = New System.Drawing.Point(0, 96)
Me.XbtnRotM90.Name = "XbtnRotM90"
Me.XbtnRotM90.Size = New System.Drawing.Size(56, 48)
Me.XbtnRotM90.TabIndex = 27
Me.XbtnRotM90.Text = "Rot-90"
Me.XbtnRotM90.UseVisualStyleBackColor = False
'
'XbtnRotP90
'
Me.XbtnRotP90.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control
Me.XbtnRotP90.FlatAppearance.BorderSize = 0
Me.XbtnRotP90.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control
Me.XbtnRotP90.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption
Me.XbtnRotP90.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.XbtnRotP90.Location = New System.Drawing.Point(0, 0)
Me.XbtnRotP90.Name = "XbtnRotP90"
Me.XbtnRotP90.Size = New System.Drawing.Size(56, 48)
Me.XbtnRotP90.TabIndex = 26
Me.XbtnRotP90.Text = "Rot+90"
Me.XbtnRotP90.UseVisualStyleBackColor = False
'
'XbtnMirror
'
Me.XbtnMirror.FlatAppearance.BorderColor = System.Drawing.SystemColors.Control
Me.XbtnMirror.FlatAppearance.BorderSize = 0
Me.XbtnMirror.FlatAppearance.MouseDownBackColor = System.Drawing.SystemColors.Control
Me.XbtnMirror.FlatAppearance.MouseOverBackColor = System.Drawing.SystemColors.GradientInactiveCaption
Me.XbtnMirror.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.XbtnMirror.Location = New System.Drawing.Point(0, 48)
Me.XbtnMirror.Name = "XbtnMirror"
Me.XbtnMirror.Size = New System.Drawing.Size(56, 48)
Me.XbtnMirror.TabIndex = 28
Me.XbtnMirror.Text = "Mirror"
Me.XbtnMirror.UseVisualStyleBackColor = False
'
'StatusStrip1
'
Me.StatusStrip1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
@@ -1917,8 +1889,8 @@ Partial Class Form1
Me.TableLayoutPanel1.SetColumnSpan(Me.StatusStrip1, 3)
Me.StatusStrip1.Dock = System.Windows.Forms.DockStyle.None
Me.StatusStrip1.GripMargin = New System.Windows.Forms.Padding(0)
Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tsStatusOnL, Me.tsStatusOutput, Me.tsStatusSnapPointType, Me.tsStatusGrid, Me.tsStatusCurPosType, Me.tsStatusCursorPos, Me.tsStatusUnits, Me.tsStatusOnR})
Me.StatusStrip1.Location = New System.Drawing.Point(0, 579)
Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tsStatusOnL, Me.tsStatusOutput, Me.tsStatusSnapPointType, Me.tsStatusGrid, Me.tsStatusCurPosType, Me.tsStatusCursorPos, Me.tsStatusUnits, Me.tsStatusOnR, Me.tsStatusReg})
Me.StatusStrip1.Location = New System.Drawing.Point(0, 619)
Me.StatusStrip1.MaximumSize = New System.Drawing.Size(0, 22)
Me.StatusStrip1.MinimumSize = New System.Drawing.Size(0, 22)
Me.StatusStrip1.Name = "StatusStrip1"
@@ -2013,9 +1985,18 @@ Partial Class Form1
Or System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom), System.Windows.Forms.ToolStripStatusLabelBorderSides)
Me.tsStatusOnR.Margin = New System.Windows.Forms.Padding(1, 3, 0, 2)
Me.tsStatusOnR.Name = "tsStatusOnR"
Me.tsStatusOnR.Size = New System.Drawing.Size(204, 17)
Me.tsStatusOnR.Size = New System.Drawing.Size(184, 17)
Me.tsStatusOnR.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
'
'tsStatusReg
'
Me.tsStatusReg.AutoSize = False
Me.tsStatusReg.BorderSides = CType((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left Or System.Windows.Forms.ToolStripStatusLabelBorderSides.Top) _
Or System.Windows.Forms.ToolStripStatusLabelBorderSides.Right) _
Or System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom), System.Windows.Forms.ToolStripStatusLabelBorderSides)
Me.tsStatusReg.Name = "tsStatusReg"
Me.tsStatusReg.Size = New System.Drawing.Size(20, 17)
'
'ContextMenuTreeView1
'
Me.ContextMenuTreeView1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cmdSelectPartLayObj, Me.cmdDeselectPartLayObj, Me.ToolStripSeparator1, Me.cmdSetName, Me.cmdSetInfo, Me.ToolStripSeparator2, Me.cmdRelocatePartLayObj, Me.cmdCopyPartLayObj, Me.cmdDeletePartLayObj})
@@ -2113,14 +2094,14 @@ Partial Class Form1
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.AutoSize = True
Me.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None
Me.ClientSize = New System.Drawing.Size(1096, 601)
Me.ClientSize = New System.Drawing.Size(1096, 641)
Me.Controls.Add(Me.TableLayoutPanel1)
Me.Cursor = System.Windows.Forms.Cursors.Arrow
Me.ForeColor = System.Drawing.SystemColors.ControlText
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.KeyPreview = True
Me.Margin = New System.Windows.Forms.Padding(2)
Me.MinimumSize = New System.Drawing.Size(1112, 640)
Me.MinimumSize = New System.Drawing.Size(1112, 680)
Me.Name = "Form1"
Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide
Me.StartPosition = System.Windows.Forms.FormStartPosition.Manual
@@ -2147,7 +2128,6 @@ Partial Class Form1
Me.TabConstruct.ResumeLayout(False)
Me.TabEdit.ResumeLayout(False)
Me.TabTransform.ResumeLayout(False)
Me.TabTest.ResumeLayout(False)
Me.StatusStrip1.ResumeLayout(False)
Me.StatusStrip1.PerformLayout()
Me.ContextMenuTreeView1.ResumeLayout(False)
@@ -2163,9 +2143,6 @@ End Sub
Friend WithEvents ImageList1 As System.Windows.Forms.ImageList
Friend WithEvents tBoxInfo As System.Windows.Forms.TextBox
Friend WithEvents btnGetDist As System.Windows.Forms.CheckBox
Friend WithEvents XbtnRotM90 As System.Windows.Forms.Button
Friend WithEvents XbtnRotP90 As System.Windows.Forms.Button
Friend WithEvents XbtnMirror As System.Windows.Forms.Button
Friend WithEvents TableLayoutPanel3 As System.Windows.Forms.TableLayoutPanel
Friend WithEvents TabControl2 As System.Windows.Forms.TabControl
Friend WithEvents TabDraw As System.Windows.Forms.TabPage
@@ -2286,5 +2263,7 @@ End Sub
Friend WithEvents btnInsert As System.Windows.Forms.Button
Friend WithEvents btnInvertSurf As System.Windows.Forms.Button
Friend WithEvents btnText As System.Windows.Forms.Button
Friend WithEvents btnPolygonSide As System.Windows.Forms.Button
Friend WithEvents tsStatusReg As System.Windows.Forms.ToolStripStatusLabel
End Class
+25 -13
View File
@@ -871,7 +871,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAC4
DQAAAk1TRnQBSQFMAgEBDgEAAYgBDgGIAQ4BEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
DQAAAk1TRnQBSQFMAgEBDgEAAdABDgHQAQ4BEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAAUADAAEBAQABCAYAARAYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@@ -940,7 +940,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADW
CAAAAk1TRnQBSQFMAgEBAgEAAagBBQGoAQUBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CAAAAk1TRnQBSQFMAgEBAgEAAfABBQHwAQUBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@@ -978,16 +978,27 @@
AwABQAMAARADAAEBAQABAQUAAYAXAAP/AQAE/wQABP8EAAHkASMB/AE/BAAB4AEDAfwBPwQAAWABAwH4
AR8EAAFkAQMB+AEfBAABaAETAfgBHwQAAWgBEwH4AR8EAAFwAQsB8AEPBAABcAELAfABDwQAAXABCwHw
AQ8EAAFwAQsB8AEPBAABYAEDAfABDwQAAWgBEwH4AR8EAAF/A/8EAAF/A/8EAAs=
</value>
</data>
<data name="btnPolygonSide.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGwAAAAd0SU1FB98BERI1KpxRYW4AAAEZSURBVFhHxZKBDcIwDAQZjGmZji2KXcnwOOc2
FiiNdEgc/68GuG3bdikoV4IyY8df2uQdAqVi566jTe60qaBU0mCbvJdBGdjJtz+/UbODMugMKZ6VninO
OSidzgihXaN8eJTO7ECFd6Rvqsih/PH2gW4YeIlB7HKiOIN3ZccUZAbxp9sHumUMl/l6s4uTQhffkD1T
6fNBSNi45AGu/Ql2eVKaxbuyYwoyKP/0LeiGgRcZRDBTPsI70jdV5Eg6swMV2jXKC6AMvCgjQT3WzDso
Ay/vI4/nh2K0k1VQBsPg9/BIkc27CsrgaBQpsnlXQRkcjSJFNu8qKAM71/4HnPfwh3LQP5PcYTZAuRKU
K0G5EpQrQbkSlOvYbi8bgwK7j1WopQAAAABJRU5ErkJggg==
</value>
</data>
<data name="btnText.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAHdElNRQffAQwVJxsSR4hAAAAA0klEQVRYR+2W0Q2DMAxE
GYzhMkunY4vUlxAUzBUMRu5PLD1ozw5+4qedcs5/hYaR0LAhhcsr6Gc3aNgohz+LH7cA7gy1hOIWqMy0
pwTIzFzmSK9Bw8Z6+LB8610IAJz/1QM0tICHWgSuoKGFITAEhsAQGAIeAant9+XQtPJUAMuFhHv5rges
SN0WwFIhrZ+LBB20IPVEAEt7gUQHLUjdFgBYurv3TStS9Z+OEkDO5nukfAJSuJyiz/RI1VfveQNvQsNI
aBgJDSOhYSQ0jISGceTpC0M64Frj3V19AAAAAElFTkSuQmCC
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGwAAAAd0SU1FB98BDBUnGxJHiEAAAADSSURBVFhH7ZbRDYMwDEQZjOEyS6dji9SXEBTM
FQxG7k8sPWjPDn7ip51yzn+FhpHQsCGFyyvoZzdo2CiHP4sftwDuDLWE4haozLSnBMjMXOZIr0HDxnr4
sHzrXQgAnP/VAzS0gIdaBK6goYUhMASGwBAYAh4Bqe335dC08lQAy4WEe/muB6xI3RbAUiGtn4sEHbQg
9UQAS3uBRActSN0WAFi6u/dNK1L1n44SQM7me6R8AlK4nKLP9EjVV+95A29Cw0hoGAkNI6FhJDSMhIZx
5OkLQzrgWuPdXX0AAAAASUVORK5CYII=
</value>
</data>
<data name="btnRectangle2P.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@@ -1360,11 +1371,12 @@
</data>
<data name="btnMirror.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
xAAADsQBlSsOGwAAAAd0SU1FB94KHQ4zNj1snb8AAACpSURBVFhH7Y7LCYAwEAVTgHXaiI2IbXjxbCV2
sSZCJJ+XuAmyHtzAEJgE3hgi+hQoJYFSEii52GMv/MYFSi7/CTDDunkinwSY5SBP6GtAmXKNTyuxAuZ9
1IBXA+7xloCGCCg90XhrADMCSkc23hPAiMASjfcGPETkojTu6A1wFCJyoQEaoAEa4AIqRH9RQIXwrycT
LaQBPUDJRQM+D3gDKCWBUhIo5SBzAofF58BukbQYAAAAAElFTkSuQmCC
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAHdElNRQffARMLMg3P5BK2AAAA4UlEQVRYR+2OwQ0CMQwE
UwAlUQ91RKIRRBv34U0ldBFsQ6I4LCGOwPfgIo1yXke3E1JKqwJDT2A4Ah268M4CDEdwEwi75ZJReSMQ
zreUqfNPwLBGyo9LGhI4XQ+bwFcFSrlFwCgBQ0aVWwUMEjhsy2cEBiVeA1Q+KzAgoYd35cysANOR0MMm
sAn8iwCdfflWCwcBLici3zLnhQw/FuBSIj6/RaL8QEIW6KDeIoEO8uZRWgvE8gMrdOjCux5cqu56aYEO
XXjXoxSvKZCRuX3gDQw9gaEnMPQEhp7A0BMY+pHCHcN+uyEht9XQAAAAAElFTkSuQmCC
</value>
</data>
<data name="btnRotate.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+88 -132
View File
@@ -1,4 +1,17 @@
Imports System.Runtime.InteropServices
'----------------------------------------------------------------------------
' EgalTech 2014-2015
'----------------------------------------------------------------------------
' File : Form1.vb Data : 18.01.15 Versione : 1.6a3
' Contenuto : Classe Form1 (dialogo principale dell'applicazione).
'
'
'
' Modifiche : 25.08.14 DS Creazione modulo.
'
'
'----------------------------------------------------------------------------
Imports System.Runtime.InteropServices
Imports System.Text
Imports System.Math
Imports System.IO
@@ -20,6 +33,7 @@ Public Class Form1
Public Function GetExeRoot() As String
Return Application.StartupPath
End Function
Public Function GetDataRoot() As String
Return m_sDataRoot
End Function
@@ -152,7 +166,15 @@ Public Class Form1
' Impostazioni controller
m_Controller.SetScene(Scene1)
Dim bLuaReg As Boolean = (GetPrivateProfileInt("General", "CommandLog", 0, m_sIniFile) <> 0)
m_Controller.SetCommandLog(bLuaReg, m_sDataRoot)
If Not m_Controller.SetCommandLog(bLuaReg, m_sDataRoot) Then
MessageBox.Show("Command log not running : another instance already open", "EIn Warning",
MessageBoxButtons.OK, MessageBoxIcon.Warning)
End If
If m_Controller.GetCommandLog() Then
tsStatusReg.BackColor = Color.Lime
ElseIf bLuaReg Then
tsStatusReg.BackColor = Color.Red
End If
' Apro progetto vuoto
Scene1.NewProject(True)
End Sub
@@ -367,6 +389,56 @@ Public Class Form1
End If
End Sub
' --------------------- Update UI -------------------------------
Private Sub Application_Idle(ByVal sender As Object, ByVal e As EventArgs)
' Gestione abilitazione bottoni
Dim bLayerOk As Boolean = (m_Controller.GetCurrLayer() <> GDB_ID.NULL)
Dim bSelOk As Boolean = (EgtGetFirstSelectedObj() <> GDB_ID.NULL)
' Grid
btnCplaneElevation.Enabled = m_bShowGrid
btnCplaneOrigin.Enabled = m_bShowGrid
btnCplaneRotate.Enabled = m_bShowGrid
btnCplane3P.Enabled = m_bShowGrid
btnCPlanePerpCurve.Enabled = m_bShowGrid
btnCPlaneObj.Enabled = m_bShowGrid And bSelOk
' Draw
btnPoint.Enabled = bLayerOk
btnLine2P.Enabled = bLayerOk
btnLinePDL.Enabled = bLayerOk
btnCircleCP.Enabled = bLayerOk
btnCircleCD.Enabled = bLayerOk
btnArcCSE.Enabled = bLayerOk
btnArc3P.Enabled = bLayerOk
btnArcPDP.Enabled = bLayerOk
btnRectangle2P.Enabled = bLayerOk
btnPolygonSide.Enabled = bLayerOk
btnText.Enabled = bLayerOk
' Construct
btnPlane.Enabled = bLayerOk And bSelOk
btnExtrude.Enabled = bLayerOk And bSelOk
btnRevolve.Enabled = bLayerOk And bSelOk
btnRuled.Enabled = bLayerOk And bSelOk
' Edit
btnDelete.Enabled = bSelOk
btnChangeLayer.Enabled = bSelOk
btnChangeColor.Enabled = bSelOk
btnInvertCurve.Enabled = bSelOk
btnExtendCurve.Enabled = bSelOk
btnBreakCurve.Enabled = bSelOk
btnJoinCurve.Enabled = bLayerOk And bSelOk
btnExplodeCurve.Enabled = bSelOk
btnSetCurveTh.Enabled = bSelOk
btnInvertSurf.Enabled = bSelOk
' Transform
btnMove.Enabled = bSelOk
btnRotate.Enabled = bSelOk
btnMirror.Enabled = bSelOk
btnScale.Enabled = bSelOk
btnOffset.Enabled = bSelOk
End Sub
'-------------------------------- Buttons --------------------------------------------------------
Private Sub btnNew_Click(sender As System.Object, e As System.EventArgs) Handles btnNew.Click
' gestisco eventuale file corrente modificato
@@ -389,19 +461,21 @@ Public Class Form1
End Sub
Private Sub btnSave_Click(sender As System.Object, e As System.EventArgs) Handles btnSave.Click
Dim nType As NGE = GetPrivateProfileInt("GeomDB", "SaveType", NGE.CMPTEXT, m_sIniFile)
If Not String.IsNullOrWhiteSpace(m_Controller.GetCurrFile()) Then
Scene1.SaveProject(m_Controller.GetCurrFile())
Scene1.SaveProject(m_Controller.GetCurrFile(), nType)
Else
Dim sFile As String = String.Empty
GetPrivateProfileString("General", "LastNgeDir", "", sFile, m_sIniFile)
sFile.TrimEnd("\"c)
sFile += "\New.nge"
Scene1.SaveAsProject(sFile)
Scene1.SaveAsProject(sFile, nType)
End If
End Sub
Private Sub btnSaveAs_Click(sender As System.Object, e As System.EventArgs) Handles btnSaveAs.Click
Scene1.SaveAsProject(m_Controller.GetCurrFile())
Dim nType As NGE = GetPrivateProfileInt("GeomDB", "SaveType", NGE.CMPTEXT, m_sIniFile)
Scene1.SaveAsProject(m_Controller.GetCurrFile(), nType)
End Sub
Private Sub btnImport_Click(sender As System.Object, e As System.EventArgs) Handles btnImport.Click
@@ -580,53 +654,6 @@ Public Class Form1
m_Controller.ExecuteCommand(CMD.GRID_OBJ)
End Sub
' --------------------- Update UI -------------------------------
Private Sub Application_Idle(ByVal sender As Object, ByVal e As EventArgs)
' Gestione abilitazione bottoni
Dim bLayerOk As Boolean = (m_Controller.GetCurrLayer() <> GDB_ID.NULL)
Dim bSelOk As Boolean = (EgtGetFirstSelectedObj() <> GDB_ID.NULL)
' Grid
btnCplaneElevation.Enabled = m_bShowGrid
btnCplaneOrigin.Enabled = m_bShowGrid
btnCplaneRotate.Enabled = m_bShowGrid
btnCplane3P.Enabled = m_bShowGrid
btnCPlanePerpCurve.Enabled = m_bShowGrid
btnCPlaneObj.Enabled = m_bShowGrid And bSelOk
' Draw
btnPoint.Enabled = bLayerOk
btnLine2P.Enabled = bLayerOk
btnLinePDL.Enabled = bLayerOk
btnCircleCP.Enabled = bLayerOk
btnCircleCD.Enabled = bLayerOk
btnArcCSE.Enabled = bLayerOk
btnArc3P.Enabled = bLayerOk
btnArcPDP.Enabled = bLayerOk
btnRectangle2P.Enabled = bLayerOk
btnText.Enabled = bLayerOk
' Construct
btnPlane.Enabled = bLayerOk And bSelOk
btnExtrude.Enabled = bLayerOk And bSelOk
btnRevolve.Enabled = bLayerOk And bSelOk
btnRuled.Enabled = bLayerOk And bSelOk
' Edit
btnDelete.Enabled = bSelOk
btnChangeLayer.Enabled = bSelOk
btnChangeColor.Enabled = bSelOk
btnInvertCurve.Enabled = bSelOk
btnExtendCurve.Enabled = bSelOk
btnBreakCurve.Enabled = bSelOk
btnJoinCurve.Enabled = bLayerOk And bSelOk
btnExplodeCurve.Enabled = bSelOk
btnSetCurveTh.Enabled = bSelOk
btnInvertSurf.Enabled = bSelOk
' Transform
btnMove.Enabled = bSelOk
btnRotate.Enabled = bSelOk
btnMirror.Enabled = bSelOk
btnScale.Enabled = bSelOk
btnOffset.Enabled = bSelOk
End Sub
' --------------------- Commands --------------------------------
Private Sub btnPoint_Click(sender As System.Object, e As System.EventArgs) Handles btnPoint.Click
@@ -665,6 +692,10 @@ Public Class Form1
m_Controller.ExecuteCommand(CMD.RECTANGLE2P)
End Sub
Private Sub btnPolygonSide_Click(sender As System.Object, e As System.EventArgs) Handles btnPolygonSide.Click
m_Controller.ExecuteCommand(CMD.POLYGONSIDE)
End Sub
Private Sub btnText_Click(sender As System.Object, e As System.EventArgs) Handles btnText.Click
If (ModifierKeys And Keys.Shift) <> Keys.Shift Then
m_Controller.ExecuteCommand(CMD.TEXT)
@@ -751,7 +782,11 @@ Public Class Form1
End Sub
Private Sub btnMirror_Click(sender As System.Object, e As System.EventArgs) Handles btnMirror.Click
m_Controller.ExecuteCommand(CMD.MIRROR)
If (ModifierKeys And Keys.Shift) <> Keys.Shift Then
m_Controller.ExecuteCommand(CMD.MIRROR)
Else
m_Controller.ExecuteCommand(CMD.MIRROR3D)
End If
End Sub
Private Sub btnScale_Click(sender As System.Object, e As System.EventArgs) Handles btnScale.Click
@@ -767,74 +802,6 @@ Public Class Form1
End Sub
' ----------------- Test Commands -------------------
Private Sub XbtnRotP90_Click(sender As System.Object, e As System.EventArgs) Handles XbtnRotP90.Click
XRotate(90)
' aggiorno visualizzazione
Scene1.ZoomAll()
UpdateObjInObjTree(m_nObjTreeOldId)
End Sub
Private Sub XbtnRotM90_Click(sender As System.Object, e As System.EventArgs) Handles XbtnRotM90.Click
XRotate(-90)
' aggiorno visualizzazione
Scene1.ZoomAll()
UpdateObjInObjTree(m_nObjTreeOldId)
End Sub
Private Sub XRotate(ByVal dAngRotDeg As Double)
' indice del primo gruppo sotto la radice
Dim nId As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
' recupero il box del gruppo in globale
Dim PtMinPre As New Point3d
Dim PtMaxPre As New Point3d
EgtGetBBoxGlob(nId, BBF.IGNORE_TEXT + BBF.EXACT, PtMinPre, PtMaxPre)
' ruoto attorno al punto minimo
EgtRotateGlob(nId, PtMinPre, EgtGetGridVersZ(), dAngRotDeg)
' calcolo nuovo box in globale
Dim PtMinPost As New Point3d
Dim PtMaxPost As New Point3d
EgtGetBBoxGlob(nId, BBF.IGNORE_TEXT + BBF.EXACT, PtMinPost, PtMaxPost)
' eseguo traslazione per riavere lo stesso punto minimo
Dim VtMove As Vector3d = PtMinPre - PtMinPost
EgtMoveGlob(nId, VtMove)
End Sub
Private Sub XbtnMirror_Click(sender As System.Object, e As System.EventArgs) Handles XbtnMirror.Click
' indice del primo gruppo sotto la radice
Dim nId As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
' recupero il box del gruppo in globale
Dim PtMin As New Point3d
Dim PtMax As New Point3d
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)
' sistemo gli eventuali testi
XUnMirrorTexts(nId)
' aggiorno visualizzazione
Scene1.ZoomAll()
UpdateObjInObjTree(m_nObjTreeOldId)
End Sub
Private Sub XUnMirrorTexts(ByVal nGroupId As Integer)
Dim nId As Integer = EgtGetFirstInGroup(nGroupId)
While nId <> GDB_ID.NULL
'recupero il tipo di oggetto
Dim nType As Integer = EgtGetType(nId)
'se gruppo
If nType = GDB_TY.GROUP Then
XUnMirrorTexts(nId)
' se testo
ElseIf nType = GDB_TY.EXT_TEXT Then
EgtMirrorText(nId, True)
End If
' passo al successivo
nId = EgtGetNext(nId)
End While
End Sub
'-------------------------------- KeyDown --------------------------------------------------------
Private Sub Form1_KeyDown(ByVal sender As System.Object, ByVal e As KeyEventArgs) Handles MyBase.KeyDown
' Con ESC esco dall'azione corrente
@@ -949,17 +916,6 @@ Public Class Form1
Else
tsStatusOnR.Text = "Error executing command"
End If
'EgtEnableCommandLogger()
'If EgtLuaExecLine(sCmd) Then
' Scene1.Invalidate()
' tsStatusOnR.Text = " "
'Else
' tsStatusOnR.Text = "Error executing command"
'End If
'EgtDisableCommandLogger()
' ricarico albero degli oggetti
'LoadObjTree()
SelectIdInObjTree(nIdOld)
End If
End If
+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.6.1.2")>
<Assembly: AssemblyFileVersion("1.6.1.2")>
<Assembly: AssemblyVersion("1.6.1.3")>
<Assembly: AssemblyFileVersion("1.6.1.3")>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 B

After

Width:  |  Height:  |  Size: 302 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 B

+24 -12
View File
@@ -1,4 +1,17 @@
Imports System.Math
'----------------------------------------------------------------------------
' EgalTech 2014-2015
'----------------------------------------------------------------------------
' File : Scene.vb Data : 18.01.15 Versione : 1.6a3
' Contenuto : Classe Scene (parte di MVC).
'
'
'
' Modifiche : 04.11.14 DS Creazione modulo.
'
'
'----------------------------------------------------------------------------
Imports System.Math
Imports System.IO
Imports System.Globalization
Imports TestEIn.EgtInterface
@@ -127,6 +140,7 @@ Public Class Scene
EgtSetSelSurfAttribs(m_SelSurfColor)
EgtSetWinRectAttribs(m_bZwOutline, m_ZwColor)
EgtSetGeoLineAttribs(m_DstLnColor)
EgtSetGeoTriaAttribs(m_DstLnColor)
EgtInitTscExec()
End Sub
@@ -533,9 +547,7 @@ Public Class Scene
Dim ptSnap As Point3d
If EgtGetGraphicSnapPoint(nSnap, WinXY, DIM_SEL, DIM_SEL, ptSnap) Then
' porto nel riferimento griglia
Dim frGrid As New Frame3d
EgtGetGridFrame(frGrid)
ptSnap.ToLoc(frGrid)
ptSnap.ToLoc(EgtGetGridFrame())
' costruisco la stringa
Dim sCursorPos As New System.Text.StringBuilder
sCursorPos.Append("X=")
@@ -557,9 +569,7 @@ Public Class Scene
If EgtGetGridSnapPointZ((m_nSnapType = SP.PT_SKETCH), WinXY, m_ptGrid, ptSnap) Then
' se richiesto, porto nel riferimento griglia
If m_bGridCursorPos Then
Dim frGrid As New Frame3d
EgtGetGridFrame(frGrid)
ptSnap.ToLoc(frGrid)
ptSnap.ToLoc(EgtGetGridFrame())
End If
' costruisco la stringa
Dim sCursorPos As New System.Text.StringBuilder
@@ -766,6 +776,7 @@ Public Class Scene
' Riabilitazione drag sospeso
ElseIf e.ClickedItem.Name = "cmdRestartDrag" Then
EgtResetGeoLine()
EgtResetGeoTria()
m_bDragOn = True
' Scelta tipo punto snap
ElseIf e.ClickedItem.Name = "cmdSketchPoint" Then
@@ -859,6 +870,7 @@ Public Class Scene
' pulisco eventuali geometrie temporanee
EraseDragGroup()
EgtResetGeoLine(False)
EgtResetGeoTria(False)
EgtResetWinRect(False)
' reset entità non selezionabili
EgtUnselectableClearAll()
@@ -1023,15 +1035,15 @@ Public Class Scene
Return bOk
End Function
Public Function SaveProject(Optional ByVal sFile As String = "") As Boolean
Public Function SaveProject(Optional ByVal sFile As String = "", Optional ByVal nType As NGE = NGE.CMPTEXT) As Boolean
If String.IsNullOrWhiteSpace(sFile) Or EgtGetFileType(sFile) <> FT.NGE Then
Return SaveAsProject(sFile)
Return SaveAsProject(sFile, nType)
Else
'Prima del salvataggio
RaiseEvent OnSavingProject(Me, sFile)
'Salvataggio del progetto
Cursor = Cursors.WaitCursor
Dim bOk As Boolean = EgtSaveFile(sFile, NGE.CMPTEXT)
Dim bOk As Boolean = EgtSaveFile(sFile, nType)
Cursor = Cursors.Default
'Gestione risultato
RaiseEvent OnSavedProject(Me, bOk)
@@ -1039,7 +1051,7 @@ Public Class Scene
End If
End Function
Public Function SaveAsProject(Optional ByVal sFile As String = "") As Boolean
Public Function SaveAsProject(Optional ByVal sFile As String = "", Optional ByVal nType As NGE = NGE.CMPTEXT) As Boolean
'Eventuale sistemazione estensione
sFile = Path.ChangeExtension(sFile, "nge")
'Assegnazione nome file con dialogo
@@ -1055,7 +1067,7 @@ Public Class Scene
RaiseEvent OnSavingProject(Me, SaveFileDialog.FileName)
'Salvataggio del progetto
Cursor = Cursors.WaitCursor
Dim bOk As Boolean = EgtSaveFile(SaveFileDialog.FileName, NGE.CMPTEXT)
Dim bOk As Boolean = EgtSaveFile(SaveFileDialog.FileName, nType)
Cursor = Cursors.Default
'Gestione risultato
RaiseEvent OnSavedProject(Me, bOk)
+4
View File
@@ -204,6 +204,7 @@
<Compile Include="Scene.vb">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Utilities.vb" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="AboutBox1.resx">
@@ -490,6 +491,9 @@
<ItemGroup>
<None Include="Resources\Text.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\PolygonSide.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\TestEIn\TestEInR32.exe
+30
View File
@@ -0,0 +1,30 @@
'----------------------------------------------------------------------------
' EgalTech 2015-2015
'----------------------------------------------------------------------------
' File : Utilities.vb Data : 18.01.15 Versione : 1.6a3
' Contenuto : Funzioni di utilità.
'
'
'
' Modifiche : 18.01.15 DS Creazione modulo.
'
'
'----------------------------------------------------------------------------
Module Utilities
' Verifica se il file è in uso
Public Function FileInUse(ByVal sFile As String) As Boolean
If System.IO.File.Exists(sFile) Then
Try
Dim F As Short = FreeFile()
FileOpen(F, sFile, OpenMode.Binary, OpenAccess.ReadWrite, OpenShare.LockReadWrite)
FileClose(F)
Catch
Return True
End Try
End If
Return False
End Function
End Module