# automatically generated by the FlatBuffers compiler, do not modify

# namespace: API

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

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

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

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

    # Shape
    def XArity(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
        return 0

    # Shape
    def YArity(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint32Flags, o + self._tab.Pos)
        return 0

    # Shape
    def Gcps(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) * 24
            from SEAScope.API.GCP import GCP
            obj = GCP()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

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

def ShapeStart(builder): builder.StartObject(3)
def ShapeAddXArity(builder, xArity): builder.PrependUint32Slot(0, xArity, 0)
def ShapeAddYArity(builder, yArity): builder.PrependUint32Slot(1, yArity, 0)
def ShapeAddGcps(builder, gcps): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(gcps), 0)
def ShapeStartGcpsVector(builder, numElems): return builder.StartVector(24, numElems, 8)
def ShapeEnd(builder): return builder.EndObject()
