def __init__(self, image, overlayList, displayCtx, canvas, threedee): """Create a ``GLMIP``. :arg image: An :class:`.Image` object. :arg overlayList: The :class:`.OverlayList` :arg displayCtx: The :class:`.DisplayContext` object managing the scene. :arg canvas: The canvas doing the drawing. :arg threedee: Set up for 2D or 3D rendering. """ glimageobject.GLImageObject.__init__(self, image, overlayList, displayCtx, canvas, threedee) self.shader = None self.imageTexture = None self.cmapTexture = textures.ColourMapTexture(self.name) self.addDisplayListeners() self.refreshImageTexture() self.refreshCmapTextures() def init(): fslgl.glmip_funcs.init(self) self.notify() idle.idleWhen(init, self.textureReady)
def __init__(self, overlay, overlayList, displayCtx, canvas, threedee): """Create a ``GLMesh``. :arg overlay: A :class:`.Mesh` overlay. :arg overlayList: The :class:`.OverlayList` :arg displayCtx: The :class:`.DisplayContext` managing the scene. :arg canvas: The canvas drawing this ``GLMesh``. :arg threedee: 2D or 3D rendering. """ globject.GLObject.__init__(self, overlay, overlayList, displayCtx, canvas, threedee) self.flatShader = None self.dataShader = None self.activeShader = None # We use a render texture when # rendering model cross sections. # This texture is kept at display/ # screen resolution self.renderTexture = textures.RenderTexture(self.name, interp=gl.GL_NEAREST) # Mesh overlays are coloured: # # - with a constant colour (opts.outline == False), or # # - with a +/- colour map, (opts.vertexData not None), or # # - with a lookup table (opts.useLut == True and # opts.vertexData is not None) self.cmapTexture = textures.ColourMapTexture(self.name) self.negCmapTexture = textures.ColourMapTexture(self.name) self.lutTexture = textures.LookupTableTexture(self.name) self.lut = None self.registerLut() self.addListeners() self.updateVertices() self.refreshCmapTextures(notify=False) self.compileShaders() self.updateShaderState()