本文整理匯總了Python中PyMca5.Object3D.Object3DCTools.gridMarchingCubes方法的典型用法代碼示例。如果您正苦於以下問題:Python Object3DCTools.gridMarchingCubes方法的具體用法?Python Object3DCTools.gridMarchingCubes怎麽用?Python Object3DCTools.gridMarchingCubes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyMca5.Object3D.Object3DCTools
的用法示例。
在下文中一共展示了Object3DCTools.gridMarchingCubes方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: drawObject
# 需要導入模塊: from PyMca5.Object3D import Object3DCTools [as 別名]
# 或者: from PyMca5.Object3D.Object3DCTools import gridMarchingCubes [as 別名]
def drawObject(self):
if self.values is None:
return
if DEBUG:
t0=time.time()
GL.glPushAttrib(GL.GL_ALL_ATTRIB_BITS)
GL.glShadeModel(GL.GL_FLAT)
if self.drawMode == 'NONE':
pass
elif (GL.glGetIntegerv(GL.GL_RENDER_MODE) == GL.GL_SELECT) or \
self._vertexSelectionMode:
self.buildPointList(selection=True)
elif self.drawMode == 'POINT':
self.buildPointList(selection=False)
#self.buildPointListNEW(selection=False)
elif self.drawMode == 'POINT_SELECTION':
self.buildPointList(selection=True)
elif self.drawMode in ['LINES', 'WIRE']:
Object3DCTools.draw3DGridLines(self._x,
self._y,
self._z,
self.vertexColors,
self.values,
self._configuration['private']['colorfilter'],
self._configuration['private']['useminmax'])
elif self.drawMode == "SURFACE":
flag = 1
i = 0
for use, value, label, cr, cg, cb, ca in self._configuration['private']['isosurfaces']:
color = (cr, cg, cb, ca)
if None in color:
color = None
if use:
flag = 0
GL.glEnable(GL.GL_LIGHTING)
if color is not None:
GL.glColor4ub(color[0],
color[1],
color[2],
self._alpha)
colorflag = False
if self.__isosurfacesDict[i]['list'] > 0:
if self.__isosurfacesDict[i]['color'] == color:
colorflag = True
elif (self.__isosurfacesDict[i]['color'] != None) and\
(color != None):
colorflag = True
if self.__isosurfacesDict[i]['list'] > 0:
if (self.__isosurfacesDict[i]['value'] == value) and\
colorflag:
GL.glCallList(self.__isosurfacesDict[i]['list'])
i += 1
continue
GL.glDeleteLists(self.__isosurfacesDict[i]['list'],
1)
self.__isosurfacesDict[i]['value']= value
self.__isosurfacesDict[i]['color']= color
self.__isosurfacesDict[i]['list'] = GL.glGenLists(1)
GL.glNewList(self.__isosurfacesDict[i]['list'],
GL.GL_COMPILE)
GL.glBegin(GL.GL_TRIANGLES)
Object3DCTools.gridMarchingCubes(self._x, self._y, self._z, self.values, value, color, (1, 1, 1), 1)
#Object3DCTools.gridMarchingCubes(self._x, self._y, self._z, self.values, value, None, (1, 1, 1), 1)
GL.glEnd()
GL.glEndList()
GL.glCallList(self.__isosurfacesDict[i]['list'])
GL.glDisable(GL.GL_LIGHTING)
i += 1
if flag:
#This is useless, only isosurfaces makes sense
Object3DCTools.draw3DGridQuads(self._x,
self._y,
self._z,
self.vertexColors,
self.values,
self._configuration['private']['colorfilter'],
self._configuration['private']['useminmax'])
else:
print("UNSUPPORTED MODE")
GL.glPopAttrib()
if DEBUG:
print("Drawing takes ", time.time() - t0)