def main(chapter_cls=None): # to run interactively with ipython: # ipython -i --gui=qt script.py # in this case, QtGui.QApplication.instance() will be prebuilt from PyQt4 import QtGui from superficie.viewer.Viewer import Viewer app = QtGui.QApplication.instance() run_exec = False if not app: import sys app = QtGui.QApplication(sys.argv) run_exec = True visor = Viewer() if chapter_cls: visor.book.addChapter(chapter_cls()) ## ============================ visor.whichPage = 0 visor.resize(400, 400) visor.show() visor.trackCameraPosition(True) visor.viewAll() visor.chaptersStack.show() visor.notesStack.show() if run_exec: sys.exit(app.exec_()) return visor
self.addChild(critic4) figuras = [ Plano1, Esfera1, Esfera2, Esfera3, ParaboloideHiperbolico, ParaboloideHiperbolicoReglado, ParaboloideHiperbolicoCortes, ToroMeridianos, ToroParalelos, ToroVerticalMorseConstr, ToroVerticalMorse ] class CamposVectoriales(Chapter): def __init__(self): Chapter.__init__(self, name=u"Campos vectoriales, singularidades e índice") for f in figuras: self.addPage(f()) if __name__ == "__main__": import sys from superficie.viewer.Viewer import Viewer app = QtGui.QApplication(sys.argv) visor = Viewer() visor.book.addChapter(CamposVectoriales()) visor.chapter.chapterSpecificIn() visor.whichPage = 0 visor.resize(400, 400) visor.show() visor.chaptersStack.show() sys.exit(app.exec_())
ParaboloideHiperbolico, ParaboloideHiperbolicoReglado, ParaboloideHiperbolicoCortes, ToroMeridianos, ToroParalelos, ToroVerticalMorseConstr, ToroVerticalMorse ] class CamposVectoriales(Chapter): def __init__(self): Chapter.__init__(self, name=u"Campos vectoriales, singularidades e índice") for f in figuras: self.addPage(f()) if __name__ == "__main__": import sys from superficie.viewer.Viewer import Viewer app = QtGui.QApplication(sys.argv) visor = Viewer() visor.book.addChapter(CamposVectoriales()) visor.chapter.chapterSpecificIn() visor.whichPage = 0 visor.resize(400, 400) visor.show() visor.chaptersStack.show() sys.exit(app.exec_())