# automatically generated by the FlatBuffers compiler, do not modify

# namespace: isp

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

class BoundingBox(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAs(cls, buf, offset=0):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = BoundingBox()
        x.Init(buf, n + offset)
        return x

    @classmethod
    def GetRootAsBoundingBox(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    @classmethod
    def BoundingBoxBufferHasIdentifier(cls, buf, offset, size_prefixed=False):
        return flatbuffers.util.BufferHasIdentifier(buf, offset, b"\x49\x53\x50\x46", size_prefixed=size_prefixed)

    # BoundingBox
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # BoundingBox
    def ActorType(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # BoundingBox
    def Ids(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Uint64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
        return 0

    # BoundingBox
    def IdsAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint64Flags, o)
        return 0

    # BoundingBox
    def IdsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # BoundingBox
    def IdsIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        return o == 0

    # BoundingBox
    def Coordinates(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from communications.isp.Tensor import Tensor
            obj = Tensor()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # BoundingBox
    def CoordinatesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # BoundingBox
    def CoordinatesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        return o == 0

    # BoundingBox
    def State(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return ""

    # BoundingBox
    def StateLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # BoundingBox
    def StateIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        return o == 0

    # BoundingBox
    def Occlusion(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Float64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
        return 0

    # BoundingBox
    def OcclusionAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float64Flags, o)
        return 0

    # BoundingBox
    def OcclusionLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # BoundingBox
    def OcclusionIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        return o == 0

def BoundingBoxStart(builder): builder.StartObject(5)
def Start(builder):
    return BoundingBoxStart(builder)
def BoundingBoxAddActorType(builder, actorType): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(actorType), 0)
def AddActorType(builder, actorType):
    return BoundingBoxAddActorType(builder, actorType)
def BoundingBoxAddIds(builder, ids): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(ids), 0)
def AddIds(builder, ids):
    return BoundingBoxAddIds(builder, ids)
def BoundingBoxStartIdsVector(builder, numElems): return builder.StartVector(8, numElems, 8)
def StartIdsVector(builder, numElems):
    return BoundingBoxStartIdsVector(builder, numElems)
def BoundingBoxAddCoordinates(builder, coordinates): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(coordinates), 0)
def AddCoordinates(builder, coordinates):
    return BoundingBoxAddCoordinates(builder, coordinates)
def BoundingBoxStartCoordinatesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartCoordinatesVector(builder, numElems):
    return BoundingBoxStartCoordinatesVector(builder, numElems)
def BoundingBoxAddState(builder, state): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(state), 0)
def AddState(builder, state):
    return BoundingBoxAddState(builder, state)
def BoundingBoxStartStateVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartStateVector(builder, numElems):
    return BoundingBoxStartStateVector(builder, numElems)
def BoundingBoxAddOcclusion(builder, occlusion): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(occlusion), 0)
def AddOcclusion(builder, occlusion):
    return BoundingBoxAddOcclusion(builder, occlusion)
def BoundingBoxStartOcclusionVector(builder, numElems): return builder.StartVector(8, numElems, 8)
def StartOcclusionVector(builder, numElems):
    return BoundingBoxStartOcclusionVector(builder, numElems)
def BoundingBoxEnd(builder): return builder.EndObject()
def End(builder):
    return BoundingBoxEnd(builder)