M
Mitch
I have several classes that inherit other classes. I need to be able to sort
the Mesh class based on its inherited list of Poly.ZMax,. How do I use
IComparer or IComparable to achieve this?
Mitch.
Public Class Poly : Inherits List(Of Vector)
Private mZMax As Double
Public Sub New(ByVal f As List(Of Vector))
MyBase.AddRange(f)
mZMax = Me.Item(0).Z
For Each v As Vector In Me
If v.Z > mZMax Then
mZMax = v.Z
End If
Next
End Sub
Public ReadOnly Property PointCount()
Get
Return MyBase.Count
End Get
End Property
Public ReadOnly Property ZMax() As Double
Get
Return mZMax
End Get
End Property
End Class
Public Class Mesh : Inherits List(Of Poly)
Public Sub AddPoly(ByVal f As Poly)
MyBase.Add(f)
End Sub
Public ReadOnly Property PolyCount()
Get
Return MyBase.Count
End Get
End Property
End Class
the Mesh class based on its inherited list of Poly.ZMax,. How do I use
IComparer or IComparable to achieve this?
Mitch.
Public Class Poly : Inherits List(Of Vector)
Private mZMax As Double
Public Sub New(ByVal f As List(Of Vector))
MyBase.AddRange(f)
mZMax = Me.Item(0).Z
For Each v As Vector In Me
If v.Z > mZMax Then
mZMax = v.Z
End If
Next
End Sub
Public ReadOnly Property PointCount()
Get
Return MyBase.Count
End Get
End Property
Public ReadOnly Property ZMax() As Double
Get
Return mZMax
End Get
End Property
End Class
Public Class Mesh : Inherits List(Of Poly)
Public Sub AddPoly(ByVal f As Poly)
MyBase.Add(f)
End Sub
Public ReadOnly Property PolyCount()
Get
Return MyBase.Count
End Get
End Property
End Class