Commit 9468f577 authored by René Fritze's avatar René Fritze Committed by René Fritze

[gui] refactor gl buffer dtype to prevent futurewarning

parent 68f2d38f
Pipeline #68734 passed with stages
in 37 minutes and 16 seconds
......@@ -129,23 +129,20 @@ if config.HAVE_QT and config.HAVE_QTOPENGL and config.HAVE_GL:
self.shift = - np.array(bb[0]) - self.size / 2
# setup buffers
buffer_dtype = [('position', 'f4', 2), ('color', 'f4', (1,))]
if self.reference_element == triangle:
if codim == 2:
self.vertex_data = np.empty(len(coordinates),
dtype=[('position', 'f4', 2), ('color', 'f4', 1)])
self.vertex_data = np.empty(len(coordinates), dtype=buffer_dtype)
self.indices = subentities
else:
self.vertex_data = np.empty(len(subentities) * 3,
dtype=[('position', 'f4', 2), ('color', 'f4', 1)])
self.vertex_data = np.empty(len(subentities) * 3, dtype=buffer_dtype)
self.indices = np.arange(len(subentities) * 3, dtype=np.uint32)
else:
if codim == 2:
self.vertex_data = np.empty(len(coordinates),
dtype=[('position', 'f4', 2), ('color', 'f4', 1)])
self.vertex_data = np.empty(len(coordinates), dtype=buffer_dtype)
self.indices = np.vstack((subentities[:, 0:3], subentities[:, [0, 2, 3]]))
else:
self.vertex_data = np.empty(len(subentities) * 6,
dtype=[('position', 'f4', 2), ('color', 'f4', 1)])
self.vertex_data = np.empty(len(subentities) * 6, dtype=buffer_dtype)
self.indices = np.arange(len(subentities) * 6, dtype=np.uint32)
self.indices = np.ascontiguousarray(self.indices)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment