Merge branch 'NewImportModifyPart'
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
Public Const TABLE = "Table"
|
||||
Public Const TABLE_OUTLINE = "TableOutline"
|
||||
Public Const PART = "Part"
|
||||
Public Const ORIGINAL_SOLID = "OriginalSolid"
|
||||
Public Const PRINT_SOLID = "PrintSolid"
|
||||
Public Const LAY_MACH_START = "MachStart"
|
||||
Public Const LAY_REFERENCE = "Frame"
|
||||
@@ -151,5 +150,7 @@
|
||||
Public Const KEY_ISOFILE_PATH = "IsoFilePath"
|
||||
|
||||
Public Const FILE_PATH = "FilePath"
|
||||
Public Const PART_NAME = "PartName"
|
||||
Public Const ENTITY_NAME = "EntityName"
|
||||
|
||||
End Module
|
||||
|
||||
@@ -111,6 +111,7 @@ Public Module ConstIni
|
||||
Public Const K_CURRMATERIAL As String = "CurrMaterial"
|
||||
Public Const K_CURRMACHINING As String = "CurrMachining"
|
||||
Public Const K_VIEWSLIDER As String = "ViewSlider"
|
||||
Public Const K_IMPORTCURREXTENSION As String = "ImportCurrExtension"
|
||||
|
||||
Public Const S_MRUFILES As String = "MruFiles"
|
||||
Public Const S_MRUIMPORTFILES As String = "MruImportFiles"
|
||||
|
||||
+9
-18
@@ -123,11 +123,6 @@
|
||||
<DependentUpon>DispositionPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DispositionPanel\DispositionPanelVM.vb" />
|
||||
<Compile Include="ImportPanel\ImportPanelV.xaml.vb">
|
||||
<DependentUpon>ImportPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ImportPanel\ImportPanelVM.vb" />
|
||||
<Compile Include="ImportPanel\ImportUtility.vb" />
|
||||
<Compile Include="InstrumentPanel\InstrumentPanelV.xaml.vb">
|
||||
<DependentUpon>InstrumentPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -154,16 +149,16 @@
|
||||
<DependentUpon>MachSaveInDbWindowV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="MachSaveInDbWnd\MachSaveInDbWndVM.vb" />
|
||||
<Compile Include="ManagePartPanel\ManagePartPanelV.xaml.vb">
|
||||
<DependentUpon>ManagePartPanelV.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ManagePartPanel\ManagePartPanelVM.vb" />
|
||||
<Compile Include="ManagePartPanel\ManagePartUtility.vb" />
|
||||
<Compile Include="MaterialDb\Material.vb" />
|
||||
<Compile Include="MaterialDb\MaterialDbV.xaml.vb">
|
||||
<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>
|
||||
@@ -304,10 +299,6 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ImportPanel\ImportPanelV.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="InstrumentPanel\InstrumentPanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
@@ -348,14 +339,14 @@
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="ManagePartPanel\ManagePartPanelV.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="MaterialDb\MaterialDbV.xaml">
|
||||
<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>
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
<TabItem Header="NULL">
|
||||
</TabItem>
|
||||
<TabItem Header="IMPORT">
|
||||
<PrintApp:ImportPanelV DataContext="{StaticResource ImportPanelVM}"/>
|
||||
<!--<PrintApp:ImportPanelV DataContext="{StaticResource ImportPanelVM}"/>-->
|
||||
<PrintApp:ManagePartPanelV DataContext="{StaticResource ManagePartPanelVM}"/>
|
||||
</TabItem>
|
||||
<TabItem Header="DISPOSITION">
|
||||
<PrintApp:DispositionPanelV DataContext="{StaticResource DispositionPanelVM}"/>
|
||||
@@ -36,7 +37,8 @@
|
||||
<Button Height="100"/>
|
||||
</TabItem>
|
||||
<TabItem Header="MODIFYPART">
|
||||
<PrintApp:ModifyPartPanelV DataContext="{StaticResource ModifyPartPanelVM}"/>
|
||||
<!--<PrintApp:ModifyPartPanelV DataContext="{StaticResource ModifyPartPanelVM}"/>-->
|
||||
<PrintApp:ManagePartPanelV DataContext="{StaticResource ManagePartPanelVM}"/>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
|
||||
|
||||
@@ -55,7 +55,8 @@ Public Class LeftPanelVM
|
||||
Case Panels.SHELLNUMBER
|
||||
Map.refShellNumberPanelVM.Init()
|
||||
Case Panels.MODIFYPART
|
||||
Map.refModifyPartPanelVM.Init()
|
||||
''Map.refModifyPartPanelVM.Init()
|
||||
Map.refManagePartPanelVM.Init(ManagePartPanelVM.ManagePartType.MODIFY)
|
||||
End Select
|
||||
Map.refViewLayerManagerVM.UpdateForced()
|
||||
NotifyPropertyChanged(NameOf(SelPanel))
|
||||
|
||||
@@ -19,6 +19,7 @@ Class MainWindowV
|
||||
AddHandler Me.ContentRendered, AddressOf MainWindowV_ContentRendered
|
||||
AddHandler Me.Closing, AddressOf MainWindowV_Closing
|
||||
AddHandler Me.KeyDown, AddressOf MainWindowV_KeyDown
|
||||
AddHandler Me.StateChanged, AddressOf MainWindowV_StateChanged
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
@@ -63,6 +64,14 @@ Class MainWindowV
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub MainWindowV_StateChanged(sender As Object, e As EventArgs)
|
||||
If Not IsNothing(Map.refSecondaryWindowV) AndAlso Not Map.refSecondaryWindowV.WindowChangingState Then
|
||||
Map.refSecondaryWindowV.WindowState = Me.WindowState
|
||||
'Application.Current.MainWindow.Topmost = True
|
||||
'Application.Current.MainWindow.Topmost = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' EVENTS
|
||||
|
||||
End Class
|
||||
|
||||
@@ -0,0 +1,147 @@
|
||||
<UserControl x:Class="ManagePartPanelV"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Icarus"
|
||||
xmlns:EgtWPFLib5="clr-namespace:EgtWPFLib5;assembly=EgtWPFLib5"
|
||||
Width="150"
|
||||
Margin="5,0,0,0"
|
||||
VerticalAlignment="Stretch">
|
||||
<Grid DockPanel.Dock="Left">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="2*"/>
|
||||
<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>
|
||||
<!--<UniformGrid Grid.Row="1" Rows="1"
|
||||
IsEnabled="{Binding IsEnabled}">
|
||||
<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}"/>
|
||||
</UniformGrid>-->
|
||||
<TreeView Grid.Row="2"
|
||||
ItemsSource="{Binding ManagerPartList}"
|
||||
MinHeight="200"
|
||||
IsEnabled="{Binding IsEnabled}">
|
||||
<TreeView.Resources>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:ManagePart_Part}"
|
||||
ItemsSource="{Binding LayerList}">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Image Source="/Resources/TreeView/Folder.png"
|
||||
Height="15"/>
|
||||
<Grid>
|
||||
<TextBlock Text="{Binding sName}"
|
||||
Visibility="{Binding TextBlock_Visibility}"/>
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sName, UpdateSourceTrigger=Explicit}"
|
||||
IsExplicitFocused="{Binding UserShouldEditValueNow}"
|
||||
Visibility="{Binding TextBox_Visibility}"
|
||||
Style="{StaticResource OptionTextBox}"/>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</HierarchicalDataTemplate>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:ManagePart_Layer}"
|
||||
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:PartManager_GeomEntity}">
|
||||
<Grid>
|
||||
<TextBlock Text="{Binding sName}" />
|
||||
<EgtWPFLib5:EgtTextBox Text="{Binding sName, UpdateSourceTrigger=Explicit}"
|
||||
IsExplicitFocused="{Binding UserShouldEditValueNow}"
|
||||
Visibility="{Binding TextBox_Visibility}"
|
||||
Style="{StaticResource OptionTextBox}"/>
|
||||
</Grid>
|
||||
</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="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}"/>
|
||||
<EventSetter Event="ContextMenuOpening" Handler="Item_ContextMenuOpening"/>
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
</TreeView>
|
||||
<Border Grid.Row="3"
|
||||
Visibility="{Binding IsImport_Visibility}"
|
||||
Style="{StaticResource LeftPanelTitle_Border}">
|
||||
<TextBlock Text="Imported Entity List"
|
||||
FontWeight="DemiBold"
|
||||
FontSize="14"/>
|
||||
</Border>
|
||||
<ListBox Grid.Row="4"
|
||||
ItemsSource="{Binding ImportedEntityList, UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectedItem="{Binding SelImportedEntity}"
|
||||
MinHeight="100"
|
||||
IsEnabled="{Binding IsEnabled}"
|
||||
Visibility="{Binding IsImport_Visibility}">
|
||||
<ListBox.Resources>
|
||||
<!-- Menu' tasto destro -->
|
||||
<ContextMenu x:Key="RowMenu" ItemsSource="{Binding MenuList}" >
|
||||
<ContextMenu.ItemContainerStyle>
|
||||
<Style TargetType="MenuItem">
|
||||
<Setter Property="Command" Value="{Binding MenuItem_Command}"/>
|
||||
<Setter Property="Header" Value="{Binding sMsg}"/>
|
||||
</Style>
|
||||
</ContextMenu.ItemContainerStyle>
|
||||
</ContextMenu>
|
||||
</ListBox.Resources>
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
||||
<Setter Property="ContextMenu" Value="{StaticResource RowMenu}" />
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid HorizontalAlignment="Stretch">
|
||||
<Grid.InputBindings>
|
||||
<MouseBinding Gesture="LeftDoubleClick"
|
||||
Command="{Binding GeomEntityDoubleClick_Command}"/>
|
||||
</Grid.InputBindings>
|
||||
<TextBlock Text="{Binding ghName}">
|
||||
</TextBlock>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<UniformGrid Grid.Row="5"
|
||||
Rows="1"
|
||||
IsEnabled="{Binding IsEnabled}">
|
||||
<Button Content="Ok"
|
||||
Command="{Binding Ok_Command}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
<Button Content="Cancel"
|
||||
Command="{Binding Cancel_Command}"
|
||||
Visibility="{Binding IsImport_Visibility}"
|
||||
Style="{StaticResource ToolBar_TextButton}"/>
|
||||
</UniformGrid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,24 @@
|
||||
Public Class ManagePartPanelV
|
||||
|
||||
Protected Sub Item_ContextMenuOpening(sender As Object, e As ContextMenuEventArgs)
|
||||
Dim PartItem As ManagePart_Part
|
||||
Dim LayerItem As ManagePart_Layer
|
||||
Dim EntityItem As PartManager_GeomEntity
|
||||
Select Case e.OriginalSource.DataContext.GetType()
|
||||
Case GetType(ManagePart_Part)
|
||||
PartItem = DirectCast(e.OriginalSource.DataContext, ManagePart_Part)
|
||||
If PartItem.MenuList.Count = 0 Then
|
||||
e.Handled = True
|
||||
End If
|
||||
Case GetType(ManagePart_Layer)
|
||||
LayerItem = DirectCast(e.OriginalSource.DataContext, ManagePart_Layer)
|
||||
e.Handled = True
|
||||
Case GetType(PartManager_GeomEntity)
|
||||
EntityItem = DirectCast(e.OriginalSource.DataContext, PartManager_GeomEntity)
|
||||
If EntityItem.MenuList.Count = 0 Then
|
||||
e.Handled = True
|
||||
End If
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,506 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class ManagePartPanelVM
|
||||
Inherits VMBase
|
||||
|
||||
Public Enum ManagePartType
|
||||
IMPORT = 1
|
||||
MODIFY = 2
|
||||
End Enum
|
||||
|
||||
Private m_Type As ManagePartType
|
||||
Friend ReadOnly Property Type As ManagePartType
|
||||
Get
|
||||
Return m_Type
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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 PartManager_GeomEntity)
|
||||
Public Property ImportedEntityList As ObservableCollection(Of PartManager_GeomEntity)
|
||||
Get
|
||||
Return m_ImportedEntityList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of PartManager_GeomEntity))
|
||||
m_ImportedEntityList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SelImportedEntity As PartManager_GeomEntity
|
||||
Public Property SelImportedEntity As PartManager_GeomEntity
|
||||
Get
|
||||
Return m_SelImportedEntity
|
||||
End Get
|
||||
Set(value As PartManager_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)
|
||||
Dim SelEntity As PartManager_GeomEntity = Nothing
|
||||
' cerco tra entita' importate
|
||||
SelEntity = m_ImportedEntityList.FirstOrDefault(Function(x) x.nId = nId)
|
||||
If IsNothing(SelEntity) Then
|
||||
' cerco tra pezzi creati
|
||||
For Each ManagePart In m_ManagerPartList
|
||||
For Each Layer In ManagePart.LayerList
|
||||
SelEntity = Layer.EntityList.FirstOrDefault(Function(x) x.nId = nId)
|
||||
If Not IsNothing(SelEntity) Then
|
||||
SelEntity.bIsSelected = True
|
||||
SelEntity.NotifyPropertyChanged(NameOf(SelEntity.bIsSelected))
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If Not IsNothing(SelEntity) Then
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
m_SelImportedEntity = SelEntity
|
||||
EgtDeselectAll()
|
||||
If Not IsNothing(m_SelImportedEntity) Then
|
||||
EgtSelectObj(m_SelImportedEntity.nId)
|
||||
End If
|
||||
EgtDraw()
|
||||
NotifyPropertyChanged(NameOf(SelImportedEntity))
|
||||
End Sub
|
||||
|
||||
Private m_ManagerPartList As New ObservableCollection(Of ManagePart_Part)
|
||||
Public ReadOnly Property ManagerPartList As ObservableCollection(Of ManagePart_Part)
|
||||
Get
|
||||
Return m_ManagerPartList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelManagerPart As ManagePart_Part
|
||||
Friend Sub SetSelManagerPart(SelManagePart_Part As ManagePart_Part)
|
||||
m_SelManagerPart = SelManagePart_Part
|
||||
m_SelManagerLayer = Nothing
|
||||
End Sub
|
||||
Public ReadOnly Property SelManagerPart As ManagePart_Part
|
||||
Get
|
||||
Return m_SelManagerPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_SelManagerLayer As ManagePart_Layer
|
||||
Public ReadOnly Property SelManagerLayer As ManagePart_Layer
|
||||
Get
|
||||
Return m_SelManagerLayer
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetSelManagerLayer(SelManagePart_Layer As ManagePart_Layer)
|
||||
m_SelManagerPart = m_ManagerPartList.FirstOrDefault(Function(x) x.LayerList.Contains(SelManagePart_Layer))
|
||||
m_SelManagerLayer = SelManagePart_Layer
|
||||
End Sub
|
||||
|
||||
Private m_SelPartManager_GeomEntity As PartManager_GeomEntity
|
||||
Public ReadOnly Property SelPartManager_GeomEntity As PartManager_GeomEntity
|
||||
Get
|
||||
Return m_SelPartManager_GeomEntity
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetSelPartManager_GeomEntity(SelPartManager_GeomEntity As PartManager_GeomEntity)
|
||||
For Each CurrPart In m_ManagerPartList
|
||||
Dim CurrLayer As ManagePart_Layer = CurrPart.LayerList.FirstOrDefault(Function(x) x.EntityList.Contains(SelPartManager_GeomEntity))
|
||||
If Not IsNothing(CurrLayer) Then
|
||||
m_SelManagerPart = CurrPart
|
||||
m_SelManagerLayer = CurrLayer
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
m_SelPartManager_GeomEntity = SelPartManager_GeomEntity
|
||||
End Sub
|
||||
|
||||
Public ReadOnly Property IsImport_Visibility As Visibility
|
||||
Get
|
||||
Select Case m_Type
|
||||
Case ManagePartType.IMPORT
|
||||
Return Visibility.Visible
|
||||
Case Else ' ManagePartType.MODIFY
|
||||
Return Visibility.Collapsed
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_IsEnabled As Boolean = True
|
||||
Public ReadOnly Property IsEnabled As Boolean
|
||||
Get
|
||||
Return m_IsEnabled
|
||||
End Get
|
||||
End Property
|
||||
Friend Sub SetIsEnabled(value As Boolean)
|
||||
m_IsEnabled = value
|
||||
NotifyPropertyChanged(NameOf(IsEnabled))
|
||||
End Sub
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdSetReference As ICommand
|
||||
Private m_cmdAddPart As ICommand
|
||||
Private m_cmdRemovePart As ICommand
|
||||
Private m_cmdOk As ICommand
|
||||
Private m_cmdCancel As ICommand
|
||||
|
||||
Sub New()
|
||||
' Creo riferimento a questa classe in EgtCAM5Map
|
||||
Map.SetRefManagePartPanelVM(Me)
|
||||
End Sub
|
||||
|
||||
#Region "METHODS"
|
||||
|
||||
Friend Sub Init(Type As ManagePartType)
|
||||
m_Type = Type
|
||||
Select Case Type
|
||||
Case ManagePartType.IMPORT
|
||||
' import
|
||||
m_ImportedEntityList.Clear()
|
||||
m_ManagerPartList.Clear()
|
||||
' aggiungo geometrie importate a lista
|
||||
m_nImportedPartId = EgtGetLastPart()
|
||||
Dim nLayerId As Integer = EgtGetFirstLayer(m_nImportedPartId)
|
||||
Dim nGeometryId As Integer = EgtGetFirstInGroup(nLayerId)
|
||||
While nGeometryId <> GDB_ID.NULL
|
||||
Dim sGeometryName As String = ""
|
||||
EgtGetName(nGeometryId, sGeometryName)
|
||||
m_ImportedEntityList.Add(New PartManager_GeomEntity(Nothing, nGeometryId))
|
||||
nGeometryId = EgtGetNext(nGeometryId)
|
||||
End While
|
||||
' aggiungo primo pezzo
|
||||
m_ManagerPartList.Add(New ManagePart_Part(Nothing))
|
||||
m_ManagerPartList(0).LayerList.FirstOrDefault(Function(x) x.Type = ManagePart_Layer.LayerType.PRINT_SOLID).bIsSelected = True
|
||||
' aggiorno i contextmenu di tutti gli entity
|
||||
UpdateAllEntityContextMenu()
|
||||
Case ManagePartType.MODIFY
|
||||
' modify
|
||||
m_ImportedEntityList.Clear()
|
||||
m_ManagerPartList.Clear()
|
||||
' carico pezzi in lista
|
||||
For Each PrintPart In Map.refTopPanelVM.PartList
|
||||
m_ManagerPartList.Add(New ManagePart_Part(PrintPart))
|
||||
Next
|
||||
End Select
|
||||
NotifyPropertyChanged(NameOf(IsImport_Visibility))
|
||||
EgtDeselectAll()
|
||||
End Sub
|
||||
|
||||
Friend Sub UpdateAllEntityContextMenu()
|
||||
' aggiorno i contextmenu di tutti gli entity
|
||||
For Each ManagePart In m_ManagerPartList
|
||||
For Each Layer In ManagePart.LayerList
|
||||
For Each Entity In Layer.EntityList
|
||||
Entity.UpdateContextMenu()
|
||||
Next
|
||||
Next
|
||||
Next
|
||||
For Each Entity In ImportedEntityList
|
||||
Entity.UpdateContextMenu()
|
||||
Next
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#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_ManagerPartList.Add(New ManagePart_Part(Nothing))
|
||||
' aggiorno i contextmenu di tutti gli entity
|
||||
UpdateAllEntityContextMenu()
|
||||
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(SelManagerLayer) AndAlso m_ManagerPartList.Count > 1 Then
|
||||
' rimuovo pezzo
|
||||
m_ManagerPartList.Remove(SelManagerPart)
|
||||
'Else
|
||||
' ' rimuovo geometria
|
||||
' Dim CurrEntity As PartManager_GeomEntity = m_SelPartManager_GeomEntity
|
||||
' SelManagerLayer.EntityList.Remove(m_SelPartManager_GeomEntity)
|
||||
' ' 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()
|
||||
Select Case m_Type
|
||||
Case ManagePartType.IMPORT
|
||||
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_ManagerPartList
|
||||
For Each CurrLayer In CurrPart.LayerList
|
||||
Select Case CurrLayer.Type
|
||||
Case ManagePart_Layer.LayerType.PRINT_SOLID
|
||||
If CurrLayer.EntityList.Count = 0 Then
|
||||
If sErr.Count > 0 Then sErr(sErr.Count - 1) &= Environment.NewLine
|
||||
sErr.Add(CurrPart.sName & " - 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 ManagePart_PartIndex = 0 To m_ManagerPartList.Count - 1
|
||||
Dim ManagePart_Part As ManagePart_Part = m_ManagerPartList(ManagePart_PartIndex)
|
||||
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 PartManager_GeomEntity = Nothing
|
||||
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 ManagePart_Layer In ManagePart_Part.LayerList
|
||||
Select Case ManagePart_Layer.Type
|
||||
Case ManagePart_Layer.LayerType.PRINT_SOLID
|
||||
nPrintPartLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nPrintPartLayerId, PRINT_SOLID)
|
||||
If ManagePart_Layer.EntityList.Count > 0 Then
|
||||
PrintSolidEntity = ManagePart_Layer.EntityList(0)
|
||||
EgtRelocateGlob(PrintSolidEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
|
||||
' calcolo box superficie per creazione riferimento
|
||||
EgtGetBBoxGlob(PrintSolidEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(PrintSolidEntity.nId, GeomEntityColors.c3Print)
|
||||
If PrintSolidEntity.sName <> PrintSolidEntity.nId.ToString() Then
|
||||
EgtSetInfo(PrintSolidEntity.nId, ENTITY_NAME, PrintSolidEntity.sName)
|
||||
End If
|
||||
End If
|
||||
Case ManagePart_Layer.LayerType.MACH_START
|
||||
nMachStartLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nMachStartLayerId, LAY_MACH_START)
|
||||
Dim nMachStartId As Integer = GDB_ID.NULL
|
||||
If ManagePart_Layer.EntityList.Count > 0 Then
|
||||
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
|
||||
' se punto o curva compo
|
||||
Dim EntityType As GDB_TY = EgtGetType(PartManager_GeomEntity.nId)
|
||||
Select Case EntityType
|
||||
Case GDB_TY.GEO_POINT, GDB_TY.CRV_COMPO
|
||||
' gli cambio layer
|
||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nMachStartLayerId, GDB_POS.LAST_SON)
|
||||
nMachStartId = PartManager_GeomEntity.nId
|
||||
Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
|
||||
' altrimenti la trasformo in curva compo
|
||||
nMachStartId = EgtCreateCurveCompo(nMachStartLayerId, PartManager_GeomEntity.nId, True)
|
||||
End Select
|
||||
EgtSetName(nMachStartId, START_GEOM)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(nMachStartId, GeomEntityColors.c3MachStart)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
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
|
||||
EgtSetColor(nMachStartId, GeomEntityColors.c3MachStart)
|
||||
End If
|
||||
Case ManagePart_Layer.LayerType.RIBS
|
||||
nRibsLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nRibsLayerId, LAY_RIBS)
|
||||
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nRibsLayerId, GDB_POS.LAST_SON)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3Rib)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
Next
|
||||
Case ManagePart_Layer.LayerType.SHELL_NUMBER
|
||||
nShellNumberLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
|
||||
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, KEY_SHELLNBR_TYPE, ShellNumberEntity.ShellNumberTypes.FROMIMPORT)
|
||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nShellNumberLayerId, GDB_POS.LAST_SON)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3ShellNumber)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
Next
|
||||
Case ManagePart_Layer.LayerType.AUX_SOLIDS
|
||||
nAuxSolidsLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
|
||||
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, KEY_AUXSOLID_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nAuxSolidsLayerId, GDB_POS.LAST_SON)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3AuxSolids)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
Next
|
||||
Case ManagePart_Layer.LayerType.OTHERS
|
||||
nOthersLayerId = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nOthersLayerId, LAY_OTHERS)
|
||||
For Each PartManager_GeomEntity In ManagePart_Layer.EntityList
|
||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3Others)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
Next
|
||||
If ManagePart_PartIndex = 0 Then
|
||||
For Each PartManager_GeomEntity In ImportedEntityList
|
||||
' se curva
|
||||
Dim EntityType As GDB_TY = EgtGetType(PartManager_GeomEntity.nId)
|
||||
Select Case EntityType
|
||||
Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
|
||||
' la trasformo in curva compo
|
||||
Dim nOtherId As Integer = EgtCreateCurveCompo(nOthersLayerId, PartManager_GeomEntity.nId, True)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(nOtherId, GeomEntityColors.c3Others)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(nOtherId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
Case Else
|
||||
' altrimenti la sposto solamente
|
||||
EgtRelocateGlob(PartManager_GeomEntity.nId, nOthersLayerId, GDB_POS.LAST_SON)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(PartManager_GeomEntity.nId, GeomEntityColors.c3Others)
|
||||
If PartManager_GeomEntity.sName <> PartManager_GeomEntity.nId.ToString() Then
|
||||
EgtSetInfo(PartManager_GeomEntity.nId, ENTITY_NAME, PartManager_GeomEntity.sName)
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
' aggiungo riferimento
|
||||
Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nReferenceLayerId, LAY_REFERENCE)
|
||||
' Creo riferimento
|
||||
Dim ptOrig As New Point3d(b3PrintSolid.Min())
|
||||
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, ReferenceBtn.References.BL)
|
||||
' 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, PART_NAME, ManagePart_Part.sName)
|
||||
EgtSetInfo(nPartId, "PartOnTable", 1)
|
||||
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, 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()
|
||||
|
||||
Case ManagePartType.MODIFY
|
||||
' nulla da fare
|
||||
End Select
|
||||
' 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()
|
||||
' elimino pezzo importato
|
||||
EgtErase(m_nImportedPartId)
|
||||
EgtDraw()
|
||||
' se ci sono pezzi
|
||||
If Map.refTopPanelVM.PartList.Count > 0 Then
|
||||
' ripristino modalita' standard
|
||||
Map.refTopPanelVM.SelPage = Pages.MODIFY
|
||||
Else
|
||||
Map.refTopPanelVM.SelPage = Pages.NULL
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
@@ -0,0 +1,907 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class PartManager_GeomEntity
|
||||
Inherits VMBase
|
||||
|
||||
' layer sotto cui e' questa entita'
|
||||
Private m_OrigLayer As ManagePart_Layer
|
||||
Friend ReadOnly Property OrigLayer As ManagePart_Layer
|
||||
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.refManagePartPanelVM.SetSelPartManager_GeomEntity(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 Property sName As String
|
||||
Get
|
||||
Return m_sName
|
||||
End Get
|
||||
Set(value As String)
|
||||
m_sName = value
|
||||
SetTextBoxVisibility(False)
|
||||
NotifyPropertyChanged(NameOf(sName))
|
||||
If Map.refManagePartPanelVM.Type = ManagePartPanelVM.ManagePartType.MODIFY Then
|
||||
EgtSetInfo(m_nId, ENTITY_NAME, value)
|
||||
End If
|
||||
Map.refManagePartPanelVM.SetIsEnabled(True)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property ghName As String
|
||||
Get
|
||||
Return m_nId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_MenuList As New ObservableCollection(Of GeomEntity_MenuItem)
|
||||
Public Property MenuList As ObservableCollection(Of GeomEntity_MenuItem)
|
||||
Get
|
||||
Return m_MenuList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of GeomEntity_MenuItem))
|
||||
m_MenuList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_UserShouldEditValueNow As Boolean = False
|
||||
Public Property UserShouldEditValueNow As Boolean
|
||||
Get
|
||||
Return m_UserShouldEditValueNow
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_UserShouldEditValueNow = value
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetUserShouldEditValueNow()
|
||||
m_UserShouldEditValueNow = True
|
||||
NotifyPropertyChanged(NameOf(UserShouldEditValueNow))
|
||||
m_UserShouldEditValueNow = False
|
||||
NotifyPropertyChanged(NameOf(UserShouldEditValueNow))
|
||||
End Sub
|
||||
|
||||
Private m_TextBox_Visibility As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property TextBox_Visibility As Visibility
|
||||
Get
|
||||
Return m_TextBox_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_TextBlock_Visibility As Visibility = Visibility.Visible
|
||||
Public ReadOnly Property TextBlock_Visibility As Visibility
|
||||
Get
|
||||
Return m_TextBlock_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comandi
|
||||
Private m_cmdGeomEntityDoubleClick As ICommand
|
||||
|
||||
Sub New(OrigLayer As ManagePart_Layer, nId As Integer)
|
||||
m_nId = nId
|
||||
Dim sName As String = ""
|
||||
EgtGetInfo(m_nId, ENTITY_NAME, sName)
|
||||
m_sName = If(String.IsNullOrWhiteSpace(sName), m_nId, sName)
|
||||
m_OrigLayer = OrigLayer
|
||||
' aggiungo voci layer a contextmenu
|
||||
UpdateContextMenu()
|
||||
End Sub
|
||||
|
||||
Friend Sub UpdateContextMenu()
|
||||
m_MenuList.Clear()
|
||||
Select Case Map.refManagePartPanelVM.Type
|
||||
Case ManagePartPanelVM.ManagePartType.IMPORT
|
||||
Dim bIsSurface As Boolean = False
|
||||
For Each ProjectPart In Map.refManagePartPanelVM.ManagerPartList
|
||||
' verifico in quali layer puo' andare questo elemento
|
||||
Dim EntityType As GDB_TY = EgtGetType(nId)
|
||||
Dim nPrintSolidCount As Integer = 0
|
||||
Dim ManageLayer As ManagePart_Layer = ProjectPart.LayerList.FirstOrDefault(Function(x) x.Type = ManagePart_Layer.LayerType.PRINT_SOLID)
|
||||
If Not IsNothing(ManageLayer) Then
|
||||
nPrintSolidCount = ManageLayer.EntityList.Count
|
||||
End If
|
||||
Select Case EntityType
|
||||
Case GDB_TY.GEO_POINT, GDB_TY.CRV_COMPO, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
|
||||
If Not IsNothing(OrigLayer) Then
|
||||
' recupero i layer
|
||||
If Not ProjectPart Is OrigLayer.OrigPart OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.MACH_START Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.MACH_START, ProjectPart))
|
||||
If Not ProjectPart Is OrigLayer.OrigPart OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.OTHERS Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.OTHERS, ProjectPart))
|
||||
Else
|
||||
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.MACH_START, ProjectPart))
|
||||
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.OTHERS, ProjectPart))
|
||||
End If
|
||||
Case GDB_TY.SRF_MESH
|
||||
bIsSurface = True
|
||||
If Not IsNothing(OrigLayer) Then
|
||||
' verifico se volume chiuso
|
||||
If nPrintSolidCount = 0 AndAlso (Not ProjectPart Is OrigLayer.OrigPart OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.PRINT_SOLID) Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.PRINT_SOLID, ProjectPart))
|
||||
If Not ProjectPart Is OrigLayer.OrigPart OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.SHELL_NUMBER Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.SHELL_NUMBER, ProjectPart))
|
||||
If Not ProjectPart Is OrigLayer.OrigPart OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.AUX_SOLIDS Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.AUX_SOLIDS, ProjectPart))
|
||||
If Not ProjectPart Is OrigLayer.OrigPart OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.RIBS Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.RIBS, ProjectPart))
|
||||
If Not ProjectPart Is OrigLayer.OrigPart OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.OTHERS Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.OTHERS, ProjectPart))
|
||||
Else
|
||||
If nPrintSolidCount = 0 Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.PRINT_SOLID, ProjectPart))
|
||||
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.SHELL_NUMBER, ProjectPart))
|
||||
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.AUX_SOLIDS, ProjectPart))
|
||||
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.RIBS, ProjectPart))
|
||||
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.OTHERS, ProjectPart))
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
If bIsSurface Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.NEWPART))
|
||||
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.CHANGENAME))
|
||||
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.DELETE))
|
||||
Case ManagePartPanelVM.ManagePartType.MODIFY
|
||||
Dim bIsSurface As Boolean = False
|
||||
For Each ProjectPart In Map.refTopPanelVM.PartList
|
||||
' verifico in quali layer puo' andare questo elemento
|
||||
Dim EntityType As GDB_TY = EgtGetType(nId)
|
||||
Dim nPrintSolidCount As Integer = EgtGetGroupObjs(ProjectPart.nPrintSolidLayerId)
|
||||
Select Case EntityType
|
||||
Case GDB_TY.GEO_POINT, GDB_TY.CRV_COMPO, GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_LINE
|
||||
If Not IsNothing(OrigLayer) Then
|
||||
' recupero i layer
|
||||
If ProjectPart.nPartId <> OrigLayer.OrigPart.PrintPart.nPartId OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.MACH_START Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.MACH_START, ProjectPart))
|
||||
If ProjectPart.nPartId <> OrigLayer.OrigPart.PrintPart.nPartId OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.OTHERS Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.OTHERS, ProjectPart))
|
||||
Else
|
||||
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.MACH_START, ProjectPart))
|
||||
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.OTHERS, ProjectPart))
|
||||
End If
|
||||
Case GDB_TY.SRF_MESH
|
||||
bIsSurface = True
|
||||
If Not IsNothing(OrigLayer) Then
|
||||
' verifico se volume chiuso
|
||||
If nPrintSolidCount = 0 AndAlso (ProjectPart.nPartId <> OrigLayer.OrigPart.PrintPart.nPartId OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.PRINT_SOLID) Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.PRINT_SOLID, ProjectPart))
|
||||
If ProjectPart.nPartId <> OrigLayer.OrigPart.PrintPart.nPartId OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.SHELL_NUMBER Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.SHELL_NUMBER, ProjectPart))
|
||||
If ProjectPart.nPartId <> OrigLayer.OrigPart.PrintPart.nPartId OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.AUX_SOLIDS Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.AUX_SOLIDS, ProjectPart))
|
||||
If ProjectPart.nPartId <> OrigLayer.OrigPart.PrintPart.nPartId OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.RIBS Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.RIBS, ProjectPart))
|
||||
If ProjectPart.nPartId <> OrigLayer.OrigPart.PrintPart.nPartId OrElse OrigLayer.Type <> ManagePart_Layer.LayerType.OTHERS Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.OTHERS, ProjectPart))
|
||||
Else
|
||||
If nPrintSolidCount = 0 Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.PRINT_SOLID, ProjectPart))
|
||||
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.SHELL_NUMBER, ProjectPart))
|
||||
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.AUX_SOLIDS, ProjectPart))
|
||||
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.RIBS, ProjectPart))
|
||||
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.OTHERS, ProjectPart))
|
||||
End If
|
||||
End Select
|
||||
Next
|
||||
If bIsSurface Then m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.NEWPART))
|
||||
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.CHANGENAME))
|
||||
m_MenuList.Add(New GeomEntity_MenuItem(Me, ManagePart_Layer.LayerType.DELETE))
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Friend Sub UpdateOrigLayer(NewLayer As ManagePart_Layer)
|
||||
m_OrigLayer = NewLayer
|
||||
End Sub
|
||||
|
||||
Friend Sub SetTextBoxVisibility(bValue As Boolean)
|
||||
m_TextBox_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
|
||||
m_TextBlock_Visibility = If(Not bValue, Visibility.Visible, Visibility.Collapsed)
|
||||
NotifyPropertyChanged(NameOf(TextBox_Visibility))
|
||||
NotifyPropertyChanged(NameOf(TextBlock_Visibility))
|
||||
If bValue Then SetUserShouldEditValueNow()
|
||||
End Sub
|
||||
|
||||
#Region "COMMANDS"
|
||||
|
||||
#Region "GeomEntityDoubleClick"
|
||||
|
||||
Public ReadOnly Property GeomEntityDoubleClick_Command As ICommand
|
||||
Get
|
||||
If m_cmdGeomEntityDoubleClick Is Nothing Then
|
||||
m_cmdGeomEntityDoubleClick = New Command(AddressOf GeomEntityDoubleClick)
|
||||
End If
|
||||
Return m_cmdGeomEntityDoubleClick
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Sub GeomEntityDoubleClick()
|
||||
If Not IsNothing(Map.refManagePartPanelVM.SelManagerLayer) Then
|
||||
Map.refManagePartPanelVM.ImportedEntityList.Remove(Me)
|
||||
' aggiorno riferimenti layer e context menu
|
||||
UpdateOrigLayer(Map.refManagePartPanelVM.SelManagerLayer)
|
||||
UpdateContextMenu()
|
||||
Map.refManagePartPanelVM.SelManagerLayer.EntityList.Add(Me)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' ImportedEntity
|
||||
|
||||
#End Region ' COMMANDS
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ManagePart_Part
|
||||
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.refManagePartPanelVM.SetSelManagerPart(Me)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_nId As Integer
|
||||
Public ReadOnly Property nId As Integer
|
||||
Get
|
||||
Return m_nId
|
||||
End Get
|
||||
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
|
||||
SetTextBoxVisibility(False)
|
||||
NotifyPropertyChanged(NameOf(sName))
|
||||
If Map.refManagePartPanelVM.Type = ManagePartPanelVM.ManagePartType.MODIFY Then
|
||||
m_PrintPart.UpdateName(value)
|
||||
EgtSetInfo(m_PrintPart.nPartId, PART_NAME, value)
|
||||
End If
|
||||
Map.refManagePartPanelVM.SetIsEnabled(True)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_MenuList As New List(Of ManagerPart_MenuItem)
|
||||
Public Property MenuList As List(Of ManagerPart_MenuItem)
|
||||
Get
|
||||
Return m_MenuList
|
||||
End Get
|
||||
Set(value As List(Of ManagerPart_MenuItem))
|
||||
m_MenuList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_LayerList As New ObservableCollection(Of ManagePart_Layer)
|
||||
Public ReadOnly Property LayerList As ObservableCollection(Of ManagePart_Layer)
|
||||
Get
|
||||
Return m_LayerList
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_UserShouldEditValueNow As Boolean = False
|
||||
Public Property UserShouldEditValueNow As Boolean
|
||||
Get
|
||||
Return m_UserShouldEditValueNow
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_UserShouldEditValueNow = value
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetUserShouldEditValueNow()
|
||||
m_UserShouldEditValueNow = True
|
||||
NotifyPropertyChanged(NameOf(UserShouldEditValueNow))
|
||||
m_UserShouldEditValueNow = False
|
||||
NotifyPropertyChanged(NameOf(UserShouldEditValueNow))
|
||||
End Sub
|
||||
|
||||
Private m_TextBox_Visibility As Visibility = Visibility.Collapsed
|
||||
Public ReadOnly Property TextBox_Visibility As Visibility
|
||||
Get
|
||||
Return m_TextBox_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Private m_TextBlock_Visibility As Visibility = Visibility.Visible
|
||||
Public ReadOnly Property TextBlock_Visibility As Visibility
|
||||
Get
|
||||
Return m_TextBlock_Visibility
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Sub New(PrintPart As Print3dPartVM)
|
||||
m_PrintPart = PrintPart
|
||||
'NotifyPropertyChanged(NameOf(sName))
|
||||
If Map.refManagePartPanelVM.ManagerPartList.Count = 0 Then
|
||||
m_nId = 1
|
||||
Else
|
||||
m_nId = Map.refManagePartPanelVM.ManagerPartList.Max(Function(x) x.nId) + 1
|
||||
End If
|
||||
If Not IsNothing(PrintPart) Then
|
||||
m_sName = m_PrintPart.sName
|
||||
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.PRINT_SOLID, "Print", PrintPart))
|
||||
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.MACH_START, "Layer Start", PrintPart))
|
||||
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.RIBS, "Ribs", PrintPart))
|
||||
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.SHELL_NUMBER, "Reduce Shell Number", PrintPart))
|
||||
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.AUX_SOLIDS, "Filled Solids", PrintPart))
|
||||
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.OTHERS, "Others", PrintPart))
|
||||
Else
|
||||
m_sName = "Part" & m_nId
|
||||
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.PRINT_SOLID, "Print"))
|
||||
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.MACH_START, "Layer Start"))
|
||||
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.RIBS, "Ribs"))
|
||||
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.SHELL_NUMBER, "Reduce Shell Number"))
|
||||
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.AUX_SOLIDS, "Filled Solids"))
|
||||
m_LayerList.Add(New ManagePart_Layer(Me, ManagePart_Layer.LayerType.OTHERS, "Others"))
|
||||
End If
|
||||
' creo context menu per cambio nome ed eliminazione
|
||||
m_MenuList.Add(New ManagerPart_MenuItem(Me, ManagerPart_MenuItem.PartMenuCmd.CHANGENAME))
|
||||
m_MenuList.Add(New ManagerPart_MenuItem(Me, ManagerPart_MenuItem.PartMenuCmd.DELETE))
|
||||
End Sub
|
||||
|
||||
Friend Sub SetTextBoxVisibility(bValue As Boolean)
|
||||
m_TextBox_Visibility = If(bValue, Visibility.Visible, Visibility.Collapsed)
|
||||
m_TextBlock_Visibility = If(Not bValue, Visibility.Visible, Visibility.Collapsed)
|
||||
NotifyPropertyChanged(NameOf(TextBox_Visibility))
|
||||
NotifyPropertyChanged(NameOf(TextBlock_Visibility))
|
||||
If bValue Then SetUserShouldEditValueNow()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ManagePart_Layer
|
||||
Inherits VMBase
|
||||
|
||||
Public Enum LayerType As Integer
|
||||
PRINT_SOLID = 1
|
||||
MACH_START = 2
|
||||
RIBS = 3
|
||||
SHELL_NUMBER = 4
|
||||
AUX_SOLIDS = 5
|
||||
OTHERS = 7
|
||||
CHANGENAME = 15
|
||||
DELETE = 16
|
||||
NEWPART = 17
|
||||
End Enum
|
||||
|
||||
' enita' di origine
|
||||
Private m_OrigPart As ManagePart_Part
|
||||
Public ReadOnly Property OrigPart As ManagePart_Part
|
||||
Get
|
||||
Return m_OrigPart
|
||||
End Get
|
||||
End Property
|
||||
|
||||
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.refManagePartPanelVM.SetSelManagerLayer(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 PartManager_GeomEntity)
|
||||
Public Property EntityList As ObservableCollection(Of PartManager_GeomEntity)
|
||||
Get
|
||||
Return m_EntityList
|
||||
End Get
|
||||
Set(value As ObservableCollection(Of PartManager_GeomEntity))
|
||||
m_EntityList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(OrigPart As ManagePart_Part, Type As LayerType, sName As String)
|
||||
m_OrigPart = OrigPart
|
||||
m_Type = Type
|
||||
m_sName = sName
|
||||
End Sub
|
||||
|
||||
Sub New(OrigPart As ManagePart_Part, Type As LayerType, sName As String, PrintPart As Print3dPartVM)
|
||||
m_OrigPart = OrigPart
|
||||
m_Type = Type
|
||||
m_sName = sName
|
||||
Select Case Type
|
||||
Case LayerType.PRINT_SOLID
|
||||
m_nLayerId = PrintPart.nPrintSolidLayerId
|
||||
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
|
||||
If nEntityId <> GDB_ID.NULL Then
|
||||
m_EntityList.Add(New PartManager_GeomEntity(Me, nEntityId))
|
||||
End If
|
||||
Case LayerType.MACH_START
|
||||
m_nLayerId = PrintPart.nMachStartLayerId
|
||||
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
|
||||
While nEntityId <> GDB_ID.NULL
|
||||
m_EntityList.Add(New PartManager_GeomEntity(Me, nEntityId))
|
||||
nEntityId = EgtGetNext(nEntityId)
|
||||
End While
|
||||
Case LayerType.RIBS
|
||||
m_nLayerId = PrintPart.nRibsLayerId
|
||||
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
|
||||
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 PartManager_GeomEntity(Me, nEntityId))
|
||||
End If
|
||||
nEntityId = EgtGetNext(nEntityId)
|
||||
End While
|
||||
Case LayerType.SHELL_NUMBER
|
||||
m_nLayerId = PrintPart.nShellNumberLayerId
|
||||
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
|
||||
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 PartManager_GeomEntity(Me, nEntityId))
|
||||
End If
|
||||
nEntityId = EgtGetNext(nEntityId)
|
||||
End While
|
||||
Case LayerType.AUX_SOLIDS
|
||||
m_nLayerId = PrintPart.nAuxSolidsLayerId
|
||||
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
|
||||
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 PartManager_GeomEntity(Me, nEntityId))
|
||||
'End If
|
||||
nEntityId = EgtGetNext(nEntityId)
|
||||
End While
|
||||
Case LayerType.OTHERS
|
||||
m_nLayerId = PrintPart.nOthersLayerId
|
||||
Dim nEntityId As Integer = EgtGetFirstInGroup(m_nLayerId)
|
||||
While nEntityId <> GDB_ID.NULL
|
||||
m_EntityList.Add(New PartManager_GeomEntity(Me, nEntityId))
|
||||
nEntityId = EgtGetNext(nEntityId)
|
||||
End While
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Public Class GeomEntity_MenuItem
|
||||
Inherits VMBase
|
||||
|
||||
' enita' di origine
|
||||
Private m_OrigEntity As PartManager_GeomEntity
|
||||
|
||||
' pezzo in cui spostare
|
||||
Private m_GeomPart As Print3dPartVM
|
||||
Private m_Part As ManagePart_Part
|
||||
|
||||
' tipo del layer indicato
|
||||
Private m_Type As ManagePart_Layer.LayerType
|
||||
Public Property Type As ManagePart_Layer.LayerType
|
||||
Get
|
||||
Return m_Type
|
||||
End Get
|
||||
Set(value As ManagePart_Layer.LayerType)
|
||||
m_Type = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sMsg As String
|
||||
Get
|
||||
Dim sType As String = ""
|
||||
Select Case m_Type
|
||||
Case ManagePart_Layer.LayerType.PRINT_SOLID
|
||||
sType = "Print"
|
||||
Case ManagePart_Layer.LayerType.MACH_START
|
||||
sType = "Layer Start"
|
||||
Case ManagePart_Layer.LayerType.RIBS
|
||||
sType = "Ribs"
|
||||
Case ManagePart_Layer.LayerType.SHELL_NUMBER
|
||||
sType = "Reduce shell number"
|
||||
Case ManagePart_Layer.LayerType.AUX_SOLIDS
|
||||
sType = "Filled Solids"
|
||||
Case ManagePart_Layer.LayerType.OTHERS
|
||||
sType = "Others"
|
||||
Case ManagePart_Layer.LayerType.NEWPART
|
||||
Return "Create New Part"
|
||||
Case ManagePart_Layer.LayerType.CHANGENAME
|
||||
Return "Change Name"
|
||||
Case ManagePart_Layer.LayerType.DELETE
|
||||
Return "Delete Entity"
|
||||
End Select
|
||||
Dim PartName As String = ""
|
||||
If Map.refManagePartPanelVM.ManagerPartList.Count > 1 Then
|
||||
Dim NewPart As ManagePart_Part = Nothing
|
||||
Select Case Map.refManagePartPanelVM.Type
|
||||
Case ManagePartPanelVM.ManagePartType.IMPORT
|
||||
NewPart = Map.refManagePartPanelVM.ManagerPartList.FirstOrDefault(Function(x) x Is m_Part)
|
||||
Case ManagePartPanelVM.ManagePartType.MODIFY
|
||||
NewPart = Map.refManagePartPanelVM.ManagerPartList.FirstOrDefault(Function(x) x.PrintPart.nPartId = m_GeomPart.nPartId)
|
||||
End Select
|
||||
If Not IsNothing(NewPart) Then
|
||||
PartName = " (" & NewPart.sName & ")"
|
||||
End If
|
||||
End If
|
||||
Return "Move to " & sType & PartName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comando
|
||||
Private m_cmdCommand As ICommand
|
||||
|
||||
Sub New(OrigEntity As PartManager_GeomEntity, Type As ManagePart_Layer.LayerType, GeomPart As Print3dPartVM)
|
||||
m_OrigEntity = OrigEntity
|
||||
m_Type = Type
|
||||
m_GeomPart = GeomPart
|
||||
End Sub
|
||||
|
||||
Sub New(OrigEntity As PartManager_GeomEntity, Type As ManagePart_Layer.LayerType, Part As ManagePart_Part)
|
||||
m_OrigEntity = OrigEntity
|
||||
m_Type = Type
|
||||
m_Part = Part
|
||||
End Sub
|
||||
|
||||
Sub New(OrigEntity As PartManager_GeomEntity, Type As ManagePart_Layer.LayerType)
|
||||
m_OrigEntity = OrigEntity
|
||||
m_Type = Type
|
||||
End Sub
|
||||
|
||||
#Region "Command"
|
||||
|
||||
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()
|
||||
If m_Type = ManagePart_Layer.LayerType.CHANGENAME Then
|
||||
m_OrigEntity.SetTextBoxVisibility(True)
|
||||
Map.refManagePartPanelVM.SetIsEnabled(True)
|
||||
Return
|
||||
ElseIf m_Type = ManagePart_Layer.LayerType.DELETE Then
|
||||
If MessageBox.Show("Are you sure you want to delete this entity?", "Delete confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) = MessageBoxResult.Yes Then
|
||||
EgtErase(m_OrigEntity.nId)
|
||||
' se l'entita' e' gia' in lista pezzi
|
||||
If Not IsNothing(m_OrigEntity.OrigLayer) Then
|
||||
' elimino dalla lista pezzi
|
||||
m_OrigEntity.OrigLayer.EntityList.Remove(m_OrigEntity)
|
||||
Else
|
||||
' altrimenti lo elimino dalla lista entita' importate
|
||||
Map.refManagePartPanelVM.ImportedEntityList.Remove(m_OrigEntity)
|
||||
End If
|
||||
EgtDraw()
|
||||
End If
|
||||
Return
|
||||
ElseIf m_Type = ManagePart_Layer.LayerType.NEWPART Then
|
||||
Select Case Map.refManagePartPanelVM.Type
|
||||
Case ManagePartPanelVM.ManagePartType.IMPORT
|
||||
Dim NewPart As ManagePart_Part = New ManagePart_Part(Nothing)
|
||||
Map.refManagePartPanelVM.ManagerPartList.Add(NewPart)
|
||||
' elimino entity dalla lista entita' importate
|
||||
Map.refManagePartPanelVM.ImportedEntityList.Remove(m_OrigEntity)
|
||||
If Not IsNothing(NewPart) Then
|
||||
Dim NewLayer As ManagePart_Layer = NewPart.LayerList.FirstOrDefault(Function(x) x.Type = ManagePart_Layer.LayerType.PRINT_SOLID)
|
||||
If Not IsNothing(NewLayer) Then
|
||||
NewLayer.EntityList.Add(m_OrigEntity)
|
||||
' aggiorno riferimenti nell'entita'
|
||||
m_OrigEntity.UpdateOrigLayer(NewLayer)
|
||||
End If
|
||||
End If
|
||||
' aggiorno i contextmenu di tutti gli entity
|
||||
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
|
||||
Case ManagePartPanelVM.ManagePartType.MODIFY
|
||||
' recupero path da vecchio pezzo
|
||||
Dim sFilePath As String = ""
|
||||
EgtGetInfo(m_OrigEntity.OrigLayer.OrigPart.PrintPart.nPartId, FILE_PATH, sFilePath)
|
||||
'Dim frImportedPart As New Frame3d
|
||||
'EgtGetGroupGlobFrame(m_nImportedPartId, frImportedPart)
|
||||
' creo pezzo
|
||||
Dim nPartId As Integer = EgtCreateGroup(GDB_ID.ROOT) ', frImportedPart)
|
||||
EgtSetName(nPartId, PART)
|
||||
Dim nFrameId As Integer = GDB_ID.NULL
|
||||
Dim b3PrintSolid As New BBox3d
|
||||
' creo layer solido di stampa
|
||||
Dim nPrintPartLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nPrintPartLayerId, PRINT_SOLID)
|
||||
EgtRelocateGlob(m_OrigEntity.nId, nPrintPartLayerId, GDB_POS.LAST_SON)
|
||||
' calcolo box superficie per creazione riferimento
|
||||
EgtGetBBoxGlob(m_OrigEntity.nId, GDB_BB.STANDARD, b3PrintSolid)
|
||||
' coloro l'entita'
|
||||
EgtSetColor(m_OrigEntity.nId, GeomEntityColors.c3Print)
|
||||
' creo layer mach start
|
||||
Dim nMachStartLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nMachStartLayerId, LAY_MACH_START)
|
||||
Dim nMachStartId As Integer = GDB_ID.NULL
|
||||
' 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
|
||||
EgtSetColor(nMachStartId, GeomEntityColors.c3MachStart)
|
||||
' creo layer ribs
|
||||
Dim nRibsLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nRibsLayerId, LAY_RIBS)
|
||||
' creo layer shell number
|
||||
Dim nShellNumberLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nShellNumberLayerId, LAY_SHELL_NBR)
|
||||
' creo layer aux
|
||||
Dim nAuxSolidsLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nAuxSolidsLayerId, LAY_AUX_SOLIDS)
|
||||
' creo layer others
|
||||
Dim nOthersLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nOthersLayerId, LAY_OTHERS)
|
||||
' aggiungo riferimento
|
||||
Dim nReferenceLayerId As Integer = EgtCreateGroup(nPartId)
|
||||
EgtSetName(nReferenceLayerId, LAY_REFERENCE)
|
||||
' Creo riferimento
|
||||
Dim ptOrig As New Point3d(b3PrintSolid.Min())
|
||||
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, ReferenceBtn.References.BL)
|
||||
' appoggio il pezzo sulla tavola
|
||||
EgtMove(nPartId, New Vector3d(0, 0, -b3PrintSolid.Min.z))
|
||||
' lo aggiungo a lista pezzi
|
||||
EgtSetInfo(nPartId, FILE_PATH, sFilePath)
|
||||
EgtSetInfo(nPartId, "PartOnTable", 1)
|
||||
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
|
||||
Map.refTopPanelVM.PartList.Add(NewPart)
|
||||
Dim ManagePart_Part As ManagePart_Part = New ManagePart_Part(NewPart)
|
||||
' elimino da posizione originale
|
||||
m_OrigEntity.OrigLayer.EntityList.Remove(m_OrigEntity)
|
||||
'Dim bUpdateAllContextMenu As Boolean = False
|
||||
'Dim NewLayer As ManagePart_Layer = ManagePart_Part.LayerList.FirstOrDefault(Function(x) x.Type = ManagePart_Layer.LayerType.PRINT_SOLID)
|
||||
'If Not IsNothing(NewLayer) Then
|
||||
' NewLayer.EntityList.Add(m_OrigEntity)
|
||||
' ' aggiorno riferimenti nell'entita'
|
||||
' m_OrigEntity.UpdateOrigLayer(NewLayer)
|
||||
'End If
|
||||
EgtSetInfo(nPartId, PART_NAME, ManagePart_Part.sName)
|
||||
' lo aggiungo a lista
|
||||
Map.refManagePartPanelVM.ManagerPartList.Add(ManagePart_Part)
|
||||
' aggiorno riferimenti nel context menu item
|
||||
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
|
||||
End Select
|
||||
Return
|
||||
End If
|
||||
Select Case Map.refManagePartPanelVM.Type
|
||||
Case ManagePartPanelVM.ManagePartType.IMPORT
|
||||
' se l'entita' e' gia' in lista pezzi
|
||||
If Not IsNothing(m_OrigEntity.OrigLayer) Then
|
||||
' elimino dalla lista pezzi
|
||||
m_OrigEntity.OrigLayer.EntityList.Remove(m_OrigEntity)
|
||||
Else
|
||||
' altrimenti lo elimino dalla lista entita' importate
|
||||
Map.refManagePartPanelVM.ImportedEntityList.Remove(m_OrigEntity)
|
||||
End If
|
||||
Dim NewPart As ManagePart_Part = Map.refManagePartPanelVM.ManagerPartList.FirstOrDefault(Function(x) x Is m_Part)
|
||||
If Not IsNothing(NewPart) Then
|
||||
Dim NewLayer As ManagePart_Layer = 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
|
||||
' aggiorno riferimenti nel context menu item
|
||||
m_OrigEntity.UpdateContextMenu()
|
||||
Case ManagePartPanelVM.ManagePartType.MODIFY
|
||||
' recupero layer da pezzo
|
||||
Dim nLayerId As Integer = GDB_ID.NULL
|
||||
Select Case m_Type
|
||||
Case ManagePart_Layer.LayerType.PRINT_SOLID
|
||||
nLayerId = m_GeomPart.nPrintSolidLayerId
|
||||
Case ManagePart_Layer.LayerType.MACH_START
|
||||
nLayerId = m_GeomPart.nMachStartLayerId
|
||||
Case ManagePart_Layer.LayerType.RIBS
|
||||
nLayerId = m_GeomPart.nRibsLayerId
|
||||
Case ManagePart_Layer.LayerType.SHELL_NUMBER
|
||||
nLayerId = m_GeomPart.nShellNumberLayerId
|
||||
Case ManagePart_Layer.LayerType.AUX_SOLIDS
|
||||
nLayerId = m_GeomPart.nAuxSolidsLayerId
|
||||
Case ManagePart_Layer.LayerType.OTHERS
|
||||
nLayerId = m_GeomPart.nOthersLayerId
|
||||
End Select
|
||||
' sposto entita'
|
||||
If EgtRelocateGlob(m_OrigEntity.nId, nLayerId) Then
|
||||
' elimino info vecchio layer
|
||||
Select Case m_OrigEntity.OrigLayer.Type
|
||||
Case ManagePart_Layer.LayerType.PRINT_SOLID
|
||||
EgtResetMark(m_OrigEntity.nId)
|
||||
Case ManagePart_Layer.LayerType.MACH_START
|
||||
Case ManagePart_Layer.LayerType.RIBS
|
||||
EgtRemoveInfo(m_OrigEntity.nId, KEY_RIB_TYPE)
|
||||
Case ManagePart_Layer.LayerType.SHELL_NUMBER
|
||||
EgtRemoveInfo(m_OrigEntity.nId, KEY_SHELLNBR_TYPE)
|
||||
Case ManagePart_Layer.LayerType.AUX_SOLIDS
|
||||
EgtRemoveInfo(m_OrigEntity.nId, KEY_AUXSOLID_TYPE)
|
||||
Case ManagePart_Layer.LayerType.OTHERS
|
||||
End Select
|
||||
' sposto in lista
|
||||
m_OrigEntity.OrigLayer.EntityList.Remove(m_OrigEntity)
|
||||
Dim bUpdateAllContextMenu As Boolean = False
|
||||
Dim NewPart As ManagePart_Part = Map.refManagePartPanelVM.ManagerPartList.FirstOrDefault(Function(x) x.PrintPart.nPartId = m_GeomPart.nPartId)
|
||||
If Not IsNothing(NewPart) Then
|
||||
Dim NewLayer As ManagePart_Layer = NewPart.LayerList.FirstOrDefault(Function(x) x.Type = m_Type)
|
||||
If Not IsNothing(NewLayer) Then
|
||||
NewLayer.EntityList.Add(m_OrigEntity)
|
||||
bUpdateAllContextMenu = (m_OrigEntity.OrigLayer.Type = ManagePart_Layer.LayerType.PRINT_SOLID) OrElse (NewLayer.Type = ManagePart_Layer.LayerType.PRINT_SOLID)
|
||||
' aggiorno riferimenti nell'entita'
|
||||
m_OrigEntity.UpdateOrigLayer(NewLayer)
|
||||
End If
|
||||
End If
|
||||
' aggiungo info nuovo layer
|
||||
Select Case m_Type
|
||||
Case ManagePart_Layer.LayerType.PRINT_SOLID
|
||||
EgtSetName(m_OrigEntity.nId, PRINT_SOLID)
|
||||
EgtSetColor(m_OrigEntity.nId, c3Print)
|
||||
Case ManagePart_Layer.LayerType.MACH_START
|
||||
EgtSetName(m_OrigEntity.nId, LAY_MACH_START)
|
||||
EgtSetColor(m_OrigEntity.nId, c3MachStart)
|
||||
Case ManagePart_Layer.LayerType.RIBS
|
||||
EgtSetName(m_OrigEntity.nId, LAY_RIBS)
|
||||
EgtSetInfo(m_OrigEntity.nId, KEY_RIB_TYPE, RibEntity.RibTypes.FROMIMPORT)
|
||||
EgtSetColor(m_OrigEntity.nId, c3Rib)
|
||||
Case ManagePart_Layer.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 ManagePart_Layer.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 ManagePart_Layer.LayerType.OTHERS
|
||||
EgtSetName(m_OrigEntity.nId, LAY_OTHERS)
|
||||
EgtSetColor(m_OrigEntity.nId, c3Others)
|
||||
End Select
|
||||
EgtDraw()
|
||||
' aggiorno riferimenti nel context menu item
|
||||
If bUpdateAllContextMenu Then
|
||||
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
|
||||
Else
|
||||
m_OrigEntity.UpdateContextMenu()
|
||||
End If
|
||||
End If
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
#End Region ' Command
|
||||
|
||||
End Class
|
||||
|
||||
Public Class ManagerPart_MenuItem
|
||||
Inherits VMBase
|
||||
|
||||
Public Enum PartMenuCmd
|
||||
CHANGENAME = 1
|
||||
DELETE = 2
|
||||
End Enum
|
||||
|
||||
Private m_OrigPart As ManagePart_Part
|
||||
|
||||
' tipo del comando
|
||||
Private m_Type As PartMenuCmd
|
||||
Public Property Type As PartMenuCmd
|
||||
Get
|
||||
Return m_Type
|
||||
End Get
|
||||
Set(value As PartMenuCmd)
|
||||
m_Type = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property sMsg As String
|
||||
Get
|
||||
Select Case m_Type
|
||||
Case PartMenuCmd.CHANGENAME
|
||||
Return "Change Name"
|
||||
Case Else ' PartMenuCmd.DELETE
|
||||
Return "Delete Part"
|
||||
End Select
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' Definizione comando
|
||||
Private m_cmdCommand As ICommand
|
||||
|
||||
Sub New(OrigPart As ManagePart_Part, Type As PartMenuCmd)
|
||||
m_OrigPart = OrigPart
|
||||
m_Type = Type
|
||||
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()
|
||||
Select Case m_Type
|
||||
Case PartMenuCmd.CHANGENAME
|
||||
m_OrigPart.SetTextBoxVisibility(True)
|
||||
Map.refManagePartPanelVM.SetIsEnabled(True)
|
||||
Case PartMenuCmd.DELETE
|
||||
If Map.refManagePartPanelVM.ManagerPartList.Count <= 1 Then Return
|
||||
Select Case Map.refManagePartPanelVM.Type
|
||||
Case ManagePartPanelVM.ManagePartType.IMPORT
|
||||
For Each Layer In m_OrigPart.LayerList
|
||||
For Each Entity In Layer.EntityList
|
||||
' le rimuovo da lista entita' pezzo
|
||||
Layer.EntityList.Remove(Entity)
|
||||
' la rimetto in lista importati
|
||||
Map.refManagePartPanelVM.ImportedEntityList.Add(Entity)
|
||||
Next
|
||||
Next
|
||||
' elimino pezzo da lista
|
||||
Map.refManagePartPanelVM.ManagerPartList.Remove(m_OrigPart)
|
||||
Case ManagePartPanelVM.ManagePartType.MODIFY
|
||||
' elimino pezzo geometrico
|
||||
EgtErase(m_OrigPart.PrintPart.nPartId)
|
||||
' elimino pezzo da lista
|
||||
Map.refManagePartPanelVM.ManagerPartList.Remove(m_OrigPart)
|
||||
Dim bSelFirstPart As Boolean = m_OrigPart.PrintPart.nPartId = Map.refTopPanelVM.SelPart.nPartId
|
||||
' elimino pezzo da lista Top
|
||||
Map.refTopPanelVM.PartList.Remove(m_OrigPart.PrintPart)
|
||||
EgtDraw()
|
||||
If bSelFirstPart Then Map.refTopPanelVM.SelFirstPart()
|
||||
End Select
|
||||
' aggiorno riferimenti nel context menu item
|
||||
Map.refManagePartPanelVM.UpdateAllEntityContextMenu()
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
#End Region ' Cancel
|
||||
|
||||
End Class
|
||||
@@ -162,6 +162,9 @@ Public Class ProjManagerVM
|
||||
End Sub
|
||||
|
||||
Friend Sub NewProject(bDialog As Boolean)
|
||||
' Gestisco eventuale file corrente modificato
|
||||
If Not Map.refSceneHostVM.MainController.ManageModified() Then Return
|
||||
EgtResetModified()
|
||||
Dim NewProjMachine As Machine
|
||||
If bDialog AndAlso Map.refMachinePanelVM.MachineList.Count > 0 Then
|
||||
Dim ChooseMachineWndVM As New ChooseMachineWndVM
|
||||
|
||||
@@ -309,6 +309,7 @@ Public Class MySceneHostVM
|
||||
sDir = Path.GetDirectoryName(sDir)
|
||||
End If
|
||||
If Not Directory.Exists(sDir) Then sDir = ""
|
||||
Dim ExtIndex As Integer = GetMainPrivateProfileInt(S_PRINTING3D, K_IMPORTCURREXTENSION, 1)
|
||||
Dim OpenFileDialog As New OpenFileDialog With {.Title = "Insert",
|
||||
.Filter = "Stereolithography (*.stl)|*.stl" &
|
||||
"|Iges files (*.igs;*.iges)|*.igs;*.iges" &
|
||||
@@ -316,11 +317,12 @@ Public Class MySceneHostVM
|
||||
"|3D Manufacturing format (*.3mf)|*.3mf" &
|
||||
"|New geometry EgalTech(*.nge)|*.nge" &
|
||||
"|All Files (*.*)|*.*",
|
||||
.FilterIndex = 1,
|
||||
.FilterIndex = ExtIndex,
|
||||
.InitialDirectory = sDir}
|
||||
If Not OpenFileDialog.ShowDialog Then
|
||||
Return
|
||||
End If
|
||||
WriteMainPrivateProfileString(S_PRINTING3D, K_IMPORTCURREXTENSION, OpenFileDialog.FilterIndex)
|
||||
Dim sFile As String = String.Empty
|
||||
sFile = OpenFileDialog.FileName
|
||||
' importo la nuova geometria
|
||||
@@ -898,7 +900,7 @@ Public Class MySceneHostVM
|
||||
ProjectMaterial = Map.refTopPanelVM.MaterialList.FirstOrDefault(Function(x) x.sName = sMaterialName)
|
||||
End If
|
||||
If Not IsNothing(ProjectMaterial) Then
|
||||
Map.refTopPanelVM.SelMaterial = ProjectMaterial
|
||||
Map.refTopPanelVM.SetSelMaterial(ProjectMaterial, True)
|
||||
Map.refTopPanelVM.NotifyPropertyChanged(NameOf(Map.refTopPanelVM.SelMaterial))
|
||||
End If
|
||||
End If
|
||||
@@ -914,7 +916,6 @@ Public Class MySceneHostVM
|
||||
End If
|
||||
Dim nPrintPartLayerId As Integer = EgtGetFirstNameInGroup(nPartId, PRINT_SOLID)
|
||||
Dim nPrintPartId As Integer = EgtGetFirstInGroup(nPrintPartLayerId)
|
||||
Dim nOriginalPartLayerId As Integer = EgtGetFirstNameInGroup(nPartId, ORIGINAL_SOLID)
|
||||
Dim nRibsLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_RIBS)
|
||||
Dim nShellNumberLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_SHELL_NBR)
|
||||
Dim nAuxSolidsLayerId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_AUX_SOLIDS)
|
||||
@@ -924,7 +925,7 @@ Public Class MySceneHostVM
|
||||
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, nOthersLayerId, sFilePath)
|
||||
Dim NewPart As New Print3dPartVM(nPartId, nPrintPartLayerId, nReferenceLayerId, nFrameId, nMachStartLayerId, nRibsLayerId, nShellNumberLayerId, nAuxSolidsLayerId, nOthersLayerId, sFilePath)
|
||||
Map.refTopPanelVM.PartList.Add(NewPart)
|
||||
Dim bPartToRecalc As Boolean = False
|
||||
EgtGetInfo(nPartId, MAC_TORECALC_SLICE, bPartToRecalc)
|
||||
@@ -1175,7 +1176,7 @@ Public Class MySceneHostVM
|
||||
While nId <> GDB_ID.NULL
|
||||
' Recupero l'identificativo del pezzo cui appartiene
|
||||
Dim nPartId As Integer = EgtGetParent(EgtGetParent(nId))
|
||||
If nPartId = Map.refImportPanelVM.nImportedPartId Then
|
||||
If nPartId = Map.refManagePartPanelVM.nImportedPartId Then
|
||||
Dim EntityType As GDB_TY = EgtGetType(nId)
|
||||
Select Case EntityType
|
||||
Case GDB_TY.CRV_ARC, GDB_TY.CRV_BEZ, GDB_TY.CRV_COMPO, GDB_TY.CRV_LINE
|
||||
@@ -1225,7 +1226,7 @@ Public Class MySceneHostVM
|
||||
If Not m_bDragToStart Then
|
||||
' Se selezione da eseguire
|
||||
ElseIf m_nIdToSel <> GDB_ID.NULL Then
|
||||
Map.refImportPanelVM.SetSelImportedEntity(m_nIdToSel)
|
||||
Map.refManagePartPanelVM.SetSelImportedEntity(m_nIdToSel)
|
||||
End If
|
||||
' Reset
|
||||
m_bDrag = False
|
||||
|
||||
@@ -4,6 +4,12 @@ Imports EgtUILib
|
||||
Public Class SecondaryWindowV
|
||||
|
||||
Private m_SecondaryWindowVM As SecondaryWindowVM
|
||||
Private m_WindowChangingState As Boolean = False
|
||||
Public ReadOnly Property WindowChangingState As Boolean
|
||||
Get
|
||||
Return m_WindowChangingState
|
||||
End Get
|
||||
End Property
|
||||
|
||||
#Region "CONSTRUCTOR"
|
||||
|
||||
@@ -55,9 +61,11 @@ Public Class SecondaryWindowV
|
||||
End Sub
|
||||
|
||||
Private Sub SecondaryWindowV_StateChanged(sender As Object, e As EventArgs)
|
||||
m_WindowChangingState = True
|
||||
Application.Current.MainWindow.WindowState = Me.WindowState
|
||||
Application.Current.MainWindow.Topmost = True
|
||||
Application.Current.MainWindow.Topmost = False
|
||||
m_WindowChangingState = False
|
||||
End Sub
|
||||
|
||||
#End Region ' CONSTRUCTOR
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
Grid.Row="1"
|
||||
ItemsSource="{Binding PartList}"
|
||||
SelectedItem="{Binding SelPart}"
|
||||
DisplayMemberPath="sImportedFileName"
|
||||
DisplayMemberPath="sName"
|
||||
FontSize="14"
|
||||
FontFamily="/Resources/Fonts/#Roboto"
|
||||
FontWeight="Light"
|
||||
|
||||
@@ -205,7 +205,7 @@ Public Class TopPanelVM
|
||||
Set(value As MaterialIndex)
|
||||
' salvo materiale selezionato come ultimo utilizzato
|
||||
If Not IsNothing(value) Then WriteMainPrivateProfileString(S_PRINTING3D, K_CURRMATERIAL, value.sGUID)
|
||||
' salvo lavorazione selezionata per riselezionarlo
|
||||
' salvo lavorazione selezionata per riselezionarla
|
||||
Dim PrevMachiningGuid As Guid = Guid.Empty
|
||||
If Not IsNothing(m_SelMachining) Then PrevMachiningGuid = m_SelMachining.sGUID
|
||||
' seleziono materiale
|
||||
@@ -224,9 +224,18 @@ Public Class TopPanelVM
|
||||
SetSelMachining(If(Not IsNothing(PrevMachining), PrevMachining, MachiningIndex.Empty()))
|
||||
End Set
|
||||
End Property
|
||||
Friend Sub SetSelMaterial(value As MaterialIndex)
|
||||
Friend Sub SetSelMaterial(value As MaterialIndex, Optional bUpdateMaterialList As Boolean = False)
|
||||
m_SelMaterial = value
|
||||
NotifyPropertyChanged(NameOf(SelMaterial))
|
||||
If bUpdateMaterialList Then
|
||||
' salvo lavorazione selezionata per riselezionarla
|
||||
Dim PrevMachiningGuid As Guid = Guid.Empty
|
||||
If Not IsNothing(m_SelMachining) Then PrevMachiningGuid = m_SelMachining.sGUID
|
||||
' ricarico lista lavorazioni valide per il materiale selezionato
|
||||
InitMachiningsList()
|
||||
Dim PrevMachining As MachiningIndex = m_MachiningList.FirstOrDefault(Function(x) x.sGUID = PrevMachiningGuid)
|
||||
SetSelMachining(If(Not IsNothing(PrevMachining), PrevMachining, MachiningIndex.Empty()))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#End Region ' Material
|
||||
@@ -394,11 +403,25 @@ Public Class TopPanelVM
|
||||
#Region "Pages"
|
||||
|
||||
Private Sub InitIMPORT()
|
||||
' disabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
|
||||
Map.refProjManagerVM.SetProjCmdIsEnabled(False)
|
||||
Map.refTopPanelVM.SetTopPanelIsEnabled(False)
|
||||
Map.refSliceManagerVM.SetButtonsIsEnabled(False)
|
||||
Map.refSliderManagerVM.SetLayerIndexIsEnabled(False)
|
||||
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(False)
|
||||
' imposto pagina
|
||||
Map.refLeftPanelVM.SetSelPanel(LeftPanelVM.Panels.IMPORT)
|
||||
Map.refImportPanelVM.Init()
|
||||
''Map.refImportPanelVM.Init()
|
||||
Map.refManagePartPanelVM.Init(ManagePartPanelVM.ManagePartType.IMPORT)
|
||||
End Sub
|
||||
|
||||
Private Function ExitIMPORT()
|
||||
' riabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
|
||||
Map.refProjManagerVM.SetProjCmdIsEnabled(True)
|
||||
Map.refTopPanelVM.SetTopPanelIsEnabled(True)
|
||||
Map.refSliceManagerVM.SetButtonsIsEnabled(True)
|
||||
Map.refSliderManagerVM.SetLayerIndexIsEnabled(True)
|
||||
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(True)
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -510,11 +533,31 @@ Public Class TopPanelVM
|
||||
End Function
|
||||
|
||||
Private Sub InitMODIFYPART()
|
||||
' disabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
|
||||
Map.refProjManagerVM.SetProjCmdIsEnabled(False)
|
||||
Map.refTopPanelVM.SetTopPanelIsEnabled(False)
|
||||
Map.refSliceManagerVM.SetButtonsIsEnabled(False)
|
||||
Map.refSliderManagerVM.SetLayerIndexIsEnabled(False)
|
||||
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(False)
|
||||
' tolgo mark da pezzo selezionato
|
||||
If Not IsNothing(SelPart) Then
|
||||
EgtResetMark(SelPart.nPrintSolidId)
|
||||
End If
|
||||
' imposto pagina
|
||||
Map.refLeftPanelVM.SetSelPanel(LeftPanelVM.Panels.MODIFYPART)
|
||||
End Sub
|
||||
|
||||
Private Function ExitMODIFYPART()
|
||||
|
||||
' riabilito ProjManager, TopPanel, TFS, Slider, bottoni e uscita dal programma
|
||||
Map.refProjManagerVM.SetProjCmdIsEnabled(True)
|
||||
Map.refTopPanelVM.SetTopPanelIsEnabled(True)
|
||||
Map.refSliceManagerVM.SetButtonsIsEnabled(True)
|
||||
Map.refSliderManagerVM.SetLayerIndexIsEnabled(True)
|
||||
Map.refSliderManagerVM.SetLayerAdvancementIsEnabled(True)
|
||||
' ripristino mark su pezzo selezionato
|
||||
If Not IsNothing(SelPart) Then
|
||||
EgtSetMark(SelPart.nPrintSolidId)
|
||||
End If
|
||||
Return True
|
||||
End Function
|
||||
|
||||
@@ -530,8 +573,8 @@ Public Class TopPanelVM
|
||||
' rinomino pezzo e layer
|
||||
Dim nPartId As Integer = EgtGetLastPart()
|
||||
EgtSetName(nPartId, PART)
|
||||
Dim nLayerId As Integer = EgtGetFirstInGroup(nPartId)
|
||||
EgtSetName(nLayerId, ORIGINAL_SOLID)
|
||||
'Dim nLayerId As Integer = EgtGetFirstInGroup(nPartId)
|
||||
'EgtSetName(nLayerId, ORIGINAL_SOLID)
|
||||
|
||||
'' Recupero o creo layer ausiliario
|
||||
'Dim nAuxId As Integer = EgtGetFirstNameInGroup(nPartId, LAY_AUX)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<PrintApp:DispositionPanelVM x:Key="DispositionPanelVM"/>
|
||||
<PrintApp:StartMachPanelVM x:Key="StartMachPanelVM"/>
|
||||
<PrintApp:RibPanelVM x:Key="RibPanelVM"/>
|
||||
<PrintApp:ImportPanelVM x:Key="ImportPanelVM"/>
|
||||
<!--<PrintApp:ImportPanelVM x:Key="ImportPanelVM"/>-->
|
||||
<PrintApp:TopPanelVM x:Key="TopPanelVM"/>
|
||||
<PrintApp:ControllerInputPanelVM x:Key="ControllerInputPanelVM"/>
|
||||
<PrintApp:SliceManagerVM x:Key="SliceManagerVM"/>
|
||||
@@ -44,7 +44,8 @@
|
||||
<PrintApp:SimulationPanelVM x:Key="SimulationPanelVM"/>
|
||||
<PrintApp:ReferencePanelVM x:Key="ReferencePanelVM"/>
|
||||
<PrintApp:ViewLayerManagerVM x:Key="ViewLayerManagerVM"/>
|
||||
<PrintApp:ModifyPartPanelVM x:Key="ModifyPartPanelVM"/>
|
||||
<!--<PrintApp:ModifyPartPanelVM x:Key="ModifyPartPanelVM"/>-->
|
||||
<PrintApp:ManagePartPanelVM x:Key="ManagePartPanelVM"/>
|
||||
<!--<EgtBEAMWALL:CALCPanelVM x:Key="CALCPanelVM"/>
|
||||
<EgtBEAMWALL:PartParametersVM x:Key="PartParametersVM"/>
|
||||
<EgtBEAMWALL:LeftPanelVM x:Key="LeftPanelVM"/>
|
||||
|
||||
@@ -46,7 +46,7 @@ Module GeomEntityColors
|
||||
|
||||
Sub New()
|
||||
' imposto colori superfici
|
||||
m_c3Print.FromColor(System.Drawing.Color.Yellow)
|
||||
m_c3Print.FromColor(System.Drawing.Color.Aqua)
|
||||
m_c3MachStart.FromColor(System.Drawing.Color.Red)
|
||||
m_c3Rib.FromColor(System.Drawing.Color.MediumOrchid)
|
||||
m_c3ShellNumber.FromColor(System.Drawing.Color.Lime)
|
||||
|
||||
+30
-18
@@ -47,7 +47,7 @@ Module Map
|
||||
'Private m_refSplitModeVM As SplitModeVM
|
||||
'Private m_refMoveRawModeVM As MoveRawModeVM
|
||||
'Private m_refSimulTabVM As SimulTabVM
|
||||
Private m_refImportPanelVM As ImportPanelVM
|
||||
''Private m_refImportPanelVM As ImportPanelVM
|
||||
Private m_refSliceManagerVM As SliceManagerVM
|
||||
Private m_refTFSEditorVM As TFSEditorVM
|
||||
Private m_refCurrMachiningPanelVM As CurrMachiningPanelVM
|
||||
@@ -61,7 +61,8 @@ Module Map
|
||||
Private m_refShellNumberPanelVM As ShellNumberPanelVM
|
||||
Private m_refShellNumberParamPanelVM As ShellNumberParamPanelVM
|
||||
Private m_refSplashScreen As SplashScreen
|
||||
Private m_refModifyPartPanelVM As ModifyPartPanelVM
|
||||
''Private m_refModifyPartPanelVM As ModifyPartPanelVM
|
||||
Private m_refManagePartPanelVM As ManagePartPanelVM
|
||||
|
||||
#Region "Get"
|
||||
|
||||
@@ -346,11 +347,11 @@ Module Map
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
Public ReadOnly Property refImportPanelVM As ImportPanelVM
|
||||
Get
|
||||
Return m_refImportPanelVM
|
||||
End Get
|
||||
End Property
|
||||
'Public ReadOnly Property refImportPanelVM As ImportPanelVM
|
||||
' Get
|
||||
' Return m_refImportPanelVM
|
||||
' End Get
|
||||
'End Property
|
||||
|
||||
Public ReadOnly Property refSliceManagerVM As SliceManagerVM
|
||||
Get
|
||||
@@ -429,10 +430,16 @@ Module Map
|
||||
Return m_refSplashScreen
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property refModifyPartPanelVM As ModifyPartPanelVM
|
||||
|
||||
''Public ReadOnly Property refModifyPartPanelVM As ModifyPartPanelVM
|
||||
'' Get
|
||||
'' Return m_refModifyPartPanelVM
|
||||
'' End Get
|
||||
''End Property
|
||||
|
||||
Public ReadOnly Property refManagePartPanelVM As ManagePartPanelVM
|
||||
Get
|
||||
Return m_refModifyPartPanelVM
|
||||
Return m_refManagePartPanelVM
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -674,10 +681,10 @@ Module Map
|
||||
' Return Not IsNothing(m_refSimulTabVM)
|
||||
'End Function
|
||||
|
||||
Friend Function SetRefImportPanelVM(ImportPanelVM As ImportPanelVM) As Boolean
|
||||
m_refImportPanelVM = ImportPanelVM
|
||||
Return Not IsNothing(m_refImportPanelVM)
|
||||
End Function
|
||||
''Friend Function SetRefImportPanelVM(ImportPanelVM As ImportPanelVM) As Boolean
|
||||
'' m_refImportPanelVM = ImportPanelVM
|
||||
'' Return Not IsNothing(m_refImportPanelVM)
|
||||
''End Function
|
||||
|
||||
Friend Function SetRefSliceManagerVM(SliceManagerVM As SliceManagerVM) As Boolean
|
||||
m_refSliceManagerVM = SliceManagerVM
|
||||
@@ -743,10 +750,15 @@ Module Map
|
||||
m_refSplashScreen = SplashScreen
|
||||
Return Not IsNothing(m_refSplashScreen)
|
||||
End Function
|
||||
|
||||
Friend Function SetRefModifyPartPanelVM(ModifyPartPanelVM As ModifyPartPanelVM) As Boolean
|
||||
m_refModifyPartPanelVM = ModifyPartPanelVM
|
||||
Return Not IsNothing(m_refModifyPartPanelVM)
|
||||
|
||||
''Friend Function SetRefModifyPartPanelVM(ModifyPartPanelVM As ModifyPartPanelVM) As Boolean
|
||||
'' m_refModifyPartPanelVM = ModifyPartPanelVM
|
||||
'' Return Not IsNothing(m_refModifyPartPanelVM)
|
||||
''End Function
|
||||
|
||||
Friend Function SetRefManagePartPanelVM(ManagePartPanelVM As ManagePartPanelVM) As Boolean
|
||||
m_refManagePartPanelVM = ManagePartPanelVM
|
||||
Return Not IsNothing(m_refManagePartPanelVM)
|
||||
End Function
|
||||
|
||||
#End Region ' Set
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
Imports System.Collections.ObjectModel
|
||||
Imports EgtUILib
|
||||
Imports EgtWPFLib5
|
||||
|
||||
Public Class Print3dPartVM
|
||||
Inherits VMBase
|
||||
|
||||
Private m_nPartId As Integer
|
||||
Public ReadOnly Property nPartId As Integer
|
||||
@@ -17,18 +19,9 @@ Public Class Print3dPartVM
|
||||
Return m_nPrintSolidLayerId
|
||||
End Get
|
||||
End Property
|
||||
Private m_nPrintSolidId As Integer = GDB_ID.NULL
|
||||
Public ReadOnly Property nPrintSolidId As Integer
|
||||
Get
|
||||
Return m_nPrintSolidId
|
||||
End Get
|
||||
End Property
|
||||
|
||||
' solido/superficie originale
|
||||
Private m_nOriginalPartLayerId As Integer = GDB_ID.NULL
|
||||
Public ReadOnly Property nOriginalPartLayerId As Integer
|
||||
Get
|
||||
Return m_nOriginalPartLayerId
|
||||
Return EgtGetFirstInGroup(m_nPrintSolidLayerId)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -87,6 +80,13 @@ Public Class Print3dPartVM
|
||||
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 sImportedFileName As String
|
||||
Get
|
||||
Return If(Not String.IsNullOrWhiteSpace(m_sImportedFilePath), IO.Path.GetFileName(m_sImportedFilePath), "")
|
||||
@@ -118,15 +118,14 @@ Public Class Print3dPartVM
|
||||
|
||||
Sub New(nPartId As Integer, sImportedFilePath As String)
|
||||
m_nPartId = nPartId
|
||||
m_sName = IO.Path.GetFileName(sImportedFilePath)
|
||||
m_sImportedFilePath = 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,
|
||||
Sub New(nPartId As Integer, nPrintSolidLayerId As Integer, nReferenceLayerId As Integer, nReferenceId As Integer, nMachStartLayerId As Integer,
|
||||
nRibsLayerId As Integer, nShellNumberLayerId As Integer, nAuxSolidsLayerId As Integer, nOthersLayerId As Integer, sImportedFilePath As String)
|
||||
m_nPartId = nPartId
|
||||
m_nPrintSolidLayerId = nPrintSolidLayerId
|
||||
m_nPrintSolidId = nPrintSolidId
|
||||
m_nOriginalPartLayerId = nOriginalPartLayerId
|
||||
m_nReferenceLayerId = nReferenceLayerId
|
||||
m_nReferenceId = nReferenceId
|
||||
m_nMachStartLayerId = nMachStartLayerId
|
||||
@@ -134,6 +133,9 @@ Public Class Print3dPartVM
|
||||
m_nRibsLayerId = nRibsLayerId
|
||||
m_nShellNumberLayerId = nShellNumberLayerId
|
||||
m_nOthersLayerId = nOthersLayerId
|
||||
If Not EgtGetInfo(nPartId, PART_NAME, m_sName) Then
|
||||
m_sName = IO.Path.GetFileName(sImportedFilePath)
|
||||
End If
|
||||
m_sImportedFilePath = sImportedFilePath
|
||||
RefreshPrintLayers()
|
||||
End Sub
|
||||
@@ -159,6 +161,11 @@ Public Class Print3dPartVM
|
||||
m_nReferenceId = nNewReferenceId
|
||||
End Sub
|
||||
|
||||
Friend Sub UpdateName(Name As String)
|
||||
m_sName = Name
|
||||
NotifyPropertyChanged(NameOf(sName))
|
||||
End Sub
|
||||
|
||||
#End Region ' METHODS
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user