示例#1
0
def glutDestroyWindow( window ):
	"""Want to destroy the window, we need to do some cleanup..."""
	context = 0
	try:
		GLUT.glutSetWindow(window)
		context = contextdata.getContext()
		result = contextdata.cleanupContext( context )
		log.info( """Cleaning up context data for window %s: %s""", window, result )
	except Exception, err:
		log.error( """Error attempting to clean up context data for GLUT window %s: %s""", window, result )
示例#2
0
def glutDestroyWindow( window ):
    """Want to destroy the window, we need to do some cleanup..."""
    context = 0
    try:
        GLUT.glutSetWindow(window)
        context = contextdata.getContext()
        result = contextdata.cleanupContext( context )
        log.info( """Cleaning up context data for window %s: %s""", window, result )
    except Exception, err:
        log.error( """Error attempting to clean up context data for GLUT window %s: %s""", window, result )
示例#3
0
 def callback( context = contextdata.getContext( context ) ):
     """Clean up the context, assumes that the context will *not* render again!"""
     contextdata.cleanupContext( context )
    with open(collisionSceneFile, 'rb') as pfile:
        collisions = pickle.load(pfile)


    targetOcclusions = {}
    for targetidx, targetIndex in enumerate(targetIndices):
        targetPosition = targetPositions[targetidx]

        if collisions[targetIndex][1]:

            collisionProbs = np.zeros(len(collisions[targetIndex][1]))
            import copy

            rendererGT.makeCurrentContext()
            rendererGT.clear()
            contextdata.cleanupContext(contextdata.getContext())
            glfw.destroy_window(rendererGT.win)
            del rendererGT

            v, f_list, vc, vn, uv, haveTextures_list, textures_list = copy.deepcopy(v2), copy.deepcopy(f_list2), copy.deepcopy(vc2), copy.deepcopy(vn2), copy.deepcopy(uv2), copy.deepcopy(haveTextures_list2),  copy.deepcopy(textures_list2)

            removeObjectData(len(v) -1 - targetIndex, v, f_list, vc, vn, uv, haveTextures_list, textures_list)

            addObjectData(v, f_list, vc, vn, uv, haveTextures_list, textures_list,  v_teapots[currentTeapotModel][0], f_list_teapots[currentTeapotModel][0], vc_teapots[currentTeapotModel][0], vn_teapots[currentTeapotModel][0], uv_teapots[currentTeapotModel][0], haveTextures_list_teapots[currentTeapotModel][0], textures_list_teapots[currentTeapotModel][0])

            rendererGT = createRendererGT(glMode, chAzGT, chObjAzGT, chElGT, chDistGT, center, v, vc, f_list, vn, light_colorGT, chComponentGT, chVColorsGT, targetPosition.copy(), chDisplacementGT, chScaleGT, width,height, uv, haveTextures_list, textures_list, frustum, None )
            # removeObjectData(int(targetIndex-1), v, f_list, vc, vn, uv, haveTextures_list, textures_list)

            for intervalIdx, interval in enumerate(collisions[targetIndex][1]):
                collisionProbs[intervalIdx] = collisions[targetIndex][1][intervalIdx][1] - collisions[targetIndex][1][intervalIdx][0]
示例#5
0
 def callback(context=contextdata.getContext(context)):
     """Clean up the context, assumes that the context will *not* render again!"""
     contextdata.cleanupContext(context)