コード例 #1
0
ファイル: Object3DPixmap.py プロジェクト: dnaudet/pymca
 def _drawMesh(self):
     alpha = 1.0 - self._configuration['common']['transparency']
     if alpha < 0:
         alpha = 0
     elif alpha >= 1.0:
         alpha = 255
     else:
         alpha = int(255 * alpha)
     self.pixmap[:, 3] = alpha
     shape = self._imageData.shape
     self._imageData.shape = -1,1
     if DRAW_MODES[self._configuration['common']['mode']] == "POINT":
         if False:
             Object3DCTools.drawXYZPoints(self.vertices,
                                      self.pixmap)
         else:
             Object3DCTools.draw2DGridPoints(self._xValues,
                        self._yValues,
                        self._zValues,
                        self.pixmap)
     elif DRAW_MODES[self._configuration['common']['mode']] == "WIRE":
         Object3DCTools.draw2DGridLines(self._xValues,
                        self._yValues,
                        self._zValues,
                        self.pixmap)
     elif DRAW_MODES[self._configuration['common']['mode']] == "SURFACE":
         Object3DCTools.draw2DGridQuads(self._xValues,
                        self._yValues,
                        self._zValues,
                        self.pixmap)
     self._imageData.shape = shape
コード例 #2
0
ファイル: Object3DMesh.py プロジェクト: dnaudet/pymca
    def buildPointListXYZ(self, selection=False):
        if 1:
            if selection:
                if self.vertexSelectionColors is None:
                    self._getVertexSelectionColors()
                if self._configuration['private']['colorfilter']:
                    tinyNumber = 1.0e-10
                    minValue = self._configuration['common']['colormap'][
                        2] + tinyNumber
                    maxValue = self._configuration['common']['colormap'][
                        3] - tinyNumber
                    Object3DCTools.drawXYZPoints(self.vertices,
                                                 self.vertexSelectionColors,
                                                 self.values, None, 0,
                                                 [1, minValue, maxValue])
                else:
                    Object3DCTools.drawXYZPoints(
                        self.vertices, self.vertexSelectionColors, self.values,
                        None, 0, self._configuration['private']['useminmax'])
            else:
                Object3DCTools.drawXYZPoints(
                    self.vertices, self.vertexColors, self.values, None,
                    self._configuration['private']['colorfilter'],
                    self._configuration['private']['useminmax'])
        return

        GL.glVertexPointerf(self.vertices)
        if selection:
            GL.glColorPointerub(self.vertexSelectionColors)
        else:
            GL.glColorPointerub(self.vertexColors)
        GL.glEnableClientState(GL.GL_VERTEX_ARRAY)
        GL.glEnableClientState(GL.GL_COLOR_ARRAY)
        GL.glDrawArrays(GL.GL_POINTS, 0, self.nVertices)
コード例 #3
0
 def _drawMesh(self):
     alpha = 1.0 - self._configuration['common']['transparency']
     if alpha < 0:
         alpha = 0
     elif alpha >= 1.0:
         alpha = 255
     else:
         alpha = int(255 * alpha)
     self.pixmap[:, 3] = alpha
     shape = self._imageData.shape
     self._imageData.shape = -1, 1
     if DRAW_MODES[self._configuration['common']['mode']] == "POINT":
         if False:
             Object3DCTools.drawXYZPoints(self.vertices, self.pixmap)
         else:
             Object3DCTools.draw2DGridPoints(self._xValues, self._yValues,
                                             self._zValues, self.pixmap)
     elif DRAW_MODES[self._configuration['common']['mode']] == "WIRE":
         Object3DCTools.draw2DGridLines(self._xValues, self._yValues,
                                        self._zValues, self.pixmap)
     elif DRAW_MODES[self._configuration['common']['mode']] == "SURFACE":
         Object3DCTools.draw2DGridQuads(self._xValues, self._yValues,
                                        self._zValues, self.pixmap)
     self._imageData.shape = shape
コード例 #4
0
ファイル: Object3DMesh.py プロジェクト: PiRK/pymca
    def buildPointListXYZ(self, selection=False):
        if 1:
            if selection:
                if self.vertexSelectionColors is None:
                    self._getVertexSelectionColors()
                if self._configuration['private']['colorfilter']:
                    tinyNumber = 1.0e-10
                    minValue = self._configuration['common']['colormap'][2] + tinyNumber
                    maxValue = self._configuration['common']['colormap'][3] - tinyNumber
                    Object3DCTools.drawXYZPoints(self.vertices,
                             self.vertexSelectionColors,
                             self.values,
                             None,
                             0,
                             [1, minValue, maxValue])
                else:
                    Object3DCTools.drawXYZPoints(self.vertices,
                             self.vertexSelectionColors,
                             self.values,
                             None,
                             0,
                             self._configuration['private']['useminmax'])
            else:
                Object3DCTools.drawXYZPoints(self.vertices,
                             self.vertexColors,
                             self.values,
                             None,
                             self._configuration['private']['colorfilter'],
                             self._configuration['private']['useminmax'])
        return


        GL.glVertexPointerf(self.vertices)
        if selection:
            GL.glColorPointerub(self.vertexSelectionColors)
        else:
            GL.glColorPointerub(self.vertexColors)
        GL.glEnableClientState(GL.GL_VERTEX_ARRAY)
        GL.glEnableClientState(GL.GL_COLOR_ARRAY)
        GL.glDrawArrays(GL.GL_POINTS, 0, self.nVertices)