
Hi Alfredo,
Great, please keep me (us) posted
Actually the timing is convenient because this indeed was still an action to be taken, mentioned in the review report.
What I have so far is for example using namespace boost::geometry; using namespace boost::units; model::point
si::length > p1(1.*si::meter,2.*si::meter,3.*si::meter); std::clog << distance(p1,p1) << std::endl; // outputs 0. * meter
This does not work for me. The type declaration works, but coordinates are still doubles here. The construction effectively translates to "double d = 1.*si::meter". This gives me the message "cannot convert from 'boost::units::quantity<Unit>' to 'double'". So how does this work for you?
#include
... using namespace boost::units; boost::array si::length, 3> p5={{10.*si::meter,11.*si::meter,12.*si::meter}}; std::clog << distance(p5,p5) << std::endl; //outputs 0. * meter
Construction works here for me, but calculating distance does not. Because distance behind the screens takes the square root, after squaring. This requires thorough integration with Boost.Units at those places, which is not planned.
the implementation I have is very primitive and it is practically a mockup because it bypasses most of the features of the Boost.Geometry library; mainly because I didn't understand them internally.
So Boost.Geometry is not dependant on Boost.Units. I think the way to go
is define a point type using a coordinate system using Boost.Units, like
you did, and also add quantities there.
I just tried that. However, the output is then still in values, so
distance will result a value (e.g. double). It runs like this:
// Note that the last 3 template parameters have defaults
typedef model::quantity_point