Module simple_3dviz.renderables.base

Expand source code
class Renderable(object):
    """Represent something that can be rendered."""
    def init(self, ctx):
        """Initialize the renderable with the moderngl context."""
        raise NotImplementedError()

    def release(self):
        """Release all resources of this renderable in relation to open gl"""
        raise NotImplementedError()

    def update_uniforms(self, uniforms):
        """Update any uniforms that are provided from somewhere else.

        The object is free to update its own programs' uniform values as well.
        Also since the program can be shared, the uniforms might be updated
        from another object.

        Arguments
        ---------
            uniforms: list of tuples
        """
        pass

    def render(self):
        """Render whatever this represents."""
        raise NotImplementedError()

Classes

class Renderable

Represent something that can be rendered.

Expand source code
class Renderable(object):
    """Represent something that can be rendered."""
    def init(self, ctx):
        """Initialize the renderable with the moderngl context."""
        raise NotImplementedError()

    def release(self):
        """Release all resources of this renderable in relation to open gl"""
        raise NotImplementedError()

    def update_uniforms(self, uniforms):
        """Update any uniforms that are provided from somewhere else.

        The object is free to update its own programs' uniform values as well.
        Also since the program can be shared, the uniforms might be updated
        from another object.

        Arguments
        ---------
            uniforms: list of tuples
        """
        pass

    def render(self):
        """Render whatever this represents."""
        raise NotImplementedError()

Subclasses

Methods

def init(self, ctx)

Initialize the renderable with the moderngl context.

Expand source code
def init(self, ctx):
    """Initialize the renderable with the moderngl context."""
    raise NotImplementedError()
def release(self)

Release all resources of this renderable in relation to open gl

Expand source code
def release(self):
    """Release all resources of this renderable in relation to open gl"""
    raise NotImplementedError()
def render(self)

Render whatever this represents.

Expand source code
def render(self):
    """Render whatever this represents."""
    raise NotImplementedError()
def update_uniforms(self, uniforms)

Update any uniforms that are provided from somewhere else.

The object is free to update its own programs' uniform values as well. Also since the program can be shared, the uniforms might be updated from another object.

Arguments

uniforms: list of tuples
Expand source code
def update_uniforms(self, uniforms):
    """Update any uniforms that are provided from somewhere else.

    The object is free to update its own programs' uniform values as well.
    Also since the program can be shared, the uniforms might be updated
    from another object.

    Arguments
    ---------
        uniforms: list of tuples
    """
    pass