DXF를 읽어오는 모듈을 정리

과거 동적배열로 된 변수들을 Generic.List와 Generic.Dictionary로 변경하였다. 파일 읽는 시간이 놀랍게 줄었다.
리스트와 딕셔너리도 마치 동적배열처럼 사용할 수 있다.
[code lang-vb]'옛날 코드
Dim DXFEntities() As SV_DXFEntity
ReDim Preserve DXFEntities(k)
DXFEntities(k) = New SV_DXFEntity[/code]

[code lang-vb]'개체 클래스
Public Class SV_DXFEntity
    Private m_Type As String '자료명
    Private m_CodeValue As Generic.Dictionary(Of Integer, String)
    '
    Public Sub New()
        m_CodeValue = New Generic.Dictionary(Of Integer, String)
    End Sub
    Default Public Property CodeValue(ByVal groupCode As Integer) As String
        Get
            Return m_CodeValue(groupCode)
        End Get
        Set(ByVal value As String)
            m_CodeValue(groupCode) = value
        End Set
    End Property
    Public Property Type() As String
        Get
            Return m_Type
        End Get
        Set(ByVal value As String)
            m_Type = value
        End Set
    End Property
    Public Sub Add(ByVal myCode As Integer, ByVal myValue As String)
        If m_CodeValue.ContainsKey(myCode) Then Exit Sub
        m_CodeValue.Add(myCode, myValue)
    End Sub

End Class[/code]

[code lang-vb]'엔티티를 원소로하는 리스트 선언
Dim DXFEntities As Generic.List(Of SV_DXFEntity)[/code]

Posted by solarview

2008/02/23 04:25 2008/02/23 04:25
, , , , ,
Response
No Trackback , No Comment
RSS :
http://www.solarview.net/rss/response/190

Trackback URL : http://www.solarview.net/trackback/190

« Previous : 1 : ... 132 : 133 : 134 : 135 : 136 : 137 : 138 : 139 : 140 : ... 296 : Next »