fixed: auto_ptr -> unique_ptr
[opensg.git] / Tools / osgBench / run3.py
blob572ae6f630f9fe856873d2fa4277379e4f2f0554
1 import sys
2 from osgbench import *
4 def usage():
5 print "usage."
6 return -1
8 def main(argv=sys.argv):
9 if len(argv) != 2:
10 return usage()
12 filename = argv[1]
14 print "Loading %s..." % filename
15 scene = loadScene(filename)
17 print "Traversing..."
18 travscene = scene.clone()
19 g = createGraphOpSeq("GeoType() Stripe(stitch=false)")
20 g.traverseSeq(travscene)
22 print "Running test..."
23 win = TestWindow()
24 win.open()
26 test = Test()
27 test.setWindow(win)
28 test.setScene(travscene)
29 test.setNFrames(200)
31 test.clear()
32 test.addFov(42)
33 test.makeOrbit(0, 1, 0)
35 test.run()
36 print "trav FPS:", test.getFPS()
37 print "Snapshot"
38 timage = test.snapshot(100)
39 print "done"
41 test.setScene(scene)
42 test.run()
43 print "Non-Trav FPS:", test.getFPS()
44 print "Snapshot"
45 image = test.snapshot(100)
46 print "done"
48 dimage = image.clone()
49 dimage.diff(timage)
50 dimage.write("diffimage.png")
51 image.write("image1.png")
52 timage.write("image2.png")
54 win.close()
56 if __name__ == '__main__':
57 sys.exit(main() or 0)