本文整理汇总了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)