本文整理汇总了Python中opengltk.OpenGL.GL.glDeleteLists方法的典型用法代码示例。如果您正苦于以下问题:Python GL.glDeleteLists方法的具体用法?Python GL.glDeleteLists怎么用?Python GL.glDeleteLists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类opengltk.OpenGL.GL
的用法示例。
在下文中一共展示了GL.glDeleteLists方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: redoDisplayListCSG
# 需要导入模块: from opengltk.OpenGL import GL [as 别名]
# 或者: from opengltk.OpenGL.GL import glDeleteLists [as 别名]
def redoDisplayListCSG(self):
if self.dpyListCSG is not None:
GL.glDeleteLists(1, self.dpyListCSG)
g = self.geom
self.dpyListCSG = GL.glGenLists(1)
GL.glNewList(self.dpyListCSG, GL.GL_COMPILE)
## if isinstance(g, Spheres):
## g.DisplayFunction()
## else:
self.drawpolygons()
GL.glEndList()
示例2: clearCache_cb
# 需要导入模块: from opengltk.OpenGL import GL [as 别名]
# 或者: from opengltk.OpenGL.GL import glDeleteLists [as 别名]
def clearCache_cb(self):
#print "clearing cache: "
vi = self.vf.GUI.VIEWER
currentcontext = vi.currentCamera.tk.call(vi.currentCamera._w, 'getcurrentcontext')
for dl in self.dpyLists.keys():
if self.dpyLists[dl]is not None:
if currentcontext != self.dpyLists[dl][1]:
print "currentcontext != self.dpyLists[%d][1]" %(dl,), currentcontext, self.dpyLists[dl][1]
c = vi.currentCamera
c.tk.call(c._w, 'makecurrent')
#import pdb; pdb.set_trace()
#print "glDeleteLists TrajPlayerCached", self.dpyLists[dl][0]
GL.glDeleteLists(self.dpyLists[dl][0], 1)
self.dpyLists.pop(dl)
示例3: deleteTemplate
# 需要导入模块: from opengltk.OpenGL import GL [as 别名]
# 或者: from opengltk.OpenGL.GL import glDeleteLists [as 别名]
def deleteTemplate(self):
#print "Ellipsoids.deleteTemplate"
# it is asumed the right OpenGL context is active
assert self.templateDSPL is not None
currentcontext = self.viewer.currentCamera.tk.call(self.viewer.currentCamera._w, 'contexttag')
if currentcontext != self.templateDSPL[1]:
import traceback;traceback.print_stack()
warnings.warn('deleteTemplate failed because the current context is the wrong one')
print "currentcontext != self.templateDSPL[1]", currentcontext, self.templateDSPL[1]
else:
#print '-%d'%self.templateDSPL[0], currentcontext, "glDeleteLists Ellipsoids"
#print '-%d'%(self.templateDSPL[0]+1), currentcontext, "glDeleteLists Ellipsoids"
#print '-%d'%(self.templateDSPL[0]+2), currentcontext, "glDeleteLists Ellipsoids"
GL.glDeleteLists(self.templateDSPL[0], 3)
self.templateDSPL = None
示例4: deleteTemplate
# 需要导入模块: from opengltk.OpenGL import GL [as 别名]
# 或者: from opengltk.OpenGL.GL import glDeleteLists [as 别名]
def deleteTemplate(self):
if __debug__:
if hasattr(DejaVu, 'functionName'): DejaVu.functionName()
#print "Spheres.deleteTemplate", self.templateDSPL
# it is asumed the right OpenGL context is active
if GL.glGetIntegerv(GL.GL_LIST_INDEX) == [0]:
assert self.templateDSPL is not None
currentcontext = self.viewer.currentCamera.tk.call(self.viewer.currentCamera._w, 'contexttag')
if currentcontext != self.templateDSPL[1]:
import traceback;traceback.print_stack()
warnings.warn('deleteTemplate failed because the current context is the wrong one')
print "currentcontext != self.templateDSPL[1]", currentcontext, self.templateDSPL[1]
else:
#print '-%d'%self.templateDSPL[0], currentcontext, "glDeleteLists Spheres0"
#print '-%d'%(self.templateDSPL[0]+1), currentcontext, "glDeleteLists Spheres1"
#print '-%d'%(self.templateDSPL[0]+2), currentcontext, "glDeleteLists Spheres2"
GL.glDeleteLists(self.templateDSPL[0], 3)
self.templateDSPL = None
示例5: deleteOpenglList
# 需要导入模块: from opengltk.OpenGL import GL [as 别名]
# 或者: from opengltk.OpenGL.GL import glDeleteLists [as 别名]
def deleteOpenglList(self):
#print "Common2d3dObject.deleteOpenglList", self
self.redoDspLst = 0
currentcontext = self.viewer.currentCamera.tk.call(self.viewer.currentCamera._w, 'contexttag')
if self.dpyList is not None:
if currentcontext != self.dpyList[1]:
warnings.warn("""deleteOpenglList failed because the current context is the wrong one""")
#print "currentcontext != self.dpyList[1]", currentcontext, self.dpyList[1]
#import traceback;traceback.print_stack()
else:
#print '-%d'%self.dpyList[0], currentcontext,"glDeleteLists Common2d3dObject"
GL.glDeleteLists(self.dpyList[0], 1)
self.dpyList = None
if self.pickDpyList is not None:
if currentcontext != self.pickDpyList[1]:
warnings.warn("""deleteOpenglList failed because the current context is the wrong one""")
#print "currentcontext != self.pickDpyList[1]", currentcontext, self.pickDpyList[1]
else:
#print '-%d'%self.pickDpyList[0], currentcontext, "glDeleteLists Common2d3dObject2",
GL.glDeleteLists(self.pickDpyList[0], 1)
self.pickDpyList = None
示例6: RedoDisplayList
# 需要导入模块: from opengltk.OpenGL import GL [as 别名]
# 或者: from opengltk.OpenGL.GL import glDeleteLists [as 别名]
def RedoDisplayList(self):
if __debug__:
if hasattr(DejaVu, 'functionName'): DejaVu.functionName()
#print "IndexedGeom.RedoDisplayList", self.name
## if __debug__:
## print 'IndexedGeom RedoDisplayList for', self.fullName
Geom.RedoDisplayList(self)
if len(self.faceSet) and len(self.vertexSet) \
and ( self.primitiveType == GL.GL_TRIANGLES \
or self.primitiveType == GL.GL_QUADS \
or self.primitiveType == GL.GL_POLYGON):
# we always build this, that way we don't have to built on demand
outl = self.outline
if outl.colorAsMaterial:
if self.materials[GL.GL_FRONT] and \
not self.inheritMaterial:
mat = self.materials[GL.GL_FRONT]
fpProp = []
fpBind = []
for propInd in range(4):
b, p = mat.GetProperty(propInd)
fpProp.append(p)
fpBind.append(b)
fpProp.append(mat.prop[4])
fpBind.append(mat.binding[4])
else:
fpProp = None
fpBind = None
if self.materials[GL.GL_BACK] and \
not self.inheritMaterial:
mat = self.materials[GL.GL_BACK]
bpProp = []
bpBind = []
for propInd in range(4):
b, p = mat.GetProperty(propInd)
bpProp.append(p)
bpBind.append(b)
bpProp.append(mat.prop[4])
bpBind.append(mat.binding[4])
else:
bpProp = None
bpBind = None
else:
fpProp = bpProp = fpBind = bpBind = None
texCoords = None
if outl.lighting:
norms = self.normals
else:
norms = None
# WARNING: if texture, fpProp, bpProp, fpBind, bpBind,
# are not passed (either None or arrays) we get a segmentation
# fault if the surface has many colors (i.e. color MSMS by atom
# type and dispaly outline seg faults)
# calling with too many arguments segaults too
# just add None, None, None, None, after the line with colors
if hasattr(outl, 'dpyList') and outl.dpyList is not None:
lNewList = outl.dpyList[0]
else:
lNewList = GL.glGenLists(1)
self.viewer.deleteOpenglList()
#print "lNewList IndexedGeom.RedoDisplayList", lNewList, self.name
lCurrentContext = self.viewer.currentCamera.tk.call(self.viewer.currentCamera._w, 'contexttag')
outl.dpyList = ( lNewList, lCurrentContext)
GL.glNewList(outl.dpyList[0], GL.GL_COMPILE)
#print '+%d'%outl.dpyList[0], lCurrentContext, "glNewList IndexedGeom"
status=glDrawIndexedGeom(
GL.GL_TRIANGLES,
self.vertexSet.vertices.array,
self.faceSet.faces.array,
norms,
texCoords,
fpProp, bpProp, fpBind, bpBind,
self.frontAndBack,
1) # 1 means use diffuse component if no lighting
#print '*%d'%GL.glGetIntegerv(GL.GL_LIST_INDEX), "glEndList IndexedGeom"
GL.glEndList()
if not status:
#print '-%d'%outl.dpyList[0], "glDeleteLists IndexedGeom"
GL.glDeleteLists(outl.dpyList[0], 1)
outl.dpyList = None