[3depict] 03/03: * Add fix from upstream for voxel slice transparency

D Haley mycae-guest at moszumanska.debian.org
Sun Feb 5 14:38:52 UTC 2017


This is an automated email from the git hooks/post-receive script.

mycae-guest pushed a commit to branch master
in repository 3depict.

commit dd06f5b091afe68dd0e51ae5f1973b9e11afaa6b
Author: D Haley <mycae at gmx.com>
Date:   Sun Feb 5 15:34:50 2017 +0100

    * Add fix from upstream for voxel slice transparency
---
 debian/patches/series                              |  1 +
 .../patches/upstream-cf4c3e-fix-slice-transparency | 69 ++++++++++++++++++++++
 2 files changed, 70 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
index 2b9da52..02ad2fd 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 debian-desktop-naming.patch
 lowercase-textdomain.patch
 desktop-category.patch
+upstream-cf4c3e-fix-slice-transparency
diff --git a/debian/patches/upstream-cf4c3e-fix-slice-transparency b/debian/patches/upstream-cf4c3e-fix-slice-transparency
new file mode 100644
index 0000000..a7f6455
--- /dev/null
+++ b/debian/patches/upstream-cf4c3e-fix-slice-transparency
@@ -0,0 +1,69 @@
+Index: 3depict-0.0.20/src/backend/filters/voxelise.cpp
+===================================================================
+--- 3depict-0.0.20.orig/src/backend/filters/voxelise.cpp	2017-02-05 13:59:22.515897489 +0100
++++ 3depict-0.0.20/src/backend/filters/voxelise.cpp	2017-02-05 15:34:12.492125435 +0100
+@@ -751,6 +751,7 @@
+ 
+ 			DrawTriangleMesh *tm = new DrawTriangleMesh();
+ 			tm->canSelect=true;
++			tm->setAlpha(rgba.a());
+ 
+ 
+ 			vector<TRI_IDX> idx;
+Index: 3depict-0.0.20/src/gl/drawables.cpp
+===================================================================
+--- 3depict-0.0.20.orig/src/gl/drawables.cpp	2017-02-05 13:59:22.527897489 +0100
++++ 3depict-0.0.20/src/gl/drawables.cpp	2017-02-05 15:34:12.496125385 +0100
+@@ -781,6 +781,7 @@
+ 	haveCachedBounds=false;
+ 	drawMode=TRIMESH_DRAW_SURF;
+ 	deltaOrigin=Point3D(0,0,0);
++	alpha=1.0;
+ }
+ 
+ DrawTriangleMesh::~DrawTriangleMesh()
+@@ -807,8 +808,11 @@
+ 			{
+ 				for(unsigned int uj=0;uj<3;uj++)
+ 				{
+-					const RGBFloat &f=triIndices[ui].col[uj];
+-					glColor3fv(f.v);
++					float rgba[4];
++					for( unsigned int uk=0;uk<3; uk++)
++						rgba[uk]=triIndices[ui].col[uj].v[uk];
++					rgba[3]=alpha;
++					glColor4fv(rgba);
+ 					glVertex3fv(pts[triIndices[ui].idx[uj]].getValueArr());
+ 				}
+ 			}
+Index: 3depict-0.0.20/src/gl/drawables.h
+===================================================================
+--- 3depict-0.0.20.orig/src/gl/drawables.h	2017-02-05 13:59:22.527897489 +0100
++++ 3depict-0.0.20/src/gl/drawables.h	2017-02-05 15:34:12.496125385 +0100
+@@ -600,6 +600,8 @@
+ 		// this
+ 		Point3D origCentroid,deltaOrigin;
+ 
++		float alpha;
++
+ 		bool drawDoubleSided;
+ 		//If true, draw the mesh edges in addition to the
+ 		// coloured triangles
+@@ -629,6 +631,9 @@
+ 
+ 		//!Recompute the internal parameters using the input vector information
+ 		void recomputeParams(const std::vector<Point3D> &vecs, const std::vector<float> &scalars, unsigned int mode);
++
++		//!Set the opacity value (alpha)
++		void setAlpha(float f) { alpha=f;}
+ };
+ 
+ 
+@@ -680,6 +685,7 @@
+ 		void recomputeParams(const std::vector<Point3D> &vecs, 
+ 				const std::vector<float> &scalars, unsigned int mode);
+ 
++
+ };
+ 
+ //!A tapered cylinder drawing class

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/3depict.git



More information about the debian-science-commits mailing list