Boost logo

Boost :

Subject: Re: [boost] [geometry][units] Vector Class
From: Barend Gehrels (barend_at_[hidden])
Date: 2010-05-20 03:59:40


Hi Terry,

> I decided to remove boost::geometry from the implementation of my
> Vector/Point classes and instead focus on how to tell boost::geometry
> how to use my classes.
OK, I think in that way it will fit much better.

> I've been using CGAL for a few years, so I'm "baby-duck" imprinted on
> that design.
> I also used CGAL for affine transforms and some spherical conversions,
> so I hope to try boost::geometry for that functionality as well.
It does provide some transformations.
> I really had a hard time understanding what a "geometry" was.
> I expected a "geometry" to be a "system", rather than an object.
A "geometry" does not exist in our library, besides being a namespace.
We've several concepts, point, polygon, etc, and they are of course
geometries, but we don't have the object geometry. All algorithms work
(or should work) on any geometry.

> I also expected "points" to be referenced to a "reference frame" so
> that points that have difference reference frames cannot operate on
> one another without going through a transformation.
The "reference frame" is the coordinate system. You cannot calculate the
distance between two points in different coordinate systems (unless it
is implemented explicitly). For the arithmetic operations you are using,
it is different indeed, those are a kind of lower level functions, which
might be provided by a separate vector library in the future. But good
point, currently you can add two vectors from different coordinate
systems... We can solve that.

> Much as in std::chrono, time_points from different clocks cannot be
> operated on together. But durations, the difference of two
> time_points, are interoperable.
> CGAL was also very difficult for me to learn because they use the
> concept of a "kernel".

 Boost.geometry doesn't have that kernel indeed. Precision is determined
by the metafunction "coordinate_type", which can be float, double or
high precision, as you experienced.

> Perhaps I'm not not geometry savvy, but I feel a need for a geometry
> library for dummies.
> It seems a shame to keep coding "point/vector" over and over. It
> reminds me of when I used to write linked-list-queues in C from
> scratch on every project...
Boost.Geometry should be for both "dummies" and experts ;-). However,
even in Boost.Geometry we didn't want to provide another matrix/vector
library. So therefore: points, polygons, etc. The sample on the first
page gives the dummy-case:
point p1(1,2); point p2(3,4); std::cout << distance(p1,p2);
it cannot be easier.
>
> I really missed going to BoostCon this year.
> I hope you all had fun!
> Thanks for all the hard work!
>
You're welcome ;-)
Sure it was great and hope you will be there next time!

Regards, Barend


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk