We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
GLMeshItem memory leak in drawing of faces
### Short description
When rendering faces, there appears to be a memory leak relating to line 199 and 200 of GLMeshItem.py

### Code to reproduce
This can be reproduced using the GLMeshItem example script. Using top to check memory usage, the amount used by the process slowly increases as updates are called in the scene (triggered by rotating the view, etc.). If there are no changes the memory usage is constant, but otherwise will grow without bound (albeit slowly in the example). Larger meshes with cause faster accumulation.

### Expected behavior
Near-constant memory usage when rendering the faces in the scene.

### Real behavior
Increasing memory usage when rendering faces.

### Tested environment(s)

 * PyQtGraph version: tested on both 0.11.0 and 0.12.1
 * Qt Python binding:  5.15.4
 * Python version: 3.8
 * NumPy version: 1.17.3
 * Operating system: Ubuntu 20.04
 * Installation method: pip

### Additional context
changing astype on faces from np.uint to np.uint32 or np.uintc on line 199 of pyqtgraph/opengl/items/GLMeshItem.py resolves the issue for me, but I don't know if that is the correct solution.


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `pyqtgraph/opengl/items/GLMeshItem.py`
Content:
```
1 from OpenGL.GL import *
2 from .. GLGraphicsItem import GLGraphicsItem
3 from .. MeshData import MeshData
4 from ...Qt import QtGui
5 from .. import shaders
6 from ... import functions as fn
7 import numpy as np
8 
9 
10 
11 __all__ = ['GLMeshItem']
12 
13 class GLMeshItem(GLGraphicsItem):
14     """
15     **Bases:** :class:`GLGraphicsItem <pyqtgraph.opengl.GLGraphicsItem>`
16     
17     Displays a 3D triangle mesh. 
18     """
19     def __init__(self, **kwds):
20         """
21         ============== =====================================================
22         **Arguments:**
23         meshdata       MeshData object from which to determine geometry for 
24                        this item.
25         color          Default face color used if no vertex or face colors 
26                        are specified.
27         edgeColor      Default edge color to use if no edge colors are
28                        specified in the mesh data.
29         drawEdges      If True, a wireframe mesh will be drawn. 
30                        (default=False)
31         drawFaces      If True, mesh faces are drawn. (default=True)
32         shader         Name of shader program to use when drawing faces.
33                        (None for no shader)
34         smooth         If True, normal vectors are computed for each vertex
35                        and interpolated within each face.
36         computeNormals If False, then computation of normal vectors is 
37                        disabled. This can provide a performance boost for 
38                        meshes that do not make use of normals.
39         ============== =====================================================
40         """
41         self.opts = {
42             'meshdata': None,
43             'color': (1., 1., 1., 1.),
44             'drawEdges': False,
45             'drawFaces': True,
46             'edgeColor': (0.5, 0.5, 0.5, 1.0),
47             'shader': None,
48             'smooth': True,
49             'computeNormals': True,
50         }
51         
52         GLGraphicsItem.__init__(self)
53         glopts = kwds.pop('glOptions', 'opaque')
54         self.setGLOptions(glopts)
55         shader = kwds.pop('shader', None)
56         self.setShader(shader)
57         
58         self.setMeshData(**kwds)
59         
60         ## storage for data compiled from MeshData object
61         self.vertexes = None
62         self.normals = None
63         self.colors = None
64         self.faces = None
65         
66     def setShader(self, shader):
67         """Set the shader used when rendering faces in the mesh. (see the GL shaders example)"""
68         self.opts['shader'] = shader
69         self.update()
70         
71     def shader(self):
72         shader = self.opts['shader']
73         if isinstance(shader, shaders.ShaderProgram):
74             return shader
75         else:
76             return shaders.getShaderProgram(shader)
77         
78     def setColor(self, c):
79         """Set the default color to use when no vertex or face colors are specified."""
80         self.opts['color'] = c
81         self.update()
82         
83     def setMeshData(self, **kwds):
84         """
85         Set mesh data for this item. This can be invoked two ways:
86         
87         1. Specify *meshdata* argument with a new MeshData object
88         2. Specify keyword arguments to be passed to MeshData(..) to create a new instance.
89         """
90         md = kwds.get('meshdata', None)
91         if md is None:
92             opts = {}
93             for k in ['vertexes', 'faces', 'edges', 'vertexColors', 'faceColors']:
94                 try:
95                     opts[k] = kwds.pop(k)
96                 except KeyError:
97                     pass
98             md = MeshData(**opts)
99         
100         self.opts['meshdata'] = md
101         self.opts.update(kwds)
102         self.meshDataChanged()
103         self.update()
104         
105     
106     def meshDataChanged(self):
107         """
108         This method must be called to inform the item that the MeshData object
109         has been altered.
110         """
111         
112         self.vertexes = None
113         self.faces = None
114         self.normals = None
115         self.colors = None
116         self.edges = None
117         self.edgeColors = None
118         self.update()
119     
120     def parseMeshData(self):
121         ## interpret vertex / normal data before drawing
122         ## This can:
123         ##   - automatically generate normals if they were not specified
124         ##   - pull vertexes/noormals/faces from MeshData if that was specified
125         
126         if self.vertexes is not None and self.normals is not None:
127             return
128         #if self.opts['normals'] is None:
129             #if self.opts['meshdata'] is None:
130                 #self.opts['meshdata'] = MeshData(vertexes=self.opts['vertexes'], faces=self.opts['faces'])
131         if self.opts['meshdata'] is not None:
132             md = self.opts['meshdata']
133             if self.opts['smooth'] and not md.hasFaceIndexedData():
134                 self.vertexes = md.vertexes()
135                 if self.opts['computeNormals']:
136                     self.normals = md.vertexNormals()
137                 self.faces = md.faces()
138                 if md.hasVertexColor():
139                     self.colors = md.vertexColors()
140                 if md.hasFaceColor():
141                     self.colors = md.faceColors()
142             else:
143                 self.vertexes = md.vertexes(indexed='faces')
144                 if self.opts['computeNormals']:
145                     if self.opts['smooth']:
146                         self.normals = md.vertexNormals(indexed='faces')
147                     else:
148                         self.normals = md.faceNormals(indexed='faces')
149                 self.faces = None
150                 if md.hasVertexColor():
151                     self.colors = md.vertexColors(indexed='faces')
152                 elif md.hasFaceColor():
153                     self.colors = md.faceColors(indexed='faces')
154                     
155             if self.opts['drawEdges']:
156                 if not md.hasFaceIndexedData():
157                     self.edges = md.edges()
158                     self.edgeVerts = md.vertexes()
159                 else:
160                     self.edges = md.edges()
161                     self.edgeVerts = md.vertexes(indexed='faces')
162             return
163     
164     def paint(self):
165         self.setupGLState()
166         
167         self.parseMeshData()        
168         
169         if self.opts['drawFaces']:
170             with self.shader():
171                 verts = self.vertexes
172                 norms = self.normals
173                 color = self.colors
174                 faces = self.faces
175                 if verts is None:
176                     return
177                 glEnableClientState(GL_VERTEX_ARRAY)
178                 try:
179                     glVertexPointerf(verts)
180                     
181                     if self.colors is None:
182                         color = self.opts['color']
183                         if isinstance(color, QtGui.QColor):
184                             glColor4f(*fn.glColor(color))
185                         else:
186                             glColor4f(*color)
187                     else:
188                         glEnableClientState(GL_COLOR_ARRAY)
189                         glColorPointerf(color)
190                     
191                     
192                     if norms is not None:
193                         glEnableClientState(GL_NORMAL_ARRAY)
194                         glNormalPointerf(norms)
195                     
196                     if faces is None:
197                         glDrawArrays(GL_TRIANGLES, 0, np.product(verts.shape[:-1]))
198                     else:
199                         faces = faces.astype(np.uint).flatten()
200                         glDrawElements(GL_TRIANGLES, faces.shape[0], GL_UNSIGNED_INT, faces)
201                 finally:
202                     glDisableClientState(GL_NORMAL_ARRAY)
203                     glDisableClientState(GL_VERTEX_ARRAY)
204                     glDisableClientState(GL_COLOR_ARRAY)
205             
206         if self.opts['drawEdges']:
207             verts = self.edgeVerts
208             edges = self.edges
209             glEnableClientState(GL_VERTEX_ARRAY)
210             try:
211                 glVertexPointerf(verts)
212                 
213                 if self.edgeColors is None:
214                     color = self.opts['edgeColor']
215                     if isinstance(color, QtGui.QColor):
216                         glColor4f(*fn.glColor(color))
217                     else:
218                         glColor4f(*color)
219                 else:
220                     glEnableClientState(GL_COLOR_ARRAY)
221                     glColorPointerf(color)
222                 edges = edges.flatten()
223                 glDrawElements(GL_LINES, edges.shape[0], GL_UNSIGNED_INT, edges)
224             finally:
225                 glDisableClientState(GL_VERTEX_ARRAY)
226                 glDisableClientState(GL_COLOR_ARRAY)
227             
228
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/pyqtgraph/opengl/items/GLMeshItem.py b/pyqtgraph/opengl/items/GLMeshItem.py
--- a/pyqtgraph/opengl/items/GLMeshItem.py
+++ b/pyqtgraph/opengl/items/GLMeshItem.py
@@ -196,7 +196,7 @@
                     if faces is None:
                         glDrawArrays(GL_TRIANGLES, 0, np.product(verts.shape[:-1]))
                     else:
-                        faces = faces.astype(np.uint).flatten()
+                        faces = faces.astype(np.uint32).flatten()
                         glDrawElements(GL_TRIANGLES, faces.shape[0], GL_UNSIGNED_INT, faces)
                 finally:
                     glDisableClientState(GL_NORMAL_ARRAY)

{"golden_diff": "diff --git a/pyqtgraph/opengl/items/GLMeshItem.py b/pyqtgraph/opengl/items/GLMeshItem.py\n--- a/pyqtgraph/opengl/items/GLMeshItem.py\n+++ b/pyqtgraph/opengl/items/GLMeshItem.py\n@@ -196,7 +196,7 @@\n                     if faces is None:\n                         glDrawArrays(GL_TRIANGLES, 0, np.product(verts.shape[:-1]))\n                     else:\n-                        faces = faces.astype(np.uint).flatten()\n+                        faces = faces.astype(np.uint32).flatten()\n                         glDrawElements(GL_TRIANGLES, faces.shape[0], GL_UNSIGNED_INT, faces)\n                 finally:\n                     glDisableClientState(GL_NORMAL_ARRAY)\n", "issue": "GLMeshItem memory leak in drawing of faces\n### Short description\r\nWhen rendering faces, there appears to be a memory leak relating to line 199 and 200 of GLMeshItem.py\r\n\r\n### Code to reproduce\r\nThis can be reproduced using the GLMeshItem example script. Using top to check memory usage, the amount used by the process slowly increases as updates are called in the scene (triggered by rotating the view, etc.). If there are no changes the memory usage is constant, but otherwise will grow without bound (albeit slowly in the example). Larger meshes with cause faster accumulation.\r\n\r\n### Expected behavior\r\nNear-constant memory usage when rendering the faces in the scene.\r\n\r\n### Real behavior\r\nIncreasing memory usage when rendering faces.\r\n\r\n### Tested environment(s)\r\n\r\n * PyQtGraph version: tested on both 0.11.0 and 0.12.1\r\n * Qt Python binding:  5.15.4\r\n * Python version: 3.8\r\n * NumPy version: 1.17.3\r\n * Operating system: Ubuntu 20.04\r\n * Installation method: pip\r\n\r\n### Additional context\r\nchanging astype on faces from np.uint to np.uint32 or np.uintc on line 199 of pyqtgraph/opengl/items/GLMeshItem.py resolves the issue for me, but I don't know if that is the correct solution.\r\n\n", "before_files": [{"content": "from OpenGL.GL import *\nfrom .. GLGraphicsItem import GLGraphicsItem\nfrom .. MeshData import MeshData\nfrom ...Qt import QtGui\nfrom .. import shaders\nfrom ... import functions as fn\nimport numpy as np\n\n\n\n__all__ = ['GLMeshItem']\n\nclass GLMeshItem(GLGraphicsItem):\n    \"\"\"\n    **Bases:** :class:`GLGraphicsItem <pyqtgraph.opengl.GLGraphicsItem>`\n    \n    Displays a 3D triangle mesh. \n    \"\"\"\n    def __init__(self, **kwds):\n        \"\"\"\n        ============== =====================================================\n        **Arguments:**\n        meshdata       MeshData object from which to determine geometry for \n                       this item.\n        color          Default face color used if no vertex or face colors \n                       are specified.\n        edgeColor      Default edge color to use if no edge colors are\n                       specified in the mesh data.\n        drawEdges      If True, a wireframe mesh will be drawn. \n                       (default=False)\n        drawFaces      If True, mesh faces are drawn. (default=True)\n        shader         Name of shader program to use when drawing faces.\n                       (None for no shader)\n        smooth         If True, normal vectors are computed for each vertex\n                       and interpolated within each face.\n        computeNormals If False, then computation of normal vectors is \n                       disabled. This can provide a performance boost for \n                       meshes that do not make use of normals.\n        ============== =====================================================\n        \"\"\"\n        self.opts = {\n            'meshdata': None,\n            'color': (1., 1., 1., 1.),\n            'drawEdges': False,\n            'drawFaces': True,\n            'edgeColor': (0.5, 0.5, 0.5, 1.0),\n            'shader': None,\n            'smooth': True,\n            'computeNormals': True,\n        }\n        \n        GLGraphicsItem.__init__(self)\n        glopts = kwds.pop('glOptions', 'opaque')\n        self.setGLOptions(glopts)\n        shader = kwds.pop('shader', None)\n        self.setShader(shader)\n        \n        self.setMeshData(**kwds)\n        \n        ## storage for data compiled from MeshData object\n        self.vertexes = None\n        self.normals = None\n        self.colors = None\n        self.faces = None\n        \n    def setShader(self, shader):\n        \"\"\"Set the shader used when rendering faces in the mesh. (see the GL shaders example)\"\"\"\n        self.opts['shader'] = shader\n        self.update()\n        \n    def shader(self):\n        shader = self.opts['shader']\n        if isinstance(shader, shaders.ShaderProgram):\n            return shader\n        else:\n            return shaders.getShaderProgram(shader)\n        \n    def setColor(self, c):\n        \"\"\"Set the default color to use when no vertex or face colors are specified.\"\"\"\n        self.opts['color'] = c\n        self.update()\n        \n    def setMeshData(self, **kwds):\n        \"\"\"\n        Set mesh data for this item. This can be invoked two ways:\n        \n        1. Specify *meshdata* argument with a new MeshData object\n        2. Specify keyword arguments to be passed to MeshData(..) to create a new instance.\n        \"\"\"\n        md = kwds.get('meshdata', None)\n        if md is None:\n            opts = {}\n            for k in ['vertexes', 'faces', 'edges', 'vertexColors', 'faceColors']:\n                try:\n                    opts[k] = kwds.pop(k)\n                except KeyError:\n                    pass\n            md = MeshData(**opts)\n        \n        self.opts['meshdata'] = md\n        self.opts.update(kwds)\n        self.meshDataChanged()\n        self.update()\n        \n    \n    def meshDataChanged(self):\n        \"\"\"\n        This method must be called to inform the item that the MeshData object\n        has been altered.\n        \"\"\"\n        \n        self.vertexes = None\n        self.faces = None\n        self.normals = None\n        self.colors = None\n        self.edges = None\n        self.edgeColors = None\n        self.update()\n    \n    def parseMeshData(self):\n        ## interpret vertex / normal data before drawing\n        ## This can:\n        ##   - automatically generate normals if they were not specified\n        ##   - pull vertexes/noormals/faces from MeshData if that was specified\n        \n        if self.vertexes is not None and self.normals is not None:\n            return\n        #if self.opts['normals'] is None:\n            #if self.opts['meshdata'] is None:\n                #self.opts['meshdata'] = MeshData(vertexes=self.opts['vertexes'], faces=self.opts['faces'])\n        if self.opts['meshdata'] is not None:\n            md = self.opts['meshdata']\n            if self.opts['smooth'] and not md.hasFaceIndexedData():\n                self.vertexes = md.vertexes()\n                if self.opts['computeNormals']:\n                    self.normals = md.vertexNormals()\n                self.faces = md.faces()\n                if md.hasVertexColor():\n                    self.colors = md.vertexColors()\n                if md.hasFaceColor():\n                    self.colors = md.faceColors()\n            else:\n                self.vertexes = md.vertexes(indexed='faces')\n                if self.opts['computeNormals']:\n                    if self.opts['smooth']:\n                        self.normals = md.vertexNormals(indexed='faces')\n                    else:\n                        self.normals = md.faceNormals(indexed='faces')\n                self.faces = None\n                if md.hasVertexColor():\n                    self.colors = md.vertexColors(indexed='faces')\n                elif md.hasFaceColor():\n                    self.colors = md.faceColors(indexed='faces')\n                    \n            if self.opts['drawEdges']:\n                if not md.hasFaceIndexedData():\n                    self.edges = md.edges()\n                    self.edgeVerts = md.vertexes()\n                else:\n                    self.edges = md.edges()\n                    self.edgeVerts = md.vertexes(indexed='faces')\n            return\n    \n    def paint(self):\n        self.setupGLState()\n        \n        self.parseMeshData()        \n        \n        if self.opts['drawFaces']:\n            with self.shader():\n                verts = self.vertexes\n                norms = self.normals\n                color = self.colors\n                faces = self.faces\n                if verts is None:\n                    return\n                glEnableClientState(GL_VERTEX_ARRAY)\n                try:\n                    glVertexPointerf(verts)\n                    \n                    if self.colors is None:\n                        color = self.opts['color']\n                        if isinstance(color, QtGui.QColor):\n                            glColor4f(*fn.glColor(color))\n                        else:\n                            glColor4f(*color)\n                    else:\n                        glEnableClientState(GL_COLOR_ARRAY)\n                        glColorPointerf(color)\n                    \n                    \n                    if norms is not None:\n                        glEnableClientState(GL_NORMAL_ARRAY)\n                        glNormalPointerf(norms)\n                    \n                    if faces is None:\n                        glDrawArrays(GL_TRIANGLES, 0, np.product(verts.shape[:-1]))\n                    else:\n                        faces = faces.astype(np.uint).flatten()\n                        glDrawElements(GL_TRIANGLES, faces.shape[0], GL_UNSIGNED_INT, faces)\n                finally:\n                    glDisableClientState(GL_NORMAL_ARRAY)\n                    glDisableClientState(GL_VERTEX_ARRAY)\n                    glDisableClientState(GL_COLOR_ARRAY)\n            \n        if self.opts['drawEdges']:\n            verts = self.edgeVerts\n            edges = self.edges\n            glEnableClientState(GL_VERTEX_ARRAY)\n            try:\n                glVertexPointerf(verts)\n                \n                if self.edgeColors is None:\n                    color = self.opts['edgeColor']\n                    if isinstance(color, QtGui.QColor):\n                        glColor4f(*fn.glColor(color))\n                    else:\n                        glColor4f(*color)\n                else:\n                    glEnableClientState(GL_COLOR_ARRAY)\n                    glColorPointerf(color)\n                edges = edges.flatten()\n                glDrawElements(GL_LINES, edges.shape[0], GL_UNSIGNED_INT, edges)\n            finally:\n                glDisableClientState(GL_VERTEX_ARRAY)\n                glDisableClientState(GL_COLOR_ARRAY)\n            \n", "path": "pyqtgraph/opengl/items/GLMeshItem.py"}], "after_files": [{"content": "from OpenGL.GL import *\nfrom .. GLGraphicsItem import GLGraphicsItem\nfrom .. MeshData import MeshData\nfrom ...Qt import QtGui\nfrom .. import shaders\nfrom ... import functions as fn\nimport numpy as np\n\n\n\n__all__ = ['GLMeshItem']\n\nclass GLMeshItem(GLGraphicsItem):\n    \"\"\"\n    **Bases:** :class:`GLGraphicsItem <pyqtgraph.opengl.GLGraphicsItem>`\n    \n    Displays a 3D triangle mesh. \n    \"\"\"\n    def __init__(self, **kwds):\n        \"\"\"\n        ============== =====================================================\n        **Arguments:**\n        meshdata       MeshData object from which to determine geometry for \n                       this item.\n        color          Default face color used if no vertex or face colors \n                       are specified.\n        edgeColor      Default edge color to use if no edge colors are\n                       specified in the mesh data.\n        drawEdges      If True, a wireframe mesh will be drawn. \n                       (default=False)\n        drawFaces      If True, mesh faces are drawn. (default=True)\n        shader         Name of shader program to use when drawing faces.\n                       (None for no shader)\n        smooth         If True, normal vectors are computed for each vertex\n                       and interpolated within each face.\n        computeNormals If False, then computation of normal vectors is \n                       disabled. This can provide a performance boost for \n                       meshes that do not make use of normals.\n        ============== =====================================================\n        \"\"\"\n        self.opts = {\n            'meshdata': None,\n            'color': (1., 1., 1., 1.),\n            'drawEdges': False,\n            'drawFaces': True,\n            'edgeColor': (0.5, 0.5, 0.5, 1.0),\n            'shader': None,\n            'smooth': True,\n            'computeNormals': True,\n        }\n        \n        GLGraphicsItem.__init__(self)\n        glopts = kwds.pop('glOptions', 'opaque')\n        self.setGLOptions(glopts)\n        shader = kwds.pop('shader', None)\n        self.setShader(shader)\n        \n        self.setMeshData(**kwds)\n        \n        ## storage for data compiled from MeshData object\n        self.vertexes = None\n        self.normals = None\n        self.colors = None\n        self.faces = None\n        \n    def setShader(self, shader):\n        \"\"\"Set the shader used when rendering faces in the mesh. (see the GL shaders example)\"\"\"\n        self.opts['shader'] = shader\n        self.update()\n        \n    def shader(self):\n        shader = self.opts['shader']\n        if isinstance(shader, shaders.ShaderProgram):\n            return shader\n        else:\n            return shaders.getShaderProgram(shader)\n        \n    def setColor(self, c):\n        \"\"\"Set the default color to use when no vertex or face colors are specified.\"\"\"\n        self.opts['color'] = c\n        self.update()\n        \n    def setMeshData(self, **kwds):\n        \"\"\"\n        Set mesh data for this item. This can be invoked two ways:\n        \n        1. Specify *meshdata* argument with a new MeshData object\n        2. Specify keyword arguments to be passed to MeshData(..) to create a new instance.\n        \"\"\"\n        md = kwds.get('meshdata', None)\n        if md is None:\n            opts = {}\n            for k in ['vertexes', 'faces', 'edges', 'vertexColors', 'faceColors']:\n                try:\n                    opts[k] = kwds.pop(k)\n                except KeyError:\n                    pass\n            md = MeshData(**opts)\n        \n        self.opts['meshdata'] = md\n        self.opts.update(kwds)\n        self.meshDataChanged()\n        self.update()\n        \n    \n    def meshDataChanged(self):\n        \"\"\"\n        This method must be called to inform the item that the MeshData object\n        has been altered.\n        \"\"\"\n        \n        self.vertexes = None\n        self.faces = None\n        self.normals = None\n        self.colors = None\n        self.edges = None\n        self.edgeColors = None\n        self.update()\n    \n    def parseMeshData(self):\n        ## interpret vertex / normal data before drawing\n        ## This can:\n        ##   - automatically generate normals if they were not specified\n        ##   - pull vertexes/noormals/faces from MeshData if that was specified\n        \n        if self.vertexes is not None and self.normals is not None:\n            return\n        #if self.opts['normals'] is None:\n            #if self.opts['meshdata'] is None:\n                #self.opts['meshdata'] = MeshData(vertexes=self.opts['vertexes'], faces=self.opts['faces'])\n        if self.opts['meshdata'] is not None:\n            md = self.opts['meshdata']\n            if self.opts['smooth'] and not md.hasFaceIndexedData():\n                self.vertexes = md.vertexes()\n                if self.opts['computeNormals']:\n                    self.normals = md.vertexNormals()\n                self.faces = md.faces()\n                if md.hasVertexColor():\n                    self.colors = md.vertexColors()\n                if md.hasFaceColor():\n                    self.colors = md.faceColors()\n            else:\n                self.vertexes = md.vertexes(indexed='faces')\n                if self.opts['computeNormals']:\n                    if self.opts['smooth']:\n                        self.normals = md.vertexNormals(indexed='faces')\n                    else:\n                        self.normals = md.faceNormals(indexed='faces')\n                self.faces = None\n                if md.hasVertexColor():\n                    self.colors = md.vertexColors(indexed='faces')\n                elif md.hasFaceColor():\n                    self.colors = md.faceColors(indexed='faces')\n                    \n            if self.opts['drawEdges']:\n                if not md.hasFaceIndexedData():\n                    self.edges = md.edges()\n                    self.edgeVerts = md.vertexes()\n                else:\n                    self.edges = md.edges()\n                    self.edgeVerts = md.vertexes(indexed='faces')\n            return\n    \n    def paint(self):\n        self.setupGLState()\n        \n        self.parseMeshData()        \n        \n        if self.opts['drawFaces']:\n            with self.shader():\n                verts = self.vertexes\n                norms = self.normals\n                color = self.colors\n                faces = self.faces\n                if verts is None:\n                    return\n                glEnableClientState(GL_VERTEX_ARRAY)\n                try:\n                    glVertexPointerf(verts)\n                    \n                    if self.colors is None:\n                        color = self.opts['color']\n                        if isinstance(color, QtGui.QColor):\n                            glColor4f(*fn.glColor(color))\n                        else:\n                            glColor4f(*color)\n                    else:\n                        glEnableClientState(GL_COLOR_ARRAY)\n                        glColorPointerf(color)\n                    \n                    \n                    if norms is not None:\n                        glEnableClientState(GL_NORMAL_ARRAY)\n                        glNormalPointerf(norms)\n                    \n                    if faces is None:\n                        glDrawArrays(GL_TRIANGLES, 0, np.product(verts.shape[:-1]))\n                    else:\n                        faces = faces.astype(np.uint32).flatten()\n                        glDrawElements(GL_TRIANGLES, faces.shape[0], GL_UNSIGNED_INT, faces)\n                finally:\n                    glDisableClientState(GL_NORMAL_ARRAY)\n                    glDisableClientState(GL_VERTEX_ARRAY)\n                    glDisableClientState(GL_COLOR_ARRAY)\n            \n        if self.opts['drawEdges']:\n            verts = self.edgeVerts\n            edges = self.edges\n            glEnableClientState(GL_VERTEX_ARRAY)\n            try:\n                glVertexPointerf(verts)\n                \n                if self.edgeColors is None:\n                    color = self.opts['edgeColor']\n                    if isinstance(color, QtGui.QColor):\n                        glColor4f(*fn.glColor(color))\n                    else:\n                        glColor4f(*color)\n                else:\n                    glEnableClientState(GL_COLOR_ARRAY)\n                    glColorPointerf(color)\n                edges = edges.flatten()\n                glDrawElements(GL_LINES, edges.shape[0], GL_UNSIGNED_INT, edges)\n            finally:\n                glDisableClientState(GL_VERTEX_ARRAY)\n                glDisableClientState(GL_COLOR_ARRAY)\n            \n", "path": "pyqtgraph/opengl/items/GLMeshItem.py"}]}