TestEIn 1.6c5 :

- aggiunta gestione raccordi e smussi di curve.
This commit is contained in:
Dario Sassi
2015-03-20 08:33:36 +00:00
parent 2183c972c3
commit 94309ff76c
10 changed files with 298 additions and 140 deletions
+128 -6
View File
@@ -79,6 +79,8 @@ Public Class Controller
ARC3P
ARCPDP
ARCPVP
FILLET
CHAMFER
RECTANGLE2P
POLYGON
POLYGONSIDE
@@ -147,6 +149,8 @@ Public Class Controller
Private m_bLast As Boolean = False
Private m_ptLastSel As Point3d ' punto da ultima selezione entità
Private m_nLastSel As Integer ' info aux da ultima selezione entità
Private m_ptPrevSel As Point3d ' unto da penultima selezione entità
Private m_nPrevSel As Integer ' info aux da penultima selezione entità
Private m_ptCont As Point3d ' punto finale di entità precedente (per continuazione)
Private m_vtCont As Vector3d = Vector3d.X_AX() ' direzione finale di entità precedente (per continuazione)
@@ -764,9 +768,13 @@ Public Class Controller
m_bLast = bVal
End Sub
Public Sub SetPointFromSelection(ByVal PtP As Point3d, ByVal nAux As Integer)
m_ptLastSel = PtP
m_nLastSel = nAux
Public Sub SetPointFromSelection(ByVal nId As Integer, ByVal PtP As Point3d, ByVal nAux As Integer)
If EgtIsSelectedObj(nId) Then
m_ptPrevSel = m_ptLastSel
m_nPrevSel = m_nLastSel
m_ptLastSel = PtP
m_nLastSel = nAux
End If
End Sub
Public Sub ResetStatus()
@@ -897,6 +905,12 @@ Public Class Controller
' ArcPVP
Case CMD.ARCPVP
Return ProcessArcPVP()
' Fillet
Case CMD.FILLET
Return ProcessFillet()
' Chamfer
Case CMD.CHAMFER
Return ProcessChamfer()
' Rectangle 2P
Case CMD.RECTANGLE2P
Return ProcessRectangle2P()
@@ -1027,6 +1041,10 @@ Public Class Controller
DragArcPDP()
Case CMD.ARCPVP
DragArcPVP()
Case CMD.FILLET
DragFillet()
Case CMD.CHAMFER
DragChamfer()
Case CMD.RECTANGLE2P
DragRectangle2P()
Case CMD.POLYGON
@@ -2436,7 +2454,7 @@ Public Class Controller
If GetCurrLayer() = GDB_ID.NULL Or Not m_Scene.CreateDragGroup() Then
Return False
End If
' imposto stato a primo punto per Arc3P
' imposto stato a primo punto per ArcPDP
m_Scene.SetStatusSelPoint(True)
m_nStep = 1
' abilito dialogo
@@ -2647,6 +2665,110 @@ Public Class Controller
End If
End Sub
Private Function ProcessFillet() As Boolean
Select 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 raggio per Fillet
m_nStep = 1
' abilito dialogo
RaiseEvent PrepareInputBox("FILLET", "Insert Radius", "Trim", False, True)
RaiseEvent SetInputBoxCheck(True)
m_nInpType = IBT.TY_DOUBLE
SetInputBoxDouble(10)
Case 1
' reset scena
m_Scene.ResetStatus(False)
' creo il fillet (i punti sono in globale)
Dim nId2 As Integer = EgtGetLastSelectedObj()
Dim nId1 As Integer = EgtGetPrevSelectedObj()
EnableCommandLog()
EgtCreateCurveFillet(GetCurrLayer(),
nId1, m_ptPrevSel.Loc(GDB_ID.GRID), nId2, m_ptLastSel.Loc(GDB_ID.GRID),
Vector3d.Z_AX, m_dLast, m_bLast, REF_TY.GRID)
DisableCommandLog()
EgtDraw()
' aggiorno stato
RaiseEvent UpdateUI(Me, True)
m_nStep = 0
Case Else
m_nStep = 0
Return False
End Select
Return True
End Function
Private Sub DragFillet()
' il gruppo di Drag ha riferimento globale
If m_nStep = 1 Then
' svuoto il gruppo di drag
EgtEmptyGroup(m_Scene.GetDragGroup())
' inserisco le due curve nel gruppo di drag
Dim nId2 As Integer = m_Scene.AddToDragGroup(EgtGetLastSelectedObj())
Dim nId1 As Integer = m_Scene.AddToDragGroup(EgtGetPrevSelectedObj())
' creo fillet (il gruppo di Drag ha riferimento globale)
EgtCreateCurveFillet(m_Scene.GetDragGroup(),
nId1, m_ptPrevSel, nId2, m_ptLastSel,
EgtGetGridVersZ(), m_dLast, m_bLast, REF_TY.GLOB)
EgtDraw()
End If
End Sub
Private Function ProcessChamfer() 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 raggio per Fillet
m_nStep = 1
' abilito dialogo
RaiseEvent PrepareInputBox("CHAMFER", "Insert distance", "Trim", False, True)
RaiseEvent SetInputBoxCheck(True)
m_nInpType = IBT.TY_DOUBLE
SetInputBoxDouble(10)
Case 1
' reset scena
m_Scene.ResetStatus(False)
' creo il fillet (i punti sono in globale)
Dim nId2 As Integer = EgtGetLastSelectedObj()
Dim nId1 As Integer = EgtGetPrevSelectedObj()
EnableCommandLog()
EgtCreateCurveChamfer(GetCurrLayer(),
nId1, m_ptPrevSel.Loc(GDB_ID.GRID), nId2, m_ptLastSel.Loc(GDB_ID.GRID),
Vector3d.Z_AX, m_dLast, m_bLast, REF_TY.GRID)
DisableCommandLog()
EgtDraw()
' aggiorno stato
RaiseEvent UpdateUI(Me, True)
m_nStep = 0
Case Else
m_nStep = 0
Return False
End Select
Return True
End Function
Private Sub DragChamfer()
' il gruppo di Drag ha riferimento globale
If m_nStep = 1 Then
' svuoto il gruppo di drag
EgtEmptyGroup(m_Scene.GetDragGroup())
' inserisco le due curve nel gruppo di drag
Dim nId2 As Integer = m_Scene.AddToDragGroup(EgtGetLastSelectedObj())
Dim nId1 As Integer = m_Scene.AddToDragGroup(EgtGetPrevSelectedObj())
' creo chamfer (il gruppo di Drag ha riferimento globale)
EgtCreateCurveChamfer(m_Scene.GetDragGroup(),
nId1, m_ptPrevSel, nId2, m_ptLastSel,
EgtGetGridVersZ(), m_dLast, m_bLast, REF_TY.GLOB)
EgtDraw()
End If
End Sub
Private Function ProcessRectangle2P() As Boolean
Select Case m_nStep
Case 0
@@ -4408,7 +4530,7 @@ Public Class Controller
If bAllSelected Then
Dim nId As Integer = EgtGetFirstSelectedObj()
While nId <> GDB_ID.NULL
If Not m_Scene.AddToDragGroup(nId) Then
If m_Scene.AddToDragGroup(nId) = GDB_ID.NULL Then
m_Scene.EraseDragGroup()
Return False
End If
@@ -4417,7 +4539,7 @@ Public Class Controller
' altrimenti solo l'ultimo
Else
Dim nId As Integer = EgtGetLastSelectedObj()
If nId = GDB_ID.NULL And Not m_Scene.AddToDragGroup(nId) Then
If nId = GDB_ID.NULL Or m_Scene.AddToDragGroup(nId) = GDB_ID.NULL Then
m_Scene.EraseDragGroup()
Return False
End If