From 059bd3b5cfe13233aa641b0dc46a15c53abd7f74 Mon Sep 17 00:00:00 2001 From: LemurPwned Date: Thu, 21 Jun 2018 16:56:40 +0200 Subject: [PATCH] arrows are drawn now if normalization is off #144 --- ColorPolicy.py | 2 +- Widgets/openGL_widgets/AbstractGLContext.py | 2 +- Widgets/openGL_widgets/ArrowGLContext.py | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ColorPolicy.py b/ColorPolicy.py index 7cab3a2..f6baee1 100644 --- a/ColorPolicy.py +++ b/ColorPolicy.py @@ -199,4 +199,4 @@ def standard_procedure(outline, color, iterations, averaging, xc, yc, zc, if not decimate: assert dotted_color.shape == (iterations, zc*yc*xc, 3) assert outline.shape == (zc*yc*xc, 4) - return dotted_color, outline, decimate + return dotted_color, outline, decimate, np.array(color) diff --git a/Widgets/openGL_widgets/AbstractGLContext.py b/Widgets/openGL_widgets/AbstractGLContext.py index c77a081..2fa9eae 100644 --- a/Widgets/openGL_widgets/AbstractGLContext.py +++ b/Widgets/openGL_widgets/AbstractGLContext.py @@ -81,7 +81,7 @@ def prerendering_calculation(self): yc = int(self.file_header['ynodes']) zc = int(self.file_header['znodes']) # change drawing function - self.color_vectors, self.vectors_list, decimate = \ + self.color_vectors, self.vectors_list, decimate, self.colorX = \ ColorPolicy.standard_procedure(self.vectors_list, self.color_vectors, self.iterations, diff --git a/Widgets/openGL_widgets/ArrowGLContext.py b/Widgets/openGL_widgets/ArrowGLContext.py index f5e438d..3fa690b 100644 --- a/Widgets/openGL_widgets/ArrowGLContext.py +++ b/Widgets/openGL_widgets/ArrowGLContext.py @@ -41,9 +41,10 @@ def __init__(self, data_dict, parent): def prerendering_calculation(self): super().prerendering_calculation() + ArrowGLContext.normalize_specification(self.colorX, vbo=True) if self.normalize: - ArrowGLContext.normalize_specification(self.color_vectors, vbo=True) - self.structure_vbo = self.regenerate_structure(self.color_vectors) + ArrowGLContext.normalize_specification(self.color_vectors, vbo=True) + self.structure_vbo = self.regenerate_structure(self.colorX) self.index_required = self.SIDES*2 self.indices = self.generate_index() self.color_vectors = ColorPolicy.apply_vbo_format(self.color_vectors,