diff --git a/brain/circuit.cpp b/brain/circuit.cpp index 254661f..26f2d11 100644 --- a/brain/circuit.cpp +++ b/brain/circuit.cpp @@ -349,5 +349,10 @@ Matrix4fs Circuit::getTransforms( const GIDSet& gids ) const } +Quaternionfs Circuit::getRotations( const GIDSet& gids ) const +{ + return _impl->getRotations( gids ); +} + } diff --git a/brain/circuit.h b/brain/circuit.h index 73e5082..ccfc635 100644 --- a/brain/circuit.h +++ b/brain/circuit.h @@ -84,6 +84,8 @@ class Circuit : public boost::noncopyable BRAIN_API Vector3fs getPositions( const GIDSet& gids ) const; /** @return The local to world transformations of the given cells. */ BRAIN_API Matrix4fs getTransforms( const GIDSet& gids ) const; + /** @return The local to world rotation of the given cells. */ + BRAIN_API Quaternionfs getRotations( const GIDSet& gids ) const; class Impl; //!< @internal diff --git a/doc/Changelog.md b/doc/Changelog.md index 254fbdb..dd51633 100644 --- a/doc/Changelog.md +++ b/doc/Changelog.md @@ -3,6 +3,8 @@ Changelog {#Changelog} # git master +* [49](https://github.com/BlueBrain/Brion/pull/49): + Added the method brain::Circuit::getRotations * [46](https://github.com/BlueBrain/Brion/pull/46): Fixed a bug in enum to string conversions affecting morphologyConverter. * [39](https://github.com/BlueBrain/Brion/pull/39): diff --git a/tests/circuit.cpp b/tests/circuit.cpp index 9aa46ec..5494805 100644 --- a/tests/circuit.cpp +++ b/tests/circuit.cpp @@ -306,12 +306,13 @@ BOOST_AUTO_TEST_CASE(all_mvd3) BOOST_CHECK( transforms[20].equals( brain::Matrix4f( - brain::Quaternionf( 0.383102, 0, 0.923706, 0 ), + brain::Quaternionf( 0, 0.923706, 0, 0.383102 ), brain::Vector3f( 30.12771, 1794.125911, 19.860587 )), 0.00001f )); + BOOST_CHECK( transforms[100].equals( brain::Matrix4f( - brain::Quaternionf ( 0.120884, 0, -0.992667, 0 ), + brain::Quaternionf ( 0, -0.992667, 0, 0.120884 ), brain::Vector3f( 48.757924, 1824.458993, 15.302584 )), 0.00001f )); } @@ -341,12 +342,12 @@ BOOST_AUTO_TEST_CASE(partial_mvd3) BOOST_CHECK( transforms[1].equals( brain::Matrix4f( - brain::Quaternionf( 0.383102, 0, 0.923706, 0 ), + brain::Quaternionf( 0, 0.923706, 0, 0.383102 ), brain::Vector3f( 30.12771, 1794.125911, 19.860587 )), 0.00001f )); BOOST_CHECK( transforms[2].equals( brain::Matrix4f( - brain::Quaternionf( 0.120884, 0, -0.992667, 0 ), + brain::Quaternionf( 0, -0.992667, 0, 0.120884 ), brain::Vector3f( 48.757924, 1824.458993, 15.302584 )), 0.00001f )); }