Merge branch 'ModifyPart' into develop

This commit is contained in:
Emmanuele Sassi
2022-10-27 11:16:06 +02:00
17 changed files with 1087 additions and 15 deletions
+11
View File
@@ -159,6 +159,11 @@
<DependentUpon>MaterialDbV.xaml</DependentUpon>
</Compile>
<Compile Include="MaterialDb\MaterialDbVM.vb" />
<Compile Include="ModifyPartPanel\ModifyPartPanelV.xaml.vb">
<DependentUpon>ModifyPartPanelV.xaml</DependentUpon>
</Compile>
<Compile Include="ModifyPartPanel\ModifyPartPanelVM.vb" />
<Compile Include="ModifyPartPanel\ModifyPartUtility.vb" />
<Compile Include="OptionsWindow\MachineBox.xaml.vb">
<DependentUpon>MachineBox.xaml</DependentUpon>
</Compile>
@@ -257,6 +262,7 @@
</Compile>
<Compile Include="Utility\DisableModifiedMgr.vb" />
<Compile Include="Utility\EgwCrypto.vb" />
<Compile Include="Utility\GeomEntityColors.vb" />
<Compile Include="Utility\LuaExec.vb" />
<Compile Include="Utility\Map.vb" />
<Compile Include="Utility\MyMachine.vb" />
@@ -343,6 +349,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="ModifyPartPanel\ModifyPartPanelV.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="OptionsWindow\MachineBox.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
@@ -623,6 +633,7 @@
<ItemGroup>
<Resource Include="Resources\TopPanel\Edit.png" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
<PropertyGroup>
<PostBuildEvent>IF "$(PlatformName)"=="x64" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\Icarus\IcarusR64.exe
+2 -2
View File
@@ -14,7 +14,7 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border Style="{StaticResource LeftPanelTitle_Border}">
<TextBlock Text="Lista nuovi pezzi"
<TextBlock Text="New part list"
FontWeight="DemiBold"
FontSize="14"/>
</Border>
@@ -70,7 +70,7 @@
</TreeView>
<Border Grid.Row="3"
Style="{StaticResource LeftPanelTitle_Border}">
<TextBlock Text="Lista entità importate"
<TextBlock Text="Imported entity list"
FontWeight="DemiBold"
FontSize="14"/>
</Border>
+20 -4
View File
@@ -224,7 +224,8 @@ Public Class ImportPanelVM
Return
Else
' Creo pezzi e layer necessari
For Each ImportPart In m_ImportPartList
For ImportPartIndex = 0 To m_ImportPartList.Count - 1
Dim ImportPart As ImportPart = m_ImportPartList(ImportPartIndex)
Dim frImportedPart As New Frame3d
EgtGetGroupGlobFrame(m_nImportedPartId, frImportedPart)
Dim nPartId As Integer = EgtCreateGroup(GDB_ID.ROOT, frImportedPart)
@@ -238,6 +239,7 @@ Public Class ImportPanelVM
Dim nShellNumberLayerId As Integer = GDB_ID.NULL
Dim nAuxSolidsLayerId As Integer = GDB_ID.NULL
Dim nMachStartLayerId As Integer = GDB_ID.NULL
Dim nOthersLayerId As Integer = GDB_ID.NULL
For Each ImportLayer In ImportPart.LayerList
Select Case ImportLayer.Type
Case ImportLayer.LayerType.PRINT_SOLID
@@ -322,11 +324,25 @@ Public Class ImportPanelVM
EgtSetColor(GeomEntity.nId, c3LightBlue)
Next
Case ImportLayer.LayerType.OTHERS
Dim nOthersLayerId As Integer = EgtCreateGroup(nPartId)
nOthersLayerId = EgtCreateGroup(nPartId)
EgtSetName(nOthersLayerId, LAY_OTHERS)
For Each GeomEntity In ImportLayer.EntityList
EgtRelocateGlob(GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
Next
If ImportPartIndex = 0 Then
For Each GeomEntity In ImportedEntityList
' se curva
Dim EntityType As GDB_TY = EgtGetType(GeomEntity.nId)
Select Case EntityType
Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
' la trasformo in curva compo
EgtCreateCurveCompo(nOthersLayerId, GeomEntity.nId, True)
Case Else
' altrimenti la sposto solamente
EgtRelocateGlob(GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
End Select
Next
End If
End Select
Next
' aggiungo riferimento
@@ -365,13 +381,13 @@ Public Class ImportPanelVM
End If
EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, PrintSolidEntity.Reference)
' appoggio il pezzo sulla tavola
EgtMove( nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
EgtMove(nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
' lo aggiungo a lista pezzi
Dim sFilePath As String = ""
EgtGetInfo(m_nImportedPartId, FILE_PATH, sFilePath)
EgtSetInfo(nPartId, FILE_PATH, sFilePath)
EgtSetInfo(nPartId, "PartOnTable", 1)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, PrintSolidEntity.nId, nOriginalPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, sFilePath)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, PrintSolidEntity.nId, nOriginalPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Map.refTopPanelVM.PartList.Add(NewPart)
Next
End If
+1 -1
View File
@@ -36,7 +36,7 @@
<Button Height="100"/>
</TabItem>
<TabItem Header="MODIFYPART">
<PrintApp:ImportPanelV DataContext="{StaticResource ImportPanelVM}"/>
<PrintApp:ModifyPartPanelV DataContext="{StaticResource ModifyPartPanelVM}"/>
</TabItem>
</TabControl>
+2
View File
@@ -54,6 +54,8 @@ Public Class LeftPanelVM
Map.refRibPanelVM.Init()
Case Panels.SHELLNUMBER
Map.refShellNumberPanelVM.Init()
Case Panels.MODIFYPART
Map.refModifyPartPanelVM.Init()
End Select
Map.refViewLayerManagerVM.UpdateForced()
NotifyPropertyChanged(NameOf(SelPanel))
@@ -0,0 +1,120 @@
<UserControl x:Class="ModifyPartPanelV"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Icarus"
Width="150"
Margin="5,0,0,0">
<Grid DockPanel.Dock="Left">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border Style="{StaticResource LeftPanelTitle_Border}">
<TextBlock Text="Part entity list"
FontWeight="DemiBold"
FontSize="14"/>
</Border>
<!--<DockPanel Grid.Row="1">
<Button DockPanel.Dock="Left"
Content="+"
FontSize="20"
Command="{Binding AddPart_Command}"
Style="{StaticResource LeftPanel_Button}"/>
<Button DockPanel.Dock="Left"
Content="-"
FontSize="20"
Command="{Binding RemovePart_Command}"
Style="{StaticResource LeftPanel_Button}"/>
<Button Content="Reference"
Command="{Binding SetReference_Command}"
Style="{StaticResource LeftPanel_TextButton}"/>
</DockPanel>-->
<TreeView Grid.Row="2"
ItemsSource="{Binding ModifyPartList}"
MinHeight="300">
<TreeView.Resources>
<HierarchicalDataTemplate DataType="{x:Type local:ModifyPart}"
ItemsSource="{Binding LayerList}">
<StackPanel Orientation="Horizontal">
<Image Source="/Resources/TreeView/Folder.png"
Height="15"/>
<TextBlock Text="{Binding ghName}" />
</StackPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:ModifyLayer}"
ItemsSource="{Binding EntityList, UpdateSourceTrigger=PropertyChanged}">
<StackPanel Orientation="Horizontal">
<Image Source="/Resources/TreeView/Folder.png"
Height="15"/>
<TextBlock Text="{Binding sName}" />
</StackPanel>
</HierarchicalDataTemplate>
<HierarchicalDataTemplate DataType="{x:Type local:ModifyEntity}">
<StackPanel Orientation="Horizontal">
<!--<Image Source="/WpfTutorialSamples;component/Images/user.png" Margin="0,0,5,0" />-->
<TextBlock Text="{Binding ghName}" />
<TextBlock Text="{Binding ghReference, UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel>
</HierarchicalDataTemplate>
<!-- Menu' tasto destro -->
<ContextMenu x:Key="RowMenu" ItemsSource="{Binding MenuList}" >
<ContextMenu.ItemContainerStyle>
<Style TargetType="MenuItem">
<Setter Property="Command" Value="{Binding MenuItem_Command}"/>
<Setter Property="CommandParameter" Value="{Binding MenuItem_Command}"/>
<Setter Property="Header" Value="{Binding sMsg}"/>
</Style>
</ContextMenu.ItemContainerStyle>
</ContextMenu>
</TreeView.Resources>
<TreeView.ItemContainerStyle>
<Style TargetType="{x:Type TreeViewItem}">
<Setter Property="IsSelected" Value="{Binding bIsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
<Setter Property="IsExpanded" Value="True" />
<Setter Property="ContextMenu" Value="{StaticResource RowMenu}" />
</Style>
</TreeView.ItemContainerStyle>
</TreeView>
<!--<Border Grid.Row="3"
Style="{StaticResource LeftPanelTitle_Border}">
<TextBlock Text="Lista entità importate"
FontWeight="DemiBold"
FontSize="14"/>
</Border>
<ListBox Grid.Row="4"
ItemsSource="{Binding ImportedEntityList, UpdateSourceTrigger=PropertyChanged}"
SelectedItem="{Binding SelImportedEntity}"
MinHeight="200">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid HorizontalAlignment="Stretch">
<Grid.InputBindings>
<MouseBinding Gesture="LeftDoubleClick"
Command="{Binding ImportedEntity_DoubleClick}"/>
</Grid.InputBindings>
<TextBlock Text="{Binding ghName}">
</TextBlock>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>-->
<UniformGrid Grid.Row="5"
Rows="1">
<Button Content="Ok"
Command="{Binding Ok_Command}"
Style="{StaticResource LeftPanel_TextButton}"/>
<!--<Button Content="Cancel"
Command="{Binding Cancel_Command}"
Style="{StaticResource LeftPanel_TextButton}"/>-->
</UniformGrid>
</Grid>
</UserControl>
@@ -0,0 +1,3 @@
Public Class ModifyPartPanelV
End Class
+407
View File
@@ -0,0 +1,407 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports EgtWPFLib5
Public Class ModifyPartPanelVM
Inherits VMBase
'Private m_nImportedPartId As Integer = GDB_ID.NULL
'Friend ReadOnly Property nImportedPartId As Integer
' Get
' Return m_nImportedPartId
' End Get
'End Property
'Private m_ImportedEntityList As New ObservableCollection(Of GeomEntity)
'Public Property ImportedEntityList As ObservableCollection(Of GeomEntity)
' Get
' Return m_ImportedEntityList
' End Get
' Set(value As ObservableCollection(Of GeomEntity))
' m_ImportedEntityList = value
' End Set
'End Property
'Private m_SelImportedEntity As GeomEntity
'Public Property SelImportedEntity As GeomEntity
' Get
' Return m_SelImportedEntity
' End Get
' Set(value As GeomEntity)
' m_SelImportedEntity = value
' EgtDeselectAll()
' If Not IsNothing(m_SelImportedEntity) Then
' EgtSelectObj(m_SelImportedEntity.nId)
' End If
' EgtDraw()
' End Set
'End Property
'Friend Sub SetSelImportedEntity(nId As Integer)
' m_SelImportedEntity = Map.refImportPanelVM.ImportedEntityList.FirstOrDefault(Function(x) x.nId = nId)
' EgtDeselectAll()
' If Not IsNothing(m_SelImportedEntity) Then
' EgtSelectObj(m_SelImportedEntity.nId)
' End If
' EgtDraw()
' NotifyPropertyChanged(NameOf(SelImportedEntity))
'End Sub
Private m_ModifyPartList As New ObservableCollection(Of ModifyPart)
Public ReadOnly Property ModifyPartList As ObservableCollection(Of ModifyPart)
Get
Return m_ModifyPartList
End Get
End Property
Private m_SelModifyPart As ModifyPart
Friend Sub SetSelModifyPart(SelModifyPart As ModifyPart)
m_SelModifyPart = SelModifyPart
m_SelModifyLayer = Nothing
End Sub
Public ReadOnly Property SelModifyPart As ModifyPart
Get
Return m_SelModifyPart
End Get
End Property
Private m_SelModifyLayer As ModifyLayer
Public ReadOnly Property SelModifyLayer As ModifyLayer
Get
Return m_SelModifyLayer
End Get
End Property
Friend Sub SetSelModifyLayer(SelModifyLayer As ModifyLayer)
m_SelModifyPart = m_ModifyPartList.FirstOrDefault(Function(x) x.LayerList.Contains(SelModifyLayer))
m_SelModifyLayer = SelModifyLayer
End Sub
Private m_SelModifyEntity As ModifyEntity
Public ReadOnly Property SelModifyEntity As ModifyEntity
Get
Return m_SelModifyEntity
End Get
End Property
Friend Sub SetSelModifyEntity(SelModifyEntity As ModifyEntity)
For Each CurrPart In m_ModifyPartList
Dim CurrLayer As ModifyLayer = CurrPart.LayerList.FirstOrDefault(Function(x) x.EntityList.Contains(SelModifyEntity))
If Not IsNothing(CurrLayer) Then
m_SelModifyPart = CurrPart
m_SelModifyLayer = CurrLayer
Exit For
End If
Next
m_SelModifyEntity = SelModifyEntity
End Sub
' Definizione comandi
Private m_cmdOk As ICommand
Private m_cmdCancel As ICommand
Sub New()
' Creo riferimento a questa classe in EgtCAM5Map
Map.SetRefModifyPartPanelVM(Me)
End Sub
#Region "METHODS"
Friend Sub Init()
m_ModifyPartList.Clear()
' carico pezzi in lista
For Each PrintPart In Map.refTopPanelVM.PartList
m_ModifyPartList.Add(New ModifyPart(PrintPart))
Next
End Sub
#End Region ' METHODS
#Region "COMMANDS"
'#Region "SetReference"
' Public ReadOnly Property SetReference_Command As ICommand
' Get
' If m_cmdSetReference Is Nothing Then
' m_cmdSetReference = New Command(AddressOf SetReference)
' End If
' Return m_cmdSetReference
' End Get
' End Property
' Public Sub SetReference()
' If Not IsNothing(SelGeomEntity) Then
' Dim ChooseReferenceWndVM As New ChooseReferenceWndVM
' Dim ChooseReferenceWndV As New ChooseReferenceWndV(Application.Current.MainWindow, ChooseReferenceWndVM)
' If Not ChooseReferenceWndV.ShowDialog() Then Return
' SelGeomEntity.Reference = ChooseReferenceWndVM.SelReference
' End If
' End Sub
'#End Region ' SetReference
'#Region "AddPart"
' Public ReadOnly Property AddPart_Command As ICommand
' Get
' If m_cmdAddPart Is Nothing Then
' m_cmdAddPart = New Command(AddressOf AddPart)
' End If
' Return m_cmdAddPart
' End Get
' End Property
' Public Sub AddPart()
' m_ImportPartList.Add(New ImportPart)
' End Sub
'#End Region ' AddPart
'#Region "RemovePart"
' Public ReadOnly Property RemovePart_Command As ICommand
' Get
' If m_cmdRemovePart Is Nothing Then
' m_cmdRemovePart = New Command(AddressOf RemovePart)
' End If
' Return m_cmdRemovePart
' End Get
' End Property
' Public Sub RemovePart()
' If IsNothing(SelImportLayer) Then
' ' rimuovo pezzo
' m_ImportPartList.Remove(SelImportPart)
' Else
' ' rimuovo geometria
' Dim CurrEntity As GeomEntity = m_SelGeomEntity
' SelImportLayer.EntityList.Remove(m_SelGeomEntity)
' ' la rimetto in lista importati
' ImportedEntityList.Add(CurrEntity)
' End If
' End Sub
'#End Region ' RemovePart
#Region "Ok"
Public ReadOnly Property Ok_Command As ICommand
Get
If m_cmdOk Is Nothing Then
m_cmdOk = New Command(AddressOf Ok)
End If
Return m_cmdOk
End Get
End Property
Public Sub Ok()
'Dim sErr As New List(Of String)
'' verifico che tutti i pezzi abbiano una superficie da stampare nel layer apposito
'For Each CurrPart In m_ImportPartList
' For Each CurrLayer In CurrPart.LayerList
' Select Case CurrLayer.Type
' Case ImportLayer.LayerType.PRINT_SOLID
' If CurrLayer.EntityList.Count = 0 Then
' If sErr.Count > 0 Then sErr(sErr.Count - 1) &= Environment.NewLine
' sErr.Add(CurrPart.ghName & " - No print surface defined!")
' End If
' End Select
' Next
'Next
'If sErr.Count > 0 Then
' MessageBox.Show(String.Concat(sErr), "Error")
' Return
'Else
' ' Creo pezzi e layer necessari
' For Each ImportPart In m_ImportPartList
' Dim frImportedPart As New Frame3d
' EgtGetGroupGlobFrame(m_nImportedPartId, frImportedPart)
' Dim nPartId As Integer = EgtCreateGroup(GDB_ID.ROOT, frImportedPart)
' EgtSetName(nPartId, PART)
' Dim nFrameId As Integer = GDB_ID.NULL
' Dim b3PrintSolid As New BBox3d
' Dim nPrintPartLayerId As Integer = GDB_ID.NULL
' Dim PrintSolidEntity As GeomEntity = Nothing
' Dim nOriginalPartLayerId As Integer = GDB_ID.NULL
' Dim nRibsLayerId As Integer = GDB_ID.NULL
' Dim nShellNumberLayerId As Integer = GDB_ID.NULL
' Dim nAuxSolidsLayerId As Integer = GDB_ID.NULL
' Dim nMachStartLayerId As Integer = GDB_ID.NULL
' Dim nOthersLayerId As Integer = GDB_ID.NULL
' For Each ImportLayer In ImportPart.LayerList
' Select Case ImportLayer.Type
' Case ImportLayer.LayerType.PRINT_SOLID
' nPrintPartLayerId = EgtCreateGroup(nPartId)
' EgtSetName(nPrintPartLayerId, PRINT_SOLID)
' If ImportLayer.EntityList.Count > 0 Then
' PrintSolidEntity = ImportLayer.EntityList(0)
' EgtRelocateGlob(PrintSolidEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
' ' calcolo box superficie per creazione riferimento
' EgtGetBBoxGlob(PrintSolidEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
' End If
' 'Case ImportLayer.LayerType.ORIGINAL_SOLID
' ' nOriginalPartLayerId = EgtCreateGroup(nPartId)
' ' EgtSetName(nOriginalPartLayerId, ORIGINAL_SOLID)
' ' For Each GeomEntity In ImportLayer.EntityList
' ' EgtRelocateGlob(GeomEntity.nId, nOriginalPartLayerId, GDB_POS.LAST_SON)
' ' Next
' Case ImportLayer.LayerType.MACH_START
' nMachStartLayerId = EgtCreateGroup(nPartId)
' EgtSetName(nMachStartLayerId, LAY_MACH_START)
' Dim nMachStartId As Integer = GDB_ID.NULL
' If ImportLayer.EntityList.Count > 0 Then
' For Each GeomEntity In ImportLayer.EntityList
' ' se punto o curva compo
' Dim EntityType As GDB_TY = EgtGetType(GeomEntity.nId)
' Select Case EntityType
' Case GDB_TY.GEO_POINT, GDB_TY.CRV_COMPO
' ' gli cambio layer
' EgtRelocateGlob(GeomEntity.nId, nMachStartLayerId, GDB_POS.LAST_SON)
' nMachStartId = GeomEntity.nId
' Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
' ' altrimenti la trasformo in curva compo
' nMachStartId = EgtCreateCurveCompo(nMachStartLayerId, GeomEntity.nId, True)
' End Select
' EgtSetName(nMachStartId, START_GEOM)
' ' coloro l'entita' di rosso
' Dim c3Red As Color3d
' c3Red.FromColor(System.Drawing.Color.Red)
' EgtSetColor(nMachStartId, c3Red)
' Next
' Else
' ' creo punto di partenza
' Dim ptStart As Point3d = b3PrintSolid.Center() - 0.6 * b3PrintSolid.DimY() * Vector3d.Y_AX() - 0.5 * b3PrintSolid.DimZ() * Vector3d.Z_AX()
' nMachStartId = EgtCreateGeoPoint(nMachStartLayerId, ptStart, GDB_RT.GLOB)
' EgtSetName(nMachStartId, START_GEOM)
' ' coloro l'entita' di rosso
' Dim c3Red As Color3d
' c3Red.FromColor(System.Drawing.Color.Red)
' EgtSetColor(nMachStartId, c3Red)
' End If
' Case ImportLayer.LayerType.RIBS
' nRibsLayerId = EgtCreateGroup(nPartId)
' EgtSetName(nRibsLayerId, LAY_RIBS)
' For Each GeomEntity In ImportLayer.EntityList
' EgtSetInfo(GeomEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
' EgtRelocateGlob(GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON)
' ' coloro l'entita' di viola
' Dim c3LightBlue As Color3d
' c3LightBlue.FromColor(System.Drawing.Color.MediumOrchid)
' EgtSetColor(GeomEntity.nId, c3LightBlue)
' Next
' Case ImportLayer.LayerType.SHELL_NUMBER
' nShellNumberLayerId = EgtCreateGroup(nPartId)
' EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
' For Each GeomEntity In ImportLayer.EntityList
' EgtSetInfo(GeomEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
' EgtRelocateGlob(GeomEntity.nId, nShellNumberLayerId, GDB_POS.LAST_SON)
' ' coloro l'entita' di verde
' Dim c3LightBlue As Color3d
' c3LightBlue.FromColor(System.Drawing.Color.Lime)
' EgtSetColor(GeomEntity.nId, c3LightBlue)
' Next
' Case ImportLayer.LayerType.AUX_SOLIDS
' nAuxSolidsLayerId = EgtCreateGroup(nPartId)
' EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
' For Each GeomEntity In ImportLayer.EntityList
' EgtSetInfo(GeomEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT)
' EgtRelocateGlob(GeomEntity.nId, nAuxSolidsLayerId, GDB_POS.LAST_SON)
' ' coloro l'entita' di oro
' Dim c3LightBlue As Color3d
' c3LightBlue.FromColor(System.Drawing.Color.DarkGoldenrod)
' EgtSetColor(GeomEntity.nId, c3LightBlue)
' Next
' Case ImportLayer.LayerType.OTHERS
' nOthersLayerId = EgtCreateGroup(nPartId)
' EgtSetName(nOthersLayerId, LAY_OTHERS)
' For Each GeomEntity In ImportLayer.EntityList
' EgtRelocateGlob(GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
' Next
' End Select
' Next
' ' aggiungo riferimento
' Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
' EgtSetName(nReferenceLayerId, LAY_REFERENCE)
' ' Creo riferimento
' Dim ptOrig As New Point3d(b3PrintSolid.Min())
' Select Case PrintSolidEntity.Reference
' Case ChooseReferenceWndVM.References.TL
' ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX
' Case ChooseReferenceWndVM.References.TR
' ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
' Case ChooseReferenceWndVM.References.BL
' Case ChooseReferenceWndVM.References.BR
' ptOrig += b3PrintSolid.DimX() * Vector3d.X_AX
' Case ChooseReferenceWndVM.References.TC
' ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
' Case ChooseReferenceWndVM.References.ML
' ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX
' Case ChooseReferenceWndVM.References.MR
' ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
' Case ChooseReferenceWndVM.References.TC
' ptOrig += b3PrintSolid.DimY() * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
' Case ChooseReferenceWndVM.References.MR
' ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() * Vector3d.X_AX
' Case ChooseReferenceWndVM.References.BC
' ptOrig += b3PrintSolid.DimX() / 2 * Vector3d.X_AX
' Case ChooseReferenceWndVM.References.MC
' ptOrig += b3PrintSolid.DimY() / 2 * Vector3d.Y_AX + b3PrintSolid.DimX() / 2 * Vector3d.X_AX
' End Select
' Dim frPrintSolid As New Frame3d(ptOrig)
' nFrameId = EgtCreateGeoFrame(nReferenceLayerId, frPrintSolid, GDB_RT.GLOB)
' If nFrameId Then
' EgtSetName(nFrameId, FRAME_PART)
' EgtSetMode(nFrameId, GDB_MD.LOCKED)
' End If
' EgtSetInfo(nReferenceLayerId, KEY_REFERENCE, PrintSolidEntity.Reference)
' ' appoggio il pezzo sulla tavola
' EgtMove( nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
' ' lo aggiungo a lista pezzi
' Dim sFilePath As String = ""
' EgtGetInfo(m_nImportedPartId, FILE_PATH, sFilePath)
' EgtSetInfo(nPartId, FILE_PATH, sFilePath)
' EgtSetInfo(nPartId, "PartOnTable", 1)
' Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, PrintSolidEntity.nId, nOriginalPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
' Map.refTopPanelVM.PartList.Add(NewPart)
' Next
'End If
''EgtAddMachGroup("3dPrint")
''EgtSetTable("Tab")
''Dim nRawId As Integer = EgtAddRawPart(b3PrintSolid.Min, b3PrintSolid.DimX, b3PrintSolid.DimY, b3PrintSolid.DimZ, New Color3d(128, 128, 128, 30))
''EgtAddPartToRawPart(nPartId, b3PrintSolid.Min, nRawId)
''EgtMoveToCornerRawPart(nRawId, New Point3d(dPosX, dPosY, 0), MCH_CR.BL)
''EgtResetCurrMachGroup()
'' seleziono ultimo pezzo aggiunto
'Map.refTopPanelVM.SelLastPart()
'' elimino vecchio pezzo d'importazione
'EgtErase(m_nImportedPartId)
'EgtDraw()
' ripristino modalita' standard
Map.refTopPanelVM.SelPage = Pages.MODIFY
End Sub
#End Region ' Ok
#Region "Cancel"
Public ReadOnly Property Cancel_Command As ICommand
Get
If m_cmdCancel Is Nothing Then
m_cmdCancel = New Command(AddressOf Cancel)
End If
Return m_cmdCancel
End Get
End Property
Public Sub Cancel()
' ripristino modalita' standard
Map.refTopPanelVM.SelPage = Pages.MODIFY
End Sub
#End Region ' Cancel
#End Region ' COMMANDS
End Class
+435
View File
@@ -0,0 +1,435 @@
Imports System.Collections.ObjectModel
Imports EgtUILib
Imports EgtWPFLib5
Public Class ModifyEntity
Inherits VMBase
' layer sotto cui e' questa entita'
Private m_OrigLayer As ModifyLayer
Friend ReadOnly Property OrigLayer As ModifyLayer
Get
Return m_OrigLayer
End Get
End Property
Private m_bIsSelected As Boolean
Public Property bIsSelected As Boolean
Get
Return m_bIsSelected
End Get
Set(value As Boolean)
m_bIsSelected = value
' seleziono in scena
EgtDeselectAll()
If Not IsNothing(value) Then
EgtSelectObj(m_nId)
End If
EgtDraw()
' segno come elemento selezionato in treeview
Map.refModifyPartPanelVM.SetSelModifyEntity(Me)
End Set
End Property
Private m_nId As Integer = GDB_ID.NULL
Public ReadOnly Property nId As Integer
Get
Return m_nId
End Get
End Property
Private m_sName As String
Public ReadOnly Property sName As String
Get
Return m_sName
End Get
End Property
Public ReadOnly Property ghName As String
Get
Return m_nId
End Get
End Property
Private m_MenuList As New List(Of MenuItemVm)
Public Property MenuList As List(Of MenuItemVm)
Get
Return m_MenuList
End Get
Set(value As List(Of MenuItemVm))
m_MenuList = value
End Set
End Property
Sub New(nId As Integer, sName As String, OrigLayer As ModifyLayer)
m_nId = nId
m_sName = sName
m_OrigLayer = OrigLayer
' aggiungo voci layer a contextmenu
CreateContextMenu(OrigLayer)
End Sub
Friend Sub UpdateContextMenu(OrigLayer As ModifyLayer)
m_MenuList.Clear()
' aggiungo voci layer a contextmenu
CreateContextMenu(OrigLayer)
End Sub
Friend Sub CreateContextMenu(OrigLayer As ModifyLayer)
For Each ProjectPart In Map.refTopPanelVM.PartList
' verifico in quali layer puo' andare questo elemento
Dim EntityType As GDB_TY = EgtGetType(nId)
Select Case EntityType
Case GDB_TY.GEO_POINT, GDB_TY.CRV_COMPO, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
' recupero i layer
If OrigLayer.Type <> ModifyLayer.LayerType.MACH_START Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.MACH_START, ProjectPart))
If OrigLayer.Type <> ModifyLayer.LayerType.OTHERS Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.OTHERS, ProjectPart))
Case GDB_TY.SRF_MESH
' verifico se volume chiuso
If OrigLayer.Type <> ModifyLayer.LayerType.PRINT_SOLID Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.PRINT_SOLID, ProjectPart))
If OrigLayer.Type <> ModifyLayer.LayerType.SHELL_NUMBER Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.SHELL_NUMBER, ProjectPart))
If OrigLayer.Type <> ModifyLayer.LayerType.AUX_SOLIDS Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.AUX_SOLIDS, ProjectPart))
If OrigLayer.Type <> ModifyLayer.LayerType.RIBS Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.RIBS, ProjectPart))
If OrigLayer.Type <> ModifyLayer.LayerType.OTHERS Then m_MenuList.Add(New MenuItemVm(Me, OrigLayer, ModifyLayer.LayerType.OTHERS, ProjectPart))
End Select
Next
End Sub
Friend Sub UpdateOrigLayer(NewLayer As ModifyLayer)
m_OrigLayer = NewLayer
End Sub
End Class
Public Class ModifyPart
Inherits VMBase
Private m_bIsSelected As Boolean
Public Property bIsSelected As Boolean
Get
Return m_bIsSelected
End Get
Set(value As Boolean)
m_bIsSelected = value
Map.refModifyPartPanelVM.SetSelModifyPart(Me)
End Set
End Property
Private m_PrintPart As Print3dPartVM
Public ReadOnly Property PrintPart As Print3dPartVM
Get
Return m_PrintPart
End Get
End Property
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
End Set
End Property
Public ReadOnly Property ghName As String
Get
Return m_PrintPart.sImportedFileName
End Get
End Property
Private m_LayerList As New ObservableCollection(Of ModifyLayer)
Public ReadOnly Property LayerList As ObservableCollection(Of ModifyLayer)
Get
Return m_LayerList
End Get
End Property
Sub New(PrintPart As Print3dPartVM)
m_PrintPart = PrintPart
m_LayerList.Add(New ModifyLayer(ModifyLayer.LayerType.PRINT_SOLID, "Print", PrintPart))
m_LayerList.Add(New ModifyLayer(ModifyLayer.LayerType.MACH_START, "Layer Start", PrintPart))
m_LayerList.Add(New ModifyLayer(ModifyLayer.LayerType.RIBS, "Ribs", PrintPart))
m_LayerList.Add(New ModifyLayer(ModifyLayer.LayerType.SHELL_NUMBER, "Reduce Shell Number", PrintPart))
m_LayerList.Add(New ModifyLayer(ModifyLayer.LayerType.AUX_SOLIDS, "Filled Solids", PrintPart))
m_LayerList.Add(New ModifyLayer(ModifyLayer.LayerType.OTHERS, "Others", PrintPart))
End Sub
End Class
Public Class ModifyLayer
Inherits VMBase
Public Enum LayerType As Integer
PRINT_SOLID = 1
MACH_START = 2
RIBS = 3
SHELL_NUMBER = 4
AUX_SOLIDS = 5
OTHERS = 6
End Enum
Private m_nLayerId As Integer
Private m_bIsSelected As Boolean
Public Property bIsSelected As Boolean
Get
Return m_bIsSelected
End Get
Set(value As Boolean)
m_bIsSelected = value
Map.refModifyPartPanelVM.SetSelModifyLayer(Me)
End Set
End Property
Private m_Type As LayerType
Public Property Type As LayerType
Get
Return m_Type
End Get
Set(value As LayerType)
m_Type = value
End Set
End Property
Private m_sName As String
Public Property sName As String
Get
Return m_sName
End Get
Set(value As String)
m_sName = value
End Set
End Property
Private m_EntityList As New ObservableCollection(Of ModifyEntity)
Public Property EntityList As ObservableCollection(Of ModifyEntity)
Get
Return m_EntityList
End Get
Set(value As ObservableCollection(Of ModifyEntity))
m_EntityList = value
End Set
End Property
Sub New(Type As LayerType, sName As String)
m_Type = Type
m_sName = sName
End Sub
Sub New(Type As LayerType, sName As String, PrintPart As Print3dPartVM)
m_Type = Type
m_sName = sName
Select Case Type
Case LayerType.PRINT_SOLID
m_nLayerId = PrintPart.nPrintSolidLayerId
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
Dim sEntitytName As String = ""
EgtGetName(nEntityId, sEntitytName)
m_EntityList.Add(New ModifyEntity(nEntityId, sEntitytName, Me))
Case LayerType.MACH_START
m_nLayerId = PrintPart.nMachStartLayerId
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
Dim sEntitytName As String = ""
EgtGetName(nEntityId, sEntitytName)
While nEntityId <> GDB_ID.NULL
m_EntityList.Add(New ModifyEntity(nEntityId, sEntitytName, Me))
nEntityId = EgtGetNext(nEntityId)
EgtGetName(nEntityId, sEntitytName)
End While
Case LayerType.RIBS
m_nLayerId = PrintPart.nRibsLayerId
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
Dim sEntitytName As String = ""
EgtGetName(nEntityId, sEntitytName)
While nEntityId <> GDB_ID.NULL
Dim RibType As Integer = RibEntity.RibTypes.FROMDRAW
EgtGetInfo(nEntityId, KEY_RIB_TYPE, RibType)
If RibType = RibEntity.RibTypes.FROMIMPORT Then
m_EntityList.Add(New ModifyEntity(nEntityId, sEntitytName, Me))
End If
nEntityId = EgtGetNext(nEntityId)
EgtGetName(nEntityId, sEntitytName)
End While
Case LayerType.SHELL_NUMBER
m_nLayerId = PrintPart.nShellNumberLayerId
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
Dim sEntitytName As String = ""
EgtGetName(nEntityId, sEntitytName)
While nEntityId <> GDB_ID.NULL
Dim ShellType As Integer = ShellNumberEntity.ShellNumberTypes.FROMDRAW
EgtGetInfo(nEntityId, KEY_SHELLNBR_TYPE, ShellType)
If ShellType = ShellNumberEntity.ShellNumberTypes.FROMIMPORT Then
m_EntityList.Add(New ModifyEntity(nEntityId, sEntitytName, Me))
End If
nEntityId = EgtGetNext(nEntityId)
EgtGetName(nEntityId, sEntitytName)
End While
Case LayerType.AUX_SOLIDS
m_nLayerId = PrintPart.nAuxSolidsLayerId
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
Dim sEntitytName As String = ""
EgtGetName(nEntityId, sEntitytName)
While nEntityId <> GDB_ID.NULL
'Dim ShellType As Integer = ShellNumberEntity.ShellNumberTypes.FROMDRAW
'EgtGetInfo(nEntityId, KEY_SHELLNBR_TYPE, ShellType)
'If ShellType = ShellNumberEntity.ShellNumberTypes.FROMIMPORT Then
m_EntityList.Add(New ModifyEntity(nEntityId, sEntitytName, Me))
'End If
nEntityId = EgtGetNext(nEntityId)
EgtGetName(nEntityId, sEntitytName)
End While
Case LayerType.OTHERS
m_nLayerId = PrintPart.nOthersLayerId
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
Dim sEntitytName As String = ""
EgtGetName(nEntityId, sEntitytName)
While nEntityId <> GDB_ID.NULL
m_EntityList.Add(New ModifyEntity(nEntityId, sEntitytName, Me))
nEntityId = EgtGetNext(nEntityId)
EgtGetName(nEntityId, sEntitytName)
End While
End Select
End Sub
End Class
Public Class MenuItemVm
Inherits VMBase
' enita' di origine
Private m_OrigEntity As ModifyEntity
Private m_OrigLayer As ModifyLayer
' pezzo in cui spostare
Private m_Part As Print3dPartVM
' tipo del layer indicato
Private m_Type As ModifyLayer.LayerType
Public Property Type As ModifyLayer.LayerType
Get
Return m_Type
End Get
Set(value As ModifyLayer.LayerType)
m_Type = value
End Set
End Property
Public ReadOnly Property sMsg As String
Get
Dim sType As String = ""
Select Case m_Type
Case ModifyLayer.LayerType.PRINT_SOLID
sType = "Print"
Case ModifyLayer.LayerType.MACH_START
sType = "Layer Start"
Case ModifyLayer.LayerType.RIBS
sType = "Ribs"
Case ModifyLayer.LayerType.SHELL_NUMBER
sType = "Reduce shell number"
Case ModifyLayer.LayerType.AUX_SOLIDS
sType = "Filled Solids"
Case ModifyLayer.LayerType.OTHERS
sType = "Others"
End Select
Return "Move to " & sType
End Get
End Property
' Definizione comando
Private m_cmdCommand As ICommand
Sub New(OrigEntity As ModifyEntity, OrigLayer As ModifyLayer, Type As ModifyLayer.LayerType, Part As Print3dPartVM)
m_OrigEntity = OrigEntity
m_OrigLayer = OrigLayer
m_Type = Type
m_Part = Part
End Sub
#Region "Cancel"
Public ReadOnly Property MenuItem_Command As ICommand
Get
If m_cmdCommand Is Nothing Then
m_cmdCommand = New Command(AddressOf Command)
End If
Return m_cmdCommand
End Get
End Property
Public Sub Command()
' recupero layer da pezzo
Dim nLayerId As Integer = GDB_ID.NULL
Select Case m_Type
Case ModifyLayer.LayerType.PRINT_SOLID
nLayerId = m_Part.nPrintSolidLayerId
Case ModifyLayer.LayerType.MACH_START
nLayerId = m_Part.nMachStartLayerId
Case ModifyLayer.LayerType.RIBS
nLayerId = m_Part.nRibsLayerId
Case ModifyLayer.LayerType.SHELL_NUMBER
nLayerId = m_Part.nShellNumberLayerId
Case ModifyLayer.LayerType.AUX_SOLIDS
nLayerId = m_Part.nAuxSolidsLayerId
Case ModifyLayer.LayerType.OTHERS
nLayerId = m_Part.nOthersLayerId
End Select
' sposto entita'
If EgtRelocateGlob(m_OrigEntity.nId, nLayerId) Then
' elimino info vecchio layer
Select Case m_OrigLayer.Type
Case ModifyLayer.LayerType.PRINT_SOLID
EgtResetMark(m_OrigEntity.nId)
Case ModifyLayer.LayerType.MACH_START
Case ModifyLayer.LayerType.RIBS
EgtRemoveInfo(m_OrigEntity.nId, KEY_RIB_TYPE)
Case ModifyLayer.LayerType.SHELL_NUMBER
EgtRemoveInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE)
Case ModifyLayer.LayerType.AUX_SOLIDS
EgtRemoveInfo(m_OrigEntity.nId, KEY_AUXSOLID_TYPE)
Case ModifyLayer.LayerType.OTHERS
End Select
' sposto in lista
m_OrigLayer.EntityList.Remove(m_OrigEntity)
Dim NewPart As ModifyPart = Map.refModifyPartPanelVM.ModifyPartList.FirstOrDefault(Function(x) x.PrintPart.nPartId = m_Part.nPartId)
If Not IsNothing(NewPart) Then
Dim NewLayer As ModifyLayer = NewPart.LayerList.FirstOrDefault(Function(x) x.Type = m_Type)
If Not IsNothing(NewLayer) Then
NewLayer.EntityList.Add(m_OrigEntity)
' aggiorno riferimenti nell'entita'
m_OrigEntity.UpdateOrigLayer(NewLayer)
End If
End If
' aggiungo info nuovo layer
Select Case m_Type
Case ModifyLayer.LayerType.PRINT_SOLID
EgtSetName(m_OrigEntity.nId, PRINT_SOLID)
EgtSetColor(m_OrigEntity.nId, c3Print)
Case ModifyLayer.LayerType.MACH_START
EgtSetName(m_OrigEntity.nId, LAY_MACH_START)
EgtSetColor(m_OrigEntity.nId, c3MachStart)
Case ModifyLayer.LayerType.RIBS
EgtSetName(m_OrigEntity.nId, LAY_RIBS)
EgtSetInfo(m_OrigEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtSetColor(m_OrigEntity.nId, c3Rib)
Case ModifyLayer.LayerType.SHELL_NUMBER
EgtSetName(m_OrigEntity.nId, LAY_SHELL_NBR)
EgtSetInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
EgtSetColor(m_OrigEntity.nId, c3ShellNumber)
Case ModifyLayer.LayerType.AUX_SOLIDS
EgtSetName(m_OrigEntity.nId, LAY_AUX_SOLIDS)
EgtSetInfo(m_OrigEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT)
EgtSetColor(m_OrigEntity.nId, c3AuxSolids)
Case ModifyLayer.LayerType.OTHERS
EgtSetName(m_OrigEntity.nId, LAY_OTHERS)
EgtSetColor(m_OrigEntity.nId, c3Others)
End Select
EgtDraw()
' aggiorno riferimenti nel context menu item
m_OrigEntity.UpdateContextMenu(m_OrigEntity.OrigLayer)
End If
End Sub
#End Region ' Cancel
End Class
+2 -1
View File
@@ -902,11 +902,12 @@ Public Class MySceneHostVM
Dim nShellNumberLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_SHELL_NBR)
Dim nAuxSolidsLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_AUX_SOLIDS)
Dim nMachStartLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_MACH_START)
Dim nOthersLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_OTHERS)
Dim sFilePath As String = ""
EgtGetInfo(nPartId, FILE_PATH, sFilePath)
Dim nReferenceLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_REFERENCE)
Dim nFrameId As Integer = EgtGetFirstInGroup(nReferenceLayerId)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nPrintPartId, nOriginalPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, sFilePath)
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nPrintPartId, nOriginalPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
Map.refTopPanelVM.PartList.Add(NewPart)
Dim bPartToRecalc As Boolean = False
EgtGetInfo(nPartId, MAC_TORECALC_SLICE, bPartToRecalc)
+1 -1
View File
@@ -496,7 +496,7 @@ Public Class SliceManagerVM
m_bCalculating = False
Return
End If
If IsNothing(Map.refTopPanelVM.SelMachining) Then
If IsNothing(Map.refTopPanelVM.SelMachining) OrElse IsNothing(Map.refTopPanelVM.CurrMachining) OrElse Map.refTopPanelVM.CurrMachining.dCurrStrandH <= 0 Then
MessageBox.Show("No print parameters set!", "Error", MessageBoxButton.OK, MessageBoxImage.Error)
m_bCalculating = False
Return
+2 -2
View File
@@ -42,11 +42,11 @@
FontWeight="Light"
VerticalContentAlignment="Center">
</ComboBox>
<!--<Button Grid.Column="1"
<Button Grid.Column="1"
Command="{Binding PartModify_Command}"
Style="{StaticResource PrintParamDb_Button}">
<Image Source="/Resources/TopPanel/Edit.png"/>
</Button>-->
</Button>
</Grid>
<ToggleButton x:Name="ModifyBtn"
Content="{Binding SelectedItem.sName, ElementName=ModifyModeListBox}"
+1 -1
View File
@@ -267,7 +267,7 @@ Public Class TopPanelVM
m_MachiningList.Remove(MachiningIndex.Empty())
End If
' se nuova lavorazione e' none
If SelMachining.sGUID = Guid.Empty Then
If SelMachining.sGUID = Guid.Empty AndAlso Not MachiningList.Any(Function(x) x.sGUID = MachiningIndex.Empty.sGUID) Then
' aggiungo lavorazione vuota
MachiningList.Insert(0, MachiningIndex.Empty())
End If
+1
View File
@@ -44,6 +44,7 @@
<PrintApp:SimulationPanelVM x:Key="SimulationPanelVM"/>
<PrintApp:ReferencePanelVM x:Key="ReferencePanelVM"/>
<PrintApp:ViewLayerManagerVM x:Key="ViewLayerManagerVM"/>
<PrintApp:ModifyPartPanelVM x:Key="ModifyPartPanelVM"/>
<!--<EgtBEAMWALL:CALCPanelVM x:Key="CALCPanelVM"/>
<EgtBEAMWALL:PartParametersVM x:Key="PartParametersVM"/>
<EgtBEAMWALL:LeftPanelVM x:Key="LeftPanelVM"/>
+57
View File
@@ -0,0 +1,57 @@
Imports EgtUILib
Module GeomEntityColors
Private m_c3Print As Color3d
Public ReadOnly Property c3Print As Color3d
Get
Return m_c3Print
End Get
End Property
Private m_c3MachStart As Color3d
Public ReadOnly Property c3MachStart As Color3d
Get
Return m_c3MachStart
End Get
End Property
Private m_c3Rib As Color3d
Public ReadOnly Property c3Rib As Color3d
Get
Return m_c3Rib
End Get
End Property
Private m_c3ShellNumber As Color3d
Public ReadOnly Property c3ShellNumber As Color3d
Get
Return m_c3ShellNumber
End Get
End Property
Private m_c3AuxSolids As Color3d
Public ReadOnly Property c3AuxSolids As Color3d
Get
Return m_c3AuxSolids
End Get
End Property
Private m_c3Others As Color3d
Public ReadOnly Property c3Others As Color3d
Get
Return m_c3Others
End Get
End Property
Sub New()
' imposto colori superfici
m_c3Print.FromColor(System.Drawing.Color.Yellow)
m_c3MachStart.FromColor(System.Drawing.Color.Red)
m_c3Rib.FromColor(System.Drawing.Color.MediumOrchid)
m_c3ShellNumber.FromColor(System.Drawing.Color.Lime)
m_c3AuxSolids.FromColor(System.Drawing.Color.DarkGoldenrod)
m_c3Others.FromColor(System.Drawing.Color.LightGray)
End Sub
End Module
+12
View File
@@ -60,6 +60,7 @@ Module Map
Private m_refViewLayerManagerVM As ViewLayerManagerVM
Private m_refShellNumberPanelVM As ShellNumberPanelVM
Private m_refShellNumberParamPanelVM As ShellNumberParamPanelVM
Private m_refModifyPartPanelVM As ModifyPartPanelVM
#Region "Get"
@@ -422,6 +423,12 @@ Module Map
End Get
End Property
Public ReadOnly Property refModifyPartPanelVM As ModifyPartPanelVM
Get
Return m_refModifyPartPanelVM
End Get
End Property
#End Region ' Get
#Region "Set"
@@ -725,6 +732,11 @@ Module Map
Return Not IsNothing(m_refShellNumberParamPanelVM)
End Function
Friend Function SetRefModifyPartPanelVM(ModifyPartPanelVM As ModifyPartPanelVM) As Boolean
m_refModifyPartPanelVM = ModifyPartPanelVM
Return Not IsNothing(m_refModifyPartPanelVM)
End Function
#End Region ' Set
#Region "Init"
+10 -3
View File
@@ -79,7 +79,14 @@ Public Class Print3dPartVM
End Get
End Property
Private m_sImportedFileName As String
' gruppo others
Private m_nOthersLayerId As Integer = GDB_ID.NULL
Public ReadOnly Property nOthersLayerId As Integer
Get
Return m_nOthersLayerId
End Get
End Property
Public ReadOnly Property sImportedFileName As String
Get
Return If(Not String.IsNullOrWhiteSpace(m_sImportedFilePath), IO.Path.GetFileName(m_sImportedFilePath), "")
@@ -112,11 +119,10 @@ Public Class Print3dPartVM
Sub New(nPartId As Integer, sImportedFilePath As String)
m_nPartId = nPartId
m_sImportedFilePath = sImportedFilePath
m_sImportedFileName = IO.Path.GetFileName(m_sImportedFilePath)
End Sub
Sub New(nPartId As Integer, nPrintSolidLayerId As Integer, nPrintSolidId As Integer, nOriginalPartLayerId As Integer, nReferenceLayerId As Integer, nReferenceId As Integer, nMachStartLayerId As Integer,
nRibsLayerId As Integer, nShellNumberLayerId As Integer, nAuxSolidsLayerId As Integer, sImportedFilePath As String)
nRibsLayerId As Integer, nShellNumberLayerId As Integer, nAuxSolidsLayerId As Integer, nOthersLayerId As Integer, sImportedFilePath As String)
m_nPartId = nPartId
m_nPrintSolidLayerId = nPrintSolidLayerId
m_nPrintSolidId = nPrintSolidId
@@ -127,6 +133,7 @@ Public Class Print3dPartVM
m_nAuxSolidsLayerId = nAuxSolidsLayerId
m_nRibsLayerId = nRibsLayerId
m_nShellNumberLayerId = nShellNumberLayerId
m_nOthersLayerId = nOthersLayerId
m_sImportedFilePath = sImportedFilePath
RefreshPrintLayers()
End Sub