# automatically generated by the FlatBuffers compiler, do not modify

# namespace: FacesoftFlatbuffersSchema

import flatbuffers

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

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

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

    # SerializedComponent
    def Points(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Float32Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return 0

    # SerializedComponent
    def PointsAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float32Flags, o)
        return 0

    # SerializedComponent
    def PointsLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # SerializedComponent
    def Scale(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Float32Flags, o + self._tab.Pos)
        return 0.0

def SerializedComponentStart(builder): builder.StartObject(2)
def SerializedComponentAddPoints(builder, Points): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(Points), 0)
def SerializedComponentStartPointsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def SerializedComponentAddScale(builder, Scale): builder.PrependFloat32Slot(1, Scale, 0.0)
def SerializedComponentEnd(builder): return builder.EndObject()
