[Debichem-devel] stretch-pu: package avogadro/1.2.0-2+deb9u1
Michael Banck
mbanck at debian.org
Thu Jul 13 08:18:26 UTC 2017
Package: release.debian.org
Severity: normal
Tags: stretch
User: release.debian.org at packages.debian.org
Usertags: pu
Version 1.2.0-2 (now in testing) fixes an RC bug in stretch where atoms
are not displayed at all, rendering avogadro useless.
The debdiff is attached, it replaces the old eigen3.patch with the
upstream versions here:
https://github.com/cryos/avogadro/commit/2d4be7ede177a8df7340fe3b209698d591ee8a04
https://github.com/cryos/avogadro/commit/43af3c117b0b3220b15c2fe2895b94bbd83d3a60
Changelog entry:
|avogadro (1.2.0-2+deb9u1) stretch; urgency=medium
|
| [ Anton Gladky ]
| * Update eigen3 patches, pull them from upstream. (Closes: #865085)
|
| -- Michael Banck <mbanck at debian.org> Thu, 13 Jul 2017 10:15:00 +0200
Thanks for considering.
Michael
-- System Information:
Debian Release: 8.7
APT prefers oldstable
APT policy: (500, 'oldstable')
Architecture: i386 (i686)
Kernel: Linux 3.16.0-4-686-pae (SMP w/1 CPU core)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
-------------- next part --------------
diff -Nru avogadro-1.2.0/debian/changelog avogadro-1.2.0/debian/changelog
--- avogadro-1.2.0/debian/changelog 2016-10-02 10:13:51.000000000 +0200
+++ avogadro-1.2.0/debian/changelog 2017-07-13 10:15:00.000000000 +0200
@@ -1,3 +1,10 @@
+avogadro (1.2.0-2+deb9u1) stretch; urgency=medium
+
+ [ Anton Gladky ]
+ * Update eigen3 patches, pull them from upstream. (Closes: #865085)
+
+ -- Michael Banck <mbanck at debian.org> Thu, 13 Jul 2017 10:15:00 +0200
+
avogadro (1.2.0-1) unstable; urgency=medium
* New upstream release.
diff -Nru avogadro-1.2.0/debian/control avogadro-1.2.0/debian/control
--- avogadro-1.2.0/debian/control 2015-09-26 21:19:33.000000000 +0200
+++ avogadro-1.2.0/debian/control 2017-07-13 10:15:00.000000000 +0200
@@ -7,7 +7,7 @@
Build-Depends: cmake (>> 2.6.0),
debhelper (>> 7.0.50~),
libboost-python-dev,
- libeigen3-dev,
+ libeigen3-dev (>> 3.3),
libgl2ps-dev,
libglew-dev,
libopenbabel-dev (>> 2.2.0),
diff -Nru avogadro-1.2.0/debian/patches/eigen3_lib.patch avogadro-1.2.0/debian/patches/eigen3_lib.patch
--- avogadro-1.2.0/debian/patches/eigen3_lib.patch 1970-01-01 01:00:00.000000000 +0100
+++ avogadro-1.2.0/debian/patches/eigen3_lib.patch 2016-10-02 10:13:37.000000000 +0200
@@ -0,0 +1,162 @@
+From 2d4be7ede177a8df7340fe3b209698d591ee8a04 Mon Sep 17 00:00:00 2001
+From: Claudio Fernandes <claudiosf.claudio at gmail.com>
+Date: Mon, 16 Jan 2017 19:48:23 -0200
+Subject: [PATCH] Adapt libavogadro/python to Eigen 3.3
+
+---
+ libavogadro/src/python/camera.cpp | 2 +-
+ libavogadro/src/python/eigen.cpp | 60 +++++++++++++++++++--------------------
+ 2 files changed, 31 insertions(+), 31 deletions(-)
+
+diff --git a/libavogadro/src/python/camera.cpp b/libavogadro/src/python/camera.cpp
+index 69ca87bf8..30b32af7d 100644
+--- a/libavogadro/src/python/camera.cpp
++++ b/libavogadro/src/python/camera.cpp
+@@ -10,7 +10,7 @@ using namespace Avogadro;
+ void export_Camera()
+ {
+
+- const Eigen::Transform3d& (Camera::*modelview_ptr)() const = &Camera::modelview;
++ const Eigen::Projective3d& (Camera::*modelview_ptr)() const = &Camera::modelview;
+ Eigen::Vector3d (Camera::*unProject_ptr1)(const Eigen::Vector3d&) const = &Camera::unProject;
+ Eigen::Vector3d (Camera::*unProject_ptr2)(const QPoint&, const Eigen::Vector3d&) const = &Camera::unProject;
+ Eigen::Vector3d (Camera::*unProject_ptr3)(const QPoint&) const = &Camera::unProject;
+diff --git a/libavogadro/src/python/eigen.cpp b/libavogadro/src/python/eigen.cpp
+index c1faedbcc..20b4e719d 100644
+--- a/libavogadro/src/python/eigen.cpp
++++ b/libavogadro/src/python/eigen.cpp
+@@ -305,9 +305,9 @@ template <> struct ScalarTraits<double>
+ struct innerclass
+ {
+ //
+- // Eigen::Transform3d --> python array (4x4)
++ // Eigen::Projective3d --> python array (4x4)
+ //
+- static PyObject* convert(Eigen::Transform3d const &trans)
++ static PyObject* convert(Eigen::Projective3d const &trans)
+ {
+ npy_intp dims[2] = { 4, 4 };
+ PyObject *result = PyArray_SimpleNew(2, dims, PyArray_DOUBLE);
+@@ -321,9 +321,9 @@ template <> struct ScalarTraits<double>
+ return incref(result);
+ }
+ //
+- // Eigen::Transform3d* --> python array (4x4)
++ // Eigen::Projective3d* --> python array (4x4)
+ //
+- static PyObject* convert(Eigen::Transform3d *trans)
++ static PyObject* convert(Eigen::Projective3d *trans)
+ {
+ npy_intp dims[2] = { 4, 4 };
+ PyObject *result = PyArray_SimpleNew(2, dims, PyArray_DOUBLE);
+@@ -337,9 +337,9 @@ template <> struct ScalarTraits<double>
+ return incref(result);
+ }
+ //
+- // const Eigen::Transform3d* --> python array (4x4)
++ // const Eigen::Projective3d* --> python array (4x4)
+ //
+- static PyObject* convert(const Eigen::Transform3d *trans)
++ static PyObject* convert(const Eigen::Projective3d *trans)
+ {
+ npy_intp dims[2] = { 4, 4 };
+ PyObject *result = PyArray_SimpleNew(2, dims, PyArray_DOUBLE);
+@@ -358,10 +358,10 @@ template <> struct ScalarTraits<double>
+ Transform3d_to_python_array()
+ {
+ #ifndef WIN32
+- to_python_converter<Eigen::Transform3d, innerclass>();
++ to_python_converter<Eigen::Projective3d, innerclass>();
+ #endif
+- to_python_converter<Eigen::Transform3d*, innerclass>();
+- to_python_converter<const Eigen::Transform3d*, innerclass>();
++ to_python_converter<Eigen::Projective3d*, innerclass>();
++ to_python_converter<const Eigen::Projective3d*, innerclass>();
+ }
+
+ };
+@@ -373,17 +373,17 @@ template <> struct ScalarTraits<double>
+ // Insert an rvalue from_python converter at the tail of the
+ // chain. Used for implicit conversions
+ //
+- // python array --> Eigen::Transform3d
++ // python array --> Eigen::Projective3d
+ //
+ // used for:
+ //
+- // void function(Eigen::Transform3d vec)
+- // void function(Eigen::Transform3d & vec)
+- // void function(const Eigen::Transform3d & vec)
++ // void function(Eigen::Projective3d vec)
++ // void function(Eigen::Projective3d & vec)
++ // void function(const Eigen::Projective3d & vec)
+ //
+- converter::registry::push_back( &convertible, &construct, type_id<Eigen::Transform3d>() );
++ converter::registry::push_back( &convertible, &construct, type_id<Eigen::Projective3d>() );
+
+- converter::registry::insert( &convert, type_id<Eigen::Transform3d>() );
++ converter::registry::insert( &convert, type_id<Eigen::Projective3d>() );
+ }
+
+ static void* convert(PyObject *obj_ptr)
+@@ -401,7 +401,7 @@ template <> struct ScalarTraits<double>
+ throw_error_already_set(); // the 1D array does not have exactly 3 elements
+
+ double *values = reinterpret_cast<double*>(array->data);
+- Eigen::Transform3d *c_obj = new Eigen::Transform3d();
++ Eigen::Projective3d *c_obj = new Eigen::Projective3d();
+ double *dataPtr = c_obj->data();
+
+ for (int i = 0; i < 16; ++i)
+@@ -432,7 +432,7 @@ template <> struct ScalarTraits<double>
+ // I think this is a better way to get at the double array, where is this
+ // deleted though? Does Boost::Python do it?
+ double *values = reinterpret_cast<double*>(array->data);
+- Eigen::Transform3d *storage = new Eigen::Transform3d();
++ Eigen::Projective3d *storage = new Eigen::Projective3d();
+ double *dataPtr = storage->data();
+
+ for (int i = 0; i < 16; ++i)
+@@ -467,21 +467,21 @@ class EigenUnitTestHelper
+ void set_vector3d_ptr(Eigen::Vector3d* vec) { m_vector3d = *vec; }
+ void set_const_vector3d_ptr(const Eigen::Vector3d* const vec) { m_vector3d = *vec; }
+
+- //Eigen::Transform3d transform3d() { return m_transform3d; }
+- //Eigen::Transform3d& transform3d_ref() { return m_transform3d; }
+- const Eigen::Transform3d& const_transform3d_ref() { return m_transform3d; }
+- Eigen::Transform3d* transform3d_ptr() { return &m_transform3d; }
+- const Eigen::Transform3d* const_transform3d_ptr() { return &m_transform3d; }
+-
+- //void set_transform3d(Eigen::Transform3d vec) { m_transform3d = vec; }
+- //void set_transform3d_ref(Eigen::Transform3d& vec) { m_transform3d = vec; }
+- void set_const_transform3d_ref(const Eigen::Transform3d& vec) { m_transform3d = vec; }
+- void set_transform3d_ptr(Eigen::Transform3d* vec) { m_transform3d = *vec; }
+- void set_const_transform3d_ptr(const Eigen::Transform3d* const vec) { m_transform3d = *vec; }
++ //Eigen::Projective3d transform3d() { return m_transform3d; }
++ //Eigen::Projective3d& transform3d_ref() { return m_transform3d; }
++ const Eigen::Projective3d& const_transform3d_ref() { return m_transform3d; }
++ Eigen::Projective3d* transform3d_ptr() { return &m_transform3d; }
++ const Eigen::Projective3d* const_transform3d_ptr() { return &m_transform3d; }
++
++ //void set_transform3d(Eigen::Projective3d vec) { m_transform3d = vec; }
++ //void set_transform3d_ref(Eigen::Projective3d& vec) { m_transform3d = vec; }
++ void set_const_transform3d_ref(const Eigen::Projective3d& vec) { m_transform3d = vec; }
++ void set_transform3d_ptr(Eigen::Projective3d* vec) { m_transform3d = *vec; }
++ void set_const_transform3d_ptr(const Eigen::Projective3d* const vec) { m_transform3d = *vec; }
+
+ private:
+ Eigen::Vector3d m_vector3d;
+- Eigen::Transform3d m_transform3d;
++ Eigen::Projective3d m_transform3d;
+
+ };
+ #endif
+@@ -529,7 +529,7 @@ void export_Eigen()
+ Vector3x_to_python_array<Eigen::Vector3i>();
+ Vector3x_from_python_array<Eigen::Vector3i>();
+
+- // Eigen::Transform3d
++ // Eigen::Projective3d
+ Transform3d_to_python_array();
+ Transform3d_from_python_array();
+
diff -Nru avogadro-1.2.0/debian/patches/eigen3.patch avogadro-1.2.0/debian/patches/eigen3.patch
--- avogadro-1.2.0/debian/patches/eigen3.patch 2016-10-02 10:03:38.000000000 +0200
+++ avogadro-1.2.0/debian/patches/eigen3.patch 2016-10-02 10:13:37.000000000 +0200
@@ -1,53 +1,38 @@
-From 4ee869dddc6d8e45aa85595117a0e5732cb17818 Mon Sep 17 00:00:00 2001
-From: Geoff Hutchison <geoff.hutchison at gmail.com>
-Date: Fri, 8 Jan 2016 23:19:33 -0500
-Subject: [PATCH] Adapt Eigen3 compatibility patch from Anton Gladky
- <gladk at debian.org>
+From 43af3c117b0b3220b15c2fe2895b94bbd83d3a60 Mon Sep 17 00:00:00 2001
+From: Claudio Fernandes <claudiosf.claudio at gmail.com>
+Date: Sun, 15 Jan 2017 21:23:39 -0200
+Subject: [PATCH] Adapt Avogadro to Eigen 3.3
-Patch was developed for v1.1.x, requiring some modifications.
-Currently does not apply to QTAIM - needs further const work.
-
-Change-Id: I98943d4bc67c2325e73285718c4ab7b45559673e
---
- CMakeLists.txt | 10 +---
- avogadro/src/CMakeLists.txt | 11 +---
- avogadro/src/mainwindow.cpp | 5 +-
- avogadro/src/mainwindow.h | 1 -
- libavogadro/src/CMakeLists.txt | 11 +---
- libavogadro/src/camera.cpp | 10 ++--
- libavogadro/src/camera.h | 8 +--
- libavogadro/src/engines/wireengine.cpp | 4 +-
- libavogadro/src/extensions/CMakeLists.txt | 4 +-
- .../crystallography/crystallographyextension.cpp | 3 +-
+ CMakeLists.txt | 9 +------
+ avogadro/src/mainwindow.cpp | 5 ++--
+ libavogadro/src/camera.cpp | 10 ++++----
+ libavogadro/src/camera.h | 14 +++++------
+ libavogadro/src/engines/wireengine.cpp | 4 ++--
+ .../crystallography/crystallographyextension.cpp | 2 +-
.../crystallography/ui/ceviewoptionswidget.cpp | 2 +-
- .../src/extensions/orca/orcaanalysedialog.cpp | 2 -
- .../src/extensions/orca/orcainputdialog.cpp | 3 +-
+ .../src/extensions/orca/orcaanalysedialog.cpp | 1 -
+ .../src/extensions/orca/orcainputdialog.cpp | 1 -
.../src/extensions/qtaim/qtaimmathutilities.cpp | 1 +
- .../src/extensions/qtaim/qtaimwavefunction.h | 6 +--
- .../extensions/surfaces/openqube/CMakeLists.txt | 12 ++---
+ .../qtaim/qtaimwavefunctionevaluator.cpp | 28 +++++++++++-----------
.../extensions/surfaces/openqube/gamessukout.cpp | 1 +
- .../extensions/surfaces/openqube/gaussianset.cpp | 1 +
- .../src/extensions/surfaces/openqube/slaterset.cpp | 6 ++-
- libavogadro/src/glpainter_p.cpp | 14 +++---
- libavogadro/src/glwidget.cpp | 4 +-
- libavogadro/src/molecule.cpp | 26 +++++++++-
+ .../src/extensions/surfaces/openqube/slaterset.cpp | 6 +++--
+ libavogadro/src/glpainter_p.cpp | 14 +++++------
+ libavogadro/src/glwidget.cpp | 4 ++--
+ libavogadro/src/molecule.cpp | 26 ++++++++++++++++++--
libavogadro/src/navigate.cpp | 2 +-
- libavogadro/src/primitive.h | 1 +
- libavogadro/src/python/camera.cpp | 2 +-
- libavogadro/src/python/eigen.cpp | 58 +++++++++++-----------
- libavogadro/src/tools/bondcentrictool.cpp | 28 +++++------
- libavogadro/src/tools/manipulatetool.cpp | 18 +++----
- libavogadro/src/tools/navigatetool.cpp | 2 +-
- libavogadro/src/tools/skeletontree.cpp | 11 ++--
+ libavogadro/src/tools/bondcentrictool.cpp | 28 +++++++++++-----------
+ libavogadro/src/tools/manipulatetool.cpp | 17 +++++++------
+ libavogadro/src/tools/navigatetool.cpp | 3 ++-
+ libavogadro/src/tools/skeletontree.cpp | 7 +++---
libavogadro/src/tools/skeletontree.h | 2 +-
- libavogadro/tests/CMakeLists.txt | 2 +-
- 32 files changed, 132 insertions(+), 139 deletions(-)
+ 22 files changed, 102 insertions(+), 85 deletions(-)
-Index: avogadro-1.2.0/CMakeLists.txt
-===================================================================
---- avogadro-1.2.0.orig/CMakeLists.txt
-+++ avogadro-1.2.0/CMakeLists.txt
-@@ -231,15 +231,7 @@ if(NOT Linguist_FOUND)
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 8d2958739..2cabf8d52 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -231,14 +231,7 @@ if(NOT Linguist_FOUND)
message(WARNING " Qt4 Linguist not found, please install it if you want Avogadro translations")
endif()
@@ -59,40 +44,14 @@
-# Use Stage10 Eigen3 support
- set (EIGEN2_SUPPORT_STAGE10_FULL_EIGEN2_API TRUE)
-endif()
--
+find_package(Eigen3 REQUIRED) # find and setup Eigen3 if available
+
find_package(ZLIB REQUIRED)
find_package(OpenBabel2 REQUIRED) # find and setup OpenBabel
-
-Index: avogadro-1.2.0/avogadro/src/CMakeLists.txt
-===================================================================
---- avogadro-1.2.0.orig/avogadro/src/CMakeLists.txt
-+++ avogadro-1.2.0/avogadro/src/CMakeLists.txt
-@@ -19,19 +19,10 @@ set_directory_properties(PROPERTIES INCL
- include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${OPENBABEL2_INCLUDE_DIR}
-+ ${EIGEN3_INCLUDE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}
- )
-
--if(EIGEN3_FOUND)
-- include_directories(
-- ${EIGEN3_INCLUDE_DIR}
-- )
--elseif(EIGEN2_FOUND)
-- include_directories(
-- ${EIGEN2_INCLUDE_DIR}
-- )
--endif(EIGEN3_FOUND)
--
- if(GLEW_FOUND)
- include_directories(${GLEW_INCLUDE_DIR})
- endif()
-Index: avogadro-1.2.0/avogadro/src/mainwindow.cpp
-===================================================================
---- avogadro-1.2.0.orig/avogadro/src/mainwindow.cpp
-+++ avogadro-1.2.0/avogadro/src/mainwindow.cpp
+diff --git a/avogadro/src/mainwindow.cpp b/avogadro/src/mainwindow.cpp
+index 2a5fd0ff5..f34a563a9 100644
+--- a/avogadro/src/mainwindow.cpp
++++ b/avogadro/src/mainwindow.cpp
@@ -115,7 +115,6 @@
#include <QDebug>
@@ -101,7 +60,7 @@
#define USEQUAT
// This is a "hidden" exported Qt function on the Mac for Qt-4.x.
#ifdef Q_WS_MAC
-@@ -2775,7 +2774,7 @@ protected:
+@@ -2775,7 +2774,7 @@ class XMLEventSource : public pqEventSource
linearGoal.row(1) = linearGoal.row(2).cross(linearGoal.row(0));
// calculate the translation matrix
@@ -110,7 +69,7 @@
goal.pretranslate(- 3.0 * (d->glWidget->radius() + CAMERA_NEAR_DISTANCE) * Vector3d::UnitZ());
-@@ -2840,7 +2839,7 @@ protected:
+@@ -2840,7 +2839,7 @@ class XMLEventSource : public pqEventSource
Matrix3d linearGoal = Matrix3d::Identity();
// calculate the translation matrix
@@ -119,46 +78,10 @@
goal.pretranslate(- 3.0 * (d->glWidget->radius() + CAMERA_NEAR_DISTANCE) * Vector3d::UnitZ());
-Index: avogadro-1.2.0/avogadro/src/mainwindow.h
-===================================================================
---- avogadro-1.2.0.orig/avogadro/src/mainwindow.h
-+++ avogadro-1.2.0/avogadro/src/mainwindow.h
-@@ -26,7 +26,6 @@
-
- #include "config.h"
-
--#include <Eigen/Geometry>
- #include "ui_mainwindow.h"
- #include "flattabwidget.h"
-
-Index: avogadro-1.2.0/libavogadro/src/CMakeLists.txt
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/CMakeLists.txt
-+++ avogadro-1.2.0/libavogadro/src/CMakeLists.txt
-@@ -12,18 +12,9 @@ set_directory_properties(PROPERTIES INCL
- include_directories(
- ${CMAKE_CURRENT_BINARY_DIR}
- ${OPENBABEL2_INCLUDE_DIR}
-+ ${EIGEN3_INCLUDE_DIR}
- )
-
--if(EIGEN3_FOUND)
-- include_directories(
-- ${EIGEN3_INCLUDE_DIR}
-- )
--elseif(EIGEN2_FOUND)
-- include_directories(
-- ${EIGEN2_INCLUDE_DIR}
-- )
--endif(EIGEN3_FOUND)
--
- # I think this is necessary now in order to tell the linker where openbabel is
- link_directories(${OPENBABEL2_LIBRARY_DIRS})
-
-Index: avogadro-1.2.0/libavogadro/src/camera.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/camera.cpp
-+++ avogadro-1.2.0/libavogadro/src/camera.cpp
+diff --git a/libavogadro/src/camera.cpp b/libavogadro/src/camera.cpp
+index 24128455b..fe9a07bd4 100644
+--- a/libavogadro/src/camera.cpp
++++ b/libavogadro/src/camera.cpp
@@ -47,7 +47,7 @@ namespace Avogadro
CameraPrivate() {};
@@ -173,7 +96,7 @@
double Camera::distance(const Eigen::Vector3d & point) const
{
- return ( d->modelview * point ).norm();
-+ return ( (d->modelview).linear() * point ).norm();
++ return ( d->modelview * point.homogeneous() ).head<3>().norm();
}
- void Camera::setModelview(const Eigen::Transform3d &matrix)
@@ -193,25 +116,29 @@
{
return d->modelview;
}
-Index: avogadro-1.2.0/libavogadro/src/camera.h
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/camera.h
-+++ avogadro-1.2.0/libavogadro/src/camera.h
-@@ -102,15 +102,15 @@ namespace Avogadro {
+diff --git a/libavogadro/src/camera.h b/libavogadro/src/camera.h
+index 89b4496ab..6b9abe00e 100644
+--- a/libavogadro/src/camera.h
++++ b/libavogadro/src/camera.h
+@@ -101,16 +101,16 @@ namespace Avogadro {
+ double angleOfViewY() const;
/** Sets 4x4 "modelview" matrix representing the camera orientation and position.
* @param matrix the matrix to copy from
- * @sa Eigen::Transform3d & modelview(), applyModelview() */
+- * @sa Eigen::Transform3d & modelview(), applyModelview() */
- void setModelview(const Eigen::Transform3d &matrix);
++ * @sa Eigen::Projective3d & modelview(), applyModelview() */
+ void setModelview(const Eigen::Projective3d &matrix);
/** @return a constant reference to the 4x4 "modelview" matrix representing
* the camera orientation and position
- * @sa setModelview(), Eigen::Transform3d & modelview() */
+- * @sa setModelview(), Eigen::Transform3d & modelview() */
- const Eigen::Transform3d & modelview() const;
++ * @sa setModelview(), Eigen::Projective3d & modelview() */
+ const Eigen::Projective3d & modelview() const;
/** @return a non-constant reference to the 4x4 "modelview" matrix representing
* the camera orientation and position
- * @sa setModelview(), const Eigen::Transform3d & modelview() const */
+- * @sa setModelview(), const Eigen::Transform3d & modelview() const */
- Eigen::Transform3d & modelview();
++ * @sa setModelview(), const Eigen::Projective3d & modelview() const */
+ Eigen::Projective3d & modelview();
/** Calls gluPerspective() or glOrtho() with parameters automatically chosen
* for rendering the GLWidget's molecule with this camera. Should be called
@@ -225,16 +152,16 @@
}
};
-Index: avogadro-1.2.0/libavogadro/src/engines/wireengine.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/engines/wireengine.cpp
-+++ avogadro-1.2.0/libavogadro/src/engines/wireengine.cpp
+diff --git a/libavogadro/src/engines/wireengine.cpp b/libavogadro/src/engines/wireengine.cpp
+index c823d4ed7..1f39701d8 100644
+--- a/libavogadro/src/engines/wireengine.cpp
++++ b/libavogadro/src/engines/wireengine.cpp
@@ -109,7 +109,7 @@ namespace Avogadro {
const Camera *camera = pd->camera();
// perform a rough form of frustum culling
- Eigen::Vector3d transformedPos = pd->camera()->modelview() * v;
-+ Eigen::Vector3d transformedPos = (pd->camera()->modelview()).linear() * v;
++ Eigen::Vector3d transformedPos = (pd->camera()->modelview() * v.homogeneous()).head<3>();
double dot = transformedPos.z() / transformedPos.norm();
if(dot > -0.8)
return true;
@@ -243,28 +170,27 @@
// perform a rough form of frustum culling
- Eigen::Vector3d transformedEnd1 = pd->camera()->modelview() * v1;
-+ Eigen::Vector3d transformedEnd1 = (pd->camera()->modelview()).linear() * v1;
++ Eigen::Vector3d transformedEnd1 = (pd->camera()->modelview() * v1.homogeneous()).head<3>();
double dot = transformedEnd1.z() / transformedEnd1.norm();
if(dot > -0.8)
return true; // i.e., don't bother rendering
-Index: avogadro-1.2.0/libavogadro/src/extensions/crystallography/crystallographyextension.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/extensions/crystallography/crystallographyextension.cpp
-+++ avogadro-1.2.0/libavogadro/src/extensions/crystallography/crystallographyextension.cpp
-@@ -1989,7 +1989,8 @@ namespace Avogadro
+diff --git a/libavogadro/src/extensions/crystallography/crystallographyextension.cpp b/libavogadro/src/extensions/crystallography/crystallographyextension.cpp
+index fb871f976..1fef13417 100644
+--- a/libavogadro/src/extensions/crystallography/crystallographyextension.cpp
++++ b/libavogadro/src/extensions/crystallography/crystallographyextension.cpp
+@@ -1989,7 +1989,7 @@ namespace Avogadro
// fix coordinates
// Apply COB matrix:
Eigen::Matrix3d invCob;
- cob.computeInverse(&invCob);
-+ bool tInvert;
-+ cob.computeInverseWithCheck(invCob,tInvert);
++ invCob = cob.inverse();
for (QList<Eigen::Vector3d>::iterator
it = fcoords.begin(),
it_end = fcoords.end();
-Index: avogadro-1.2.0/libavogadro/src/extensions/crystallography/ui/ceviewoptionswidget.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/extensions/crystallography/ui/ceviewoptionswidget.cpp
-+++ avogadro-1.2.0/libavogadro/src/extensions/crystallography/ui/ceviewoptionswidget.cpp
+diff --git a/libavogadro/src/extensions/crystallography/ui/ceviewoptionswidget.cpp b/libavogadro/src/extensions/crystallography/ui/ceviewoptionswidget.cpp
+index 3f3cf4436..fe56919fc 100644
+--- a/libavogadro/src/extensions/crystallography/ui/ceviewoptionswidget.cpp
++++ b/libavogadro/src/extensions/crystallography/ui/ceviewoptionswidget.cpp
@@ -139,7 +139,7 @@ namespace Avogadro
{
// View into a Miller plane
@@ -274,10 +200,10 @@
modelView.setIdentity();
// OK, so we want to rotate to look along the normal at the plane
-Index: avogadro-1.2.0/libavogadro/src/extensions/orca/orcaanalysedialog.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/extensions/orca/orcaanalysedialog.cpp
-+++ avogadro-1.2.0/libavogadro/src/extensions/orca/orcaanalysedialog.cpp
+diff --git a/libavogadro/src/extensions/orca/orcaanalysedialog.cpp b/libavogadro/src/extensions/orca/orcaanalysedialog.cpp
+index 8a0657872..ceee90805 100644
+--- a/libavogadro/src/extensions/orca/orcaanalysedialog.cpp
++++ b/libavogadro/src/extensions/orca/orcaanalysedialog.cpp
@@ -41,7 +41,6 @@
#include <openbabel/mol.h>
@@ -286,15 +212,10 @@
#include <vector>
-@@ -1272,4 +1271,3 @@ void OrcaAnalyseDialog::writeSettings(QS
- // missing vtables with gcc, check that you haven't forgotten one of
- // these:
- //#include "orcaanalysedialog.moc"
--
-Index: avogadro-1.2.0/libavogadro/src/extensions/orca/orcainputdialog.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/extensions/orca/orcainputdialog.cpp
-+++ avogadro-1.2.0/libavogadro/src/extensions/orca/orcainputdialog.cpp
+diff --git a/libavogadro/src/extensions/orca/orcainputdialog.cpp b/libavogadro/src/extensions/orca/orcainputdialog.cpp
+index 9ed1bde24..3f8c8bb03 100644
+--- a/libavogadro/src/extensions/orca/orcainputdialog.cpp
++++ b/libavogadro/src/extensions/orca/orcainputdialog.cpp
@@ -33,7 +33,6 @@
#include <openbabel/mol.h>
@@ -303,19 +224,10 @@
#include <vector>
-@@ -123,7 +122,7 @@ OrcaInputDialog::OrcaInputDialog(QWidget
- OrcaInputDialog::~OrcaInputDialog()
- {
- QSettings settings;
-- writeSettings(settings);
-+ writeSettings(settings);
- delete basicData;
- delete basisData;
- delete controlData;
-Index: avogadro-1.2.0/libavogadro/src/extensions/qtaim/qtaimmathutilities.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/extensions/qtaim/qtaimmathutilities.cpp
-+++ avogadro-1.2.0/libavogadro/src/extensions/qtaim/qtaimmathutilities.cpp
+diff --git a/libavogadro/src/extensions/qtaim/qtaimmathutilities.cpp b/libavogadro/src/extensions/qtaim/qtaimmathutilities.cpp
+index 93e7270d1..743462c02 100644
+--- a/libavogadro/src/extensions/qtaim/qtaimmathutilities.cpp
++++ b/libavogadro/src/extensions/qtaim/qtaimmathutilities.cpp
@@ -28,6 +28,7 @@
#include <cmath>
@@ -324,71 +236,62 @@
namespace Avogadro {
namespace QTAIMMathUtilities {
-Index: avogadro-1.2.0/libavogadro/src/extensions/qtaim/qtaimwavefunction.h
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/extensions/qtaim/qtaimwavefunction.h
-+++ avogadro-1.2.0/libavogadro/src/extensions/qtaim/qtaimwavefunction.h
-@@ -115,9 +115,9 @@ namespace Avogadro
- qint64 numberOfGaussianPrimitives() const { return m_numberOfGaussianPrimitives; }
- qint64 numberOfNuclei() const { return m_numberOfNuclei; }
-
-- const qreal* xNuclearCoordinates() const { return m_xNuclearCoordinates.constData(); }
-- const qreal* yNuclearCoordinates() const { return m_yNuclearCoordinates.constData(); }
-- const qreal* zNuclearCoordinates() const { return m_zNuclearCoordinates.constData(); }
-+ qreal* xNuclearCoordinates() { return m_xNuclearCoordinates.data(); }
-+ qreal* yNuclearCoordinates() { return m_yNuclearCoordinates.data(); }
-+ qreal* zNuclearCoordinates() { return m_zNuclearCoordinates.data(); }
- qreal xNuclearCoordinate( qint64 i ) const { return m_xNuclearCoordinates.at(i); }
- qreal yNuclearCoordinate( qint64 i ) const { return m_yNuclearCoordinates.at(i); }
- qreal zNuclearCoordinate( qint64 i ) const { return m_zNuclearCoordinates.at(i); }
-Index: avogadro-1.2.0/libavogadro/src/extensions/surfaces/openqube/CMakeLists.txt
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/extensions/surfaces/openqube/CMakeLists.txt
-+++ avogadro-1.2.0/libavogadro/src/extensions/surfaces/openqube/CMakeLists.txt
-@@ -1,13 +1,7 @@
- find_package(Qt4 4.6 REQUIRED)
--find_package(Eigen3)
--if(NOT EIGEN3_FOUND)
-- message(STATUS "Cannot find Eigen3, trying Eigen2")
-- find_package(Eigen2 REQUIRED)
--else()
-- set (EIGEN2_SUPPORT_STAGE10_FULL_EIGEN2_API TRUE)
--endif()
-+find_package(Eigen3 REQUIRED)
-
--include_directories(${QT_INCLUDE_DIR} ${EIGEN2_INCLUDE_DIR})
-+include_directories(${QT_INCLUDE_DIR} ${EIGEN3_INCLUDE_DIR})
-
- # Headers for our public API
- set(openqube_HDRS
-Index: avogadro-1.2.0/libavogadro/src/extensions/surfaces/openqube/gamessukout.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/extensions/surfaces/openqube/gamessukout.cpp
-+++ avogadro-1.2.0/libavogadro/src/extensions/surfaces/openqube/gamessukout.cpp
-@@ -15,6 +15,7 @@
- ******************************************************************************/
-
- #include "gamessukout.h"
-+#include <iostream>
-
+diff --git a/libavogadro/src/extensions/qtaim/qtaimwavefunctionevaluator.cpp b/libavogadro/src/extensions/qtaim/qtaimwavefunctionevaluator.cpp
+index d60a4d5d4..711468400 100644
+--- a/libavogadro/src/extensions/qtaim/qtaimwavefunctionevaluator.cpp
++++ b/libavogadro/src/extensions/qtaim/qtaimwavefunctionevaluator.cpp
+@@ -35,21 +35,21 @@ namespace Avogadro
+ m_nprim=wfn.numberOfGaussianPrimitives();
+ m_nnuc=wfn.numberOfNuclei();
+
+- m_nucxcoord=Map<Matrix<qreal,Dynamic,1> >(wfn.xNuclearCoordinates(),m_nnuc);
+- m_nucycoord=Map<Matrix<qreal,Dynamic,1> >(wfn.yNuclearCoordinates(),m_nnuc);
+- m_nuczcoord=Map<Matrix<qreal,Dynamic,1> >(wfn.zNuclearCoordinates(),m_nnuc);
+- m_nucz=Map<Matrix<qint64,Dynamic,1> >(wfn.nuclearCharges(),m_nnuc);
+- m_X0=Map<Matrix<qreal,Dynamic,1> >(wfn.xGaussianPrimitiveCenterCoordinates(),m_nprim,1);
+- m_Y0=Map<Matrix<qreal,Dynamic,1> >(wfn.yGaussianPrimitiveCenterCoordinates(),m_nprim,1);
+- m_Z0=Map<Matrix<qreal,Dynamic,1> >(wfn.zGaussianPrimitiveCenterCoordinates(),m_nprim,1);
+- m_xamom=Map<Matrix<qint64,Dynamic,1> >(wfn.xGaussianPrimitiveAngularMomenta(),m_nprim,1);
+- m_yamom=Map<Matrix<qint64,Dynamic,1> >(wfn.yGaussianPrimitiveAngularMomenta(),m_nprim,1);
+- m_zamom=Map<Matrix<qint64,Dynamic,1> >(wfn.zGaussianPrimitiveAngularMomenta(),m_nprim,1);
+- m_alpha=Map<Matrix<qreal,Dynamic,1> >(wfn.gaussianPrimitiveExponentCoefficients(),m_nprim,1);
++ m_nucxcoord=Map<Matrix<qreal,Dynamic,1> >(const_cast<qreal*>(wfn.xNuclearCoordinates()),m_nnuc);
++ m_nucycoord=Map<Matrix<qreal,Dynamic,1> >(const_cast<qreal*>(wfn.yNuclearCoordinates()),m_nnuc);
++ m_nuczcoord=Map<Matrix<qreal,Dynamic,1> >(const_cast<qreal*>(wfn.zNuclearCoordinates()),m_nnuc);
++ m_nucz=Map<Matrix<qint64,Dynamic,1> >(const_cast<qint64*>(wfn.nuclearCharges()),m_nnuc);
++ m_X0=Map<Matrix<qreal,Dynamic,1> >(const_cast<qreal*>(wfn.xGaussianPrimitiveCenterCoordinates()),m_nprim,1);
++ m_Y0=Map<Matrix<qreal,Dynamic,1> >(const_cast<qreal*>(wfn.yGaussianPrimitiveCenterCoordinates()),m_nprim,1);
++ m_Z0=Map<Matrix<qreal,Dynamic,1> >(const_cast<qreal*>(wfn.zGaussianPrimitiveCenterCoordinates()),m_nprim,1);
++ m_xamom=Map<Matrix<qint64,Dynamic,1> >(const_cast<qint64*>(wfn.xGaussianPrimitiveAngularMomenta()),m_nprim,1);
++ m_yamom=Map<Matrix<qint64,Dynamic,1> >(const_cast<qint64*>(wfn.yGaussianPrimitiveAngularMomenta()),m_nprim,1);
++ m_zamom=Map<Matrix<qint64,Dynamic,1> >(const_cast<qint64*>(wfn.zGaussianPrimitiveAngularMomenta()),m_nprim,1);
++ m_alpha=Map<Matrix<qreal,Dynamic,1> >(const_cast<qreal*>(wfn.gaussianPrimitiveExponentCoefficients()),m_nprim,1);
+ // TODO Implement screening for unoccupied molecular orbitals.
+- m_occno=Map<Matrix<qreal,Dynamic,1> >(wfn.molecularOrbitalOccupationNumbers(),m_nmo,1);
+- m_orbe=Map<Matrix<qreal,Dynamic,1> >(wfn.molecularOrbitalEigenvalues(),m_nmo,1);
+- m_coef=Map<Matrix<qreal,Dynamic,Dynamic,RowMajor> >(wfn.molecularOrbitalCoefficients(),m_nmo,m_nprim);
++ m_occno=Map<Matrix<qreal,Dynamic,1> >(const_cast<qreal*>(wfn.molecularOrbitalOccupationNumbers()),m_nmo,1);
++ m_orbe=Map<Matrix<qreal,Dynamic,1> >(const_cast<qreal*>(wfn.molecularOrbitalEigenvalues()),m_nmo,1);
++ m_coef=Map<Matrix<qreal,Dynamic,Dynamic,RowMajor> >(const_cast<qreal*>(wfn.molecularOrbitalCoefficients()),m_nmo,m_nprim);
+ m_totalEnergy=wfn.totalEnergy();
+ m_virialRatio=wfn.virialRatio();
+
+diff --git a/libavogadro/src/extensions/surfaces/openqube/gamessukout.cpp b/libavogadro/src/extensions/surfaces/openqube/gamessukout.cpp
+index 7316c2e1c..d88ffdfc5 100644
+--- a/libavogadro/src/extensions/surfaces/openqube/gamessukout.cpp
++++ b/libavogadro/src/extensions/surfaces/openqube/gamessukout.cpp
+@@ -19,6 +19,7 @@
using Eigen::Vector3d;
using std::vector;
-Index: avogadro-1.2.0/libavogadro/src/extensions/surfaces/openqube/gaussianset.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/extensions/surfaces/openqube/gaussianset.cpp
-+++ avogadro-1.2.0/libavogadro/src/extensions/surfaces/openqube/gaussianset.cpp
-@@ -17,6 +17,7 @@
- ******************************************************************************/
- #include "gaussianset.h"
+#include <iostream>
+ #include <fstream>
- #ifdef WIN32
- #define _USE_MATH_DEFINES
-Index: avogadro-1.2.0/libavogadro/src/extensions/surfaces/openqube/slaterset.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/extensions/surfaces/openqube/slaterset.cpp
-+++ avogadro-1.2.0/libavogadro/src/extensions/surfaces/openqube/slaterset.cpp
+ namespace OpenQube
+diff --git a/libavogadro/src/extensions/surfaces/openqube/slaterset.cpp b/libavogadro/src/extensions/surfaces/openqube/slaterset.cpp
+index b0502dd25..4a27733c9 100644
+--- a/libavogadro/src/extensions/surfaces/openqube/slaterset.cpp
++++ b/libavogadro/src/extensions/surfaces/openqube/slaterset.cpp
@@ -25,9 +25,9 @@
#include "cube.h"
@@ -405,31 +308,31 @@
SelfAdjointEigenSolver<MatrixXd> s(m_overlap);
MatrixXd p = s.eigenvectors();
- MatrixXd m = p * s.eigenvalues().cwise().inverse().cwise().sqrt().asDiagonal() * p.inverse();
-+ //MatrixXd m = p * s.eigenvalues().cwise().inverse().cwise().sqrt().asDiagonal() * p.inverse();
++ // TODO check if this is correct
+ MatrixXd m1 = (s.eigenvalues().array().inverse().sqrt());
+ MatrixXd m = p.array()*(m1.diagonal().array())*p.inverse().array();
m_normalized = m * m_eigenVectors;
if (!(m_overlap*m*m).isIdentity())
-Index: avogadro-1.2.0/libavogadro/src/glpainter_p.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/glpainter_p.cpp
-+++ avogadro-1.2.0/libavogadro/src/glpainter_p.cpp
+diff --git a/libavogadro/src/glpainter_p.cpp b/libavogadro/src/glpainter_p.cpp
+index b301d4f84..9c0b00ab7 100644
+--- a/libavogadro/src/glpainter_p.cpp
++++ b/libavogadro/src/glpainter_p.cpp
@@ -789,13 +789,13 @@ namespace Avogadro
} else {
points[theta-1] = Eigen::AngleAxisd(theta * (M_PI / 180.0) / 2, n) * u;
}
- points[theta-1] = d->widget->camera()->modelview() * (origin + points[theta-1]);
-+ points[theta-1] = (d->widget->camera()->modelview()).linear() * (origin + points[theta-1]);
++ points[theta-1] = (d->widget->camera()->modelview() * (origin + points[theta-1]).homogeneous()).head<3>();
}
// Get vectors representing the points' positions in terms of the model view.
- Eigen::Vector3d _origin = d->widget->camera()->modelview() * origin;
- Eigen::Vector3d _direction1 = d->widget->camera()->modelview() * (origin+u);
- Eigen::Vector3d _direction2 = d->widget->camera()->modelview() * (origin+v);
-+ Eigen::Vector3d _origin = (d->widget->camera()->modelview()).linear() * origin;
-+ Eigen::Vector3d _direction1 = (d->widget->camera()->modelview()).linear() * (origin+u);
-+ Eigen::Vector3d _direction2 = (d->widget->camera()->modelview()).linear() * (origin+v);
++ Eigen::Vector3d _origin = (d->widget->camera()->modelview() * origin.homogeneous()).head<3>();
++ Eigen::Vector3d _direction1 = (d->widget->camera()->modelview() * (origin+u).homogeneous()).head<3>();
++ Eigen::Vector3d _direction2 = (d->widget->camera()->modelview() * (origin+v).homogeneous()).head<3>();
glPushAttrib(GL_ALL_ATTRIB_BITS);
glPushMatrix();
@@ -438,27 +341,27 @@
points[theta-1] = Eigen::AngleAxisd(theta * (M_PI / 180.0) / 2, n) * u;
}
- points[theta-1] = d->widget->camera()->modelview() * (origin + points[theta-1]);
-+ points[theta-1] = (d->widget->camera()->modelview()).linear() * (origin + points[theta-1]);
++ points[theta-1] = (d->widget->camera()->modelview() * (origin + points[theta-1]).homogeneous()).head<3>();
}
// Get vectors representing the points' positions in terms of the model view.
- Eigen::Vector3d _direction1 = d->widget->camera()->modelview() * (origin + u);
- Eigen::Vector3d _direction2 = d->widget->camera()->modelview() * (origin + v);
-+ Eigen::Vector3d _direction1 = (d->widget->camera()->modelview()).linear() * (origin + u);
-+ Eigen::Vector3d _direction2 = (d->widget->camera()->modelview()).linear() * (origin + v);
++ Eigen::Vector3d _direction1 = (d->widget->camera()->modelview() * (origin + u).homogeneous()).head<3>();
++ Eigen::Vector3d _direction2 = (d->widget->camera()->modelview() * (origin + v).homogeneous()).head<3>();
glPushAttrib(GL_ALL_ATTRIB_BITS);
glPushMatrix();
-Index: avogadro-1.2.0/libavogadro/src/glwidget.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/glwidget.cpp
-+++ avogadro-1.2.0/libavogadro/src/glwidget.cpp
+diff --git a/libavogadro/src/glwidget.cpp b/libavogadro/src/glwidget.cpp
+index 7a0a029d6..3cbe31f8b 100644
+--- a/libavogadro/src/glwidget.cpp
++++ b/libavogadro/src/glwidget.cpp
@@ -765,7 +765,7 @@ namespace Avogadro {
GLfloat fogColor[4]= {static_cast<GLfloat>(d->background.redF()), static_cast<GLfloat>(d->background.greenF()),
static_cast<GLfloat>(d->background.blueF()), static_cast<GLfloat>(d->background.alphaF())};
glFogfv(GL_FOG_COLOR, fogColor);
- Vector3d distance = camera()->modelview() * d->center;
-+ Vector3d distance = (camera()->modelview()).linear() * d->center;
++ Vector3d distance = (camera()->modelview() * d->center.homogeneous()).head<3>();
double distanceToCenter = distance.norm();
glFogf(GL_FOG_DENSITY, 1.0);
glHint(GL_FOG_HINT, GL_NICEST);
@@ -471,28 +374,27 @@
y += d->pd->painter()->drawText
(x, y, tr("ModelView row 1: %L1 %L2 %L3 %L4")
.arg(modelview(0, 0), 6, 'f', 2, ' ')
-Index: avogadro-1.2.0/libavogadro/src/molecule.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/molecule.cpp
-+++ avogadro-1.2.0/libavogadro/src/molecule.cpp
+diff --git a/libavogadro/src/molecule.cpp b/libavogadro/src/molecule.cpp
+index c544185e2..0bad6f9e6 100644
+--- a/libavogadro/src/molecule.cpp
++++ b/libavogadro/src/molecule.cpp
@@ -38,7 +38,7 @@
#include "zmatrix.h"
#include <Eigen/Geometry>
-#include <Eigen/LeastSquares>
-+#include <Eigen/Eigenvalues>
++#include <Eigen/Eigenvalues>
#include <vector>
-@@ -1907,7 +1907,29 @@ namespace Avogadro{
+@@ -1908,7 +1908,29 @@ namespace Avogadro{
}
d->center /= static_cast<double>(nAtoms);
Eigen::Hyperplane<double, 3> planeCoeffs;
- Eigen::fitHyperplane(numAtoms(), atomPositions, &planeCoeffs);
-+
-+
+ //Eigen::fitHyperplane(numAtoms(), atomPositions, &planeCoeffs);
-+
++
++ // TODO check if this is OK
+ /************************/
+ typedef Eigen::Matrix<double,3,3> CovMatrixType;
+ typedef Eigen::Vector3d VectorType;
@@ -511,194 +413,36 @@
+ Eigen::SelfAdjointEigenSolver<CovMatrixType> eig(covMat);
+ planeCoeffs.normal() = eig.eigenvectors().col(0);
+ /************************/
-+
++
++
delete[] atomPositions;
d->normalVector = planeCoeffs.normal();
}
-Index: avogadro-1.2.0/libavogadro/src/navigate.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/navigate.cpp
-+++ avogadro-1.2.0/libavogadro/src/navigate.cpp
+diff --git a/libavogadro/src/navigate.cpp b/libavogadro/src/navigate.cpp
+index f31d4cddb..ccb17081d 100644
+--- a/libavogadro/src/navigate.cpp
++++ b/libavogadro/src/navigate.cpp
@@ -40,7 +40,7 @@ namespace Avogadro {
void Navigate::zoom(GLWidget *widget, const Eigen::Vector3d &goal,
double delta)
{
- Vector3d transformedGoal = widget->camera()->modelview() * goal;
-+ Vector3d transformedGoal = (widget->camera()->modelview()).linear() * goal;
++ Vector3d transformedGoal = (widget->camera()->modelview() * goal.homogeneous()).head<3>();
double distanceToGoal = transformedGoal.norm();
double t = ZOOM_SPEED * delta;
-Index: avogadro-1.2.0/libavogadro/src/primitive.h
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/primitive.h
-+++ avogadro-1.2.0/libavogadro/src/primitive.h
-@@ -29,6 +29,7 @@
- #include "config.h"
-
- #include "global.h"
-+#include "Eigen/Core"
-
- #include <QObject>
- #include <QMetaType>
-Index: avogadro-1.2.0/libavogadro/src/python/camera.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/python/camera.cpp
-+++ avogadro-1.2.0/libavogadro/src/python/camera.cpp
-@@ -10,7 +10,7 @@ using namespace Avogadro;
- void export_Camera()
- {
-
-- const Eigen::Transform3d& (Camera::*modelview_ptr)() const = &Camera::modelview;
-+ const Eigen::Projective3d& (Camera::*modelview_ptr)() const = &Camera::modelview;
- Eigen::Vector3d (Camera::*unProject_ptr1)(const Eigen::Vector3d&) const = &Camera::unProject;
- Eigen::Vector3d (Camera::*unProject_ptr2)(const QPoint&, const Eigen::Vector3d&) const = &Camera::unProject;
- Eigen::Vector3d (Camera::*unProject_ptr3)(const QPoint&) const = &Camera::unProject;
-Index: avogadro-1.2.0/libavogadro/src/python/eigen.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/python/eigen.cpp
-+++ avogadro-1.2.0/libavogadro/src/python/eigen.cpp
-@@ -305,9 +305,9 @@ template <> struct ScalarTraits<double>
- struct innerclass
- {
- //
-- // Eigen::Transform3d --> python array (4x4)
-+ // Eigen::Projective3d --> python array (4x4)
- //
-- static PyObject* convert(Eigen::Transform3d const &trans)
-+ static PyObject* convert(Eigen::Projective3d const &trans)
- {
- npy_intp dims[2] = { 4, 4 };
- PyObject *result = PyArray_SimpleNew(2, dims, PyArray_DOUBLE);
-@@ -321,9 +321,9 @@ template <> struct ScalarTraits<double>
- return incref(result);
- }
- //
-- // Eigen::Transform3d* --> python array (4x4)
-+ // Eigen::Projective3d* --> python array (4x4)
- //
-- static PyObject* convert(Eigen::Transform3d *trans)
-+ static PyObject* convert(Eigen::Projective3d *trans)
- {
- npy_intp dims[2] = { 4, 4 };
- PyObject *result = PyArray_SimpleNew(2, dims, PyArray_DOUBLE);
-@@ -337,9 +337,9 @@ template <> struct ScalarTraits<double>
- return incref(result);
- }
- //
-- // const Eigen::Transform3d* --> python array (4x4)
-+ // const Eigen::Projective3d* --> python array (4x4)
- //
-- static PyObject* convert(const Eigen::Transform3d *trans)
-+ static PyObject* convert(const Eigen::Projective3d *trans)
- {
- npy_intp dims[2] = { 4, 4 };
- PyObject *result = PyArray_SimpleNew(2, dims, PyArray_DOUBLE);
-@@ -358,10 +358,10 @@ template <> struct ScalarTraits<double>
- Transform3d_to_python_array()
- {
- #ifndef WIN32
-- to_python_converter<Eigen::Transform3d, innerclass>();
-+ to_python_converter<Eigen::Projective3d, innerclass>();
- #endif
-- to_python_converter<Eigen::Transform3d*, innerclass>();
-- to_python_converter<const Eigen::Transform3d*, innerclass>();
-+ to_python_converter<Eigen::Projective3d*, innerclass>();
-+ to_python_converter<const Eigen::Projective3d*, innerclass>();
- }
-
- };
-@@ -377,13 +377,13 @@ template <> struct ScalarTraits<double>
- //
- // used for:
- //
-- // void function(Eigen::Transform3d vec)
-- // void function(Eigen::Transform3d & vec)
-- // void function(const Eigen::Transform3d & vec)
-+ // void function(Eigen::Projective3d vec)
-+ // void function(Eigen::Projective3d & vec)
-+ // void function(const Eigen::Projective3d & vec)
- //
-- converter::registry::push_back( &convertible, &construct, type_id<Eigen::Transform3d>() );
-+ converter::registry::push_back( &convertible, &construct, type_id<Eigen::Projective3d>() );
-
-- converter::registry::insert( &convert, type_id<Eigen::Transform3d>() );
-+ converter::registry::insert( &convert, type_id<Eigen::Projective3d>() );
- }
-
- static void* convert(PyObject *obj_ptr)
-@@ -401,7 +401,7 @@ template <> struct ScalarTraits<double>
- throw_error_already_set(); // the 1D array does not have exactly 3 elements
-
- double *values = reinterpret_cast<double*>(array->data);
-- Eigen::Transform3d *c_obj = new Eigen::Transform3d();
-+ Eigen::Projective3d *c_obj = new Eigen::Projective3d();
- double *dataPtr = c_obj->data();
-
- for (int i = 0; i < 16; ++i)
-@@ -432,7 +432,7 @@ template <> struct ScalarTraits<double>
- // I think this is a better way to get at the double array, where is this
- // deleted though? Does Boost::Python do it?
- double *values = reinterpret_cast<double*>(array->data);
-- Eigen::Transform3d *storage = new Eigen::Transform3d();
-+ Eigen::Projective3d *storage = new Eigen::Projective3d();
- double *dataPtr = storage->data();
-
- for (int i = 0; i < 16; ++i)
-@@ -467,21 +467,21 @@ class EigenUnitTestHelper
- void set_vector3d_ptr(Eigen::Vector3d* vec) { m_vector3d = *vec; }
- void set_const_vector3d_ptr(const Eigen::Vector3d* const vec) { m_vector3d = *vec; }
-
-- //Eigen::Transform3d transform3d() { return m_transform3d; }
-- //Eigen::Transform3d& transform3d_ref() { return m_transform3d; }
-- const Eigen::Transform3d& const_transform3d_ref() { return m_transform3d; }
-- Eigen::Transform3d* transform3d_ptr() { return &m_transform3d; }
-- const Eigen::Transform3d* const_transform3d_ptr() { return &m_transform3d; }
--
-- //void set_transform3d(Eigen::Transform3d vec) { m_transform3d = vec; }
-- //void set_transform3d_ref(Eigen::Transform3d& vec) { m_transform3d = vec; }
-- void set_const_transform3d_ref(const Eigen::Transform3d& vec) { m_transform3d = vec; }
-- void set_transform3d_ptr(Eigen::Transform3d* vec) { m_transform3d = *vec; }
-- void set_const_transform3d_ptr(const Eigen::Transform3d* const vec) { m_transform3d = *vec; }
-+ //Eigen::Projective3d transform3d() { return m_transform3d; }
-+ //Eigen::Projective3d& transform3d_ref() { return m_transform3d; }
-+ const Eigen::Projective3d& const_transform3d_ref() { return m_transform3d; }
-+ Eigen::Projective3d* transform3d_ptr() { return &m_transform3d; }
-+ const Eigen::Projective3d* const_transform3d_ptr() { return &m_transform3d; }
-+
-+ //void set_transform3d(Eigen::Projective3d vec) { m_transform3d = vec; }
-+ //void set_transform3d_ref(Eigen::Projective3d& vec) { m_transform3d = vec; }
-+ void set_const_transform3d_ref(const Eigen::Projective3d& vec) { m_transform3d = vec; }
-+ void set_transform3d_ptr(Eigen::Projective3d* vec) { m_transform3d = *vec; }
-+ void set_const_transform3d_ptr(const Eigen::Projective3d* const vec) { m_transform3d = *vec; }
-
- private:
- Eigen::Vector3d m_vector3d;
-- Eigen::Transform3d m_transform3d;
-+ Eigen::Projective3d m_transform3d;
-
- };
- #endif
-@@ -529,7 +529,7 @@ void export_Eigen()
- Vector3x_to_python_array<Eigen::Vector3i>();
- Vector3x_from_python_array<Eigen::Vector3i>();
-
-- // Eigen::Transform3d
-+ // Eigen::Projective3d
- Transform3d_to_python_array();
- Transform3d_from_python_array();
-
-Index: avogadro-1.2.0/libavogadro/src/tools/bondcentrictool.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/tools/bondcentrictool.cpp
-+++ avogadro-1.2.0/libavogadro/src/tools/bondcentrictool.cpp
+diff --git a/libavogadro/src/tools/bondcentrictool.cpp b/libavogadro/src/tools/bondcentrictool.cpp
+index b373e0df8..a11604f27 100644
+--- a/libavogadro/src/tools/bondcentrictool.cpp
++++ b/libavogadro/src/tools/bondcentrictool.cpp
@@ -578,8 +578,8 @@ namespace Avogadro {
Vector3d clicked = *m_clickedAtom->pos();
- Vector3d axis = Vector3d(0, 0, ((widget->camera()->modelview() * other).z() >=
- (widget->camera()->modelview() * center).z() ? -1 : 1));
-+ Vector3d axis = Vector3d(0, 0, (((widget->camera()->modelview()).linear() * other).z() >=
-+ ((widget->camera()->modelview()).linear() * center).z() ? -1 : 1));
++ Vector3d axis = Vector3d(0, 0, ((widget->camera()->modelview() * other.homogeneous()).z() >=
++ (widget->camera()->modelview() * center.homogeneous()).z() ? -1 : 1));
Vector3d centerProj = widget->camera()->project(center);
centerProj -= Vector3d(0,0,centerProj.z());
@@ -708,8 +452,8 @@
- Vector3d axis = Vector3d(0, 0, ((widget->camera()->modelview() * other).z() >=
- (widget->camera()->modelview() * center).z() ? -1 : 1));
-+ Vector3d axis = Vector3d(0, 0, ((widget->camera()->modelview().linear() * other).z() >=
-+ (widget->camera()->modelview().linear() * center).z() ? -1 : 1));
++ Vector3d axis = Vector3d(0, 0, ((widget->camera()->modelview() * other.homogeneous()).z() >=
++ (widget->camera()->modelview() * center.homogeneous()).z() ? -1 : 1));
Vector3d centerProj = widget->camera()->project(center);
centerProj -= Vector3d(0,0,centerProj.z());
@@ -721,10 +465,10 @@
- Vector3d topRight = widget->camera()->modelview() * (right + planeVec);
- Vector3d botRight = widget->camera()->modelview() * (right - planeVec);
- Vector3d botLeft = widget->camera()->modelview() * (left - planeVec);
-+ Vector3d topLeft = (widget->camera()->modelview()).linear() * (left + planeVec);
-+ Vector3d topRight = (widget->camera()->modelview()).linear() * (right + planeVec);
-+ Vector3d botRight = (widget->camera()->modelview()).linear() * (right - planeVec);
-+ Vector3d botLeft = (widget->camera()->modelview()).linear() * (left - planeVec);
++ Vector3d topLeft = (widget->camera()->modelview() * (left + planeVec).homogeneous()).head<3>();
++ Vector3d topRight = (widget->camera()->modelview() * (right + planeVec).homogeneous()).head<3>();
++ Vector3d botRight = (widget->camera()->modelview() * (right - planeVec).homogeneous()).head<3>();
++ Vector3d botLeft = (widget->camera()->modelview() * (left - planeVec).homogeneous()).head<3>();
float alpha = 0.4;
double lineWidth = 1.5;
@@ -736,10 +480,10 @@
- Vector3d topRight = widget->camera()->modelview() * C;
- Vector3d botRight = widget->camera()->modelview() * B;
- Vector3d botLeft = widget->camera()->modelview() * A;
-+ Vector3d topLeft = widget->camera()->modelview().linear() * D;
-+ Vector3d topRight = widget->camera()->modelview().linear() * C;
-+ Vector3d botRight = widget->camera()->modelview().linear() * B;
-+ Vector3d botLeft = widget->camera()->modelview().linear() * A;
++ Vector3d topLeft = (widget->camera()->modelview() * D.homogeneous()).head<3>();
++ Vector3d topRight = (widget->camera()->modelview() * C.homogeneous()).head<3>();
++ Vector3d botRight = (widget->camera()->modelview() * B.homogeneous()).head<3>();
++ Vector3d botLeft = (widget->camera()->modelview() * A.homogeneous()).head<3>();
float alpha = 0.4;
double lineWidth = 1.5;
@@ -754,24 +498,23 @@
rotation.translate(-centerVector);
- return rotation*positionVector;
-+ return rotation.linear()*positionVector;
++ return (rotation*positionVector.homogeneous()).head<3>();
}
// ########## showAnglesChanged ##########
-Index: avogadro-1.2.0/libavogadro/src/tools/manipulatetool.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/tools/manipulatetool.cpp
-+++ avogadro-1.2.0/libavogadro/src/tools/manipulatetool.cpp
-@@ -40,7 +40,7 @@
+diff --git a/libavogadro/src/tools/manipulatetool.cpp b/libavogadro/src/tools/manipulatetool.cpp
+index 05cc257af..b01a66817 100644
+--- a/libavogadro/src/tools/manipulatetool.cpp
++++ b/libavogadro/src/tools/manipulatetool.cpp
+@@ -40,7 +40,6 @@
#include <QAbstractButton>
using Eigen::Vector3d;
-using Eigen::Transform3d;
-+using Eigen::Projective3d;
using Eigen::AngleAxisd;
namespace Avogadro {
-@@ -138,7 +138,7 @@ namespace Avogadro {
+@@ -138,7 +137,7 @@ namespace Avogadro {
double yRotate = m_settingsWidget->yRotateSpinBox->value() * DEG_TO_RAD;
double zRotate = m_settingsWidget->zRotateSpinBox->value() * DEG_TO_RAD;
@@ -780,31 +523,31 @@
rotation.matrix().setIdentity();
rotation.translation() = center;
rotation.rotate(AngleAxisd(xRotate, Vector3d::UnitX())
-@@ -152,12 +152,12 @@ namespace Avogadro {
+@@ -152,12 +151,12 @@ namespace Avogadro {
if (p->type() == Primitive::AtomType) {
Atom *atom = static_cast<Atom*>(p);
tempPos = translate + *(atom->pos());
- atom->setPos(rotation * tempPos);
-+ atom->setPos(rotation.linear() * tempPos);
++ atom->setPos((rotation * tempPos.homogeneous()).head<3>());
}
} else {
foreach(Atom *atom, widget->molecule()->atoms()) {
tempPos = translate + *(atom->pos());
- atom->setPos(rotation * tempPos);
-+ atom->setPos(rotation.linear() * tempPos);
++ atom->setPos((rotation * tempPos.homogeneous()).head<3>());
}
}
-@@ -199,7 +199,7 @@ namespace Avogadro {
+@@ -199,7 +198,7 @@ namespace Avogadro {
widget->setCursor(Qt::SizeVerCursor);
// Move the selected atom(s) in to or out of the screen
- Vector3d transformedGoal = widget->camera()->modelview() * *goal;
-+ Vector3d transformedGoal = widget->camera()->modelview().linear() * *goal;
++ Vector3d transformedGoal = (widget->camera()->modelview() * goal->homogeneous()).head<3>();
double distanceToGoal = transformedGoal.norm();
double t = ZOOM_SPEED * delta;
-@@ -255,7 +255,7 @@ namespace Avogadro {
+@@ -255,7 +254,7 @@ namespace Avogadro {
// Rotate the selected atoms about the center
// rotate only selected primitives
@@ -813,16 +556,16 @@
fragmentRotation.matrix().setIdentity();
fragmentRotation.translation() = *center;
fragmentRotation.rotate(
-@@ -266,7 +266,7 @@ namespace Avogadro {
+@@ -266,7 +265,7 @@ namespace Avogadro {
foreach(Primitive *p, widget->selectedPrimitives())
if (p->type() == Primitive::AtomType)
- static_cast<Atom *>(p)->setPos(fragmentRotation * *static_cast<Atom *>(p)->pos());
-+ static_cast<Atom *>(p)->setPos(fragmentRotation.linear() * *static_cast<Atom *>(p)->pos());
++ static_cast<Atom *>(p)->setPos((fragmentRotation * static_cast<Atom *>(p)->pos()->homogeneous()).head<3>());
widget->molecule()->update();
}
-@@ -274,7 +274,7 @@ namespace Avogadro {
+@@ -274,7 +273,7 @@ namespace Avogadro {
double delta) const
{
// Tilt the selected atoms about the center
@@ -831,40 +574,41 @@
fragmentRotation.matrix().setIdentity();
fragmentRotation.translation() = *center;
fragmentRotation.rotate(AngleAxisd(delta * ROTATION_SPEED, widget->camera()->backTransformedZAxis()));
-@@ -282,7 +282,7 @@ namespace Avogadro {
+@@ -282,7 +281,7 @@ namespace Avogadro {
foreach(Primitive *p, widget->selectedPrimitives())
if (p->type() == Primitive::AtomType)
- static_cast<Atom *>(p)->setPos(fragmentRotation * *static_cast<Atom *>(p)->pos());
-+ static_cast<Atom *>(p)->setPos(fragmentRotation.linear() * *static_cast<Atom *>(p)->pos());
++ static_cast<Atom *>(p)->setPos((fragmentRotation * static_cast<Atom *>(p)->pos()->homogeneous()).head<3>());
widget->molecule()->update();
}
-Index: avogadro-1.2.0/libavogadro/src/tools/navigatetool.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/tools/navigatetool.cpp
-+++ avogadro-1.2.0/libavogadro/src/tools/navigatetool.cpp
-@@ -92,7 +92,7 @@ namespace Avogadro {
+diff --git a/libavogadro/src/tools/navigatetool.cpp b/libavogadro/src/tools/navigatetool.cpp
+index 115bb3245..643ce4ddd 100644
+--- a/libavogadro/src/tools/navigatetool.cpp
++++ b/libavogadro/src/tools/navigatetool.cpp
+@@ -92,7 +92,8 @@ namespace Avogadro {
double sumOfWeights = 0.;
QList<Atom*> atoms = widget->molecule()->atoms();
foreach (Atom *atom, atoms) {
- Vector3d transformedAtomPos = widget->camera()->modelview() * *atom->pos();
-+ Vector3d transformedAtomPos = (widget->camera()->modelview()).linear() * (*atom->pos());
++ Vector3d transformedAtomPos = (widget->camera()->modelview() *
++ atom->pos()->homogeneous()).head<3>();
double atomDistance = transformedAtomPos.norm();
double dot = transformedAtomPos.z() / atomDistance;
double weight = exp(-30. * (1. + dot));
-Index: avogadro-1.2.0/libavogadro/src/tools/skeletontree.cpp
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/tools/skeletontree.cpp
-+++ avogadro-1.2.0/libavogadro/src/tools/skeletontree.cpp
-@@ -25,6 +25,7 @@
- **********************************************************************/
-
- #include "skeletontree.h"
-+#include <iostream>
-
+diff --git a/libavogadro/src/tools/skeletontree.cpp b/libavogadro/src/tools/skeletontree.cpp
+index 03390e9a1..269439855 100644
+--- a/libavogadro/src/tools/skeletontree.cpp
++++ b/libavogadro/src/tools/skeletontree.cpp
+@@ -29,6 +29,7 @@
#include <avogadro/atom.h>
#include <avogadro/bond.h>
+ #include <avogadro/molecule.h>
++#include <iostream>
+
+ using namespace Eigen;
+ using namespace std;
@@ -221,7 +222,7 @@ namespace Avogadro {
{
if (m_rootNode) {
@@ -884,27 +628,14 @@
// Update the root node with the new position
Atom* a = n->atom();
- a->setPos(rotationMatrix * (*a->pos()));
-+ a->setPos(rotationMatrix.linear() * (*a->pos()));
++ a->setPos((rotationMatrix * (*a->pos()).homogeneous()).head<3>());
a->update();
// Now update the children
-@@ -270,10 +271,10 @@ namespace Avogadro {
- printSkeleton(node);
-
- Atom* a = n->atom();
-- cout << a->pos()->x() << "," << a->pos()->y()<< ","<<a->pos()->z() << endl;
-+ std::cout << a->pos()->x() << "," << a->pos()->y()<< ","<<a->pos()->z() << endl;
-
- if (!n->isLeaf()) {
-- cout << "-------------" << endl;
-+ std::cout << "-------------" << endl;
- }
- }
-
-Index: avogadro-1.2.0/libavogadro/src/tools/skeletontree.h
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/tools/skeletontree.h
-+++ avogadro-1.2.0/libavogadro/src/tools/skeletontree.h
+diff --git a/libavogadro/src/tools/skeletontree.h b/libavogadro/src/tools/skeletontree.h
+index e2010feb4..0f51c4f31 100644
+--- a/libavogadro/src/tools/skeletontree.h
++++ b/libavogadro/src/tools/skeletontree.h
@@ -230,7 +230,7 @@ namespace Avogadro {
* @param centerVector Center location to rotate around.
*/
@@ -914,28 +645,3 @@
};
} // End namespace Avogadro
-Index: avogadro-1.2.0/libavogadro/tests/CMakeLists.txt
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/tests/CMakeLists.txt
-+++ avogadro-1.2.0/libavogadro/tests/CMakeLists.txt
-@@ -13,7 +13,7 @@ set_directory_properties(PROPERTIES INCL
- include_directories(
- ${CMAKE_SOURCE_DIR}
- ${CMAKE_CURRENT_BINARY_DIR}
-- ${EIGEN2_INCLUDE_DIR}
-+ ${EIGEN3_INCLUDE_DIR}
- ${OPENBABEL2_INCLUDE_DIR}
- ${BOOST_PYTHON_INCLUDES}
- ${PYTHON_INCLUDE_PATH}
-Index: avogadro-1.2.0/libavogadro/src/extensions/CMakeLists.txt
-===================================================================
---- avogadro-1.2.0.orig/libavogadro/src/extensions/CMakeLists.txt
-+++ avogadro-1.2.0/libavogadro/src/extensions/CMakeLists.txt
-@@ -144,6 +144,6 @@ add_subdirectory(crystallography)
- add_subdirectory(spectra)
- add_subdirectory(surfaces)
- add_subdirectory(swcntbuilder)
--add_subdirectory(qtaim)
-+#add_subdirectory(qtaim)
- add_subdirectory(quantuminput)
- add_subdirectory(orca)
diff -Nru avogadro-1.2.0/debian/patches/series avogadro-1.2.0/debian/patches/series
--- avogadro-1.2.0/debian/patches/series 2016-10-02 10:06:16.000000000 +0200
+++ avogadro-1.2.0/debian/patches/series 2017-07-06 18:18:38.000000000 +0200
@@ -3,3 +3,5 @@
eigen3.patch
gcc-version.diff
libmsymfloat.patch
+eigen3_lib.patch
+
More information about the Debichem-devel
mailing list