53b515135f
- migliorata importazione rib, aux solid e shell number - aggiunti parametri aux solid e shell number - correzioni e migliorie
232 lines
6.1 KiB
VB.net
232 lines
6.1 KiB
VB.net
Imports System.Collections.ObjectModel
|
|
Imports EgtUILib
|
|
Imports EgtWPFLib5
|
|
|
|
Public Class GeomEntity
|
|
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
|
|
' seleziono in scena
|
|
EgtDeselectAll()
|
|
If Not IsNothing(value) Then
|
|
EgtSelectObj(m_nId)
|
|
End If
|
|
EgtDraw()
|
|
' segno come elemento selezionato in treeview
|
|
Map.refImportPanelVM.SetSelGeomEntity(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 & If(Not String.IsNullOrWhiteSpace(m_sName), " - " & m_sName, "")
|
|
End Get
|
|
End Property
|
|
|
|
Private m_Reference As ChooseReferenceWndVM.References = ChooseReferenceWndVM.References.BL
|
|
Public Property Reference As ChooseReferenceWndVM.References
|
|
Get
|
|
Return m_Reference
|
|
End Get
|
|
Set(value As ChooseReferenceWndVM.References)
|
|
m_Reference = value
|
|
NotifyPropertyChanged(NameOf(ghReference))
|
|
End Set
|
|
End Property
|
|
Public ReadOnly Property ghReference As String
|
|
Get
|
|
Select Case m_Reference
|
|
Case ChooseReferenceWndVM.References.TL
|
|
Return "┌"
|
|
Case ChooseReferenceWndVM.References.TR
|
|
Return "┐"
|
|
Case ChooseReferenceWndVM.References.BL
|
|
Return "└"
|
|
Case ChooseReferenceWndVM.References.BR
|
|
Return "┘"
|
|
Case ChooseReferenceWndVM.References.TC
|
|
Return "┬"
|
|
Case ChooseReferenceWndVM.References.ML
|
|
Return "├"
|
|
Case ChooseReferenceWndVM.References.MR
|
|
Return "┤"
|
|
Case ChooseReferenceWndVM.References.BC
|
|
Return "┴"
|
|
Case ChooseReferenceWndVM.References.MC
|
|
Return "┼"
|
|
Case Else
|
|
Return "X"
|
|
End Select
|
|
End Get
|
|
End Property
|
|
|
|
' Definizione comandi
|
|
Private m_cmdImportedEntity As ICommand
|
|
|
|
Sub New(nId As Integer, sName As String)
|
|
m_nId = nId
|
|
m_sName = sName
|
|
End Sub
|
|
|
|
#Region "COMMANDS"
|
|
|
|
#Region "ImportedEntity"
|
|
|
|
Public ReadOnly Property ImportedEntity_DoubleClick As ICommand
|
|
Get
|
|
If m_cmdImportedEntity Is Nothing Then
|
|
m_cmdImportedEntity = New Command(AddressOf ImportedEntity)
|
|
End If
|
|
Return m_cmdImportedEntity
|
|
End Get
|
|
End Property
|
|
|
|
Public Sub ImportedEntity()
|
|
If Not IsNothing(Map.refImportPanelVM.SelImportLayer) Then
|
|
Map.refImportPanelVM.ImportedEntityList.Remove(Me)
|
|
Map.refImportPanelVM.SelImportLayer.EntityList.Add(Me)
|
|
End If
|
|
End Sub
|
|
|
|
#End Region ' ImportedEntity
|
|
|
|
#End Region ' COMMANDS
|
|
End Class
|
|
|
|
Public Class ImportPart
|
|
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.refImportPanelVM.SetSelImportPart(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_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 If(Not String.IsNullOrWhiteSpace(m_sName), m_nId & " - " & m_sName, "Part" & m_nId)
|
|
End Get
|
|
End Property
|
|
|
|
Private m_LayerList As New ObservableCollection(Of ImportLayer)
|
|
Public ReadOnly Property LayerList As ObservableCollection(Of ImportLayer)
|
|
Get
|
|
Return m_LayerList
|
|
End Get
|
|
End Property
|
|
|
|
Sub New()
|
|
m_nId = If(Map.refImportPanelVM.ImportPartList.Count = 0, 1, Map.refImportPanelVM.ImportPartList.Max(Function(x) x.m_nId) + 1)
|
|
m_LayerList.Add(New ImportLayer(ImportLayer.LayerType.PRINT_SOLID, "Print"))
|
|
m_LayerList.Add(New ImportLayer(ImportLayer.LayerType.MACH_START, "Layer Start"))
|
|
'm_LayerList.Add(New ImportLayer(ImportLayer.LayerType.ORIGINAL_SOLID, "Original Solid"))
|
|
m_LayerList.Add(New ImportLayer(ImportLayer.LayerType.RIBS, "Ribs"))
|
|
m_LayerList.Add(New ImportLayer(ImportLayer.LayerType.SHELL_NUMBER, "Reduce Shell Number"))
|
|
m_LayerList.Add(New ImportLayer(ImportLayer.LayerType.AUX_SOLIDS, "Filled Solids"))
|
|
m_LayerList.Add(New ImportLayer(ImportLayer.LayerType.OTHERS, "Others"))
|
|
End Sub
|
|
|
|
End Class
|
|
|
|
Public Class ImportLayer
|
|
Inherits VMBase
|
|
|
|
Public Enum LayerType As Integer
|
|
PRINT_SOLID = 1
|
|
MACH_START = 2
|
|
RIBS = 3
|
|
SHELL_NUMBER = 4
|
|
AUX_SOLIDS = 5
|
|
OTHERS = 7
|
|
End Enum
|
|
|
|
Private m_bIsSelected As Boolean
|
|
Public Property bIsSelected As Boolean
|
|
Get
|
|
Return m_bIsSelected
|
|
End Get
|
|
Set(value As Boolean)
|
|
m_bIsSelected = value
|
|
Map.refImportPanelVM.SetSelImportLayer(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 GeomEntity)
|
|
Public Property EntityList As ObservableCollection(Of GeomEntity)
|
|
Get
|
|
Return m_EntityList
|
|
End Get
|
|
Set(value As ObservableCollection(Of GeomEntity))
|
|
m_EntityList = value
|
|
End Set
|
|
End Property
|
|
|
|
Sub New(Type As LayerType, sName As String)
|
|
m_Type = Type
|
|
m_sName = sName
|
|
End Sub
|
|
|
|
End Class
|