def keyboard(*args): global gCurrent, gFocus, gValues import sys (key, x, y) = args if key == 27 or key == 'x': sys.exit(0) elif key == 'm': VisusXMLInterface().write("restart.xml", gRoot) elif key == '+': if gFocus is not None: iso_value = VisusIsoValue() gFocus.getValue(iso_value) iso_value.data(iso_value.data() * 1.1) gFocus.setValue(iso_value) updateIso(iso_value) glutPostRedisplay() elif key == '-': if gFocus is not None: iso_value = VisusIsoValue() gFocus.getValue(iso_value) iso_value.data(iso_value.data() / 1.1) gFocus.setValue(iso_value) updateIso(iso_value) glutPostRedisplay() return
def keyboard(*args): global gCurrent, gFocus, gValues import sys (key, x, y) = args if key == 27 or key == "x": sys.exit(0) elif key == "m": VisusXMLInterface().write("restart.xml", gRoot) elif key == "+": if gFocus is not None: iso_value = VisusIsoValue() gFocus.getValue(iso_value) iso_value.data(iso_value.data() * 1.1) gFocus.setValue(iso_value) updateIso(iso_value) glutPostRedisplay() elif key == "-": if gFocus is not None: iso_value = VisusIsoValue() gFocus.getValue(iso_value) iso_value.data(iso_value.data() / 1.1) gFocus.setValue(iso_value) updateIso(iso_value) glutPostRedisplay() return
def keyboard( *args ): global gColorMap,gColorMaps,gFocus,gRoot import sys (key, x, y) = args if key == 27: sys.exit(0) elif key == 'x': sys.exit(0) elif key == 'm': VisusXMLInterface().write("restart.xml", gRoot) elif key == 'n': if gFocus.nrOfChildren() > 0: gFocus = gFocus.child(0) print "Switching to first child of focus type(", gFocus.nodeType(), ")" else: print "Switching to root of scene graph" gFocus = gRoot elif key == '+': value = VisusIsoValue() gFocus.getValue(value) value.data(value.data() * 1.1) gFocus.setValue(value) print "Iso-Value updated to ", value.data(), " you won't see update in label since generic interface does not know of label" elif key == '-': value = VisusIsoValue() gFocus.getValue(value) value.data(value.data() / 1.1) gFocus.setValue(value) print "Iso-Value updated to ", value.data(), " you won't see update in label since generic interface does not know of label" glutPostRedisplay() return
glutIdleFunc(idle) glInit() createData() box = constructWorldBox(gBBox) # Create the default scene graph gRoot = VisusGroup.construct() if not gRoot.setValue(gBBox): print "Error occurred setting bbox" gRoot.mapToWorldBox(box) gRoot.drawBoundingBox(True) gFocus = gRoot isoValue = VisusIsoValue(1.0) iso = addIsoSurface(gRoot) iso.setValue(isoValue) font = VisusFont() font.fontSize(3) gIsoValueLabel = VisusLabelNode.construct() gIsoValueLabel.position(0.8, -0.9) gIsoValueLabel.setValue(font) gRoot.attachSubTree(gIsoValueLabel) updateIso(isoValue) gValues.append(gRoot)
data.domainBoundingBox(left,right); gBBox = VisusBoundingBox() gBBox.set(left,right); box = constructWorldBox(gBBox) # Create the default scene graph gRoot = VisusGroup.construct() if not gRoot.setValue(gBBox): print "Error occurred setting bbox" gRoot.mapToWorldBox(box) gRoot.drawBoundingBox(True) gFocus = gRoot isoValue = VisusIsoValue(7.0) iso = addIsoSurface(gRoot) iso.setValue(isoValue) font = VisusFont() font.fontSize(3) gColorBar = VisusColorBar.construct() gColorBar.position(-1,-0.8) gColorBar.setValue(gColorMap) axis = gColorBar.axis() axis.drawLegend(False) axis.labelFont(font) axis.minValue(gMinValue) axis.maxValue(gMaxValue)
def keyboard(*args): global gColorMap, gColorMaps, gFocus, gRoot import sys (key, x, y) = args if key == 27: sys.exit(0) elif key == 'x': sys.exit(0) elif key == 'm': VisusXMLInterface().write("restart.xml", gRoot) elif key == 'n': if gFocus.nrOfChildren() > 0: gFocus = gFocus.child(0) print "Switching to first child of focus type(", gFocus.nodeType( ), ")" else: print "Switching to root of scene graph" gFocus = gRoot elif key == '+': value = VisusIsoValue() gFocus.getValue(value) value.data(value.data() * 1.1) gFocus.setValue(value) print "Iso-Value updated to ", value.data( ), " you won't see update in label since generic interface does not know of label" elif key == '-': value = VisusIsoValue() gFocus.getValue(value) value.data(value.data() / 1.1) gFocus.setValue(value) print "Iso-Value updated to ", value.data( ), " you won't see update in label since generic interface does not know of label" glutPostRedisplay() return