def __init__(self): # A Batch is a collection of vertex lists for batched rendering. self.batch = pyglet.graphics.Batch() # A TextureGroup manages an OpenGL texture. self.group = TextureGroup(image.load(TEXTURE_PATH).get_texture()) # A mapping from position to the texture of the block at that position. # This defines all the blocks that are currently in the world. self.world = {} # Same mapping as `world` but only contains blocks that are shown. self.shown = {} # Mapping from position to a pyglet `VertextList` for all shown blocks. self._shown = {} # Mapping from sector to a list of positions inside that sector. self.sectors = {} # Simple function queue implementation. The queue is populated with # _show_block() and _hide_block() calls self.queue = deque() # a module to save and load the world self.saveModule = saveModule.saveModule() # notifications to display self.notification = "" self._initialize()
def __init__(self): # A Batch is a collection of vertex lists for batched rendering. self.batch = pyglet.graphics.Batch() # A TextureGroup manages an OpenGL texture. self.group = TextureGroup(image.load(TEXTURE_PATH).get_texture()) # A mapping from position to the texture of the block at that position. # This defines all the blocks that are currently in the world. self.world = {} # Same mapping as `world` but only contains blocks that are shown. self.shown = {} # Mapping from position to a pyglet `VertextList` for all shown blocks. self._shown = {} # Mapping from sector to a list of positions inside that sector. self.sectors = {} # Simple function queue implementation. The queue is populated with # _show_block() and _hide_block() calls self.queue = deque() # a module to save and load the world self.saveModule = saveModule.saveModule() self._initialize()
parts = name.split(".") #dirt = parts[0].replace("3DSlice", "") part = parts[0] finalNumber = "" for i in reversed(range(len(part))): if part[i].isdigit(): finalNumber = str(part[i]) + finalNumber #dirt = name.replace("3DSlice", "").replace(".dcm.pgm", "") if finalNumber.isdigit(): return int(finalNumber) else: return 0 sm = saveModule.saveModule() sav = open(sm.getSaveDest(), "w") sourceFolder = "./tmp" sourceFiles = [] if len(sys.argv) > 1: sourceFolder = sys.argv[1] for arg in sys.argv: if arg.startswith("minVal="): minVal = int(arg.replace("minVal=", "")) elif arg.startswith("maxVal="): maxVal = int(arg.replace("maxVal=", "")) elif arg.startswith("materialSwitch="): materialSwitch = int(arg.replace("materialSwitch=", "")) elif arg.startswith("heightMap="):