# automatically generated by the FlatBuffers compiler, do not modify

# namespace: DeepSeaScene

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

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

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

    @classmethod
    def GetRootAsFramebuffer(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    # Framebuffer
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # Framebuffer
    def Name(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

    # Framebuffer
    def Surfaces(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from DeepSeaScene.FramebufferSurface import FramebufferSurface
            obj = FramebufferSurface()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

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

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

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

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

    # Framebuffer
    def Viewport(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            x = o + self._tab.Pos
            from DeepSeaScene.AlignedBox3f import AlignedBox3f
            obj = AlignedBox3f()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

def Start(builder): builder.StartObject(6)
def FramebufferStart(builder):
    """This method is deprecated. Please switch to Start."""
    return Start(builder)
def AddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
def FramebufferAddName(builder, name):
    """This method is deprecated. Please switch to AddName."""
    return AddName(builder, name)
def AddSurfaces(builder, surfaces): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(surfaces), 0)
def FramebufferAddSurfaces(builder, surfaces):
    """This method is deprecated. Please switch to AddSurfaces."""
    return AddSurfaces(builder, surfaces)
def StartSurfacesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def FramebufferStartSurfacesVector(builder, numElems):
    """This method is deprecated. Please switch to Start."""
    return StartSurfacesVector(builder, numElems)
def AddWidth(builder, width): builder.PrependFloat32Slot(2, width, 0.0)
def FramebufferAddWidth(builder, width):
    """This method is deprecated. Please switch to AddWidth."""
    return AddWidth(builder, width)
def AddHeight(builder, height): builder.PrependFloat32Slot(3, height, 0.0)
def FramebufferAddHeight(builder, height):
    """This method is deprecated. Please switch to AddHeight."""
    return AddHeight(builder, height)
def AddLayers(builder, layers): builder.PrependUint32Slot(4, layers, 0)
def FramebufferAddLayers(builder, layers):
    """This method is deprecated. Please switch to AddLayers."""
    return AddLayers(builder, layers)
def AddViewport(builder, viewport): builder.PrependStructSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(viewport), 0)
def FramebufferAddViewport(builder, viewport):
    """This method is deprecated. Please switch to AddViewport."""
    return AddViewport(builder, viewport)
def End(builder): return builder.EndObject()
def FramebufferEnd(builder):
    """This method is deprecated. Please switch to End."""
    return End(builder)
# automatically generated by the FlatBuffers compiler, do not modify

# namespace: DeepSeaScene

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

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

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

    @classmethod
    def GetRootAsFramebuffer(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    # Framebuffer
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # Framebuffer
    def Name(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

    # Framebuffer
    def Surfaces(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from DeepSeaScene.FramebufferSurface import FramebufferSurface
            obj = FramebufferSurface()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

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

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

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

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

    # Framebuffer
    def Viewport(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            x = o + self._tab.Pos
            from DeepSeaScene.AlignedBox3f import AlignedBox3f
            obj = AlignedBox3f()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

def Start(builder): builder.StartObject(6)
def FramebufferStart(builder):
    """This method is deprecated. Please switch to Start."""
    return Start(builder)
def AddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
def FramebufferAddName(builder, name):
    """This method is deprecated. Please switch to AddName."""
    return AddName(builder, name)
def AddSurfaces(builder, surfaces): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(surfaces), 0)
def FramebufferAddSurfaces(builder, surfaces):
    """This method is deprecated. Please switch to AddSurfaces."""
    return AddSurfaces(builder, surfaces)
def StartSurfacesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def FramebufferStartSurfacesVector(builder, numElems):
    """This method is deprecated. Please switch to Start."""
    return StartSurfacesVector(builder, numElems)
def AddWidth(builder, width): builder.PrependFloat32Slot(2, width, 0.0)
def FramebufferAddWidth(builder, width):
    """This method is deprecated. Please switch to AddWidth."""
    return AddWidth(builder, width)
def AddHeight(builder, height): builder.PrependFloat32Slot(3, height, 0.0)
def FramebufferAddHeight(builder, height):
    """This method is deprecated. Please switch to AddHeight."""
    return AddHeight(builder, height)
def AddLayers(builder, layers): builder.PrependUint32Slot(4, layers, 0)
def FramebufferAddLayers(builder, layers):
    """This method is deprecated. Please switch to AddLayers."""
    return AddLayers(builder, layers)
def AddViewport(builder, viewport): builder.PrependStructSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(viewport), 0)
def FramebufferAddViewport(builder, viewport):
    """This method is deprecated. Please switch to AddViewport."""
    return AddViewport(builder, viewport)
def End(builder): return builder.EndObject()
def FramebufferEnd(builder):
    """This method is deprecated. Please switch to End."""
    return End(builder)
# automatically generated by the FlatBuffers compiler, do not modify # namespace: DeepSeaScene This method is deprecated. Please switch to GetRootAs. # Framebuffer # Framebuffer # Framebuffer # Framebuffer # Framebuffer # Framebuffer # Framebuffer # Framebuffer # Framebuffer This method is deprecated. Please switch to Start. This method is deprecated. Please switch to AddName. This method is deprecated. Please switch to AddSurfaces. This method is deprecated. Please switch to Start. This method is deprecated. Please switch to AddWidth. This method is deprecated. Please switch to AddHeight. This method is deprecated. Please switch to AddLayers. This method is deprecated. Please switch to AddViewport. This method is deprecated. Please switch to End.