VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "Handobject"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'********************************************************************
'   HandObject.cls
'
'   Purpose:
'       Holds the settings of an object in the cameras frame.
'       Used in application to remove recursion and create my own stack.
'       An object is considered any thing that is connected.
'********************************************************************
Dim leftx As Integer
Dim lefty As Integer
Dim topx As Integer
Dim topy As Integer
Dim rightx As Integer
Dim righty As Integer
Dim Count As Long
Dim cordx() As Integer
Dim cordy() As Integer
Dim amount As Long

Private Sub Class_Initialize()
    Count = 0
    amount = 0
    topy = 0
    topx = 0
    rightx = 0
    leftx = 160
End Sub

'********************************************************************
'Data Assessors
'********************************************************************

Public Property Let settopx(ByVal stopx As Integer)
    topx = stopx
End Property
Public Property Let settopy(ByVal stopy As Integer)
    topy = stopy
End Property
Public Property Let setleftx(ByVal sleftx As Integer)
    leftx = sleftx
End Property
Public Property Let setlefty(ByVal slefty As Integer)
    lefty = slefty
End Property
Public Property Let setrightx(ByVal srightx As Integer)
    rightx = srightx
End Property
Public Property Let setrighty(ByVal srighty As Integer)
    righty = srighty
End Property


Public Property Get Size() As Long
     Size = amount
End Property
Public Property Get CountSize() As Long
    CountSize = Count
End Property
Public Property Get SpreadLeftx() As Integer
    SpreadLeftx = leftx
End Property
Public Property Get SpreadLefty() As Integer
    SpreadLefty = lefty
End Property
Public Property Get SpreadRighty() As Integer
    SpreadRighty = righty
End Property
Public Property Get SpreadRightx() As Integer
    SpreadRightx = rightx
End Property
Public Property Get SpreadTopx() As Integer
    SpreadTopx = topx
End Property
Public Property Get SpreadTopy() As Integer
    SpreadTopy = topy
End Property
Public Sub Push(x As Integer, y As Integer)
'****************************************************************************
'Push
'
'Purpose:   Pushes (Stores) the x and y cordinates of an object
'
'Input:     (x,y) cordinates
'
'Output:    None
'****************************************************************************
    
    Count = Count + 1
    ReDim Preserve cordx(0 To Count) As Integer
    ReDim Preserve cordy(0 To Count) As Integer
    cordx(Count) = x
    cordy(Count) = y
    amount = amount + 1
    
    If y > topy Then
        topy = y
        topx = x
    End If
    
    If x < leftx Then
        leftx = x
        lefty = y
    End If
    
    If x > rightx Then
        rightx = x
        righty = y
    End If
      
End Sub

Public Sub Pop(ByRef x As Integer, ByRef y As Integer)
'****************************************************************************
'Pop
'
'Purpose:   Pops (Retrieves) the x and y cordinates of an object
'
'Input:     None
'
'Output:    (x,y) cordinates
'****************************************************************************
    
    x = cordx(Count)
    y = cordy(Count)
    Count = Count - 1
    ReDim Preserve cordx(0 To Count) As Integer
    ReDim Preserve cordy(0 To Count) As Integer
    
End Sub
