[yade] 01/03: Fix compilation against new libqglviewer. (Closes: #790627)
Anton Gladky
gladk at moszumanska.debian.org
Sun Jul 5 12:44:12 UTC 2015
This is an automated email from the git hooks/post-receive script.
gladk pushed a commit to branch master
in repository yade.
commit dcc15ea89878856cbb0f912ab36927995358a637
Author: Anton Gladky <gladk at debian.org>
Date: Sat Jul 4 14:06:25 2015 +0200
Fix compilation against new libqglviewer. (Closes: #790627)
---
debian/control | 2 +-
debian/patches/03_libqglviewer.patch | 22 +++++++++++
debian/patches/04_libqglviewer.patch | 72 ++++++++++++++++++++++++++++++++++++
debian/patches/series | 2 +
4 files changed, 97 insertions(+), 1 deletion(-)
diff --git a/debian/control b/debian/control
index 5f726c2..1b30b94 100644
--- a/debian/control
+++ b/debian/control
@@ -18,7 +18,7 @@ Build-Depends: cmake,
libloki-dev,
libmetis-dev [amd64 i386 ia64 kfreebsd-amd64 kfreebsd-i386 powerpc],
libopenblas-dev [amd64 i386 ia64 kfreebsd-amd64 kfreebsd-i386 powerpc],
- libqglviewer-dev,
+ libqglviewer-dev-qt4,
libsuitesparse-dev [amd64 i386 ia64 kfreebsd-amd64 kfreebsd-i386 powerpc],
libvtk6-dev,
libxi-dev,
diff --git a/debian/patches/03_libqglviewer.patch b/debian/patches/03_libqglviewer.patch
new file mode 100644
index 0000000..40476b8
--- /dev/null
+++ b/debian/patches/03_libqglviewer.patch
@@ -0,0 +1,22 @@
+From 74196a3a7f8858f96dfa30311f546a66ab724833 Mon Sep 17 00:00:00 2001
+From: Anton Gladky <gladky.anton at gmail.com>
+Date: Wed, 1 Jul 2015 10:39:17 +0200
+Subject: [PATCH] Fix compilation against gqlviewer-qt4.
+
+---
+ cMake/FindQGLVIEWER.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cMake/FindQGLVIEWER.cmake b/cMake/FindQGLVIEWER.cmake
+index c3d1075..f940ad0 100644
+--- a/cMake/FindQGLVIEWER.cmake
++++ b/cMake/FindQGLVIEWER.cmake
+@@ -15,7 +15,7 @@ find_path(QGLVIEWER_INCLUDE_DIR
+ )
+
+ find_library(QGLVIEWER_LIBRARY_RELEASE
+- NAMES qglviewer-qt4 qglviewer QGLViewer QGLViewer2
++ NAMES QGLViewer-qt4 qglviewer QGLViewer QGLViewer2
+ PATHS /usr/lib
+ /usr/local/lib
+ ENV QGLVIEWERROOT
diff --git a/debian/patches/04_libqglviewer.patch b/debian/patches/04_libqglviewer.patch
new file mode 100644
index 0000000..e0136ab
--- /dev/null
+++ b/debian/patches/04_libqglviewer.patch
@@ -0,0 +1,72 @@
+From b150a09593b52e6d37b6f26076a5d617eda9e0f6 Mon Sep 17 00:00:00 2001
+From: Anton Gladky <gladky.anton at gmail.com>
+Date: Fri, 26 Jun 2015 19:15:38 +0200
+Subject: [PATCH] Fix compilation with QGLViewer>=2.6.3
+
+---
+ gui/qt4/GLViewer.cpp | 5 ++++-
+ gui/qt4/GLViewer.hpp | 4 ++++
+ gui/qt4/GLViewerDisplay.cpp | 8 ++++++++
+ 3 files changed, 16 insertions(+), 1 deletion(-)
+
+diff --git a/gui/qt4/GLViewer.cpp b/gui/qt4/GLViewer.cpp
+index 8718eef..a6d0010 100644
+--- a/gui/qt4/GLViewer.cpp
++++ b/gui/qt4/GLViewer.cpp
+@@ -466,8 +466,11 @@ void GLViewer::initFromDOMElement(const QDomElement& element){
+
+ boost::posix_time::ptime GLViewer::getLastUserEvent(){return last_user_event;};
+
+-
++#if QGLVIEWER_VERSION>=0x020603
++qreal YadeCamera::zNear() const
++#else
+ float YadeCamera::zNear() const
++#endif
+ {
+ float z = distanceToSceneCenter() - zClippingCoefficient()*sceneRadius()*(1.f-2*cuttingDistance);
+
+diff --git a/gui/qt4/GLViewer.hpp b/gui/qt4/GLViewer.hpp
+index d97b925..1a3160d 100644
+--- a/gui/qt4/GLViewer.hpp
++++ b/gui/qt4/GLViewer.hpp
+@@ -151,7 +151,11 @@ class YadeCamera : public qglviewer::Camera
+ float cuttingDistance;
+ public :
+ YadeCamera():cuttingDistance(0){};
++#if QGLVIEWER_VERSION>=0x020603
++ virtual qreal zNear() const;
++#else
+ virtual float zNear() const;
++#endif
+ virtual void setCuttingDistance(float s){cuttingDistance=s;};
+ };
+
+diff --git a/gui/qt4/GLViewerDisplay.cpp b/gui/qt4/GLViewerDisplay.cpp
+index 7bc918e..26c8a92 100644
+--- a/gui/qt4/GLViewerDisplay.cpp
++++ b/gui/qt4/GLViewerDisplay.cpp
+@@ -82,7 +82,11 @@ void GLViewer::draw()
+ int selection = selectedName();
+ if(selection!=-1 && (*(Omega::instance().getScene()->bodies)).exists(selection) && isMoving){
+ static Real lastTimeMoved(0);
++#if QGLVIEWER_VERSION>=0x020603
++ qreal v0,v1,v2; manipulatedFrame()->getPosition(v0,v1,v2);
++#else
+ float v0,v1,v2; manipulatedFrame()->getPosition(v0,v1,v2);
++#endif
+ if(last == selection) // delay by one redraw, so the body will not jump into 0,0,0 coords
+ {
+ Quaternionr& q = (*(Omega::instance().getScene()->bodies))[selection]->state->ori;
+@@ -100,7 +104,11 @@ void GLViewer::draw()
+ }
+ if(manipulatedClipPlane>=0){
+ assert(manipulatedClipPlane<renderer->numClipPlanes);
++#if QGLVIEWER_VERSION>=0x020603
++ qreal v0,v1,v2; manipulatedFrame()->getPosition(v0,v1,v2);
++#else
+ float v0,v1,v2; manipulatedFrame()->getPosition(v0,v1,v2);
++#endif
+ double q0,q1,q2,q3; manipulatedFrame()->getOrientation(q0,q1,q2,q3);
+ Se3r newSe3(Vector3r(v0,v1,v2),Quaternionr(q0,q1,q2,q3)); newSe3.orientation.normalize();
+ const Se3r& oldSe3=renderer->clipPlaneSe3[manipulatedClipPlane];
diff --git a/debian/patches/series b/debian/patches/series
index ca049af..8637dc5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,4 @@
01_remove_google_analytics.patch
02_fix_cmake_findvtk.patch
+03_libqglviewer.patch
+04_libqglviewer.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/yade.git
More information about the debian-science-commits
mailing list