def setupApplication(cls):
        """Setups the default application state."""
        # read data directory.

        root = {"name": "ROOT", "dirs": [], "files": []}
        directory_map = {}
        directory_map[_DataProber.DataPath] = root
        for path, dirs, files in os.walk(_DataProber.DataPath):
            element = directory_map[path]

            for name in dirs:
                item = {"name": name, "dirs": [], "files": []}
                item["name"] = name
                directory_map[os.path.join(path, name)] = item
                element["dirs"].append(item)
            element["files"] = []
            for name in files:
                relpath = os.path.relpath(os.path.join(path, name),
                                          _DataProber.DataPath)
                item = {"name": name, "itemValue": relpath}
                element["files"].append(item)
        cls.Database = root
        cls.View = simple.CreateRenderView()
        simple.Render()

        # setup animation scene
        scene = simple.GetAnimationScene()
        simple.GetTimeTrack()
        scene.PlayMode = "Snap To TimeSteps"
示例#2
0
 def __init__(self):
     super(ParaViewWebTimeHandler, self).__init__()
     # setup animation scene
     self.scene = simple.GetAnimationScene()
     simple.GetTimeTrack()
     self.scene.PlayMode = "Snap To TimeSteps"