diff --git a/Constants/ConstEgtStone3D.vb b/Constants/ConstEgtStone3D.vb index e8c418c..4596ccc 100644 --- a/Constants/ConstEgtStone3D.vb +++ b/Constants/ConstEgtStone3D.vb @@ -124,6 +124,12 @@ Sink = 2 End Enum + Public Enum JunctionType As Integer + TrimStart = 0 + TrimEnd = 1 + Angled = 3 + End Enum + ' Constanti ParametricCompo Public Enum ParamType As Integer BOOL = 1 diff --git a/Panel/EditPanelVM.vb b/Panel/EditPanelVM.vb index 3bfe358..0b103f9 100644 --- a/Panel/EditPanelVM.vb +++ b/Panel/EditPanelVM.vb @@ -5,7 +5,7 @@ Public Class EditPanelVM #Region "FIELDS & PROPERTIES" - Private ReadOnly m_MsgList As New List(Of String)({TopBar_Msg_Stg0, TopBar_Msg_Stg1, TopBar_Msg_Stg2}) + Private ReadOnly m_MsgList As New List(Of String)({TopBar_Msg_Stg0, TopBar_Msg_Stg1, TopBar_Msg_Stg2, Msg_Paragraph1, Msg_Paragraph2}) Public ReadOnly Property MsgList As List(Of String) Get Return m_MsgList @@ -40,28 +40,31 @@ Public Class EditPanelVM Return m_nIdPart End Get Set(value As Integer) + If m_nIdPart <> GDB_ID.NULL Then SceneCmd.DeselectAll() m_nIdPart = value - If ParamList.Count > 0 Then UpdatePanelInfoFromPart(m_nIdPart) - AdvanceStage() + Stage = EditPanelStage.InsertNewParam ' devo capire che tipo di pezzo sto modificando ' se non ha info di accoppiamento è una base (piano cucina) ' se ha l'info "Sink" allora è un pezzo di una buca ' se ha info di accoppiamento generico è una paretina - Dim bIsSink As Boolean = False - EgtGetInfo(m_nIdPart, "Sink", bIsSink) - If bIsSink Then - PartType = PartType.Sink - Return + PartType = GetPartType() + If ParamList.Count > 0 Then + Select Case PartType + Case PartType.Panel + UpdatePanelInfoFromPart(m_nIdPart) + Case PartType.Sink + Dim bIsBottom As Boolean = False + EgtGetInfo(m_nIdPart, "Bottom", bIsBottom) + If bIsBottom Then + Dim nParent As Integer = GDB_ID.NULL + EgtGetInfo(m_nIdPart, "Parent", nParent) + UpdatePanelInfoFromPart(nParent) + Else + UpdatePanelInfoFromPart(m_nIdPart) + End If + End Select End If - Dim sPair As String = String.Empty - EgtGetInfo(m_nIdPart, "PairMyRef", sPair) - Dim bIsPanel As Boolean = sPair <> String.Empty - If bIsPanel Then - PartType = PartType.Panel - Return - End If - ' altrimenti è un piano cucina - PartType = PartType.TopKitchen + UpdateParameterListShown() End Set End Property @@ -82,6 +85,16 @@ Public Class EditPanelVM Return EgtMsg(110042) ' Conferma, modifica con altri parametri o annulla End Get End Property + Public ReadOnly Property Msg_Paragraph1 As String + Get + Return EgtMsg(110038) ' Frontalino + End Get + End Property + Public ReadOnly Property Msg_Paragraph2 As String + Get + Return EgtMsg(110039) ' Fondo + End Get + End Property #End Region ' Messages @@ -113,13 +126,54 @@ Public Class EditPanelVM Dim dTh As Double = 10 EgtGetInfo(nIdPart, "Th", dTh) DirectCast(ParamList(3), _TextBoxParam).sValue = dTh.ToString() + Dim nJunctionType As Integer + EgtGetInfo(nIdPart, "JunctionType", nJunctionType) + DirectCast(ParamList(4), _ComboBoxParam).IndexSelParamCmBx = nJunctionType - 1 + End Sub + Private Sub UpdateParameterListShown() + '' dalle info leggo se l'oggetto è una paretina o una buca + If PartType = PartType.TopKitchen Then + 'ParamList(3).nVisibility = Visibility.Collapsed + 'ParamList(4).nVisibility = Visibility.Collapsed + + 'ParamList(5).nVisibility = Visibility.Visible + 'ParamList(6).nVisibility = Visibility.Visible + 'ParamList(7).nVisibility = Visibility.Visible + 'ParamList(8).nVisibility = Visibility.Visible + 'ParamList(9).nVisibility = Visibility.Visible + + ElseIf PartType = PartType.Sink Then + ParamList(1).nVisibility = Visibility.Visible + ParamList(2).nVisibility = Visibility.Visible + ParamList(3).nVisibility = Visibility.Visible + ParamList(4).nVisibility = Visibility.Collapsed + + ParamList(5).nVisibility = Visibility.Visible + ParamList(6).nVisibility = Visibility.Visible + ParamList(7).nVisibility = Visibility.Visible + ParamList(8).nVisibility = Visibility.Visible + + ParamList(9).nVisibility = Visibility.Collapsed + ElseIf PartType = PartType.Panel Then + ParamList(1).nVisibility = Visibility.Collapsed + ParamList(2).nVisibility = Visibility.Visible + ParamList(3).nVisibility = Visibility.Visible + ParamList(4).nVisibility = Visibility.Visible + + ParamList(5).nVisibility = Visibility.Collapsed + ParamList(6).nVisibility = Visibility.Collapsed + ParamList(7).nVisibility = Visibility.Collapsed + ParamList(8).nVisibility = Visibility.Collapsed + + ParamList(9).nVisibility = Visibility.Visible + End If End Sub Public Overrides Sub LoadParamList() AddGenericParam(New _TextBlockParam("Messaggio", MsgList(0), ParamType.STR, Visibility.Visible)) ' sezione paretina - AddGenericParam(New _TextBlockParam("Messaggio", MsgList(1), ParamType.STR, Visibility.Collapsed)) + AddGenericParam(New _TextBlockParam("Messaggio", MsgList(3), ParamType.STR, Visibility.Collapsed)) Dim dH As Double = 200 AddGenericParam(New _TextBoxParam("Altezza", dH, ParamType.LEN, Visibility.Visible)) Dim dTh As Double = 20 @@ -129,54 +183,13 @@ Public Class EditPanelVM AddGenericParam(New _ComboBoxParam("Tipo Giunzione", JunctionTypeList, nJunctionType)) ' sezione fondello - AddGenericParam(New _TextBlockParam("Messaggio", MsgList(2), ParamType.STR, Visibility.Collapsed)) - AddGenericParam(New _TextBoxParam("Altezza", 100, ParamType.LEN, Visibility.Collapsed)) + AddGenericParam(New _TextBlockParam("Messaggio", MsgList(4), ParamType.STR, Visibility.Collapsed)) AddGenericParam(New _TextBoxParam("Spessore", 10, ParamType.LEN, Visibility.Collapsed)) AddGenericParam(New _TextBoxParam("Inclinazione", 0.1, ParamType.DOUB, Visibility.Collapsed)) AddGenericParam(New _TextBoxParam("Diametro foro", 30, ParamType.LEN, Visibility.Collapsed)) ' checkbox AddGenericParam(New _CheckBoxParam("ModificaAdiacenti", "Modifica anche altre paretine dello stesso tipo", Visibility.Visible)) - - '' dalle info leggo se l'oggetto è una paretina o una buca - - 'If DirectCast(sender, _ComboBoxParam).Name = "TipoParetina" Then - ' If DirectCast(Selection, ParamCmBx).Name = "SplitBottom" Then - ' ParamList(3).nVisibility = Visibility.Collapsed - ' ParamList(4).nVisibility = Visibility.Collapsed - - ' ParamList(5).nVisibility = Visibility.Visible - ' ParamList(6).nVisibility = Visibility.Visible - ' ParamList(7).nVisibility = Visibility.Visible - ' ParamList(8).nVisibility = Visibility.Visible - ' ParamList(9).nVisibility = Visibility.Visible - ' Map.refSceneHostVM.m_SelType = GDB_TY.SRF_MESH - ' 'DirectCast(Map.refSceneButtonV.m_PanelUC, SceneUserControlV).Preview.Visibility = Visibility.Visible - ' ElseIf DirectCast(Selection, ParamCmBx).Name = "Tappa Buca" Then - ' ParamList(2).nVisibility = Visibility.Visible - ' ParamList(3).nVisibility = Visibility.Visible - ' ParamList(4).nVisibility = Visibility.Visible - - ' ParamList(5).nVisibility = Visibility.Visible - ' ParamList(6).nVisibility = Visibility.Visible - ' ParamList(7).nVisibility = Visibility.Visible - ' ParamList(8).nVisibility = Visibility.Visible - ' ParamList(9).nVisibility = Visibility.Visible - ' Map.refSceneHostVM.m_SelType = GDB_TY.CRV_LINE - ' Else - ' ParamList(2).nVisibility = Visibility.Collapsed - ' ParamList(3).nVisibility = Visibility.Visible - ' ParamList(4).nVisibility = Visibility.Visible - - ' ParamList(5).nVisibility = Visibility.Collapsed - ' ParamList(6).nVisibility = Visibility.Collapsed - ' ParamList(7).nVisibility = Visibility.Collapsed - ' ParamList(8).nVisibility = Visibility.Collapsed - ' ParamList(9).nVisibility = Visibility.Collapsed - ' Map.refSceneHostVM.m_SelType = GDB_TY.CRV_LINE - ' 'DirectCast(Map.refSceneButtonV.m_PanelUC, SceneUserControlV).Preview.Visibility = Visibility.Hidden - ' End If - 'End If End Sub Public Sub AdvanceStage() @@ -191,14 +204,14 @@ Public Class EditPanelVM ' in base al tipo di pezzo che sto modificando chiamo la funzione corrispondente Select Case PartType Case PartType.Sink - 'EditSplitBottom() + EditSinkWithSplitBottom() Case PartType.Panel - EditPanel() + EditPanel(nIdPart) Case PartType.TopKitchen 'EditTopKitchen() End Select - - + ' aggiorno la lista dei partSolid + SolidManagerM.CreatePartSolid() ' chiudo lo user control Close() End Sub @@ -224,122 +237,22 @@ Public Class EditPanelVM SolidManagerM.ManageUndoRedo() End Sub - Public Sub AddPanel(nId As Integer) - Dim ComboBoxParam As _ComboBoxParam = DirectCast(ParamList(1), _ComboBoxParam) - If ComboBoxParam.SelParamCmBx.Name = "Alzatina" Then - AddSplashTop(nId) - ElseIf ComboBoxParam.SelParamCmBx.Name = "Frontalino" Then - AddWaterfall(nId) - ElseIf ComboBoxParam.SelParamCmBx.Name = "Tappa Buca" Then - AddWaterfallAndBottom(nId) + Public Function GetPartType() + Dim bIsSink As Boolean = False + EgtGetInfo(m_nIdPart, "Sink", bIsSink) + If bIsSink Then + Return PartType.Sink End If - End Sub - - Public Function GetPanelType() - Return DirectCast(ParamList(1), _ComboBoxParam).SelParamCmBx.Name + Dim sPair As String = String.Empty + EgtGetInfo(m_nIdPart, "PairMyRef", sPair) + Dim bIsPanel As Boolean = sPair <> String.Empty + If bIsPanel Then + Return PartType.Panel + End If + ' altrimenti è un piano cucina + Return PartType.TopKitchen End Function - Private Sub AddSplashTop(nId As Integer) - Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId)) - ' setto l'indice del lato e il parent - If EgtLuaSetGlobIntVar("TOOL.nEdgeId", nId) Then AssLog("TOOL.nEdgeId = " & nId.ToString()) - If EgtLuaSetGlobIntVar("TOOL.nParent", nPartId) Then AssLog("TOOL.nParent = " & nPartId.ToString()) - ' setto le variabili per l'alzatina - Dim dAngAlzatina As Double = 90 - If EgtLuaSetGlobNumVar("TOOL.dPairAng", dAngAlzatina) Then AssLog("TOOL.dPairAng = " & dAngAlzatina.ToString()) - Dim nJunctionTypeAlz = 1 - If EgtLuaSetGlobIntVar("TOOL.nJunctionType", nJunctionTypeAlz) Then AssLog("TOOL.nJunctionType = " & nJunctionTypeAlz.ToString()) - Dim bOnLoop As Boolean = False - If EgtLuaSetGlobBoolVar("TOOL.bOnLoop", bOnLoop) Then AssLog("TOOL.bOnLoop = false") - Dim bInsideLoop As Boolean = True - If EgtLuaSetGlobBoolVar("TOOL.bInsideLoop", bInsideLoop) Then AssLog("TOOL.bInsideLoop = true") - ' setto le varibili generiche per il pezzo - Dim dTh As Double = DirectCast(ParamList(4), _TextBoxParam).GetValue() - If EgtLuaSetGlobNumVar("TOOL.dTh", dTh) Then AssLog("TOOL.dTh = " & dTh.ToString()) - Dim dH As Double = DirectCast(ParamList(3), _TextBoxParam).GetValue() - If EgtLuaSetGlobNumVar("TOOL.dH", dH) Then AssLog("TOOL.dH = " & dH.ToString()) - If EgtLuaSetGlobBoolVar("TOOL.bPrev", True) Then AssLog("TOOL.bPrev = true") - If EgtLuaSetGlobBoolVar("TOOL.bNext", True) Then AssLog("TOOL.bNext = true") - ' chiamo la funzione per la creazione - If EgtLuaCallFunction("TOOL.CreateParetinaFull") Then AssLog("TOOL.CreateParetinaFull()") - End Sub - Private Sub AddWaterfall(nId As Integer) - Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId)) - ' setto l'indice del lato e il parent - If EgtLuaSetGlobIntVar("TOOL.nEdgeId", nId) Then AssLog("TOOL.nEdgeId = " & nId.ToString()) - If EgtLuaSetGlobIntVar("TOOL.nParent", nPartId) Then AssLog("TOOL.nParent = " & nPartId.ToString()) - ' setto le variabili per l'alzatina - Dim dAngFrontalino As Double = -90 - If EgtLuaSetGlobNumVar("TOOL.dPairAng", dAngFrontalino) Then AssLog("TOOL.dPairAng = " & dAngFrontalino.ToString()) - Dim nJunctionTypeAlz = 3 - If EgtLuaSetGlobIntVar("TOOL.nJunctionType", nJunctionTypeAlz) Then AssLog("TOOL.nJunctionType = " & nJunctionTypeAlz.ToString()) - Dim bOnLoop As Boolean = True - If EgtLuaSetGlobBoolVar("TOOL.bOnLoop", bOnLoop) Then AssLog("TOOL.bOnLoop = false") - Dim bInsideLoop As Boolean = True - If EgtLuaSetGlobBoolVar("TOOL.bInsideLoop", bInsideLoop) Then AssLog("TOOL.bInsideLoop = true") - ' setto le varibili generiche per il pezzo - Dim dTh As Double = DirectCast(ParamList(4), _TextBoxParam).GetValue() - If EgtLuaSetGlobNumVar("TOOL.dTh", dTh) Then AssLog("TOOL.dTh = " & dTh.ToString()) - Dim dH As Double = DirectCast(ParamList(3), _TextBoxParam).GetValue() - If EgtLuaSetGlobNumVar("TOOL.dH", dH) Then AssLog("TOOL.dH = " & dH.ToString()) - If EgtLuaSetGlobBoolVar("TOOL.bPrev", True) Then AssLog("TOOL.bPrev = true") - If EgtLuaSetGlobBoolVar("TOOL.bNext", True) Then AssLog("TOOL.bNext = true") - ' chiamo la funzione per la creazione - If EgtLuaCallFunction("TOOL.CreateParetinaFull") Then AssLog("TOOL.CreateParetinaFull()") - End Sub - - Private Sub AddSplitBottom(PartList As List(Of Integer)) - If PartList.Count = 0 Then - Close() - Return - End If - Dim lEdgeList As New List(Of Integer) - For Each nPart As Integer In PartList - Dim nOutLay As Integer = EgtGetFirstNameInGroup(nPart, "OutLoop") - Dim nEdge As Integer = EgtGetFirstNameInGroup(nOutLay, "A3") - lEdgeList.Add(nEdge) - Next - - For i As Integer = 1 To lEdgeList.Count - EgtLuaSetGlobIntVar("TOOL.tbIdEdges." & i.ToString(), lEdgeList(i - 1).ToString()) - Next - Dim dTh As Double = DirectCast(ParamList(7), _TextBoxParam).GetValue() - EgtLuaSetGlobNumVar("TOOL.dTh", dTh) - Dim dDiam As Double = DirectCast(ParamList(9), _TextBoxParam).GetValue() - EgtLuaSetGlobNumVar("TOOL.dDiamBore", dDiam) - Dim dAng As Double = DirectCast(ParamList(8), _TextBoxParam).GetValue() - EgtLuaSetGlobNumVar("TOOL.dSlopeAng", dAng) - EgtLuaCallFunction("TOOL.CreateSplitBottom") - End Sub - - Private Sub AddWaterfallAndBottom(nId As Integer) - Dim nInLoopLay As Integer = EgtGetParent(nId) - Dim nEdges As Integer = EgtGetGroupObjs(nInLoopLay) - Dim nEdge As Integer = EgtGetFirstInGroup(nInLoopLay) - While nEdge <> GDB_ID.NULL - AddWaterfall(nEdge) - nEdge = EgtGetNext(nEdge) - End While - ' recupero le info dei part creati come frontalini dalle info del Parent - Dim nParent As Integer = EgtGetParent(nInLoopLay) - ' scopro la posizione ordinale dell'inloop in questione - Dim nIn As Integer = 1 - Dim nInLoop As Integer = EgtGetFirstNameInGroup(nParent, "InLoop") - While nInLoop <> nInLoopLay - nIn += 1 - nInLoop = EgtGetNextName(nInLoop, "InLoop") - End While - Dim WaterFallList As New List(Of Integer) - For i As Integer = 1 To nEdges - Dim sInfoName As String = "A" & i.ToString() & "_I" & nIn.ToString() - Dim sPartName As String = String.Empty - EgtGetInfo(nParent, sInfoName, sPartName) - WaterFallList.Add(EgtGetFirstNameInGroup(GDB_ID.ROOT, sPartName)) - Next - ' ora che ho la lista dei frontalini posso creare lo split bottom - AddSplitBottom(WaterFallList) - End Sub - Private Sub SetVariablesAndRecreate(nEdgeId As Integer) If EgtLuaSetGlobIntVar("TOOL.nEdgeId", nEdgeId) Then AssLog("TOOL.nEdgeId = " & nEdgeId.ToString()) Dim nJunctionType = DirectCast(ParamList(4), _ComboBoxParam).IndexSelParamCmBx + 1 ' in Lua l'enum è 1-based @@ -355,14 +268,14 @@ Public Class EditPanelVM If EgtLuaCallFunction("TOOL.CreateParetinaFull") Then AssLog("TOOL.CreateParetinaFull()") End Sub - Private Sub EditPanel() + Private Sub EditPanel(nId) ' recupero le info salvate nel Part - EgtLuaExecLine("TOOL.FillInfoTableFromPart(" & nIdPart.ToString() & ")") + EgtLuaExecLine("TOOL.FillInfoTableFromPart(" & nId.ToString() & ")") ' recupero l'id dell'edge che ha generato la paretina Dim nParent As Integer = GDB_ID.NULL - EgtGetInfo(nIdPart, "Parent", nParent) + EgtGetInfo(nId, "Parent", nParent) Dim nIn As Integer = 0 - EgtGetInfo(nIdPart, "nInLoop", nIn) + EgtGetInfo(nId, "nInLoop", nIn) Dim sLayName As String = "OutLoop" Dim nLayId As Integer = GDB_ID.NULL If nIn = 0 Then @@ -377,19 +290,19 @@ Public Class EditPanelVM End While End If Dim nEdge As Integer = 0 - EgtGetInfo(nIdPart, "ParentEdge", nEdge) + EgtGetInfo(nId, "ParentEdge", nEdge) Dim sEdgeName As String = "A" & nEdge.ToString() Dim nEdgeId As Integer = EgtGetFirstNameInGroup(nLayId, sEdgeName) ' setto i parametri che ha scelto l'utente SetVariablesAndRecreate(nEdgeId) ' se la checkbox per la modifica delle paretine dello stesso tipo, sullo stesso loop, è checkata allora scorro il loop e continuo a chiamare la ricreazione - If DirectCast(ParamList(10), _CheckBoxParam).IsChecked Then + If DirectCast(ParamList(9), _CheckBoxParam).IsChecked Then ' scorro i next e prev modificando anche le paretine adiacenti con le stesse modifiche ' facendo attenzione a non entrare in un loop Dim sCurrPartName As String = String.Empty - EgtGetName(nIdPart, sCurrPartName) + EgtGetName(nId, sCurrPartName) Dim sNamePrev As String = String.Empty - EgtGetInfo(nIdPart, "Prev", sNamePrev) + EgtGetInfo(nId, "Prev", sNamePrev) Dim nLastPrev As Integer = GDB_ID.NULL While sNamePrev <> String.Empty And sNamePrev <> sCurrPartName Dim nPrev As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, sNamePrev) @@ -404,7 +317,7 @@ Public Class EditPanelVM nLastPrev = nPrev End While Dim sNameNext As String = String.Empty - EgtGetInfo(nIdPart, "Next", sNameNext) + EgtGetInfo(nId, "Next", sNameNext) While sNameNext <> String.Empty Dim nNext As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, sNameNext) ' recupero le info salvate nel Part @@ -420,5 +333,93 @@ Public Class EditPanelVM End If End Sub + Private Function GetNeighbours(nId As Integer) + Dim NeighList As New List(Of Integer) + If nId = GDB_ID.NULL Then Return NeighList + Dim nNextId As Integer = nId + While nNextId <> GDB_ID.NULL + NeighList.Add(nNextId) + Dim sNextName As String = String.Empty + EgtGetInfo(nNextId, "Next", sNextName) + nNextId = EgtGetFirstNameInGroup(GDB_ID.ROOT, sNextName) + If nNextId = nId Then Exit While + End While + + Return NeighList + End Function + + Private Sub EditSinkBottom(PartList As List(Of Integer)) + Dim lEdgeList As New List(Of Integer) + For Each nPart As Integer In PartList + Dim nOutLay As Integer = EgtGetFirstNameInGroup(nPart, "OutLoop") + Dim nEdge As Integer = EgtGetFirstNameInGroup(nOutLay, "A3") + lEdgeList.Add(nEdge) + Next + + For i As Integer = 1 To lEdgeList.Count + EgtLuaSetGlobIntVar("TOOL.tbIdEdges." & i.ToString(), lEdgeList(i - 1).ToString()) + Next + Dim dTh As Double = DirectCast(ParamList(6), _TextBoxParam).GetValue() + EgtLuaSetGlobNumVar("TOOL.dTh", dTh) + Dim dDiam As Double = DirectCast(ParamList(8), _TextBoxParam).GetValue() + EgtLuaSetGlobNumVar("TOOL.dDiamBore", dDiam) + Dim dAng As Double = DirectCast(ParamList(7), _TextBoxParam).GetValue() + EgtLuaSetGlobNumVar("TOOL.dSlopeAng", dAng) + EgtLuaCallFunction("TOOL.CreateSplitBottom") + End Sub + + Private Sub EditSinkWithSplitBottom() + ' risalgo ai frontalini + Dim bBottom As Boolean = False + EgtGetInfo(nIdPart, "Bottom", bBottom) + Dim nWaterfallId As Integer = nIdPart + If bBottom Then + Dim sInfoPartDest As String = String.Empty + EgtGetInfo(nIdPart, "PairToRef", sInfoPartDest) + Dim sInfoPartDestSplit As Array = sInfoPartDest.Split(","c) + Dim sPartDest As String = sInfoPartDestSplit(0) + nWaterfallId = EgtGetFirstNameInGroup(GDB_ID.ROOT, sPartDest) + End If + ' modifico i frontalini + DirectCast(ParamList(9), _CheckBoxParam).IsChecked = True + EditPanel(nWaterfallId) + ' recupero la lista degli id dei frontalini + Dim WaterfallList As List(Of Integer) = GetNeighbours(nWaterfallId) + ' modifico i pezzi dello split bottom + EditSinkBottom(WaterfallList) + End Sub + + Public Sub SelectPartOrPartsToEdit() + If PartType = PartType.Sink Then + Dim bBottom As Boolean = False + EgtGetInfo(nIdPart, "Bottom", bBottom) + Dim BottomList As List(Of Integer) + Dim WaterFallList As List(Of Integer) + If bBottom Then + BottomList = GetNeighbours(nIdPart) + Dim nWaterfallId As Integer = GDB_ID.NULL + EgtGetInfo(nIdPart, "Parent", nWaterfallId) + WaterFallList = GetNeighbours(nWaterfallId) + Else + WaterFallList = GetNeighbours(nIdPart) + Dim sBottomName As String = String.Empty + EgtGetInfo(nIdPart, "A3", sBottomName) + Dim nBottomId As Integer = EgtGetFirstNameInGroup(GDB_ID.ROOT, sBottomName) + BottomList = GetNeighbours(nBottomId) + End If + For Each nPartId In BottomList + Dim PartSolidSel As PartSolidM = GetPartSolid(nPartId) + PartSolidSel.SelectSinglePart() + Next + For Each nPartId In WaterFallList + Dim PartSolidSel As PartSolidM = GetPartSolid(nPartId) + PartSolidSel.SelectSinglePart() + Next + Else + Dim PartSolidSel As PartSolidM = GetPartSolid(nIdPart) + PartSolidSel.SelectSinglePart() + End If + End Sub + #End Region ' Methods End Class diff --git a/Panel/NewPanelVM.vb b/Panel/NewPanelVM.vb index dbe9c86..0dfddda 100644 --- a/Panel/NewPanelVM.vb +++ b/Panel/NewPanelVM.vb @@ -193,7 +193,7 @@ Public Class NewPanelVM ' chiamo la funzione per la creazione If EgtLuaCallFunction("TOOL.CreateParetinaFull") Then AssLog("TOOL.CreateParetinaFull()") End Sub - Private Sub AddWaterfall(nId As Integer) + Private Sub AddWaterfall(nId As Integer, Optional sInfoKey As String = "", Optional bInfoValue As Boolean = False) Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId)) ' setto l'indice del lato e il parent If EgtLuaSetGlobIntVar("TOOL.nEdgeId", nId) Then AssLog("TOOL.nEdgeId = " & nId.ToString()) @@ -214,11 +214,16 @@ Public Class NewPanelVM If EgtLuaSetGlobNumVar("TOOL.dH", dH) Then AssLog("TOOL.dH = " & dH.ToString()) If EgtLuaSetGlobBoolVar("TOOL.bPrev", True) Then AssLog("TOOL.bPrev = true") If EgtLuaSetGlobBoolVar("TOOL.bNext", True) Then AssLog("TOOL.bNext = true") + ' se presente setto l'info addizionale + If sInfoKey <> String.Empty Then + If EgtLuaSetGlobStringVar("TOOL.tbInfo.InfoKey", sInfoKey) Then AssLog("TOOL.InfoKey = " & sInfoKey) + If EgtLuaSetGlobBoolVar("TOOL.tbInfo.InfoValue", bInfoValue) Then AssLog("TOOL.InfoKey = " & (bInfoValue.ToString()).ToLower()) + End If ' chiamo la funzione per la creazione If EgtLuaCallFunction("TOOL.CreateParetinaFull") Then AssLog("TOOL.CreateParetinaFull()") End Sub - Private Sub AddSplitBottom(PartList As List(Of Integer)) + Private Sub AddSplitBottom(PartList As List(Of Integer), Optional sInfoKey As String = "", Optional bInfoValue As Boolean = False) If PartList.Count = 0 Then Close() Return @@ -239,6 +244,11 @@ Public Class NewPanelVM EgtLuaSetGlobNumVar("TOOL.dDiamBore", dDiam) Dim dAng As Double = DirectCast(ParamList(8), _TextBoxParam).GetValue() EgtLuaSetGlobNumVar("TOOL.dSlopeAng", dAng) + ' se presente setto l'info addizionale + If sInfoKey <> String.Empty Then + If EgtLuaSetGlobStringVar("TOOL.tbInfo.InfoKey", sInfoKey) Then AssLog("TOOL.InfoKey = " & sInfoKey) + If EgtLuaSetGlobBoolVar("TOOL.tbInfo.InfoValue", bInfoValue) Then AssLog("TOOL.InfoKey = " & (bInfoValue.ToString()).ToLower()) + End If EgtLuaCallFunction("TOOL.CreateSplitBottom") End Sub @@ -247,7 +257,7 @@ Public Class NewPanelVM Dim nEdges As Integer = EgtGetGroupObjs(nInLoopLay) Dim nEdge As Integer = EgtGetFirstInGroup(nInLoopLay) While nEdge <> GDB_ID.NULL - AddWaterfall(nEdge) + AddWaterfall(nEdge, "Sink", True) nEdge = EgtGetNext(nEdge) End While ' recupero le info dei part creati come frontalini dalle info del Parent @@ -277,7 +287,7 @@ Public Class NewPanelVM WaterFallList.Add(EgtGetFirstNameInGroup(GDB_ID.ROOT, sPartName)) Next ' ora che ho la lista dei frontalini posso creare lo split bottom - AddSplitBottom(WaterFallList) + AddSplitBottom(WaterFallList, "Sink", True) End Sub #End Region ' Methods diff --git a/Panel/PanelManagerM.vb b/Panel/PanelManagerM.vb index ffa8842..8b1825d 100644 --- a/Panel/PanelManagerM.vb +++ b/Panel/PanelManagerM.vb @@ -1,3 +1,4 @@ -Module PanelManagerM +Imports EgtUILib.EgtInterface +Module PanelManagerM End Module diff --git a/SceneHost/MySceneHostVM.vb b/SceneHost/MySceneHostVM.vb index 2db8b38..ea7c9a3 100644 --- a/SceneHost/MySceneHostVM.vb +++ b/SceneHost/MySceneHostVM.vb @@ -989,8 +989,8 @@ Line1: DirectCast(Map.refSceneButtonVM.m_EditPanelUC.DataContext, EditPanelVM).nIdPart = PartSolidId End If - ' selezione semplice - If EgtIsPart(nPartId) Then + ' selezione semplice + If EgtIsPart(nPartId) Then Dim nStat As Integer = GDB_ST.ON_ EgtGetStatus(nPartId, nStat) ' Se già selezionato o posizione oggetto incompatibile con flag posizione selezionati @@ -1097,7 +1097,7 @@ Line1: ' WARNING WARNING WARNING WARNING WARNING WARNING ' questo controllo è stato tolto per poter selezionare gli oggetti importati nel vme e quindi non presenti nel nesting 'If bSelected Then If Map.refSceneButtonVM.IsTgBtnChecked(EGT_EDIT_PANEL) Then - PartSolidIdToSel.SelectSinglePart() + DirectCast(Map.refSceneButtonVM.m_EditPanelUC.DataContext, EditPanelVM).SelectPartOrPartsToEdit() Else PartSolidIdToSel.SelectPart() End If diff --git a/SceneUserControl/SceneUserControlV.xaml b/SceneUserControl/SceneUserControlV.xaml index 9827aec..ed6b055 100644 --- a/SceneUserControl/SceneUserControlV.xaml +++ b/SceneUserControl/SceneUserControlV.xaml @@ -56,6 +56,7 @@ Style="{StaticResource SceneUserControl_TxBl}"/> diff --git a/SceneUserControl/SceneUserControlVM.vb b/SceneUserControl/SceneUserControlVM.vb index 89119d2..826771e 100644 --- a/SceneUserControl/SceneUserControlVM.vb +++ b/SceneUserControl/SceneUserControlVM.vb @@ -358,7 +358,7 @@ Public Class _ComboBoxParam End Set End Property - Private m_IndexSelParamCmBx As Integer + Private m_IndexSelParamCmBx As Integer = 0 Public Property IndexSelParamCmBx As Integer Get Return m_IndexSelParamCmBx