# automatically generated by the FlatBuffers compiler, do not modify

# namespace: foxglove

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

# A primitive representing a sphere or ellipsoid
class SpherePrimitive(object):
    __slots__ = ['_tab']

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

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

    # Position of the center of the sphere and orientation of the sphere
    # SpherePrimitive
    def Pose(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .Pose import Pose
            obj = Pose()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Size (diameter) of the sphere along each axis
    # SpherePrimitive
    def Size(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .Vector3 import Vector3
            obj = Vector3()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Color of the sphere
    # SpherePrimitive
    def Color(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .Color import Color
            obj = Color()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

def SpherePrimitiveStart(builder): builder.StartObject(3)
def Start(builder):
    return SpherePrimitiveStart(builder)
def SpherePrimitiveAddPose(builder, pose): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(pose), 0)
def AddPose(builder, pose):
    return SpherePrimitiveAddPose(builder, pose)
def SpherePrimitiveAddSize(builder, size): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(size), 0)
def AddSize(builder, size):
    return SpherePrimitiveAddSize(builder, size)
def SpherePrimitiveAddColor(builder, color): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(color), 0)
def AddColor(builder, color):
    return SpherePrimitiveAddColor(builder, color)
def SpherePrimitiveEnd(builder): return builder.EndObject()
def End(builder):
    return SpherePrimitiveEnd(builder)