TestEIn 1.6c2 :
- disegno line2p e arcPDP con modalità continuazione (Ctrl) - aggiunta gestione tangenze per circonferenze e archi.
This commit is contained in:
+79
-16
@@ -124,6 +124,7 @@ Public Class Controller
|
||||
End Enum
|
||||
Private m_nLastCmd As CMD = CMD.NULL
|
||||
Private m_nStep As Integer = 0
|
||||
Private m_bContinue As Boolean = False
|
||||
Private m_ptP1 As Point3d
|
||||
Private m_sepP1 As SEP
|
||||
Private m_nIdP1 As Integer
|
||||
@@ -756,12 +757,21 @@ Public Class Controller
|
||||
|
||||
Public Sub ResetStatus()
|
||||
m_nStep = 0
|
||||
m_bContinue = False
|
||||
m_sepP1 = SEP.PT_STD
|
||||
m_sepP2 = SEP.PT_STD
|
||||
m_sepLast = SEP.PT_STD
|
||||
m_Scene.ResetStatus()
|
||||
End Sub
|
||||
|
||||
Public Sub SetContinue()
|
||||
m_bContinue = True
|
||||
End Sub
|
||||
|
||||
Public Function GetContinue() As Boolean
|
||||
Return m_bContinue
|
||||
End Function
|
||||
|
||||
Public Function RepeatLastCommand() As Boolean
|
||||
Return ExecuteCommand(m_nLastCmd)
|
||||
End Function
|
||||
@@ -1878,7 +1888,7 @@ Public Class Controller
|
||||
m_Scene.EnableDrag()
|
||||
RaiseEvent PrepareInputBox("LINE 2P", "Insert End Point ", "", False, True)
|
||||
m_nInpType = IBT.TY_POINT3D
|
||||
SetInputBoxPoint3d(m_ptLast.Loc(GetCurrLayer()))
|
||||
SetInputBoxPoint3d(m_ptLast.Loc(GDB_ID.GRID))
|
||||
Select Case m_sepP1
|
||||
Case SEP.PT_TG, SEP.PT_PERP
|
||||
m_Scene.DisableMinDistPoint()
|
||||
@@ -1903,8 +1913,13 @@ Public Class Controller
|
||||
End If
|
||||
EgtDraw()
|
||||
' aggiorno stato
|
||||
m_nStep = 0
|
||||
RaiseEvent UpdateUI(Me, True)
|
||||
' se continuazione e creazione riuscita, vedo di continuare ...
|
||||
If m_bContinue And nId <> GDB_ID.NULL Then
|
||||
ContinueLine2P()
|
||||
Else
|
||||
m_nStep = 0
|
||||
End If
|
||||
Case Else
|
||||
m_nStep = 0
|
||||
Return False
|
||||
@@ -1933,6 +1948,25 @@ Public Class Controller
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Sub ContinueLine2P()
|
||||
' verifico di essere in modalità continua
|
||||
If Not m_bContinue Then
|
||||
Return
|
||||
End If
|
||||
' pulisco
|
||||
m_Scene.ResetStatus(False)
|
||||
' imposto per stato 1 di linea 2P
|
||||
m_nLastCmd = CMD.LINE2P
|
||||
m_nStep = 1
|
||||
m_Scene.CreateDragGroup()
|
||||
m_Scene.SetStatusSelPoint()
|
||||
m_ptLast = m_ptCont
|
||||
m_sepLast = SEP.PT_STD
|
||||
m_nIdLast = GDB_ID.NULL
|
||||
' processo stato 1 per essere sul 2
|
||||
ProcessLine2P()
|
||||
End Sub
|
||||
|
||||
Private Function ProcessLinePDL() As Boolean
|
||||
Select Case m_nStep
|
||||
Case 0
|
||||
@@ -2129,13 +2163,14 @@ Public Class Controller
|
||||
m_Scene.EnableDrag()
|
||||
RaiseEvent PrepareInputBox("CIRCLE CP", "Insert Point", "", False, True)
|
||||
m_nInpType = IBT.TY_POINT3D
|
||||
m_Scene.EnableTangentPoint()
|
||||
Case 2
|
||||
' reset scena
|
||||
m_Scene.ResetStatus(False)
|
||||
' creo la circonferenza (i punti sono in globale)
|
||||
EnableCommandLog()
|
||||
Dim nId As Integer = EgtCreateCurveCircleCPN(GetCurrLayer(), m_ptP1.Loc(GDB_ID.GRID),
|
||||
m_ptLast.Loc(GDB_ID.GRID), Vector3d.Z_AX, REF_TY.GRID)
|
||||
Dim nId As Integer = EgtCreateCurveCircleCPNEx(GetCurrLayer(), m_ptP1.Loc(GDB_ID.GRID),
|
||||
m_ptLast.Loc(GDB_ID.GRID), m_sepLast, m_nIdLast, Vector3d.Z_AX, REF_TY.GRID)
|
||||
DisableCommandLog()
|
||||
EgtDraw()
|
||||
' aggiorno stato
|
||||
@@ -2235,19 +2270,24 @@ Public Class Controller
|
||||
m_Scene.EnableDrag()
|
||||
RaiseEvent PrepareInputBox("ARC CSE", "Insert Start Point", "", False, True)
|
||||
m_nInpType = IBT.TY_POINT3D
|
||||
m_Scene.EnableTangentPoint()
|
||||
Case 2
|
||||
m_ptP2 = m_ptLast
|
||||
m_sepP2 = m_sepLast
|
||||
m_nIdP2 = m_nIdLast
|
||||
m_nStep = 3
|
||||
m_Scene.EnableDrag()
|
||||
RaiseEvent PrepareInputBox("ARC CSE", "Insert Point Near End", "", False, True)
|
||||
m_nInpType = IBT.TY_POINT3D
|
||||
m_Scene.DisableTangentPoint()
|
||||
Case 3
|
||||
' reset scena
|
||||
m_Scene.ResetStatus(False)
|
||||
' creo l'arco (i punti sono in globale)
|
||||
EnableCommandLog()
|
||||
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)
|
||||
Dim nId = EgtCreateCurveArcC2PNEx(GetCurrLayer(), m_ptP1.Loc(GDB_ID.GRID),
|
||||
m_ptP2.Loc(GDB_ID.GRID), m_sepP2, m_nIdP2,
|
||||
m_ptLast.Loc(GDB_ID.GRID), Vector3d.Z_AX, REF_TY.GRID)
|
||||
DisableCommandLog()
|
||||
If nId <> GDB_ID.NULL Then
|
||||
Dim PtP As Point3d
|
||||
@@ -2281,7 +2321,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(), REF_TY.GLOB)
|
||||
EgtCreateCurveArcC2PNEx(m_Scene.GetDragGroup(), m_ptP1, m_ptP2, m_sepP2, m_nIdP2, m_ptLast, EgtGetGridVersZ(), REF_TY.GLOB)
|
||||
Else
|
||||
EgtModifyCurveArcC2PN(nId, m_ptLast, REF_TY.GLOB)
|
||||
End If
|
||||
@@ -2403,6 +2443,7 @@ Public Class Controller
|
||||
m_Scene.EnableDrag()
|
||||
RaiseEvent PrepareInputBox("ARC PDP", "Insert End Point", "", False, True)
|
||||
m_nInpType = IBT.TY_POINT3D
|
||||
m_Scene.EnableTangentPoint()
|
||||
Case 3
|
||||
' reset scena
|
||||
m_Scene.ResetStatus(False)
|
||||
@@ -2410,8 +2451,8 @@ Public Class Controller
|
||||
m_vtLast = GlobDirFromGridAng(m_dLast)
|
||||
' creo l'arco (i punti sono in globale)
|
||||
EnableCommandLog()
|
||||
Dim nId = EgtCreateCurveArc2PVN(GetCurrLayer(), m_ptP1.Loc(GDB_ID.GRID), m_ptLast.Loc(GDB_ID.GRID),
|
||||
m_vtLast.Loc(GDB_ID.GRID), Vector3d.Z_AX, REF_TY.GRID)
|
||||
Dim nId = EgtCreateCurveArc2PVNEx(GetCurrLayer(), m_ptP1.Loc(GDB_ID.GRID), m_ptLast.Loc(GDB_ID.GRID),
|
||||
m_sepLast, m_nIdLast, m_vtLast.Loc(GDB_ID.GRID), Vector3d.Z_AX, REF_TY.GRID)
|
||||
DisableCommandLog()
|
||||
If nId <> GDB_ID.NULL Then
|
||||
m_ptCont = m_ptLast
|
||||
@@ -2421,8 +2462,13 @@ Public Class Controller
|
||||
End If
|
||||
EgtDraw()
|
||||
' aggiorno stato
|
||||
m_nStep = 0
|
||||
RaiseEvent UpdateUI(Me, True)
|
||||
' se continuazione e creazione riuscita, vedo di continuare ...
|
||||
If m_bContinue And nId <> GDB_ID.NULL Then
|
||||
ContinueArcPDP()
|
||||
Else
|
||||
m_nStep = 0
|
||||
End If
|
||||
Case Else
|
||||
m_nStep = 0
|
||||
Return False
|
||||
@@ -2470,6 +2516,25 @@ Public Class Controller
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Public Sub ContinueArcPDP()
|
||||
' verifico di essere in modalità continua
|
||||
If Not m_bContinue Then
|
||||
Return
|
||||
End If
|
||||
' pulisco
|
||||
m_Scene.ResetStatus(False)
|
||||
' imposto per stato 1 di arco PDP
|
||||
m_nLastCmd = CMD.ARCPDP
|
||||
m_nStep = 1
|
||||
m_Scene.CreateDragGroup()
|
||||
m_Scene.SetStatusSelPoint(True)
|
||||
m_ptLast = m_ptCont
|
||||
m_vtLast = m_vtCont
|
||||
' processo stato 1 per essere sul 2
|
||||
ProcessArcPDP()
|
||||
End Sub
|
||||
|
||||
Private Function ProcessArcPVP() As Boolean
|
||||
Select Case m_nStep
|
||||
Case 0
|
||||
@@ -3473,9 +3538,8 @@ Public Class Controller
|
||||
' devo sempre partire dalla curva originale
|
||||
m_Scene.EraseDragGroup()
|
||||
PrepareTransform(False, True)
|
||||
' verifico se caso speciale : estensione + drag + snap a punto intersezione
|
||||
Dim bSpecial As Boolean = (m_Scene.GetDragStatus() And
|
||||
m_Scene.GetSnapPointType() = SP.PT_INTERS)
|
||||
' verifico se caso speciale : drag
|
||||
Dim bSpecial As Boolean = m_Scene.GetDragStatus()
|
||||
' lunghezza aggiuntiva per caso speciale
|
||||
Dim dAddLen As Double = IIf(bSpecial, EXTEND_ADD, 0)
|
||||
' eseguo trim/estensione sull'estremo più vicino al punto di selezione
|
||||
@@ -3488,9 +3552,8 @@ Public Class Controller
|
||||
|
||||
Private Function ExecuteSpecialDataExtendCurve() As Boolean
|
||||
If m_nStep = 1 Then
|
||||
' verifico se caso speciale : estensione + drag + snap a punto intersezione
|
||||
Dim bSpecial As Boolean = (m_Scene.GetDragStatus() And
|
||||
m_Scene.GetSnapPointType() = SP.PT_INTERS)
|
||||
' verifico se caso speciale : drag
|
||||
Dim bSpecial As Boolean = m_Scene.GetDragStatus()
|
||||
' se standard
|
||||
If Not bSpecial Then
|
||||
m_dLast = (m_ptLast - m_ptP1) * m_vtCont
|
||||
|
||||
@@ -942,6 +942,12 @@ Public Function EgtCreateCurveCircleCPN(ByVal nParentId 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 EgtCreateCurveCircleCPNEx(ByVal nParentId As Integer,
|
||||
ByRef PtCen As Point3d, ByRef PtOn As Point3d, ByVal nSepO As SEP, ByVal nIdO As Integer,
|
||||
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, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
|
||||
@@ -953,12 +959,24 @@ Public Function EgtCreateCurveArcC2PN(ByVal nParentId As Integer,
|
||||
ByRef VtNorm As Vector3d, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
|
||||
Public Function EgtCreateCurveArcC2PNEx(ByVal nParentId As Integer,
|
||||
ByRef PtCen As Point3d, ByRef PtStart As Point3d, ByVal nSepS As SEP, ByVal nIdS As Integer,
|
||||
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, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
|
||||
End Function
|
||||
|
||||
<DllImport(EgtIntDll, CharSet:=CharSet.Unicode)>
|
||||
Public Function EgtCreateCurveArc2PVNEx(ByVal nParentId As Integer, ByRef PtStart As Point3d,
|
||||
ByRef PtEnd As Point3d, ByVal nSepE As SEP, ByVal nIdE As Integer,
|
||||
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)>
|
||||
Public Function EgtCreateCurveCompoByChain(ByVal nParentId As Integer, ByVal nNumCrv As Integer, ByVal nCrvId() As Integer,
|
||||
ByRef PtNearStart As Point3d, ByVal bCrvErase As Boolean, Optional ByVal nRefType As REF_TY = REF_TY.LOC) As Integer
|
||||
|
||||
@@ -490,7 +490,11 @@ Public Class Form1
|
||||
Private Sub OnUpdateUI(ByVal sender As Object, ByVal bReloadUI As Boolean) Handles m_Controller.UpdateUI
|
||||
' pulisco input e relativi messaggi
|
||||
ResetInputBox()
|
||||
tsStatusOutput.Text = ""
|
||||
If m_Controller.GetContinue() Then
|
||||
tsStatusOutput.Text = EgtMsg(399)
|
||||
Else
|
||||
tsStatusOutput.Text = ""
|
||||
End If
|
||||
' aggiorno dati correnti
|
||||
EmitTitle()
|
||||
EmitCurrPartLayer()
|
||||
@@ -876,6 +880,10 @@ Public Class Form1
|
||||
End Sub
|
||||
|
||||
Private Sub btnLine2P_Click(sender As System.Object, e As System.EventArgs) Handles btnLine2P.Click
|
||||
If (ModifierKeys And Keys.Control) = Keys.Control Then
|
||||
m_Controller.SetContinue()
|
||||
tsStatusOutput.Text = EgtMsg(399) ' Continue : 'L' with line, 'A' with arc
|
||||
End If
|
||||
m_Controller.ExecuteCommand(CMD.LINE2P)
|
||||
End Sub
|
||||
|
||||
@@ -905,6 +913,10 @@ Public Class Form1
|
||||
|
||||
Private Sub btnArcPDP_Click(sender As System.Object, e As System.EventArgs) Handles btnArcPDP.Click
|
||||
If (ModifierKeys And Keys.Shift) <> Keys.Shift Then
|
||||
If (ModifierKeys And Keys.Control) = Keys.Control Then
|
||||
m_Controller.SetContinue()
|
||||
tsStatusOutput.Text = EgtMsg(399) ' Continue : 'L' with line, 'A' with arc
|
||||
End If
|
||||
m_Controller.ExecuteCommand(CMD.ARCPDP)
|
||||
Else
|
||||
m_Controller.ExecuteCommand(CMD.ARCPVP)
|
||||
@@ -1051,6 +1063,12 @@ Public Class Form1
|
||||
' pulisco output
|
||||
tsStatusOutput.Text = ""
|
||||
ResetInputBox()
|
||||
' Con 'A' forzo il passaggio ad arco se in modalità continua
|
||||
ElseIf e.KeyData = Keys.A Then
|
||||
m_Controller.ContinueArcPDP()
|
||||
' Con 'L' forzo il passaggio a retta se in modalità continua
|
||||
ElseIf e.KeyData = Keys.L Then
|
||||
m_Controller.ContinueLine2P()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -46,5 +46,5 @@ Imports System.Runtime.InteropServices
|
||||
' utilizzando l'asterisco (*) come descritto di seguito:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.6.3.1")>
|
||||
<Assembly: AssemblyFileVersion("1.6.3.1")>
|
||||
<Assembly: AssemblyVersion("1.6.3.2")>
|
||||
<Assembly: AssemblyFileVersion("1.6.3.2")>
|
||||
|
||||
Reference in New Issue
Block a user