From 402084bd49e425bc9bc08820b6050ed6dbd49fd7 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 22 Nov 2017 07:44:27 +0000 Subject: [PATCH] OmagOFFICE 1.8k2 : - tagli inclinati di colore diverso. --- CompoWindow/CompoWindowVM.vb | 10 ++++++---- EgtStoneLib/ConstMach.vb | 3 +++ EgtStoneLib/CsvM.vb | 4 ++-- EgtStoneLib/SplitAuto.vb | 15 +++++++++++---- My Project/AssemblyInfo.vb | 4 ++-- SideEntityControl/SideEntityControlVM.vb | 23 +++++++++++++---------- 6 files changed, 37 insertions(+), 22 deletions(-) diff --git a/CompoWindow/CompoWindowVM.vb b/CompoWindow/CompoWindowVM.vb index f0a5642..69f23a0 100644 --- a/CompoWindow/CompoWindowVM.vb +++ b/CompoWindow/CompoWindowVM.vb @@ -179,6 +179,7 @@ Public Class CompoWindowVM Else TextLayer = EgtCreateGroup(nId2) EgtSetName(TextLayer, SIDE_ANGLE_LAYER) + EgtSetColor(TextLayer, New Color3d(0, 0, 0)) End If ' Modifico inclinazione lati If Not IsNothing(CompoWindowMap.refCompoParamPageVM.m_SideAngleEntityList) Then @@ -190,7 +191,7 @@ Public Class CompoWindowVM EgtSetInfo(nCurrEntityName, INFO_SIDE_ANGLE, CurrSideAngleEntity.dSideAngle) ' Creo testo con angolo di inclinazione per nesting Dim sText As String = DoubleToString(CurrSideAngleEntity.dSideAngle, 1) & "°" - SideEntityControlVM.AddTextToLine(sText, TextLayer, nCurrEntityName, 10, dBBoxRad, False) + SideEntityControlVM.AddTextToLine(sText, TextLayer, nCurrEntityName, 20, dBBoxRad, False) Else ' Cancello inclinazione nell'apposito campo info EgtRemoveInfo(nCurrEntityName, INFO_SIDE_ANGLE) @@ -220,8 +221,8 @@ Public Class CompoWindowVM If CompoWindowMap.refCompoManagerVM.TopIsChecked Then Dim dDimX As Double = ptMax.x - ptMin.x Dim dDimY As Double = ptMax.y - ptMin.y - Dim dH As Double = Math.Min(0.15 * dDimY, 30) - Dim nText As Integer = EgtCreateTextAdv(nRegId, New Point3d(dDimX / 2, dDimY - dH, 0), 0, "*TOP*", "", 500, False, dH, 1, 0, INS_POS.MC) + Dim dH As Double = Math.Min(0.1 * dDimY, 30) + Dim nText As Integer = EgtCreateTextAdv(nRegId, New Point3d(dDimX / 2, dDimY - 0.6 * dH, 0), 0, "*TOP*", "", 500, False, dH, 1, 0, INS_POS.MC) EgtSetColor(nText, New Color3d()) End If ' Aggiusto per lavorazioni @@ -284,6 +285,7 @@ Public Class CompoWindowVM Else TextLayer = EgtCreateGroup(Pz) EgtSetName(TextLayer, SIDE_ANGLE_LAYER) + EgtSetColor(TextLayer, New Color3d(0, 0, 0)) End If ' Modifico inclinazione lati If Not IsNothing(CompoWindowMap.refCompoParamPageVM.m_SideAngleEntityList) Then @@ -295,7 +297,7 @@ Public Class CompoWindowVM EgtSetInfo(nCurrEntityName, INFO_SIDE_ANGLE, CurrSideAngleEntity.dSideAngle) ' Creo testo con angolo di inclinazione per nesting Dim sText As String = DoubleToString(CurrSideAngleEntity.dSideAngle, 1) & "°" - SideEntityControlVM.AddTextToLine(sText, TextLayer, nCurrEntityName, 10, dBBoxRad, False) + SideEntityControlVM.AddTextToLine(sText, TextLayer, nCurrEntityName, 20, dBBoxRad, False) Else ' Cancello inclinazione nell'apposito campo info EgtRemoveInfo(nCurrEntityName, INFO_SIDE_ANGLE) diff --git a/EgtStoneLib/ConstMach.vb b/EgtStoneLib/ConstMach.vb index a0bba3d..3cd1b3e 100644 --- a/EgtStoneLib/ConstMach.vb +++ b/EgtStoneLib/ConstMach.vb @@ -193,6 +193,9 @@ Module ConstMach Public Function COL_MCH_CUT() As Color3d Return New Color3d(0, 255, 0) End Function + Public Function COL_MCH_CUT_ANG() As Color3d + Return New Color3d(255, 0, 255) + End Function Public Function COL_MCH_FREE() As Color3d Return New Color3d(0, 0, 255) End Function diff --git a/EgtStoneLib/CsvM.vb b/EgtStoneLib/CsvM.vb index 1dd10a9..fa25b03 100644 --- a/EgtStoneLib/CsvM.vb +++ b/EgtStoneLib/CsvM.vb @@ -171,8 +171,8 @@ Module CsvM EgtMove(nRegId, New Vector3d(0, 0, DELTAZ_REG), GDB_RT.GLOB) ' Eventuale testo per indicare il sopra If Not bMaxDimOnX Then - Dim dH As Double = Math.Min(0.15 * dDimY, 30) - Dim nText As Integer = EgtCreateTextAdv(nRegId, New Point3d(dDimX / 2, dDimY - dH, 0), 0, "*TOP*", "", 500, False, dH, 1, 0, INS_POS.MC) + Dim dH As Double = Math.Min(0.1 * dDimY, 30) + Dim nText As Integer = EgtCreateTextAdv(nRegId, New Point3d(dDimX / 2, dDimY - 0.6 * dH, 0), 0, "*TOP*", "", 500, False, dH, 1, 0, INS_POS.MC) EgtSetColor(nText, New Color3d()) End If ' Aggiusto per lavorazioni diff --git a/EgtStoneLib/SplitAuto.vb b/EgtStoneLib/SplitAuto.vb index acafdca..12b9581 100644 --- a/EgtStoneLib/SplitAuto.vb +++ b/EgtStoneLib/SplitAuto.vb @@ -125,15 +125,15 @@ Public Module SplitAuto Dim bEnabled As Boolean = MachSplit.m_bEnabled Dim nInterf As Integer = If(bReset, FMI_TYPE.NONE, MachSplit.m_nInterf) ' Colore della lavorazione principale - ColorSingleMachining(MachSplit.m_nId, MachSplit.m_sLay, bEnabled, nInterf) + ColorSingleMachining(MachSplit.m_nId, MachSplit.m_sLay, MachSplit.m_dSideAng, bEnabled, nInterf) ' Colore delle lavorazioni inglobate For Each nId As Integer In MachSplit.m_vOthId - ColorSingleMachining(nId, MachSplit.m_sLay, bEnabled, nInterf) + ColorSingleMachining(nId, MachSplit.m_sLay, MachSplit.m_dSideAng, bEnabled, nInterf) Next EgtEnableModified() End Sub - Private Sub ColorSingleMachining(nOperId As Integer, sLay As String, bEnabled As Boolean, nInterf As Integer) + Private Sub ColorSingleMachining(nOperId As Integer, sLay As String, dSideAng As Double, bEnabled As Boolean, nInterf As Integer) ' Verifico se è un taglio da sotto Dim bDrip As Boolean = (sLay = NAME_DRIPCUT) ' Recupero il preview della lavorazione @@ -165,7 +165,14 @@ Public Module SplitAuto EgtSetColor(nPocId, If(bFreeEnd, COL_MCH_DISABLED, COL_MCH_DIS_INTERF)) EgtSetColor(nDwnPocId, If(bFreeEnd, COL_MCH_DISABLED, COL_MCH_DIS_INTERF)) Else - Dim colCut As Color3d = If(bDrip, COL_MCH_DRIPCUT, COL_MCH_CUT) + Dim colCut As Color3d + If bDrip Then + colCut = COL_MCH_DRIPCUT() + ElseIf Math.Abs(dSideAng) > EPS_ANG_SMALL Then + colCut = COL_MCH_CUT_ANG() + Else + colCut = COL_MCH_CUT() + End If For Each nId In vCutId EgtSetColor(nId, colCut) Next diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 91128fe..9c02a21 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -69,5 +69,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/SideEntityControl/SideEntityControlVM.vb b/SideEntityControl/SideEntityControlVM.vb index 4aca37a..b10007f 100644 --- a/SideEntityControl/SideEntityControlVM.vb +++ b/SideEntityControl/SideEntityControlVM.vb @@ -269,7 +269,7 @@ Public Class SideEntityControlVM ' If DirectCast(Entity, SideAngleEntity).dSideAngle <> 0 Then ' End If - ' 'AddTextToLine(Entity.sEntityName & " = " & DoubleToString(Entity.dSideAngle, 1) & "°", Entity.nTextId, Entity.nGeomId, 10, dBBoxRad, True) + ' 'AddTextToLine(Entity.sEntityName & " = " & DoubleToString(Entity.dSideAngle, 1) & "°", Entity.nTextId, Entity.nGeomId, 20, dBBoxRad, True) ' Next 'End Sub @@ -297,6 +297,7 @@ Public Class SideEntityControlVM Else TextLayer = EgtCreateGroup(Part1) EgtSetName(TextLayer, SIDE_ANGLE_LAYER) + EgtSetColor(TextLayer, New Color3d(0, 0, 0)) End If ' Se modalità angoli di inclinazione... @@ -304,13 +305,13 @@ Public Class SideEntityControlVM ' Per ogni entità, creo testo con nome e angolo di inclinazione For Each Entity In m_SideEntityList Dim sText As String = Entity.sEntityName & " = " & DoubleToString(DirectCast(Entity, SideAngleEntity).dSideAngle, 1) & "°" - AddTextToLine(sText, Entity.nTextId, Entity.nGeomId, 10, dBBoxRad, True) + 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_SideEntityList - AddTextToLine(Entity.sEntityName, Entity.nTextId, Entity.nGeomId, 10, dBBoxRad, True) + AddTextToLine(Entity.sEntityName, Entity.nTextId, Entity.nGeomId, 20, dBBoxRad, True) Next ' Creo le geometrie dei gocciolatoi CreateDripGeom(Part1) @@ -343,6 +344,7 @@ Public Class SideEntityControlVM If TextLayer = GDB_ID.NULL Then TextLayer = EgtCreateGroup(Part1) EgtSetName(TextLayer, SIDE_ANGLE_LAYER) + EgtSetColor(TextLayer, New Color3d(0, 0, 0)) End If Dim LastLine As Integer = EgtGetLastInGroup(OutLoop) @@ -500,11 +502,11 @@ Public Class SideEntityControlVM ' Cancello inclinazione nell'apposito campo info EgtRemoveInfo(CurrLine, INFO_SIDE_ANGLE) ' Creo testo con angolo di inclinazione 0 - AddTextToLine(sEntityName & " = 0°", TextLayer, CurrLine, 10, dBBoxRad, True) + AddTextToLine(sEntityName & " = 0°", TextLayer, CurrLine, 20, dBBoxRad, True) Else m_SideEntityList.Add(New SideAngleEntity(CurrLine, sEntityName, TextLayer, dSideAngleVal, m_Mode)) ' Creo testo con angolo di inclinazione 0 - AddTextToLine(sEntityName & " = " & DoubleToString(dSideAngleVal, 1) & "°", TextLayer, CurrLine, 10, dBBoxRad, True) + AddTextToLine(sEntityName & " = " & DoubleToString(dSideAngleVal, 1) & "°", TextLayer, CurrLine, 20, dBBoxRad, True) End If End Sub @@ -527,16 +529,16 @@ Public Class SideEntityControlVM ' Cancello gocciolatoio nell'apposito campo info EgtRemoveInfo(CurrLine, INFO_HAVE_DRIP) ' Creo testo entità - AddTextToLine(sEntityName, TextLayer, CurrLine, 10, dBBoxRad, True) + AddTextToLine(sEntityName, TextLayer, CurrLine, 20, dBBoxRad, True) Else m_SideEntityList.Add(New DripEntity(CurrLine, sEntityName, TextLayer, bHaveDripVal, m_Mode)) ' Creo testo con angolo di inclinazione 0 - AddTextToLine(sEntityName, TextLayer, CurrLine, 10, dBBoxRad, True) + AddTextToLine(sEntityName, TextLayer, CurrLine, 20, dBBoxRad, True) End If End Sub ' Funzione che dato un segmento e una distanza, scrive il testo centrato alla sua destra - Friend Shared Sub AddTextToLine(sText As String, TextLayer As Integer, CurrLine As Integer, dDistance As Double, dBBoxRad As Double, bTextExt As Boolean) + Friend Shared Function AddTextToLine(sText As String, TextLayer As Integer, CurrLine As Integer, dDistance As Double, dBBoxRad As Double, bTextExt As Boolean) As Integer ' Calcolo altezza testo Dim dH As Double = 0.075 * dBBoxRad ' Creo testo @@ -598,7 +600,8 @@ Public Class SideEntityControlVM ' Calcolo il centro del testo Dim ptTextMC As Point3d = Point3d.Media(ptLineStart, ptLineEnd) + vtCurrLine * (dDistance + (vtCurrLine * vtptExtptMC)) EgtMove(nText, (ptTextMC - Point3d.ORIG)) - End Sub + Return nText + End Function ' Funzione che crea le geometrie dei gocciolatoi Friend Sub CreateDripGeom(nPartId As Integer) @@ -628,7 +631,7 @@ Public Class SideEntityControlVM Dim nCrvId As Integer = EgtGetFirstInGroup(DripLayer) While nCrvId <> GDB_ID.NULL EgtOffsetCurve(nCrvId, -m_dDripOffset, OFF_TYPE.EXTEND) - EgtSetColor(nCrvId, New Color3d(255, 0, 255)) + EgtSetColor(nCrvId, New Color3d(255, 165, 0)) EgtSetInfo(nCrvId, INFO_DEPTH, m_dDripDepth) If m_dDripShort > EPS_SMALL Then Dim dLen As Double