|
|
|
@@ -36,16 +36,19 @@ Public Class NestingTabVM
|
|
|
|
|
Private m_bCsvData As Boolean = False
|
|
|
|
|
|
|
|
|
|
' Id del rettangolo, del traglio e della curva da modificare tramite Drag
|
|
|
|
|
Private m_nIdSelectedOutLoopRettangle As Integer = GDB_ID.NULL
|
|
|
|
|
Private m_nIdSelectedRegionRettangle As Integer = GDB_ID.NULL
|
|
|
|
|
Private m_nIdSelectedSawRettangle As Integer = GDB_ID.NULL
|
|
|
|
|
Private m_nIdSelectedCurvRettangle As Integer = GDB_ID.NULL
|
|
|
|
|
Private m_nIdSelectedTextRettangle As Integer = GDB_ID.NULL
|
|
|
|
|
Private m_nIdSelectedTextTopRettangle As Integer = GDB_ID.NULL
|
|
|
|
|
Private m_nIdSelectedFlatSurfRettangle As Integer = GDB_ID.NULL
|
|
|
|
|
Private m_SideListRettangle(4) As Integer
|
|
|
|
|
Private m_nIdSelectedOutLoopRectangle As Integer = GDB_ID.NULL
|
|
|
|
|
Private m_nIdSelectedRegionRectangle As Integer = GDB_ID.NULL
|
|
|
|
|
Private m_nIdSelectedSawRectangle As Integer = GDB_ID.NULL
|
|
|
|
|
Private m_nIdSelectedCurvRectangle As Integer = GDB_ID.NULL
|
|
|
|
|
Private m_nIdSelectedTextRectangle As Integer = GDB_ID.NULL
|
|
|
|
|
Private m_nIdSelectedTextTopRectangle As Integer = GDB_ID.NULL
|
|
|
|
|
Private m_nIdSelectedFlatSurfRectangle As Integer = GDB_ID.NULL
|
|
|
|
|
Private m_SideListRectangle(4) As Integer
|
|
|
|
|
Private m_sTextContent As String = String.Empty
|
|
|
|
|
|
|
|
|
|
' Id dei lato WJ da separare tramite comando ON_OFF
|
|
|
|
|
Private m_nIdSelectedSideWJ As Integer = GDB_ID.NULL
|
|
|
|
|
Private m_nIdSelectedWaterJet As Integer = GDB_ID.NULL
|
|
|
|
|
|
|
|
|
|
Private m_CsvImportWindow As CsvWindowV
|
|
|
|
|
Friend ReadOnly Property CsvImportWindow As CsvWindowV
|
|
|
|
@@ -152,6 +155,13 @@ Public Class NestingTabVM
|
|
|
|
|
End Set
|
|
|
|
|
End Property
|
|
|
|
|
|
|
|
|
|
Private m_CountColumn As Integer = 1
|
|
|
|
|
Public ReadOnly Property CountColumn As Integer
|
|
|
|
|
Get
|
|
|
|
|
Return m_CountColumn
|
|
|
|
|
End Get
|
|
|
|
|
End Property
|
|
|
|
|
|
|
|
|
|
#Region "Messages"
|
|
|
|
|
|
|
|
|
|
Public ReadOnly Property InsertPartMsg As String
|
|
|
|
@@ -172,12 +182,24 @@ Public Class NestingTabVM
|
|
|
|
|
End Get
|
|
|
|
|
End Property
|
|
|
|
|
|
|
|
|
|
Public ReadOnly Property DragRettangleMsg As String
|
|
|
|
|
Public ReadOnly Property DragRectangleMsg As String
|
|
|
|
|
Get
|
|
|
|
|
Return "Drag Rectangle"
|
|
|
|
|
End Get
|
|
|
|
|
End Property
|
|
|
|
|
|
|
|
|
|
Public ReadOnly Property SplitCurvWJMsg As String
|
|
|
|
|
Get
|
|
|
|
|
Return "Split"
|
|
|
|
|
End Get
|
|
|
|
|
End Property
|
|
|
|
|
|
|
|
|
|
Public ReadOnly Property StartCurvWJMsg As String
|
|
|
|
|
Get
|
|
|
|
|
Return "Start"
|
|
|
|
|
End Get
|
|
|
|
|
End Property
|
|
|
|
|
|
|
|
|
|
Public ReadOnly Property SelectAllMsg As String
|
|
|
|
|
Get
|
|
|
|
|
Return EgtMsg(MSG_NESTPAGEUC + 4)
|
|
|
|
@@ -198,7 +220,7 @@ Public Class NestingTabVM
|
|
|
|
|
|
|
|
|
|
Public ReadOnly Property CsvDataMsg As String
|
|
|
|
|
Get
|
|
|
|
|
Return EgtMsg( 90398) 'Dati Csv
|
|
|
|
|
Return EgtMsg(90398) 'Dati Csv
|
|
|
|
|
End Get
|
|
|
|
|
End Property
|
|
|
|
|
|
|
|
|
@@ -228,13 +250,14 @@ Public Class NestingTabVM
|
|
|
|
|
#Region "CONSTRUCTOR"
|
|
|
|
|
|
|
|
|
|
Sub New()
|
|
|
|
|
If (GetMainPrivateProfileInt(S_NEST, K_DRAGRETTANGLE, 1) <> 0) Then
|
|
|
|
|
m_DragRettangle_Visibility = Visibility.Visible
|
|
|
|
|
If GetMainPrivateProfileInt(S_NEST, K_DRAGRECTANGLE, 1) <> 0 Then
|
|
|
|
|
m_DragRectangle_Visibility = Visibility.Visible
|
|
|
|
|
m_CountColumn += 1
|
|
|
|
|
Else
|
|
|
|
|
m_DragRettangle_Visibility = Visibility.Collapsed
|
|
|
|
|
m_DragRectangle_Visibility = Visibility.Collapsed
|
|
|
|
|
End If
|
|
|
|
|
NotifyPropertyChanged("DragRettangle_Visibility")
|
|
|
|
|
NotifyPropertyChanged("DragRettangle_Cl_Span")
|
|
|
|
|
NotifyPropertyChanged("DragRectangle_Visibility")
|
|
|
|
|
NotifyPropertyChanged("CountColumn")
|
|
|
|
|
' Creo riferimento a questa classe in OmagOFFICEMap
|
|
|
|
|
OmagOFFICEMap.SetRefNestingTabVM(Me)
|
|
|
|
|
End Sub
|
|
|
|
@@ -551,14 +574,12 @@ Public Class NestingTabVM
|
|
|
|
|
Return True
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
#Region "DRAG RETTANGLE"
|
|
|
|
|
#Region "DRAG RECTANGLE"
|
|
|
|
|
|
|
|
|
|
' funzione chiamata da OnMyMouseMoveScene: verifica che la selezione sia corretta (deve essere il lato di una figura rettangolare)
|
|
|
|
|
Private Sub OnMyMouseDownSceneSelSideRettangle(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
|
|
|
|
' Si può selezionare solo con il tasto sinistro e se il bottone TEST Attivo
|
|
|
|
|
If e.Button <> Windows.Forms.MouseButtons.Left Then
|
|
|
|
|
Return
|
|
|
|
|
End If
|
|
|
|
|
Private Sub OnMyMouseDownSceneSelSideRectangle(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
|
|
|
|
' Si può selezionare solo con il tasto sinistro
|
|
|
|
|
If e.Button <> Windows.Forms.MouseButtons.Left Then Return
|
|
|
|
|
' Verifico se selezionato indicativo di pezzo
|
|
|
|
|
EgtSetObjFilterForSelWin(False, True, False, False, False)
|
|
|
|
|
Dim nSelMy As Integer
|
|
|
|
@@ -574,8 +595,8 @@ Public Class NestingTabVM
|
|
|
|
|
If sLayer = NAME_OUTLOOP Then
|
|
|
|
|
If EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then
|
|
|
|
|
' -------------------------------- INIZIO VERIFICHE --------------------------------
|
|
|
|
|
m_nIdSelectedOutLoopRettangle = nIdParent
|
|
|
|
|
If Not IsRettangle(m_SideListRettangle) Then
|
|
|
|
|
m_nIdSelectedOutLoopRectangle = nIdParent
|
|
|
|
|
If Not IsRectangle(m_SideListRectangle) Then
|
|
|
|
|
'm_CurrProjPage.ClearMessage()
|
|
|
|
|
'm_CurrProjPage.SetWarningMessage("Non è un rettangolo (0)")
|
|
|
|
|
Return
|
|
|
|
@@ -599,26 +620,26 @@ Public Class NestingTabVM
|
|
|
|
|
Dim nIdSaw As Integer = EgtGetFirstNameInGroup(nIdPV, "Saw" & nIdMy.ToString)
|
|
|
|
|
' -------------------------------- FINE VERIFICHE --------------------------------
|
|
|
|
|
|
|
|
|
|
If Not EgtGetGroupObjs(nIdSaw) Then
|
|
|
|
|
m_nIdSelectedSawRettangle = nIdSaw
|
|
|
|
|
m_nIdSelectedCurvRettangle = nIdMy
|
|
|
|
|
If EgtGetGroupObjs(nIdSaw) <> 0 Then
|
|
|
|
|
m_nIdSelectedSawRectangle = nIdSaw
|
|
|
|
|
m_nIdSelectedCurvRectangle = nIdMy
|
|
|
|
|
|
|
|
|
|
m_nIdSelectedRegionRettangle = EgtGetFirstNameInGroup(nIdParentPart, NAME_REGION)
|
|
|
|
|
' recupero i testi cintenuti nel layer Region
|
|
|
|
|
If m_nIdSelectedRegionRettangle <> GDB_ID.NULL Then
|
|
|
|
|
Dim nCurrId As Integer = EgtGetFirstInGroup(m_nIdSelectedRegionRettangle)
|
|
|
|
|
m_nIdSelectedRegionRectangle = EgtGetFirstNameInGroup(nIdParentPart, NAME_REGION)
|
|
|
|
|
' recupero i testi contenuti nel layer Region
|
|
|
|
|
If m_nIdSelectedRegionRectangle <> GDB_ID.NULL Then
|
|
|
|
|
Dim nCurrId As Integer = EgtGetFirstInGroup(m_nIdSelectedRegionRectangle)
|
|
|
|
|
While nCurrId <> GDB_ID.NULL
|
|
|
|
|
If EgtGetType(nCurrId) = GDB_TY.EXT_TEXT Then
|
|
|
|
|
Dim sVal As String = String.Empty
|
|
|
|
|
EgtTextGetContent(nCurrId, sVal)
|
|
|
|
|
If sVal = "*TOP*" Then
|
|
|
|
|
m_nIdSelectedTextTopRettangle = nCurrId
|
|
|
|
|
m_nIdSelectedTextTopRectangle = nCurrId
|
|
|
|
|
Else
|
|
|
|
|
m_nIdSelectedTextRettangle = nCurrId
|
|
|
|
|
m_sTextContent = GetMyRettangleText(sVal)
|
|
|
|
|
m_nIdSelectedTextRectangle = nCurrId
|
|
|
|
|
m_sTextContent = GetMyRectangleText(sVal)
|
|
|
|
|
End If
|
|
|
|
|
ElseIf EgtGetType(nCurrId) = GDB_TY.SRF_FRGN Then
|
|
|
|
|
m_nIdSelectedFlatSurfRettangle = nCurrId
|
|
|
|
|
m_nIdSelectedFlatSurfRectangle = nCurrId
|
|
|
|
|
End If
|
|
|
|
|
nCurrId = EgtGetNext(nCurrId)
|
|
|
|
|
End While
|
|
|
|
@@ -631,15 +652,15 @@ Public Class NestingTabVM
|
|
|
|
|
Exit While
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
' se le'elemto corrente non è una linea
|
|
|
|
|
' se l'elemento corrente non è una linea
|
|
|
|
|
End If
|
|
|
|
|
' se le'elemto corrente non appartiene al layer OutLoop passo al prossimo elemento dell'elenco
|
|
|
|
|
' se l'elemento corrente non appartiene al layer OutLoop passo al prossimo elemento dell'elenco
|
|
|
|
|
nIdMy = EgtGetNextObjInSelWin()
|
|
|
|
|
End While
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
' restituisce il valore del Text ripulito dalle dimensioni
|
|
|
|
|
Private Function GetMyRettangleText(sTextPz As String) As String
|
|
|
|
|
Private Function GetMyRectangleText(sTextPz As String) As String
|
|
|
|
|
' da DrawPageUC.xaml.vb/MultipleInsert
|
|
|
|
|
Dim sText As String = String.Empty
|
|
|
|
|
If sTextPz.Contains("<br/>") Then
|
|
|
|
@@ -650,56 +671,57 @@ Public Class NestingTabVM
|
|
|
|
|
If sTextPz.Contains(" ") Then
|
|
|
|
|
Dim sInfo() As String = sTextPz.Split(" "c)
|
|
|
|
|
If sInfo.Count > 3 Then
|
|
|
|
|
Return sText = sInfo(0) & " " & sInfo(1) & " "
|
|
|
|
|
sText = sInfo(0) & " " & sInfo(1) & " "
|
|
|
|
|
Return sText
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
Return sText
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
' verifico che la figura selezionata sia realmente un rettangolo
|
|
|
|
|
Private Function IsRettangle(ByRef IdSideList() As Integer) As Boolean
|
|
|
|
|
Private Function IsRectangle(ByRef IdSideList() As Integer) As Boolean
|
|
|
|
|
' creo una lista con i lati del rettangolo
|
|
|
|
|
Dim nCounter As Integer = 0
|
|
|
|
|
' recupero i lati dal leyer "OutLoop"
|
|
|
|
|
Dim IdSideRettangle As Integer = EgtGetFirstInGroup(m_nIdSelectedOutLoopRettangle)
|
|
|
|
|
While IdSideRettangle <> GDB_ID.NULL And nCounter < 4
|
|
|
|
|
Dim IdSideRectangle As Integer = EgtGetFirstInGroup(m_nIdSelectedOutLoopRectangle)
|
|
|
|
|
While IdSideRectangle <> GDB_ID.NULL And nCounter < 4
|
|
|
|
|
Dim sVal As String = String.Empty
|
|
|
|
|
Dim dPrevAng As Double = 0
|
|
|
|
|
EgtGetInfo(IdSideRettangle, "PrevAng", sVal)
|
|
|
|
|
EgtGetInfo(IdSideRectangle, "PrevAng", sVal)
|
|
|
|
|
StringToDouble(sVal, dPrevAng)
|
|
|
|
|
Dim dNextAng As Double = 0
|
|
|
|
|
EgtGetInfo(IdSideRettangle, "NextAng", sVal)
|
|
|
|
|
EgtGetInfo(IdSideRectangle, "NextAng", sVal)
|
|
|
|
|
StringToDouble(sVal, dNextAng)
|
|
|
|
|
' se gli angoli non sono retti allora esco senza caricare il lato corrente
|
|
|
|
|
If Math.Abs(dPrevAng - 90) > EPS_ANG_SMALL OrElse Math.Abs(dNextAng - 90) > EPS_ANG_SMALL Then
|
|
|
|
|
Exit While
|
|
|
|
|
End If
|
|
|
|
|
IdSideList(nCounter) = IdSideRettangle
|
|
|
|
|
IdSideList(nCounter) = IdSideRectangle
|
|
|
|
|
nCounter += 1
|
|
|
|
|
IdSideRettangle = EgtGetNext(IdSideRettangle)
|
|
|
|
|
IdSideRectangle = EgtGetNext(IdSideRectangle)
|
|
|
|
|
End While
|
|
|
|
|
' verifico che siano solo quattro lati
|
|
|
|
|
If IdSideRettangle = GDB_ID.NULL And nCounter = 4 Then
|
|
|
|
|
If IdSideRectangle = GDB_ID.NULL And nCounter = 4 Then
|
|
|
|
|
' solo se la figura ha 4 lati ortogonali
|
|
|
|
|
Return True
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
m_nIdSelectedOutLoopRettangle = GDB_ID.NULL
|
|
|
|
|
m_nIdSelectedOutLoopRectangle = GDB_ID.NULL
|
|
|
|
|
' la figura presenta più/meno di 4 lati
|
|
|
|
|
Return False
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
' recupero le informazioni correnti per sapere se la figura è mdificabile
|
|
|
|
|
Private Function GetRettangleInfoScale(ByRef frFixed As Frame3d, ByRef MaxLen As Double, ByRef MinLen As Double) As Vector3d
|
|
|
|
|
Private Function GetRectangleInfoScale(ByRef frFixed As Frame3d, ByRef MaxLen As Double, ByRef MinLen As Double) As Vector3d
|
|
|
|
|
' determino la direzione del lato selezionato
|
|
|
|
|
Dim vtDirSelectedCurv As New Vector3d
|
|
|
|
|
EgtStartVector(m_nIdSelectedCurvRettangle, GDB_ID.ROOT, vtDirSelectedCurv)
|
|
|
|
|
EgtStartVector(m_nIdSelectedCurvRectangle, GDB_ID.ROOT, vtDirSelectedCurv)
|
|
|
|
|
|
|
|
|
|
' recupero il lato successivo a quello selezionato
|
|
|
|
|
Dim Index As Integer = 0
|
|
|
|
|
Dim Len As Double = 0
|
|
|
|
|
For Ind As Integer = 0 To 3
|
|
|
|
|
If m_SideListRettangle(Ind) = m_nIdSelectedCurvRettangle Then
|
|
|
|
|
If m_SideListRectangle(Ind) = m_nIdSelectedCurvRectangle Then
|
|
|
|
|
' verifico se esiste un lato Precedente altrimenti recupero l'ultimo della lista
|
|
|
|
|
If Ind = 0 Then
|
|
|
|
|
Index = 3
|
|
|
|
@@ -709,8 +731,8 @@ Public Class NestingTabVM
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
' recupero la dimensione del lato
|
|
|
|
|
EgtCurveLength(m_SideListRettangle(Index), MaxLen)
|
|
|
|
|
EgtCurveLength(m_nIdSelectedCurvRettangle, MinLen)
|
|
|
|
|
EgtCurveLength(m_SideListRectangle(Index), MaxLen)
|
|
|
|
|
EgtCurveLength(m_nIdSelectedCurvRectangle, MinLen)
|
|
|
|
|
|
|
|
|
|
' verifico che il lato selezionato sia il maggiore
|
|
|
|
|
If MinLen > MaxLen Then Return Nothing
|
|
|
|
@@ -718,11 +740,11 @@ Public Class NestingTabVM
|
|
|
|
|
' determimo il versore dal lato appena calcolato
|
|
|
|
|
Dim vtDir As New Vector3d
|
|
|
|
|
|
|
|
|
|
EgtStartVector(m_SideListRettangle(Index), GDB_ID.ROOT, vtDir)
|
|
|
|
|
EgtStartVector(m_SideListRectangle(Index), GDB_ID.ROOT, vtDir)
|
|
|
|
|
vtDir.Normalize()
|
|
|
|
|
Dim dProjectionBaseX As Double = vtDir * Vector3d.X_AX
|
|
|
|
|
Dim ptFixed As New Point3d
|
|
|
|
|
EgtStartPoint(m_SideListRettangle(Index), GDB_ID.ROOT, ptFixed)
|
|
|
|
|
EgtStartPoint(m_SideListRectangle(Index), GDB_ID.ROOT, ptFixed)
|
|
|
|
|
|
|
|
|
|
Dim vtPerp As New Vector3d(vtDir.x, vtDir.y, vtDir.z)
|
|
|
|
|
vtPerp.Rotate(Vector3d.Z_AX, 90)
|
|
|
|
@@ -735,7 +757,7 @@ Public Class NestingTabVM
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
' funzione chiamata da OnMyMouseMoveScene: gestisce la modifica lungo una dimensione del rettangolo selezionato
|
|
|
|
|
Private Sub OnMyMouseMoveSawRettangle(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
|
|
|
|
Private Sub OnMyMouseMoveSawRectangle(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
|
|
|
|
' Se drag non abilitato o già in esecuzione, esco
|
|
|
|
|
If Not m_bDrag Or m_bDragging Then Return
|
|
|
|
|
' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
|
|
|
|
@@ -753,7 +775,7 @@ Public Class NestingTabVM
|
|
|
|
|
Dim MaxLen As Double = 0
|
|
|
|
|
Dim MinLen As Double = 0
|
|
|
|
|
' recupero info sul rettangolo selezionato
|
|
|
|
|
Dim vtDir As Vector3d = GetRettangleInfoScale(frFixed, MaxLen, MinLen)
|
|
|
|
|
Dim vtDir As Vector3d = GetRectangleInfoScale(frFixed, MaxLen, MinLen)
|
|
|
|
|
If vtDir.Equals(Vector3d.NULL) Then
|
|
|
|
|
Return
|
|
|
|
|
End If
|
|
|
|
@@ -774,34 +796,34 @@ Public Class NestingTabVM
|
|
|
|
|
|
|
|
|
|
' Modifico dimensione figura
|
|
|
|
|
If Math.Abs(dScalefactor) > EPS_SMALL * EPS_SMALL Then
|
|
|
|
|
EgtScale(m_nIdSelectedOutLoopRettangle, frFixed, dScalefactor, 1, 1, GDB_ID.ROOT)
|
|
|
|
|
EgtScale(m_nIdSelectedFlatSurfRettangle, frFixed, dScalefactor, 1, 1, GDB_ID.ROOT)
|
|
|
|
|
EgtScale(m_nIdSelectedOutLoopRectangle, frFixed, dScalefactor, 1, 1, GDB_RT.GLOB)
|
|
|
|
|
EgtScale(m_nIdSelectedFlatSurfRectangle, frFixed, dScalefactor, 1, 1, GDB_RT.GLOB)
|
|
|
|
|
Dim ptCen As Point3d
|
|
|
|
|
EgtCenterPoint(m_nIdSelectedTextRettangle, ptCen)
|
|
|
|
|
EgtModifyText(m_nIdSelectedTextRettangle, m_sTextContent & LenToString(MaxLen + dProjection, 2) & " x " & LenToString(MinLen, 2))
|
|
|
|
|
EgtMove(m_nIdSelectedTextRettangle, vtMove * 0.5, GDB_ID.ROOT)
|
|
|
|
|
If m_nIdSelectedTextTopRettangle <> GDB_ID.NULL Then
|
|
|
|
|
EgtMove(m_nIdSelectedTextTopRettangle, vtMove * 0.5, GDB_ID.ROOT)
|
|
|
|
|
EgtCenterPoint(m_nIdSelectedTextRectangle, ptCen)
|
|
|
|
|
EgtModifyText(m_nIdSelectedTextRectangle, m_sTextContent & LenToString(MaxLen + dProjection, 2) & " x " & LenToString(MinLen, 2))
|
|
|
|
|
EgtMove(m_nIdSelectedTextRectangle, vtMove * 0.5, GDB_RT.GLOB)
|
|
|
|
|
If m_nIdSelectedTextTopRectangle <> GDB_ID.NULL Then
|
|
|
|
|
EgtMove(m_nIdSelectedTextTopRectangle, vtMove * 0.5, GDB_RT.GLOB)
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
' verifico che il il lato maggiore rimanga semore il lato maggiore
|
|
|
|
|
Dim bRettangleCorrect As Boolean = False
|
|
|
|
|
If (MaxLen + dProjection - MinLen) > EPS_SMALL Then bRettangleCorrect = True
|
|
|
|
|
Dim bRectangleCorrect As Boolean = False
|
|
|
|
|
If (MaxLen + dProjection - MinLen) > EPS_SMALL Then bRectangleCorrect = True
|
|
|
|
|
|
|
|
|
|
Dim nWarn As Integer = 0
|
|
|
|
|
ResetAllMachinings(nWarn)
|
|
|
|
|
EnableReferenceRegion(False)
|
|
|
|
|
' se la modifica genera un errore allora ripristino la figura prima della defomrazione
|
|
|
|
|
If Not EgtVerifyPart(EgtGetParent(m_nIdSelectedOutLoopRettangle), True) Or Not bRettangleCorrect Then
|
|
|
|
|
EgtScale(m_nIdSelectedOutLoopRettangle, frFixed, 1 / dScalefactor, 1, 1, GDB_ID.ROOT)
|
|
|
|
|
EgtScale(m_nIdSelectedFlatSurfRettangle, frFixed, 1 / dScalefactor, 1, 1, GDB_ID.ROOT)
|
|
|
|
|
If Not EgtVerifyPart(EgtGetParent(m_nIdSelectedOutLoopRectangle), True) Or Not bRectangleCorrect Then
|
|
|
|
|
EgtScale(m_nIdSelectedOutLoopRectangle, frFixed, 1 / dScalefactor, 1, 1, GDB_RT.GLOB)
|
|
|
|
|
EgtScale(m_nIdSelectedFlatSurfRectangle, frFixed, 1 / dScalefactor, 1, 1, GDB_RT.GLOB)
|
|
|
|
|
Dim ptCen As Point3d
|
|
|
|
|
EgtCenterPoint(m_nIdSelectedTextRettangle, ptCen)
|
|
|
|
|
EgtModifyText(m_nIdSelectedTextRettangle, m_sTextContent & LenToString(MaxLen, 2) & " x " & LenToString(MinLen, 2))
|
|
|
|
|
EgtMove(m_nIdSelectedTextRettangle, -vtMove * 0.5, GDB_ID.ROOT)
|
|
|
|
|
If m_nIdSelectedTextTopRettangle <> GDB_ID.NULL Then
|
|
|
|
|
EgtMove(m_nIdSelectedTextTopRettangle, -vtMove * 0.5, GDB_ID.ROOT)
|
|
|
|
|
EgtCenterPoint(m_nIdSelectedTextRectangle, ptCen)
|
|
|
|
|
EgtModifyText(m_nIdSelectedTextRectangle, m_sTextContent & LenToString(MaxLen, 2) & " x " & LenToString(MinLen, 2))
|
|
|
|
|
EgtMove(m_nIdSelectedTextRectangle, -vtMove * 0.5, GDB_RT.GLOB)
|
|
|
|
|
If m_nIdSelectedTextTopRectangle <> GDB_ID.NULL Then
|
|
|
|
|
EgtMove(m_nIdSelectedTextTopRectangle, -vtMove * 0.5, GDB_RT.GLOB)
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
@@ -813,20 +835,20 @@ Public Class NestingTabVM
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
' funzione chiamata da OnMyMouseUp: gestisce il reset di tutti gli indici in uso
|
|
|
|
|
Public Sub ResetDragRettangleParam()
|
|
|
|
|
Public Sub ResetDragRectangleParam()
|
|
|
|
|
' deseleziono l'elemento corrente
|
|
|
|
|
EgtDeselectObj(m_nIdSelectedSawRettangle)
|
|
|
|
|
EgtDeselectObj(m_nIdSelectedCurvRettangle)
|
|
|
|
|
EgtResetMark(m_nIdSelectedSawRettangle)
|
|
|
|
|
EgtDeselectObj(m_nIdSelectedSawRectangle)
|
|
|
|
|
EgtDeselectObj(m_nIdSelectedCurvRectangle)
|
|
|
|
|
EgtResetMark(m_nIdSelectedSawRectangle)
|
|
|
|
|
' resetto gli indici
|
|
|
|
|
m_nIdSelectedOutLoopRettangle = GDB_ID.NULL
|
|
|
|
|
m_nIdSelectedRegionRettangle = GDB_ID.NULL
|
|
|
|
|
m_nIdSelectedSawRettangle = GDB_ID.NULL
|
|
|
|
|
m_nIdSelectedCurvRettangle = GDB_ID.NULL
|
|
|
|
|
m_nIdSelectedTextRettangle = GDB_ID.NULL
|
|
|
|
|
m_nIdSelectedTextTopRettangle = GDB_ID.NULL
|
|
|
|
|
m_nIdSelectedFlatSurfRettangle = GDB_ID.NULL
|
|
|
|
|
m_SideListRettangle = {GDB_ID.NULL, GDB_ID.NULL, GDB_ID.NULL, GDB_ID.NULL}
|
|
|
|
|
m_nIdSelectedOutLoopRectangle = GDB_ID.NULL
|
|
|
|
|
m_nIdSelectedRegionRectangle = GDB_ID.NULL
|
|
|
|
|
m_nIdSelectedSawRectangle = GDB_ID.NULL
|
|
|
|
|
m_nIdSelectedCurvRectangle = GDB_ID.NULL
|
|
|
|
|
m_nIdSelectedTextRectangle = GDB_ID.NULL
|
|
|
|
|
m_nIdSelectedTextTopRectangle = GDB_ID.NULL
|
|
|
|
|
m_nIdSelectedFlatSurfRectangle = GDB_ID.NULL
|
|
|
|
|
m_SideListRectangle = {GDB_ID.NULL, GDB_ID.NULL, GDB_ID.NULL, GDB_ID.NULL}
|
|
|
|
|
m_sTextContent = String.Empty
|
|
|
|
|
' disattivo il drag
|
|
|
|
|
m_bDrag = False
|
|
|
|
@@ -840,32 +862,338 @@ Public Class NestingTabVM
|
|
|
|
|
|
|
|
|
|
#End Region ' METHODS
|
|
|
|
|
|
|
|
|
|
Private m_bDragRettangle As Boolean
|
|
|
|
|
Public Property bDragRettangle As Boolean
|
|
|
|
|
Private m_bDragRectangle As Boolean
|
|
|
|
|
Public Property bDragRectangle As Boolean
|
|
|
|
|
Get
|
|
|
|
|
Return m_bDragRettangle
|
|
|
|
|
Return m_bDragRectangle
|
|
|
|
|
End Get
|
|
|
|
|
Set(value As Boolean)
|
|
|
|
|
m_bDragRettangle = value
|
|
|
|
|
m_bDragRectangle = value
|
|
|
|
|
m_bSplitCurvWJ = False
|
|
|
|
|
ResetSplitCurvWJParam(True)
|
|
|
|
|
m_bStartCurvWJ = False
|
|
|
|
|
ResetStartCurvWJParam(True)
|
|
|
|
|
NotifyPropertyChanged("bSplitCurvWJ")
|
|
|
|
|
NotifyPropertyChanged("bStartCurvWJ")
|
|
|
|
|
End Set
|
|
|
|
|
End Property
|
|
|
|
|
|
|
|
|
|
Private m_DragRettangle_Visibility As Visibility = Visibility.Collapsed
|
|
|
|
|
Public ReadOnly Property DragRettangle_Visibility As Visibility
|
|
|
|
|
Private m_DragRectangle_Visibility As Visibility = Visibility.Collapsed
|
|
|
|
|
Public ReadOnly Property DragRectangle_Visibility As Visibility
|
|
|
|
|
Get
|
|
|
|
|
Return m_DragRettangle_Visibility
|
|
|
|
|
Return m_DragRectangle_Visibility
|
|
|
|
|
End Get
|
|
|
|
|
End Property
|
|
|
|
|
|
|
|
|
|
Public ReadOnly Property DragRettangle_Cl_Span As Integer
|
|
|
|
|
Get
|
|
|
|
|
If m_DragRettangle_Visibility = Visibility.Visible Then
|
|
|
|
|
Return 1
|
|
|
|
|
#Region "WATERJET SPLIT CURVE"
|
|
|
|
|
|
|
|
|
|
' funzione per la selezione dei lati su cui operare la separazione del tagli waterjet
|
|
|
|
|
Private Sub OnMyMouseDownSceneSplitCurv(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
|
|
|
|
' Si può selezionare solo con il tasto sinistro e se il bottone TEST Attivo
|
|
|
|
|
If e.Button <> Windows.Forms.MouseButtons.Left Or
|
|
|
|
|
Not m_bSplitCurvWJ Then
|
|
|
|
|
Return
|
|
|
|
|
End If
|
|
|
|
|
' Se esiste un elemento selezionato
|
|
|
|
|
EgtResetMark(m_nIdSelectedWaterJet)
|
|
|
|
|
' Verifico se selezionato indicativo di pezzo
|
|
|
|
|
EgtSetObjFilterForSelWin(False, True, False, False, False)
|
|
|
|
|
Dim nSelMy As Integer
|
|
|
|
|
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
|
|
|
|
|
Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
|
|
|
|
|
While nIdMy <> GDB_ID.NULL
|
|
|
|
|
Dim sLayer As String = String.Empty
|
|
|
|
|
' layer di origine
|
|
|
|
|
Dim nIdParent As Integer = EgtGetParent(nIdMy)
|
|
|
|
|
' recupero il nome del Layer
|
|
|
|
|
EgtGetName(nIdParent, sLayer)
|
|
|
|
|
' solo se il nome del layer è quello associato ad un lato esterno allora procedo con l'evidenziazione
|
|
|
|
|
If sLayer = NAME_OUTLOOP Then
|
|
|
|
|
If EgtGetType(nIdMy) = GDB_TY.CRV_ARC OrElse EgtGetType(nIdMy) = GDB_TY.CRV_COMPO OrElse EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then
|
|
|
|
|
If m_nIdSelectedSideWJ <> GDB_ID.NULL Or m_nIdSelectedSideWJ = nIdMy Then
|
|
|
|
|
EgtDeselectObj(m_nIdSelectedSideWJ)
|
|
|
|
|
End If
|
|
|
|
|
' recupero il gruppo della lavorazione associata
|
|
|
|
|
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
|
|
|
|
|
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, "PV")
|
|
|
|
|
' VERIFICA: recupero l'elenco delle Preview di Tipo WaterJet associate a questo Part
|
|
|
|
|
Dim ListGroup As List(Of Integer) = ResearchGropuWJ(nIdParent, nIdPV)
|
|
|
|
|
' se non esiste almeno 1 Preview di tipo WaterJet
|
|
|
|
|
If ListGroup.Count > 0 Then
|
|
|
|
|
m_nIdSelectedSideWJ = nIdMy
|
|
|
|
|
Dim nValInfo As Integer = 1
|
|
|
|
|
If EgtGetInfo(nIdMy, "JoinEntity", nValInfo) Then
|
|
|
|
|
If nValInfo = 1 Then
|
|
|
|
|
' separo il taglio
|
|
|
|
|
EgtSetInfo(nIdMy, "JoinEntity", 0)
|
|
|
|
|
Else
|
|
|
|
|
' unisco il taglio
|
|
|
|
|
EgtSetInfo(nIdMy, "JoinEntity", 1)
|
|
|
|
|
End If
|
|
|
|
|
Else
|
|
|
|
|
' se manca l'info allora il taglio sValInfo = "1" quindi separo il taglio
|
|
|
|
|
EgtSetInfo(nIdMy, "JoinEntity", 0)
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
' Ricalcolo tutte le lavorazioni
|
|
|
|
|
Dim nWarn As Integer = 0
|
|
|
|
|
ResetAllMachinings(nWarn)
|
|
|
|
|
' recupero l'indice del PreView che deve essere acceso per indicare la selezione
|
|
|
|
|
ListGroup = ResearchGropuWJ(nIdParent, nIdPV)
|
|
|
|
|
Dim nIdWJ As Integer = GetPVIdFromIdSide(ListGroup, nIdMy)
|
|
|
|
|
GetCurrentPVFromIdSide(ListGroup, nIdMy, nIdWJ, nIdParent)
|
|
|
|
|
' salvo il valore del PreView evidenziato
|
|
|
|
|
m_nIdSelectedWaterJet = nIdWJ
|
|
|
|
|
EgtSetMark(nIdWJ)
|
|
|
|
|
EgtSelectObj(nIdMy)
|
|
|
|
|
EgtDraw()
|
|
|
|
|
Exit While
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
Return 2
|
|
|
|
|
nIdMy = EgtGetNextObjInSelWin()
|
|
|
|
|
End While
|
|
|
|
|
Return
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
' restituisce l'elenco dei Gruppi Waterjet associati al contorno indicato
|
|
|
|
|
Public Function ResearchGropuWJ(nIdOutLoop As Integer, nIdPV As Integer) As List(Of Integer)
|
|
|
|
|
Dim ListOfGroupPV As New List(Of Integer)
|
|
|
|
|
Dim nIdGroup As Integer = GDB_ID.NULL
|
|
|
|
|
Dim nIdMy As Integer = GDB_ID.NULL
|
|
|
|
|
' recupero il primo lato dall'elenco dei lati della figura
|
|
|
|
|
nIdMy = EgtGetFirstInGroup(nIdOutLoop)
|
|
|
|
|
' altrimenti cerco all'interno del layer OutLoop per ogni lato la lavorazione associata
|
|
|
|
|
While nIdMy <> GDB_ID.NULL
|
|
|
|
|
' verifico se esiste una Preview associata al lato
|
|
|
|
|
nIdGroup = EgtGetFirstNameInGroup(nIdPV, "Waterjet" & nIdMy.ToString & "S")
|
|
|
|
|
If nIdGroup <> GDB_ID.NULL Then
|
|
|
|
|
ListOfGroupPV.Add(nIdGroup)
|
|
|
|
|
End If
|
|
|
|
|
nIdMy = EgtGetNext(nIdMy)
|
|
|
|
|
End While
|
|
|
|
|
Return ListOfGroupPV
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Public Function GetPVIdFromIdSide(ListGroup As List(Of Integer), nIdMy As Integer) As Integer
|
|
|
|
|
Dim IdWaterjetPV As Integer = GDB_ID.NULL
|
|
|
|
|
For Each nIdItem As Integer In ListGroup
|
|
|
|
|
Dim sName As String = String.Empty
|
|
|
|
|
If EgtGetName(nIdItem, sName) Then
|
|
|
|
|
If sName.Contains(nIdMy.ToString) Then
|
|
|
|
|
IdWaterjetPV = nIdItem
|
|
|
|
|
Exit For
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
Next
|
|
|
|
|
Return IdWaterjetPV
|
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
Public Sub GetCurrentPVFromIdSide(ListGroup As List(Of Integer), nIdMy As Integer, ByRef nIdWj As Integer, nIdParent As Integer)
|
|
|
|
|
Dim nObjInGroup As Integer = EgtGetGroupObjs(nIdParent)
|
|
|
|
|
Dim nCount As Integer = 0
|
|
|
|
|
GetNextSideJoint(ListGroup, nIdMy, nIdWj, nCount, nObjInGroup)
|
|
|
|
|
If nIdWj <> GDB_ID.NULL Then Return
|
|
|
|
|
GetPrevSideJoint(ListGroup, nIdMy, nIdWj, nCount, nObjInGroup)
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
' funzione ricorsiva per la ricerca del lato al quale è associata la PreView
|
|
|
|
|
Private Sub GetNextSideJoint(ListGroup As List(Of Integer), nIdMy As Integer, ByRef nIdWj As Integer, ByRef nCount As Integer, nObjInGroup As Integer)
|
|
|
|
|
Dim nValInfo As Integer = 1
|
|
|
|
|
' espressione di controllo per evitare di generare Loop infinito
|
|
|
|
|
If nCount > nObjInGroup Then Return
|
|
|
|
|
If nIdWj = GDB_ID.NULL Then
|
|
|
|
|
Dim nIdWJNext As Integer = EgtGetNext(nIdMy)
|
|
|
|
|
If nIdWJNext = GDB_ID.NULL Then nIdWJNext = EgtGetFirstInGroup(EgtGetParent(nIdMy))
|
|
|
|
|
nCount += 1
|
|
|
|
|
EgtGetInfo(nIdWJNext, "JoinEntity", nValInfo)
|
|
|
|
|
If nValInfo = 1 Then
|
|
|
|
|
nIdWj = GetPVIdFromIdSide(ListGroup, nIdWJNext)
|
|
|
|
|
If nIdWj <> GDB_ID.NULL Then Return
|
|
|
|
|
Else
|
|
|
|
|
Return
|
|
|
|
|
End If
|
|
|
|
|
'nIdWJNext = EgtGetNext(nIdWJNext)
|
|
|
|
|
GetNextSideJoint(ListGroup, nIdWJNext, nIdWj, nCount, nObjInGroup)
|
|
|
|
|
If nIdWj <> GDB_ID.NULL Then Return
|
|
|
|
|
End If
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
' funzione ricorsiva per la ricerca del lato al quale è associata la PreView
|
|
|
|
|
Private Sub GetPrevSideJoint(ListGroup As List(Of Integer), nIdMy As Integer, ByRef nIdWj As Integer, ByRef nCount As Integer, nObjInGroup As Integer)
|
|
|
|
|
Dim nValInfo As Integer = 1
|
|
|
|
|
' espressione di controllo per evitare di generare Loop infinito
|
|
|
|
|
If nCount > nObjInGroup Then Return
|
|
|
|
|
If nIdWj = GDB_ID.NULL Then
|
|
|
|
|
Dim nIdWJPrev As Integer = EgtGetPrev(nIdMy)
|
|
|
|
|
' se arrivato al primo valore allora continuo la ricerca dall'ultimo
|
|
|
|
|
If nIdWJPrev = GDB_ID.NULL Then nIdWJPrev = EgtGetLastInGroup(EgtGetParent(nIdMy))
|
|
|
|
|
nCount += 1
|
|
|
|
|
EgtGetInfo(nIdWJPrev, "JoinEntity", nValInfo)
|
|
|
|
|
If nValInfo = 1 Then
|
|
|
|
|
nIdWj = GetPVIdFromIdSide(ListGroup, nIdWJPrev)
|
|
|
|
|
If nIdWj <> GDB_ID.NULL Then Return
|
|
|
|
|
Else
|
|
|
|
|
Return
|
|
|
|
|
End If
|
|
|
|
|
'nIdWJPrev = EgtGetPrev(nIdWJPrev)
|
|
|
|
|
GetPrevSideJoint(ListGroup, nIdWJPrev, nIdWj, nCount, nObjInGroup)
|
|
|
|
|
If nIdWj <> GDB_ID.NULL Then Return
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Public Sub ResetSplitCurvWJParam(Optional bAllParam As Boolean = True)
|
|
|
|
|
If bAllParam Then
|
|
|
|
|
EgtDeselectObj(m_nIdSelectedSideWJ)
|
|
|
|
|
EgtResetMark(m_nIdSelectedWaterJet)
|
|
|
|
|
End If
|
|
|
|
|
m_nIdSelectedSideWJ = GDB_ID.NULL
|
|
|
|
|
m_nIdSelectedWaterJet = GDB_ID.NULL
|
|
|
|
|
EgtDraw()
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
#End Region ' WaterJet Section and StartPoint
|
|
|
|
|
|
|
|
|
|
Private m_bSplitCurvWJ As Boolean
|
|
|
|
|
Public Property bSplitCurvWJ As Boolean
|
|
|
|
|
Get
|
|
|
|
|
Return m_bSplitCurvWJ
|
|
|
|
|
End Get
|
|
|
|
|
Set(value As Boolean)
|
|
|
|
|
m_bSplitCurvWJ = value
|
|
|
|
|
If Not m_bSplitCurvWJ Then
|
|
|
|
|
' resetto i parametri di selezione dei lati
|
|
|
|
|
ResetSplitCurvWJParam(True)
|
|
|
|
|
End If
|
|
|
|
|
m_bDragRectangle = False
|
|
|
|
|
m_bStartCurvWJ = False
|
|
|
|
|
ResetStartCurvWJParam(True)
|
|
|
|
|
NotifyPropertyChanged("bDragRectangle")
|
|
|
|
|
NotifyPropertyChanged("bStartCurvWJ")
|
|
|
|
|
End Set
|
|
|
|
|
End Property
|
|
|
|
|
|
|
|
|
|
Private m_WJ_Cmd_Visibility As Visibility = Visibility.Collapsed
|
|
|
|
|
Public ReadOnly Property WJ_Cmd_Visibility As Visibility
|
|
|
|
|
Get
|
|
|
|
|
Return m_WJ_Cmd_Visibility
|
|
|
|
|
End Get
|
|
|
|
|
End Property
|
|
|
|
|
|
|
|
|
|
' in funzione della macchinata attiva predispone la visualizzazione del bottone SplitCurv (abilitato solo per WaterJet Machine)
|
|
|
|
|
Public Sub Set_WJ_Cmd_Visibility()
|
|
|
|
|
' gestisco la visualizzazione del comando ON_OFF (per i tagli waterjet)
|
|
|
|
|
If CurrentMachine.WaterJettingActive Then
|
|
|
|
|
m_WJ_Cmd_Visibility = Visibility.Visible
|
|
|
|
|
Else
|
|
|
|
|
m_WJ_Cmd_Visibility = Visibility.Collapsed
|
|
|
|
|
End If
|
|
|
|
|
NotifyPropertyChanged("WJ_Cmd_Visibility")
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
#Region "WATERJET START POINT"
|
|
|
|
|
|
|
|
|
|
' funzione per la selezione del punto di inizio tagli waterjet (percorso chiuso)
|
|
|
|
|
Private Sub OnMyMouseDownSceneStartCurv(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
|
|
|
|
' Si può selezionare solo con il tasto sinistro e se il bottone TEST Attivo
|
|
|
|
|
If e.Button <> Windows.Forms.MouseButtons.Left Or
|
|
|
|
|
Not m_bStartCurvWJ Then
|
|
|
|
|
Return
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
' Acquisisco punto da disegno
|
|
|
|
|
Dim ptStartCurv As New Point3d
|
|
|
|
|
EgtUnProjectPoint(e.Location, ptStartCurv)
|
|
|
|
|
' Aggiusto Z punto acquisito (è in globale)
|
|
|
|
|
Dim ptRawMax As New Point3d
|
|
|
|
|
Dim ptRawMin As New Point3d
|
|
|
|
|
If GetRawBox(ptRawMin, ptRawMax) Then
|
|
|
|
|
ptStartCurv.z = ptRawMax.z
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
' Se esiste un elemento selezionato
|
|
|
|
|
EgtResetMark(m_nIdSelectedWaterJet)
|
|
|
|
|
' Verifico se selezionato indicativo di pezzo
|
|
|
|
|
EgtSetObjFilterForSelWin(False, True, False, False, False)
|
|
|
|
|
Dim nSelMy As Integer
|
|
|
|
|
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
|
|
|
|
|
Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
|
|
|
|
|
While nIdMy <> GDB_ID.NULL
|
|
|
|
|
Dim sLayer As String = String.Empty
|
|
|
|
|
' layer di origine
|
|
|
|
|
Dim nIdParent As Integer = EgtGetParent(nIdMy)
|
|
|
|
|
' recupero il nome del Layer
|
|
|
|
|
EgtGetName(nIdParent, sLayer)
|
|
|
|
|
' solo se il nome del layer è quello associato ad un lato esterno allora procedo con l'evidenziazione
|
|
|
|
|
If sLayer = NAME_OUTLOOP Then
|
|
|
|
|
If EgtGetType(nIdMy) = GDB_TY.CRV_ARC OrElse EgtGetType(nIdMy) = GDB_TY.CRV_COMPO OrElse EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then
|
|
|
|
|
' verifico che il contorno sia chiuso, altrimenti esco
|
|
|
|
|
If Not VerifyOutLoopIsClosed(nIdParent) Then
|
|
|
|
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Il contorno non è chiuso (0)", MSG_TYPE.WARNING)
|
|
|
|
|
Exit While
|
|
|
|
|
End If
|
|
|
|
|
' recupero il gruppo della lavorazione associata
|
|
|
|
|
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
|
|
|
|
|
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, "PV")
|
|
|
|
|
' VERIFICA: recupero l'elenco delle Preview di Tipo WaterJet_n_S associate a questo Part
|
|
|
|
|
Dim ListGroup As List(Of Integer) = ResearchGropuWJ(nIdParent, nIdPV)
|
|
|
|
|
' se non esiste almeno 1 Preview di tipo WaterJet
|
|
|
|
|
If ListGroup.Count <> EgtGetGroupObjs(nIdParent) Then
|
|
|
|
|
EgtSetInfo(nIdParent, "Start", ptStartCurv)
|
|
|
|
|
' Ricalcolo tutte le lavorazioni
|
|
|
|
|
Dim nWarn As Integer = 0
|
|
|
|
|
ResetAllMachinings(nWarn)
|
|
|
|
|
' recupero l'indice del PreView che deve essere acceso per indicare la selezione
|
|
|
|
|
ListGroup = ResearchGropuWJ(nIdParent, nIdPV)
|
|
|
|
|
Dim nIdWJ As Integer = GetPVIdFromIdSide(ListGroup, nIdMy)
|
|
|
|
|
GetCurrentPVFromIdSide(ListGroup, nIdMy, nIdWJ, nIdParent)
|
|
|
|
|
m_nIdSelectedWaterJet = nIdWJ
|
|
|
|
|
EgtSetMark(nIdWJ)
|
|
|
|
|
EgtDraw()
|
|
|
|
|
Exit While
|
|
|
|
|
Else
|
|
|
|
|
OmagOFFICEMap.refStatusBarVM.SetOutputMessage("Il contorno non è chiuso (1)", MSG_TYPE.WARNING)
|
|
|
|
|
Exit While
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
End If
|
|
|
|
|
End If
|
|
|
|
|
nIdMy = EgtGetNextObjInSelWin()
|
|
|
|
|
End While
|
|
|
|
|
Return
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
#End Region
|
|
|
|
|
|
|
|
|
|
Private m_bStartCurvWJ As Boolean
|
|
|
|
|
Public Property bStartCurvWJ As Boolean
|
|
|
|
|
Get
|
|
|
|
|
Return m_bStartCurvWJ
|
|
|
|
|
End Get
|
|
|
|
|
Set(value As Boolean)
|
|
|
|
|
m_bStartCurvWJ = value
|
|
|
|
|
If Not m_bStartCurvWJ Then
|
|
|
|
|
ResetStartCurvWJParam(True)
|
|
|
|
|
End If
|
|
|
|
|
m_bDragRectangle = False
|
|
|
|
|
m_bSplitCurvWJ = False
|
|
|
|
|
ResetSplitCurvWJParam(True)
|
|
|
|
|
NotifyPropertyChanged("bDragRectangle")
|
|
|
|
|
NotifyPropertyChanged("bSplitCurvWJ")
|
|
|
|
|
End Set
|
|
|
|
|
End Property
|
|
|
|
|
|
|
|
|
|
Public Sub ResetStartCurvWJParam(Optional bAllParam As Boolean = True)
|
|
|
|
|
If bAllParam Then
|
|
|
|
|
EgtDeselectObj(m_nIdSelectedSideWJ)
|
|
|
|
|
EgtResetMark(m_nIdSelectedWaterJet)
|
|
|
|
|
End If
|
|
|
|
|
m_nIdSelectedSideWJ = GDB_ID.NULL
|
|
|
|
|
m_nIdSelectedWaterJet = GDB_ID.NULL
|
|
|
|
|
EgtDraw()
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
#Region "COMMANDS"
|
|
|
|
|
|
|
|
|
@@ -1451,6 +1779,10 @@ Public Class NestingTabVM
|
|
|
|
|
EgtSetCurrentContext(OmagOFFICEMap.refSceneHostVM.MainScene.GetCtx())
|
|
|
|
|
' Cancello eventuali messaggi
|
|
|
|
|
OmagOFFICEMap.refStatusBarVM.ClearOutputMessage()
|
|
|
|
|
' cancello tutti i tagli di separazione
|
|
|
|
|
ResetAllSplitCurv()
|
|
|
|
|
' cancello tutti i punti di inizio (Waterjet)
|
|
|
|
|
ResetAllStartCurv()
|
|
|
|
|
' Cancello tutte le lavorazioni
|
|
|
|
|
CamAuto.EraseMachinings(GDB_ID.NULL)
|
|
|
|
|
' Reinserisco tutte le lavorazioni piane
|
|
|
|
@@ -1513,8 +1845,8 @@ Public Class NestingTabVM
|
|
|
|
|
EgtTextGetContent( nTextId, sText)
|
|
|
|
|
Dim nPos As Integer = sText.IndexOf( sCsvName)
|
|
|
|
|
Dim sNewText As String
|
|
|
|
|
If nPos < 0 Then
|
|
|
|
|
sNewText = sNewName & "<br/>" & sText
|
|
|
|
|
If nPos <0 Then
|
|
|
|
|
sNewText= sNewName & "<br/>" & sText
|
|
|
|
|
Else
|
|
|
|
|
sNewText = sText.Remove( nPos, sCsvName.Length()).Insert( nPos, sNewName)
|
|
|
|
|
End If
|
|
|
|
@@ -1537,17 +1869,28 @@ Public Class NestingTabVM
|
|
|
|
|
#Region "EVENTS"
|
|
|
|
|
|
|
|
|
|
Friend Sub OnMouseDownScene(sender As Object, e As Windows.Forms.MouseEventArgs)
|
|
|
|
|
' se in modalità DragRettangle (deformazione delle componenti rettangolari)
|
|
|
|
|
If m_bDragRettangle Then
|
|
|
|
|
OnMyMouseDownSceneSelSideRettangle(sender, e)
|
|
|
|
|
' se in modalità DragRectangle (deformazione delle componenti rettangolari)
|
|
|
|
|
If m_bDragRectangle Then
|
|
|
|
|
OnMyMouseDownSceneSelSideRectangle(sender, e)
|
|
|
|
|
' Dati per drag (abilito il Drag)
|
|
|
|
|
m_locPrev = e.Location
|
|
|
|
|
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev) And m_nIdSelectedCurvRettangle <> GDB_ID.NULL
|
|
|
|
|
m_bDrag = EgtUnProjectPoint(e.Location, m_ptPrev) And m_nIdSelectedCurvRectangle <> GDB_ID.NULL
|
|
|
|
|
m_bDragToStart = m_bDrag
|
|
|
|
|
m_bVerify = m_bDrag AndAlso (Keyboard.Modifiers And ModifierKeys.Shift) > 0
|
|
|
|
|
m_vtTotMove = Vector3d.NULL()
|
|
|
|
|
Return
|
|
|
|
|
End If
|
|
|
|
|
' se in modalità separazione curve WaterJet
|
|
|
|
|
If m_bSplitCurvWJ Then
|
|
|
|
|
OnMyMouseDownSceneSplitCurv(sender, e)
|
|
|
|
|
Return
|
|
|
|
|
End If
|
|
|
|
|
' se in modalità punto inizio curve WaterJet
|
|
|
|
|
If m_bStartCurvWJ Then
|
|
|
|
|
OnMyMouseDownSceneStartCurv(sender, e)
|
|
|
|
|
Return
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
' Per default no drag
|
|
|
|
|
m_bDrag = False
|
|
|
|
|
' Verifico se selezionato indicativo di pezzo
|
|
|
|
@@ -1570,7 +1913,7 @@ Public Class NestingTabVM
|
|
|
|
|
If NameLayer = INFO_COUNTERLY Then
|
|
|
|
|
Dim sText As String = String.Empty
|
|
|
|
|
If EgtTextGetContent(nId, sText) Then
|
|
|
|
|
Dim sItems() As String = sText.Split("#")
|
|
|
|
|
Dim sItems() As String = sText.Split("#"c)
|
|
|
|
|
If sItems.Count > 1 Then
|
|
|
|
|
m_nCurrNubrOfParts = 0
|
|
|
|
|
If StringToInt(sItems(1), m_nCurrNubrOfParts) Then
|
|
|
|
@@ -1611,7 +1954,7 @@ Public Class NestingTabVM
|
|
|
|
|
If Not m_bDrag Or m_bDragging Then Return
|
|
|
|
|
' Se primo movimento di drag, verifico di aver superato la soglia di movimento in pixel
|
|
|
|
|
If m_bDragToStart Then
|
|
|
|
|
If Math.Abs(e.Location.X - m_locPrev.X) < m_nRestRadius And
|
|
|
|
|
If Math.Abs(e.Location.X - m_locPrev.X) <m_nRestRadius And
|
|
|
|
|
Math.Abs(e.Location.Y - m_locPrev.Y) < m_nRestRadius Then
|
|
|
|
|
Return
|
|
|
|
|
End If
|
|
|
|
@@ -1619,8 +1962,8 @@ Public Class NestingTabVM
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
' se devo muovere un lato del rettangolo
|
|
|
|
|
If m_bDragRettangle Then
|
|
|
|
|
OnMyMouseMoveSawRettangle(sender, e)
|
|
|
|
|
If m_bDragRectangle Then
|
|
|
|
|
OnMyMouseMoveSawRectangle(sender, e)
|
|
|
|
|
Return
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
@@ -1725,11 +2068,22 @@ Public Class NestingTabVM
|
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
Friend Sub OnMouseUpScene(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
|
|
|
|
If m_bDragRettangle Then
|
|
|
|
|
If m_bDragRectangle Then
|
|
|
|
|
' deseleziono gli oggeti, resetto le variabili usate, aggiorno il disegno
|
|
|
|
|
ResetDragRettangleParam()
|
|
|
|
|
ResetDragRectangleParam()
|
|
|
|
|
Return
|
|
|
|
|
End If
|
|
|
|
|
' verifico che sia attivo il comando di modifica tagli waterjet
|
|
|
|
|
If m_bSplitCurvWJ Then
|
|
|
|
|
' deseleziono gli oggeti, resetto le variabili usate, aggiorno il disegno
|
|
|
|
|
' ResetSplitCurvWJParam(False)
|
|
|
|
|
Return
|
|
|
|
|
End If
|
|
|
|
|
If m_bStartCurvWJ Then
|
|
|
|
|
' ResetStartCurvWJParam(False)
|
|
|
|
|
Return
|
|
|
|
|
End If
|
|
|
|
|
|
|
|
|
|
' Se eseguito drag
|
|
|
|
|
If Not m_bDragToStart Then
|
|
|
|
|
' Se movimento con sola verifica finale
|
|
|
|
|