891305da21
- correzioni a gestione angolo da colore (non verificava se curva poteva avere angolo di fianco).
1005 lines
39 KiB
VB.net
1005 lines
39 KiB
VB.net
Imports EgtUILib
|
|
|
|
Public Class SideAngleUC
|
|
|
|
|
|
Public Enum ModeOpt As Integer
|
|
SIDEANGLE = 0
|
|
DRIP = 1
|
|
End Enum
|
|
' Variabile che indica se sono in sideangle o drip
|
|
Friend m_Mode As ModeOpt
|
|
|
|
' Riferimento alla MainWindow
|
|
Private m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
|
' Riferimento alla pagina che ha aperto SideAngleUC
|
|
Private m_CallingPage As MainWindow.Pages
|
|
|
|
' Gestione pagine
|
|
Private Const MAX_LINES As Integer = 10
|
|
Private m_nCurrPage As Integer = 1
|
|
Private m_nCount As Integer = 0
|
|
Private m_nShow As Integer = 0
|
|
|
|
' Massimo angolo di lato ammesso
|
|
Private Const STD_MAXSIDEANG As Double = 50.0
|
|
Private Const MAX_MAXSIDEANG As Double = 75.0
|
|
Private m_dMaxSideAng As Double = STD_MAXSIDEANG
|
|
|
|
' Lista di tutte le entità inclinabili presenti nel progetto
|
|
Friend m_SideAngleEntityList As New List(Of SideAngleEntity)
|
|
Friend m_DripEntityList As New List(Of DripEntity)
|
|
Friend m_dDripOffset As Double = 10
|
|
Friend m_dDripOffset2 As Double = 0
|
|
Friend m_dDripDepth As Double = 10
|
|
Friend m_dDripShort As Double = 0
|
|
|
|
Private Sub SideAngleUC_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
|
|
' Imposto riferimenti ad altre pagine
|
|
m_CallingPage = m_MainWindow.m_ActivePage
|
|
|
|
' Leggo da Ini il massimo angolo di fianco ammesso
|
|
m_dMaxSideAng = GetPrivateProfileDouble(S_SIDES, K_MAXSIDEANGLE, STD_MAXSIDEANG, m_MainWindow.GetIniFile())
|
|
If m_dMaxSideAng > MAX_MAXSIDEANG Then m_dMaxSideAng = MAX_MAXSIDEANG
|
|
|
|
' Imposto messaggi
|
|
If m_Mode = ModeOpt.SIDEANGLE Then
|
|
Parameter1TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 10) ' Offset
|
|
Parameter2TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 16) ' Offset2
|
|
Parameter3TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 11) ' Affondamento
|
|
Parameter4TxBl.Text = EgtMsg(MSG_IMPORTPAGEUC + 12) ' Accorciamento
|
|
End If
|
|
|
|
If m_CallingPage = MainWindow.Pages.Draw Then
|
|
' Imposto questa come pagina correntemente visualizzata nella drawpage
|
|
m_MainWindow.m_DrawPageUC.m_ActiveComponentPage = DrawPageUC.Pages.SideAngle
|
|
' Imposto contesto corrente
|
|
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
|
|
ElseIf m_CallingPage = MainWindow.Pages.Import Then
|
|
' Imposto contesto corrente
|
|
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
|
|
End If
|
|
' Inizializzo
|
|
DeleteSideAngle()
|
|
m_nCurrPage = 1
|
|
m_nCount = 0
|
|
m_nShow = 0
|
|
' Inizializzo lati per angoli (ne compilo la lista e aggiungo la scritta nel disegno)
|
|
InitSides()
|
|
' Aggiorno testi nel disegno
|
|
RefreshSideAngleText()
|
|
' Aggiorno check e valori
|
|
RefreshCheckAndValue()
|
|
|
|
' Gestisco visualizzazione dei parametri
|
|
If m_Mode = ModeOpt.SIDEANGLE Then
|
|
For Index As Integer = 1 To MAX_LINES
|
|
GetChBxFromIndex(Index).Visibility = Windows.Visibility.Collapsed
|
|
Next
|
|
Parameter1TxBl.Visibility = Windows.Visibility.Hidden
|
|
Parameter1TxBx.Visibility = Windows.Visibility.Hidden
|
|
Parameter2TxBl.Visibility = Windows.Visibility.Hidden
|
|
Parameter2TxBx.Visibility = Windows.Visibility.Hidden
|
|
Parameter3TxBl.Visibility = Windows.Visibility.Hidden
|
|
Parameter3TxBx.Visibility = Windows.Visibility.Hidden
|
|
Parameter4TxBl.Visibility = Windows.Visibility.Hidden
|
|
Parameter4TxBx.Visibility = Windows.Visibility.Hidden
|
|
Else
|
|
SideAngleBl.Visibility = Windows.Visibility.Collapsed
|
|
HeelBl.Visibility = Windows.Visibility.Collapsed
|
|
For Index As Integer = 1 To MAX_LINES
|
|
GetAngleTxBxFromIndex(Index).Visibility = Windows.Visibility.Collapsed
|
|
GetHeelTxBxFromIndex(Index).Visibility = Windows.Visibility.Collapsed
|
|
Next
|
|
Parameter1TxBl.Visibility = Windows.Visibility.Visible
|
|
Parameter1TxBx.Visibility = Windows.Visibility.Visible
|
|
Parameter2TxBl.Visibility = Windows.Visibility.Visible
|
|
Parameter2TxBx.Visibility = Windows.Visibility.Visible
|
|
Parameter3TxBl.Visibility = Windows.Visibility.Visible
|
|
Parameter3TxBx.Visibility = Windows.Visibility.Visible
|
|
Parameter4TxBl.Visibility = Windows.Visibility.Visible
|
|
Parameter4TxBx.Visibility = Windows.Visibility.Visible
|
|
End If
|
|
|
|
' Gestisco Checkbox e nomi in base al numero di lati inclinabili
|
|
TxBlChBxView()
|
|
|
|
' Aggiorno valori
|
|
If m_Mode = ModeOpt.DRIP Then
|
|
m_dDripOffset = GetPrivateProfileDouble(S_SIDES, K_DRIPOFFSET, 20, m_MainWindow.GetIniFile())
|
|
m_dDripOffset2 = GetPrivateProfileDouble(S_SIDES, K_DRIPOFFSET2, 0, m_MainWindow.GetIniFile())
|
|
m_dDripDepth = GetPrivateProfileDouble(S_SIDES, K_DRIPDEPTH, 10, m_MainWindow.GetIniFile())
|
|
m_dDripShort = GetPrivateProfileDouble(S_SIDES, K_DRIPSHORT, 0, m_MainWindow.GetIniFile())
|
|
Parameter1TxBx.Text = LenToString(m_dDripOffset, 3)
|
|
Parameter2TxBx.Text = LenToString(m_dDripOffset2, 3)
|
|
Parameter3TxBx.Text = LenToString(m_dDripDepth, 3)
|
|
Parameter4TxBx.Text = LenToString(m_dDripShort, 3)
|
|
End If
|
|
|
|
' Aggiorno visualizzazione
|
|
If m_CallingPage = MainWindow.Pages.Draw Then
|
|
EgtZoom(ZM.ALL)
|
|
Else
|
|
EgtDraw()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub TxBlChBxView()
|
|
' Bottoni Prev Next
|
|
If m_nCount <= MAX_LINES Then
|
|
PrevBtn.Visibility = Windows.Visibility.Hidden
|
|
NextBtn.Visibility = Windows.Visibility.Hidden
|
|
Else
|
|
Grid.SetRow(PrevBtn, MAX_LINES - m_nShow)
|
|
PrevBtn.Visibility = Windows.Visibility.Visible
|
|
PrevBtn.IsEnabled = ( m_nCurrPage > 1)
|
|
Grid.SetRow(NextBtn, MAX_LINES - m_nShow)
|
|
NextBtn.Visibility = Windows.Visibility.Visible
|
|
NextBtn.IsEnabled = ( m_nCount > m_nCurrPage * MAX_LINES)
|
|
End If
|
|
' Intestazione per angoli di lato
|
|
If m_Mode = ModeOpt.SIDEANGLE Then
|
|
If m_nCount = 0 Then
|
|
SideAngleBl.Visibility = Windows.Visibility.Hidden
|
|
HeelBl.Visibility = Windows.Visibility.Hidden
|
|
Else
|
|
Grid.SetRow(SideAngleBl, MAX_LINES - m_nShow)
|
|
SideAngleBl.Visibility = Windows.Visibility.Visible
|
|
Grid.SetRow(HeelBl, MAX_LINES - m_nShow)
|
|
HeelBl.Visibility = Windows.Visibility.Visible
|
|
End If
|
|
End If
|
|
' Lati visibili
|
|
For nI As Integer = 1 To m_nShow
|
|
Dim Index As Integer = MAX_LINES - m_nShow + nI
|
|
If m_Mode = ModeOpt.SIDEANGLE Then
|
|
GetAngleTxBxFromIndex(Index).Visibility = Windows.Visibility.Visible
|
|
GetHeelTxBxFromIndex(Index).Visibility = Windows.Visibility.Visible
|
|
Else
|
|
GetChBxFromIndex(Index).Visibility = Windows.Visibility.Visible
|
|
End If
|
|
Dim TxBlIndex As Integer = ( m_nCurrPage - 1) * MAX_LINES + nI - 1
|
|
GetTxBlFromIndex(Index).Text = If(m_Mode = ModeOpt.SIDEANGLE,
|
|
m_SideAngleEntityList(TxBlIndex).sEntityName,
|
|
m_DripEntityList(TxBlIndex).sEntityName)
|
|
GetTxBlFromIndex(Index).Visibility = Windows.Visibility.Visible
|
|
Next
|
|
' Lati nascosti
|
|
For Index As Integer = 1 To MAX_LINES - m_nShow
|
|
If m_Mode = ModeOpt.SIDEANGLE Then
|
|
GetAngleTxBxFromIndex(Index).Visibility = Windows.Visibility.Hidden
|
|
GetHeelTxBxFromIndex(Index).Visibility = Windows.Visibility.Hidden
|
|
Else
|
|
GetChBxFromIndex(Index).Visibility = Windows.Visibility.Hidden
|
|
End If
|
|
GetTxBlFromIndex(Index).Visibility = Windows.Visibility.Hidden
|
|
Next
|
|
End Sub
|
|
|
|
Private Function GetChBxFromIndex(Index As Integer) As CheckBox
|
|
Select Case Index
|
|
Case 1
|
|
Return A1
|
|
Case 2
|
|
Return A2
|
|
Case 3
|
|
Return A3
|
|
Case 4
|
|
Return A4
|
|
Case 5
|
|
Return A5
|
|
Case 6
|
|
Return A6
|
|
Case 7
|
|
Return A7
|
|
Case 8
|
|
Return A8
|
|
Case 9
|
|
Return A9
|
|
Case Else
|
|
Return A10
|
|
End Select
|
|
End Function
|
|
|
|
Private Function GetAngleTxBxFromIndex(Index As Integer) As EgtWPFLib.EgtTextBox
|
|
Select Case Index
|
|
Case 1
|
|
Return A1TxBx
|
|
Case 2
|
|
Return A2TxBx
|
|
Case 3
|
|
Return A3TxBx
|
|
Case 4
|
|
Return A4TxBx
|
|
Case 5
|
|
Return A5TxBx
|
|
Case 6
|
|
Return A6TxBx
|
|
Case 7
|
|
Return A7TxBx
|
|
Case 8
|
|
Return A8TxBx
|
|
Case 9
|
|
Return A9TxBx
|
|
Case Else
|
|
Return A10TxBx
|
|
End Select
|
|
End Function
|
|
|
|
Private Function GetHeelTxBxFromIndex(Index As Integer) As EgtWPFLib.EgtTextBox
|
|
Select Case Index
|
|
Case 1
|
|
Return H1TxBx
|
|
Case 2
|
|
Return H2TxBx
|
|
Case 3
|
|
Return H3TxBx
|
|
Case 4
|
|
Return H4TxBx
|
|
Case 5
|
|
Return H5TxBx
|
|
Case 6
|
|
Return H6TxBx
|
|
Case 7
|
|
Return H7TxBx
|
|
Case 8
|
|
Return H8TxBx
|
|
Case 9
|
|
Return H9TxBx
|
|
Case Else
|
|
Return H10TxBx
|
|
End Select
|
|
End Function
|
|
|
|
Private Function GetTxBlFromIndex(Index As Integer) As TextBlock
|
|
Select Case Index
|
|
Case 1
|
|
Return Entity1
|
|
Case 2
|
|
Return Entity2
|
|
Case 3
|
|
Return Entity3
|
|
Case 4
|
|
Return Entity4
|
|
Case 5
|
|
Return Entity5
|
|
Case 6
|
|
Return Entity6
|
|
Case 7
|
|
Return Entity7
|
|
Case 8
|
|
Return Entity8
|
|
Case 9
|
|
Return Entity9
|
|
Case Else
|
|
Return Entity10
|
|
End Select
|
|
End Function
|
|
|
|
Private Sub SideAngleUC_Unloaded(sender As Object, e As RoutedEventArgs) Handles Me.Unloaded
|
|
If m_CallingPage = MainWindow.Pages.Draw Then
|
|
' Ricavo nome pezzo
|
|
Dim PartId As Integer = EgtGetFirstInGroup(GDB_ID.ROOT)
|
|
' Svuoto layer in cui sono presenti i testi con le inclinazioni dei lati
|
|
If m_Mode = ModeOpt.SIDEANGLE Then
|
|
EgtEmptyGroup(EgtGetFirstNameInGroup(PartId, SIDE_ANGLE_LAYER))
|
|
Else
|
|
EgtEmptyGroup(EgtGetFirstNameInGroup(PartId, SIDE_ANGLE_LAYER))
|
|
End If
|
|
ElseIf m_CallingPage = MainWindow.Pages.Import Then
|
|
' Nessuna azione necessaria
|
|
End If
|
|
|
|
If m_Mode = ModeOpt.DRIP Then
|
|
WritePrivateProfileString(S_SIDES, K_DRIPOFFSET, DoubleToString(m_dDripOffset, 3), m_MainWindow.GetIniFile())
|
|
WritePrivateProfileString(S_SIDES, K_DRIPOFFSET2, DoubleToString(m_dDripOffset2, 3), m_MainWindow.GetIniFile())
|
|
WritePrivateProfileString(S_SIDES, K_DRIPDEPTH, DoubleToString(m_dDripDepth, 3), m_MainWindow.GetIniFile())
|
|
WritePrivateProfileString(S_SIDES, K_DRIPSHORT, DoubleToString(m_dDripShort, 3), m_MainWindow.GetIniFile())
|
|
End If
|
|
|
|
EgtDraw()
|
|
End Sub
|
|
|
|
Private Sub InitSides()
|
|
Dim PartId As Integer = GDB_ID.NULL
|
|
Dim LoopId As Integer = GDB_ID.NULL
|
|
If m_CallingPage = MainWindow.Pages.Draw Then
|
|
' Imposto contesto corrente
|
|
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
|
|
' Ricavo nome primo pezzo e lo sistemo
|
|
PartId = If(m_MainWindow.m_DrawPageUC.SelectedLayer <> GDB_ID.NULL, EgtGetFirstPart(), GDB_ID.NULL)
|
|
' Recupero nome layer con geometria di contorno (esterno o interno) del pezzo
|
|
LoopId = m_MainWindow.m_DrawPageUC.SelectedLayer
|
|
Else
|
|
' Imposto contesto corrente
|
|
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
|
|
' Recupero nome pezzo
|
|
PartId = m_MainWindow.m_ImportPageUC.SelectedPart
|
|
' Recupero nome layer con geometria di contorno (esterno o interno) del pezzo
|
|
LoopId = m_MainWindow.m_ImportPageUC.SelectedLayer
|
|
End If
|
|
|
|
' Calcolo dimensione ingombro Loop
|
|
Dim ptMin, ptMax As Point3d
|
|
EgtGetBBoxGlob(LoopId, GDB_BB.STANDARD, ptMin, ptMax)
|
|
Dim dBBoxRad As Double = 0.5 * Point3d.DistXY(ptMin, ptMax)
|
|
' Creo layer per testi se non esiste già
|
|
Dim TextLayer As Integer = EgtGetFirstNameInGroup(PartId, SIDE_ANGLE_LAYER)
|
|
If TextLayer = GDB_ID.NULL And PartId <> GDB_ID.NULL Then
|
|
TextLayer = EgtCreateGroup(PartId)
|
|
EgtSetName(TextLayer, SIDE_ANGLE_LAYER)
|
|
EgtSetColor(TextLayer, New Color3d(0, 0, 0))
|
|
End If
|
|
|
|
Dim PrevLine As Integer = EgtGetLastInGroup(LoopId)
|
|
Dim CurrLine As Integer = EgtGetFirstInGroup(LoopId)
|
|
' Creo indice per numerare le entità in ImportPage
|
|
Dim nEntityIndex As Integer = 1
|
|
' Ciclo che verifica se possibile inclinare la linea corrente fino alla penultima
|
|
While CurrLine <> GDB_ID.NULL
|
|
Dim NextLine As Integer = EgtGetNext(CurrLine)
|
|
If NextLine = GDB_ID.NULL Then NextLine = EgtGetFirstInGroup( LoopId)
|
|
If m_Mode = ModeOpt.SIDEANGLE Then
|
|
If SideAngle.VerifyIsSideAnglePossible(PrevLine, CurrLine, NextLine) Then
|
|
' Aggiungo il lato alla lista di quelli inclinabili e ne azzero l'inclinazione
|
|
AddSideAngle(CurrLine, TextLayer, dBBoxRad, nEntityIndex)
|
|
nEntityIndex += 1
|
|
End If
|
|
Else
|
|
If VerifyIsSideDripPossible(PrevLine, CurrLine, NextLine) Then
|
|
' Aggiungo il lato alla lista di quelli su cui è possibile mettere il gocciolatoio
|
|
AddDripSide(CurrLine, TextLayer, dBBoxRad, nEntityIndex)
|
|
nEntityIndex += 1
|
|
End If
|
|
End If
|
|
PrevLine = CurrLine
|
|
CurrLine = EgtGetNext(CurrLine)
|
|
End While
|
|
' Aggiorno numero di lati
|
|
If m_Mode = ModeOpt.SIDEANGLE Then
|
|
m_nCount = m_SideAngleEntityList.Count()
|
|
else
|
|
m_nCount = m_DripEntityList.Count()
|
|
End If
|
|
' Aggiorno numero item visualizzati nella pagina iniziale
|
|
m_nShow = Math.Min( m_nCount, MAX_LINES)
|
|
|
|
' Se non ci sono lati su cui operare, messaggio utente
|
|
If LoopId <> GDB_ID.NULL Then
|
|
If m_nCount = 0 Then
|
|
If m_CallingPage = MainWindow.Pages.Draw Then
|
|
m_MainWindow.m_DrawPageUC.MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 7) ' Non ci sono lati modificabili
|
|
m_MainWindow.m_DrawPageUC.MessageBrd.Background = Application.Current.FindResource("OmagCut_Yellow")
|
|
Else
|
|
m_MainWindow.m_ImportPageUC.MessageTxBx.Text = EgtMsg(MSG_DRAWPAGEUC + 7) ' Non ci sono lati modificabili
|
|
m_MainWindow.m_ImportPageUC.MessageBrd.Background = Application.Current.FindResource("OmagCut_Yellow")
|
|
End If
|
|
Else
|
|
If m_CallingPage = MainWindow.Pages.Draw Then
|
|
m_MainWindow.m_DrawPageUC.MessageTxBx.Text = ""
|
|
m_MainWindow.m_DrawPageUC.MessageBrd.Background = Brushes.Transparent
|
|
Else
|
|
m_MainWindow.m_ImportPageUC.MessageTxBx.Text = ""
|
|
m_MainWindow.m_ImportPageUC.MessageBrd.Background = Brushes.Transparent
|
|
End If
|
|
End If
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub RefreshSideAngleText()
|
|
Dim PartId As Integer = GDB_ID.NULL
|
|
Dim LoopId As Integer = GDB_ID.NULL
|
|
If m_CallingPage = MainWindow.Pages.Draw Then
|
|
' Imposto contesto corrente
|
|
EgtSetCurrentContext(m_MainWindow.m_DrawPageUC.DrawScene.GetCtx())
|
|
' Ricavo nome primo pezzo
|
|
PartId = If(m_MainWindow.m_DrawPageUC.SelectedLayer <> GDB_ID.NULL, EgtGetFirstPart(), GDB_ID.NULL)
|
|
' Recupero nome layer con geometria di contorno (esterno o interno) del pezzo
|
|
LoopId = m_MainWindow.m_DrawPageUC.SelectedLayer
|
|
ElseIf m_CallingPage = MainWindow.Pages.Import Then
|
|
' Imposto contesto corrente
|
|
EgtSetCurrentContext(m_MainWindow.m_ImportPageUC.ImportScene.GetCtx())
|
|
' Recupero nome pezzo
|
|
PartId = m_MainWindow.m_ImportPageUC.SelectedPart
|
|
' Recupero nome layer con geometria di contorno (esterno o interno) del pezzo
|
|
LoopId = m_MainWindow.m_ImportPageUC.SelectedLayer
|
|
End If
|
|
|
|
' Calcolo dimensione ingombro Loop
|
|
Dim ptMin, ptMax As Point3d
|
|
EgtGetBBoxGlob(LoopId, GDB_BB.STANDARD, ptMin, ptMax)
|
|
Dim dBBoxRad As Double = 0.5 * Point3d.DistXY(ptMin, ptMax)
|
|
|
|
' Preparo layer con testi inclinazioni (svuotandolo o creandolo)
|
|
Dim TextLayer As Integer = EgtGetFirstNameInGroup(PartId, SIDE_ANGLE_LAYER)
|
|
If TextLayer <> GDB_ID.NULL Then
|
|
EgtEmptyGroup(TextLayer)
|
|
ElseIf PartId <> GDB_ID.NULL Then
|
|
TextLayer = EgtCreateGroup(PartId)
|
|
EgtSetName(TextLayer, SIDE_ANGLE_LAYER)
|
|
EgtSetColor(TextLayer, New Color3d(0, 0, 0))
|
|
End If
|
|
|
|
' Se modalità angoli di inclinazione...
|
|
If m_Mode = ModeOpt.SIDEANGLE Then
|
|
' Per ogni entità, creo testo con nome e angolo di inclinazione
|
|
For Each Entity In m_SideAngleEntityList
|
|
Dim sText As String = Entity.sEntityName & " = " & DoubleToString(Entity.dSideAngle, 1) & "°"
|
|
If Entity.dSideHeel > 10 * EPS_SMALL Then sText += "; " & LenToString(Entity.dSideHeel, 1)
|
|
SideAngle.AddTextToLine(sText, Entity.nTextId, Entity.nGeomId, 20, dBBoxRad, True)
|
|
Next
|
|
' Altrimenti modalità gocciolatoio
|
|
Else
|
|
' Per ogni entità creo testo con nome
|
|
For Each Entity In m_DripEntityList
|
|
SideAngle.AddTextToLine(Entity.sEntityName, Entity.nTextId, Entity.nGeomId, 20, dBBoxRad, True)
|
|
Next
|
|
' Creo le geometrie dei gocciolatoi
|
|
CreateDripGeom(PartId)
|
|
End If
|
|
' Aggiorno visualizzazione
|
|
EgtDraw()
|
|
End Sub
|
|
|
|
Private Sub RefreshCheckAndValue()
|
|
If m_Mode = ModeOpt.SIDEANGLE Then
|
|
For nIndex = 1 To m_nCount
|
|
Dim Entity As SideAngleEntity = m_SideAngleEntityList(nIndex - 1)
|
|
' Creo testo con angolo di inclinazione e dimensione tallone
|
|
If nIndex < ( m_nCurrPage - 1) * MAX_LINES Or nIndex > m_nCurrPage * MAX_LINES Then Continue For
|
|
Dim nTxBxIndex As Integer = nIndex - ( m_nCurrPage - 1) * MAX_LINES + MAX_LINES - m_nShow
|
|
GetAngleTxBxFromIndex(nTxBxIndex).Text = DoubleToString(Entity.dSideAngle, 1)
|
|
GetHeelTxBxFromIndex(nTxBxIndex).Text = LenToString(Entity.dSideHeel, 1)
|
|
Next
|
|
Else
|
|
For nIndex = 1 To m_nCount
|
|
Dim Entity As DripEntity = m_DripEntityList(nIndex - 1)
|
|
' Imposto check box
|
|
If nIndex < ( m_nCurrPage - 1) * MAX_LINES Or nIndex > m_nCurrPage * MAX_LINES Then Continue For
|
|
Dim nChIndex As Integer = nIndex - ( m_nCurrPage - 1) * MAX_LINES + MAX_LINES - m_nShow
|
|
GetChBxFromIndex(nChIndex).IsChecked = Entity.bHaveDrip
|
|
Next
|
|
End If
|
|
End Sub
|
|
|
|
' Funzione che verifica se alla linea corrente è associabile un canalino
|
|
Private Function VerifyIsSideDripPossible(LastLine As Integer, CurrLine As Integer, NextLine As Integer) As Boolean
|
|
' Verifico se CurrLine è una linea
|
|
If EgtGetType(CurrLine) <> GDB_TY.CRV_LINE Then
|
|
Return False
|
|
End If
|
|
Return True
|
|
End Function
|
|
|
|
' Funzione che gestisce le operazioni sull'entità da inclinare
|
|
Private Sub AddSideAngle(CurrLine As Integer, TextLayer As Integer, dBBoxRad As Double, nEntityIndex As Integer)
|
|
' Imposto nome del lato
|
|
EgtSetName(CurrLine, "A" & nEntityIndex.ToString())
|
|
' Ricavo angolo dell'entità
|
|
Dim dSideAngleVal As Double
|
|
If Not EgtGetInfo(CurrLine, INFO_SIDE_ANGLE, dSideAngleVal) Then dSideAngleVal = 0
|
|
' Ricavo tallone dell'entità
|
|
Dim dSideHeelVal As Double
|
|
If Not EgtGetInfo(CurrLine, INFO_HEEL, dSideHeelVal) Then dSideHeelVal = 0
|
|
' Aggiungo entità all'elenco di quelle inclinabili
|
|
Dim sEntityName As String = String.Empty
|
|
EgtGetName(CurrLine, sEntityName)
|
|
m_SideAngleEntityList.Add(New SideAngleEntity(CurrLine, sEntityName, TextLayer, dSideAngleVal, dSideHeelVal))
|
|
' Creo testo con angolo di inclinazione ed eventuale tallone
|
|
Dim sText As String = sEntityName & " = " & DoubleToString(dSideAngleVal, 1) & "°"
|
|
If dSideHeelVal > 10 * EPS_SMALL Then sText += "; " & LenToString(dSideHeelVal, 1)
|
|
SideAngle.AddTextToLine(sText, TextLayer, CurrLine, 20, dBBoxRad, True)
|
|
End Sub
|
|
|
|
' Funzione che gestisce le operazioni sull'entità con gocciolatoio
|
|
Private Sub AddDripSide(CurrLine As Integer, TextLayer As Integer, dBBoxRad As Double, nEntityIndex As Integer)
|
|
' Imposto nome del lato
|
|
EgtSetName(CurrLine, "A" & nEntityIndex.ToString())
|
|
' Ricavo info dell'entità
|
|
Dim bHaveDripVal As Boolean
|
|
If Not EgtGetInfo(CurrLine, INFO_HAVE_DRIP, bHaveDripVal) Then bHaveDripVal = False
|
|
' Aggiungo entità all'elenco di quelle che possono avere il gocciolatoio
|
|
Dim sEntityName As String = String.Empty
|
|
EgtGetName(CurrLine, sEntityName)
|
|
m_DripEntityList.Add(New DripEntity(CurrLine, sEntityName, TextLayer, bHaveDripVal))
|
|
' Creo testo con nome lato
|
|
SideAngle.AddTextToLine(sEntityName, TextLayer, CurrLine, 20, dBBoxRad, True)
|
|
End Sub
|
|
|
|
' Funzione che crea le geometrie dei gocciolatoi
|
|
Friend Sub CreateDripGeom(nPartId As Integer)
|
|
' Recupero Id layer di contorno esterno
|
|
Dim nOutLoopId = EgtGetFirstNameInGroup(nPartId, NAME_OUTLOOP)
|
|
' Preparo layer con geometria gocciolatoi (svuotandolo o creandolo)
|
|
Dim DripLayer As Integer = EgtGetFirstNameInGroup(nPartId, NAME_DRIPCUT)
|
|
If DripLayer <> GDB_ID.NULL Then
|
|
EgtEmptyGroup(DripLayer)
|
|
Else
|
|
DripLayer = EgtCreateGroup(nPartId)
|
|
EgtSetName(DripLayer, NAME_DRIPCUT)
|
|
End If
|
|
' Per ogni entità con gocciolatoio, ne inserisco una copia nel layer
|
|
Dim vSelId As New List(Of Integer)
|
|
For Each Entity In m_DripEntityList
|
|
If Entity.bHaveDrip Then
|
|
Dim nSouId As Integer = EgtGetFirstNameInGroup(nOutLoopId, Entity.sEntityName)
|
|
Dim nNewId As Integer = EgtCopyGlob(nSouId, DripLayer)
|
|
EgtSetName(nNewId, Entity.sEntityName)
|
|
vSelId.Add(nNewId)
|
|
End If
|
|
Next
|
|
' Eseguo eventuali allungamenti iniziali e finali
|
|
Dim nCrvId As Integer = EgtGetFirstInGroup(DripLayer)
|
|
While nCrvId <> GDB_ID.NULL
|
|
If m_dDripShort < -EPS_SMALL Then
|
|
EgtExtendCurveStartByLen(nCrvId, -m_dDripShort)
|
|
EgtExtendCurveEndByLen(nCrvId, -m_dDripShort)
|
|
End If
|
|
nCrvId = EgtGetNext(nCrvId)
|
|
End While
|
|
' Concateno le curve
|
|
EgtCreateCurveCompoByReorder(DripLayer, vSelId.Count(), vSelId.ToArray(), New Point3d(), True)
|
|
' Eseguo eventuali accorciamenti iniziali e finali
|
|
nCrvId = EgtGetFirstInGroup(DripLayer)
|
|
While nCrvId <> GDB_ID.NULL
|
|
If m_dDripShort > EPS_SMALL AndAlso Not EgtCurveIsClosed(nCrvId) Then
|
|
Dim dLen As Double
|
|
EgtCurveLength(nCrvId, dLen)
|
|
EgtTrimCurveEndAtLen(nCrvId, dLen - m_dDripShort)
|
|
EgtTrimCurveStartAtLen(nCrvId, m_dDripShort)
|
|
End If
|
|
nCrvId = EgtGetNext(nCrvId)
|
|
End While
|
|
' Eseguo offset dei risultati
|
|
nCrvId = EgtGetFirstInGroup(DripLayer)
|
|
While nCrvId <> GDB_ID.NULL
|
|
EgtOffsetCurve(nCrvId, -m_dDripOffset, OFF_TYPE.EXTEND)
|
|
nCrvId = EgtGetNext(nCrvId)
|
|
End While
|
|
' Eventuali curve aggiuntive con offset2
|
|
If m_dDripOffset2 > EPS_SMALL Then
|
|
nCrvId = EgtGetFirstInGroup(DripLayer)
|
|
While nCrvId <> GDB_ID.NULL
|
|
Dim nNextCrvId As Integer = EgtGetNext(nCrvId)
|
|
Dim nNewId As Integer = EgtCopy(nCrvId, nCrvId, GDB_POS.AFTER)
|
|
EgtOffsetCurve(nNewId, -m_dDripOffset2, OFF_TYPE.EXTEND)
|
|
nCrvId = nNextCrvId
|
|
End While
|
|
End If
|
|
' Esplodo nelle curve componenti
|
|
nCrvId = EgtGetFirstInGroup(DripLayer)
|
|
While nCrvId <> GDB_ID.NULL
|
|
Dim nNextCrvId = EgtGetNext(nCrvId)
|
|
Dim nCount As Integer
|
|
EgtExplodeCurveCompo(nCrvId, nCount)
|
|
nCrvId = nNextCrvId
|
|
End While
|
|
' Assegno colore e attributi
|
|
nCrvId = EgtGetFirstInGroup(DripLayer)
|
|
While nCrvId <> GDB_ID.NULL
|
|
EgtSetColor(nCrvId, New Color3d(255, 165, 0))
|
|
EgtSetInfo(nCrvId, INFO_DEPTH, m_dDripDepth)
|
|
If m_dDripShort > EPS_SMALL Then EgtSetInfo(nCrvId, INFO_STRICT, "1")
|
|
nCrvId = EgtGetNext(nCrvId)
|
|
End While
|
|
End Sub
|
|
|
|
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
|
|
If m_nCurrPage = 1 Then Return
|
|
m_nCurrPage -= 1
|
|
m_nShow = Math.Min( m_nCount - ( m_nCurrPage - 1) * MAX_LINES, MAX_LINES)
|
|
TxBlChBxView()
|
|
RefreshCheckAndValue()
|
|
End Sub
|
|
|
|
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
|
|
If m_nCount <= ( m_nCurrPage - 1) * MAX_LINES Then Return
|
|
m_nCurrPage += 1
|
|
m_nShow = Math.Min( m_nCount - ( m_nCurrPage - 1) * MAX_LINES, MAX_LINES)
|
|
TxBlChBxView()
|
|
RefreshCheckAndValue()
|
|
End Sub
|
|
|
|
Private Sub SideCheck_Click(sender As Object, e As RoutedEventArgs) Handles A1.Click, A2.Click, A3.Click, A4.Click, A5.Click, A6.Click, A7.Click, A8.Click, A9.Click, A10.Click
|
|
Dim CurrCheckBox As CheckBox = e.Source
|
|
If m_Mode = ModeOpt.DRIP Then
|
|
' Recupero stato entità
|
|
Dim bVal As Boolean = CurrCheckBox.IsChecked()
|
|
Dim SideIndex As Integer = CInt(CurrCheckBox.Name.Substring(1))
|
|
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso
|
|
Dim nCurrSide As Integer = ( m_nCurrPage - 1) * MAX_LINES + SideIndex - ( MAX_LINES - m_nShow)
|
|
Dim sCurrSide As String = m_DripEntityList(nCurrSide - 1).sEntityName
|
|
' Modifico info gocciolatoi
|
|
ModifyDrip(sCurrSide, bVal)
|
|
' Aggiorno tutti i testi e le geometrie
|
|
RefreshSideAngleText()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub A1TxBx_EgtClosed(sender As Object, e As EventArgs) Handles A1TxBx.EgtClosed
|
|
SetSideAngleFromTxBx(1, A1TxBx)
|
|
End Sub
|
|
|
|
Private Sub H1TxBx_EgtClosed(sender As Object, e As EventArgs) Handles H1TxBx.EgtClosed
|
|
SetSideHeelFromTxBx(1, H1TxBx)
|
|
End Sub
|
|
|
|
Private Sub A2TxBx_EgtClosed(sender As Object, e As EventArgs) Handles A2TxBx.EgtClosed
|
|
SetSideAngleFromTxBx(2, A2TxBx)
|
|
End Sub
|
|
|
|
Private Sub H2TxBx_EgtClosed(sender As Object, e As EventArgs) Handles H2TxBx.EgtClosed
|
|
SetSideHeelFromTxBx(2, H2TxBx)
|
|
End Sub
|
|
|
|
Private Sub A3TxBx_EgtClosed(sender As Object, e As EventArgs) Handles A3TxBx.EgtClosed
|
|
SetSideAngleFromTxBx(3, A3TxBx)
|
|
End Sub
|
|
|
|
Private Sub H3TxBx_EgtClosed(sender As Object, e As EventArgs) Handles H3TxBx.EgtClosed
|
|
SetSideHeelFromTxBx(3, H3TxBx)
|
|
End Sub
|
|
|
|
Private Sub A4TxBx_EgtClosed(sender As Object, e As EventArgs) Handles A4TxBx.EgtClosed
|
|
SetSideAngleFromTxBx(4, A4TxBx)
|
|
End Sub
|
|
|
|
Private Sub H4TxBx_EgtClosed(sender As Object, e As EventArgs) Handles H4TxBx.EgtClosed
|
|
SetSideHeelFromTxBx(4, H4TxBx)
|
|
End Sub
|
|
|
|
Private Sub A5TxBx_EgtClosed(sender As Object, e As EventArgs) Handles A5TxBx.EgtClosed
|
|
SetSideAngleFromTxBx(5, A5TxBx)
|
|
End Sub
|
|
|
|
Private Sub H5TxBx_EgtClosed(sender As Object, e As EventArgs) Handles H5TxBx.EgtClosed
|
|
SetSideHeelFromTxBx(5, H5TxBx)
|
|
End Sub
|
|
|
|
Private Sub A6TxBx_EgtClosed(sender As Object, e As EventArgs) Handles A6TxBx.EgtClosed
|
|
SetSideAngleFromTxBx(6, A6TxBx)
|
|
End Sub
|
|
|
|
Private Sub H6TxBx_EgtClosed(sender As Object, e As EventArgs) Handles H6TxBx.EgtClosed
|
|
SetSideHeelFromTxBx(6, H6TxBx)
|
|
End Sub
|
|
|
|
Private Sub A7TxBx_EgtClosed(sender As Object, e As EventArgs) Handles A7TxBx.EgtClosed
|
|
SetSideAngleFromTxBx(7, A7TxBx)
|
|
End Sub
|
|
|
|
Private Sub H7TxBx_EgtClosed(sender As Object, e As EventArgs) Handles H7TxBx.EgtClosed
|
|
SetSideHeelFromTxBx(7, H7TxBx)
|
|
End Sub
|
|
|
|
Private Sub A8TxBx_EgtClosed(sender As Object, e As EventArgs) Handles A8TxBx.EgtClosed
|
|
SetSideAngleFromTxBx(8, A8TxBx)
|
|
End Sub
|
|
|
|
Private Sub H8TxBx_EgtClosed(sender As Object, e As EventArgs) Handles H8TxBx.EgtClosed
|
|
SetSideHeelFromTxBx(8, H8TxBx)
|
|
End Sub
|
|
|
|
Private Sub A9TxBx_EgtClosed(sender As Object, e As EventArgs) Handles A9TxBx.EgtClosed
|
|
SetSideAngleFromTxBx(9, A9TxBx)
|
|
End Sub
|
|
|
|
Private Sub H9TxBx_EgtClosed(sender As Object, e As EventArgs) Handles H9TxBx.EgtClosed
|
|
SetSideHeelFromTxBx(9, H9TxBx)
|
|
End Sub
|
|
|
|
Private Sub A10TxBx_EgtClosed(sender As Object, e As EventArgs) Handles A10TxBx.EgtClosed
|
|
SetSideAngleFromTxBx(10, A10TxBx)
|
|
End Sub
|
|
|
|
Private Sub H10TxBx_EgtClosed(sender As Object, e As EventArgs) Handles H10TxBx.EgtClosed
|
|
SetSideHeelFromTxBx(10, H10TxBx)
|
|
End Sub
|
|
|
|
Private Sub SetSideAngleFromTxBx(SideIndex As Integer, AngleTxBx As EgtWPFLib.EgtTextBox)
|
|
' Nuovo angolo di inclinazione
|
|
Dim dSideAngle As Double
|
|
StringToDouble(AngleTxBx.Text, dSideAngle)
|
|
' Verifico stia nei limiti
|
|
If dSideAngle < -m_dMaxSideAng Then
|
|
dSideAngle = -m_dMaxSideAng
|
|
AngleTxBx.Text = DoubleToString(dSideAngle, 2)
|
|
ElseIf dSideAngle > m_dMaxSideAng Then
|
|
dSideAngle = m_dMaxSideAng
|
|
AngleTxBx.Text = DoubleToString(dSideAngle, 2)
|
|
End If
|
|
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso
|
|
Dim nCurrSide As Integer = ( m_nCurrPage - 1) * MAX_LINES + SideIndex - ( MAX_LINES - m_nShow)
|
|
Dim sCurrSide As String = m_SideAngleEntityList(nCurrSide - 1).sEntityName
|
|
' Lo modifico nella geometria e nella lista inclinazioni
|
|
ModifySideAngle(sCurrSide, dSideAngle)
|
|
' Aggiorno tutti i testi
|
|
RefreshSideAngleText()
|
|
End Sub
|
|
|
|
Private Sub SetSideHeelFromTxBx(SideIndex As Integer, HeelTxBx As EgtWPFLib.EgtTextBox)
|
|
' Nuovo tallone
|
|
Dim dSideHeel As Double
|
|
StringToLen(HeelTxBx.Text, dSideHeel)
|
|
' Verifico stia nei limiti
|
|
If dSideHeel < 0 Then
|
|
dSideHeel = 0
|
|
HeelTxBx.Text = "0"
|
|
End If
|
|
' Converto nome checkbox in nome elemento tenendo conto della pagina e dello slittamento verso il basso
|
|
Dim nCurrSide As Integer = ( m_nCurrPage - 1) * MAX_LINES + SideIndex - ( MAX_LINES - m_nShow)
|
|
Dim sCurrSide As String = m_SideAngleEntityList(nCurrSide - 1).sEntityName
|
|
' Lo modifico nella geometria e nella lista inclinazioni
|
|
ModifySideHeel(sCurrSide, dSideHeel)
|
|
' Aggiorno tutti i testi
|
|
RefreshSideAngleText()
|
|
End Sub
|
|
|
|
' Funzione che modifica l'eventuale canalino di un lato
|
|
Friend Function ModifyDrip(sEntityName As String, bVal As Boolean) As Boolean
|
|
' Ricavo CurrEntity dal nome
|
|
Dim CurrEntity As DripEntity = DripEntity.FindEntity(sEntityName)
|
|
If IsNothing(CurrEntity) Then
|
|
EgtOutLog("Error in drip definition: selected line not found in DripEntity")
|
|
Return False
|
|
End If
|
|
' Scrivo nuovo angolo nelle info
|
|
If bVal Then
|
|
EgtSetInfo(CurrEntity.nGeomId, INFO_HAVE_DRIP, "1")
|
|
' Cancello inclinazione nell'apposito campo info
|
|
Else
|
|
EgtRemoveInfo(CurrEntity.nGeomId, INFO_HAVE_DRIP)
|
|
End If
|
|
' Aggiorno lista entità con nuova inclinazione
|
|
CurrEntity.bHaveDrip = bVal
|
|
Return True
|
|
End Function
|
|
|
|
' Funzione che modifica l'inclinazione di un lato
|
|
Friend Function ModifySideAngle(sEntityName As String, dSideAngle As Double) As Boolean
|
|
' Ricavo CurrEntity dal nome
|
|
Dim CurrEntity As SideAngleEntity = SideAngleEntity.FindEntity(sEntityName)
|
|
If IsNothing(CurrEntity) Then
|
|
EgtOutLog("Error in side angle definition: selected line not found in SideAngleList")
|
|
Return False
|
|
End If
|
|
' Scrivo nuovo angolo nelle info
|
|
If dSideAngle <> 0 Then
|
|
EgtSetInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE, dSideAngle)
|
|
EgtSetInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE, dSideAngle)
|
|
' Cancello inclinazione nell'apposito campo info
|
|
Else
|
|
EgtRemoveInfo(CurrEntity.nGeomId, INFO_SIDE_ANGLE)
|
|
EgtRemoveInfo(CurrEntity.nGeomId, INFO_ORIG_SIDE_ANGLE)
|
|
End If
|
|
' Aggiorno lista entità con nuova inclinazione
|
|
CurrEntity.dSideAngle = dSideAngle
|
|
Return True
|
|
End Function
|
|
|
|
' Funzione che modifica il tallone di un lato
|
|
Friend Function ModifySideHeel(sEntityName As String, dSideHeel As Double) As Boolean
|
|
' Ricavo CurrEntity dal nome
|
|
Dim CurrEntity As SideAngleEntity = SideAngleEntity.FindEntity(sEntityName)
|
|
If IsNothing(CurrEntity) Then
|
|
EgtOutLog("Error in side angle definition: selected line not found in SideAngleList")
|
|
Return False
|
|
End If
|
|
' Scrivo nuovo tallone nelle info
|
|
If dSideHeel > 10 * EPS_SMALL Then
|
|
EgtSetInfo(CurrEntity.nGeomId, INFO_HEEL, dSideHeel)
|
|
' Cancello inclinazione nell'apposito campo info
|
|
Else
|
|
EgtRemoveInfo(CurrEntity.nGeomId, INFO_HEEL)
|
|
End If
|
|
' Aggiorno lista entità con nuova inclinazione
|
|
CurrEntity.dSideHeel = dSideHeel
|
|
Return True
|
|
End Function
|
|
|
|
Friend Sub DeleteSideAngle()
|
|
' Cancello lista lati inclinati
|
|
If m_Mode = ModeOpt.SIDEANGLE Then
|
|
m_SideAngleEntityList.Clear()
|
|
' Annullo tutti i testi
|
|
For Index As Integer = 1 To MAX_LINES
|
|
GetAngleTxBxFromIndex(Index).Text = String.Empty
|
|
GetHeelTxBxFromIndex(Index).Text = String.Empty
|
|
Next
|
|
Else
|
|
m_DripEntityList.Clear()
|
|
' Annullo tutti i CheckBox
|
|
For Index As Integer = 1 To MAX_LINES
|
|
GetChBxFromIndex(Index).IsChecked = False
|
|
Next
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Parameter1TxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter1TxBx.EgtClosed
|
|
If m_Mode = ModeOpt.DRIP Then
|
|
' Recupero il valore
|
|
StringToDouble(Parameter1TxBx.Text, m_dDripOffset)
|
|
' Creo le geometrie dei gocciolatoi
|
|
RefreshSideAngleText()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Parameter2TxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter2TxBx.EgtClosed
|
|
If m_Mode = ModeOpt.DRIP Then
|
|
' Recupero il valore
|
|
StringToDouble(Parameter2TxBx.Text, m_dDripOffset2)
|
|
' Creo le geometrie dei gocciolatoi
|
|
RefreshSideAngleText()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Parameter3TxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter3TxBx.EgtClosed
|
|
If m_Mode = ModeOpt.DRIP Then
|
|
' Recupero il valore
|
|
StringToDouble(Parameter3TxBx.Text, m_dDripDepth)
|
|
' Creo le geometrie dei gocciolatoi
|
|
RefreshSideAngleText()
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub Parameter4TxBx_EgtClosed(sender As Object, e As EventArgs) Handles Parameter4TxBx.EgtClosed
|
|
If m_Mode = ModeOpt.DRIP Then
|
|
' Recupero il valore
|
|
StringToDouble(Parameter4TxBx.Text, m_dDripShort)
|
|
' Creo le geometrie dei gocciolatoi
|
|
RefreshSideAngleText()
|
|
End If
|
|
End Sub
|
|
|
|
Friend Sub ReLoadSideAnglePage()
|
|
SideAngleUC_Loaded(Me, New RoutedEventArgs)
|
|
End Sub
|
|
|
|
End Class
|
|
|
|
Friend Class SideAngleEntity
|
|
|
|
Private Shared m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
|
|
|
Private m_nGeomId As Integer
|
|
Private m_sEntityName As String
|
|
Private m_nTextId As Integer
|
|
Private m_dSideAngle As Double
|
|
Private m_dSideHeel As Double
|
|
|
|
Public Property nGeomId As Integer
|
|
Get
|
|
Return m_nGeomId
|
|
End Get
|
|
Set(value As Integer)
|
|
m_nGeomId = value
|
|
End Set
|
|
End Property
|
|
|
|
Public ReadOnly Property sEntityName As String
|
|
Get
|
|
Return m_sEntityName
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property nTextId As Integer
|
|
Get
|
|
Return m_nTextId
|
|
End Get
|
|
End Property
|
|
|
|
Public Property dSideAngle As Double
|
|
Get
|
|
Return m_dSideAngle
|
|
End Get
|
|
Set(value As Double)
|
|
m_dSideAngle = value
|
|
End Set
|
|
End Property
|
|
|
|
Public Property dSideHeel As Double
|
|
Get
|
|
Return m_dSideHeel
|
|
End Get
|
|
Set(value As Double)
|
|
m_dSideHeel = value
|
|
End Set
|
|
End Property
|
|
|
|
Sub New(nId As Integer, sEntityName As String, nTextId As Integer, dSideAngle As Double, dSideHeel As Double)
|
|
m_nGeomId = nId
|
|
m_sEntityName = sEntityName
|
|
m_nTextId = nTextId
|
|
m_dSideAngle = dSideAngle
|
|
m_dSideHeel = dSideHeel
|
|
End Sub
|
|
|
|
Friend Shared Function FindEntity(sEntityName As String) As SideAngleEntity
|
|
Dim EntityList As List(Of SideAngleEntity) = Nothing
|
|
If m_MainWindow.m_ActivePage = MainWindow.Pages.Draw Then
|
|
EntityList = m_MainWindow.m_DrawPageUC.m_SideAngleUC.m_SideAngleEntityList
|
|
ElseIf m_MainWindow.m_ActivePage = MainWindow.Pages.Import Then
|
|
EntityList = m_MainWindow.m_ImportPageUC.m_SideAngleUC.m_SideAngleEntityList
|
|
End If
|
|
|
|
If IsNothing(EntityList) Then
|
|
Return Nothing
|
|
End If
|
|
|
|
For Each Entity In EntityList
|
|
If Entity.m_sEntityName = sEntityName Then
|
|
Return Entity
|
|
End If
|
|
Next
|
|
Return Nothing
|
|
End Function
|
|
|
|
End Class
|
|
|
|
Friend Class DripEntity
|
|
|
|
Private Shared m_MainWindow As MainWindow = DirectCast(Application.Current.MainWindow, MainWindow)
|
|
|
|
Private m_nGeomId As Integer
|
|
Private m_sEntityName As String
|
|
Private m_nTextId As Integer
|
|
Private m_bHaveDrip As Boolean
|
|
|
|
Public Property nGeomId As Integer
|
|
Get
|
|
Return m_nGeomId
|
|
End Get
|
|
Set(value As Integer)
|
|
m_nGeomId = value
|
|
End Set
|
|
End Property
|
|
|
|
Public ReadOnly Property sEntityName As String
|
|
Get
|
|
Return m_sEntityName
|
|
End Get
|
|
End Property
|
|
|
|
Public ReadOnly Property nTextId As Integer
|
|
Get
|
|
Return m_nTextId
|
|
End Get
|
|
End Property
|
|
|
|
Public Property bHaveDrip As Boolean
|
|
Get
|
|
Return m_bHaveDrip
|
|
End Get
|
|
Set(value As Boolean)
|
|
m_bHaveDrip = value
|
|
End Set
|
|
End Property
|
|
|
|
Sub New(nId As Integer, sEntityName As String, nTextId As Integer, bHaveDrip As Boolean)
|
|
m_nGeomId = nId
|
|
m_sEntityName = sEntityName
|
|
m_nTextId = nTextId
|
|
m_bHaveDrip = bHaveDrip
|
|
End Sub
|
|
|
|
Friend Shared Function FindEntity(sEntityName As String) As DripEntity
|
|
Dim EntityList As List(Of DripEntity) = Nothing
|
|
If m_MainWindow.m_ActivePage = MainWindow.Pages.Draw Then
|
|
EntityList = m_MainWindow.m_DrawPageUC.m_SideAngleUC.m_DripEntityList
|
|
ElseIf m_MainWindow.m_ActivePage = MainWindow.Pages.Import Then
|
|
EntityList = m_MainWindow.m_ImportPageUC.m_SideAngleUC.m_DripEntityList
|
|
End If
|
|
|
|
If IsNothing(EntityList) Then
|
|
Return Nothing
|
|
End If
|
|
|
|
For Each Entity In EntityList
|
|
If Entity.m_sEntityName = sEntityName Then
|
|
Return Entity
|
|
End If
|
|
Next
|
|
Return Nothing
|
|
End Function
|
|
|
|
End Class |