|
Geometry : |
Subject: [ggl] spacial index construction interface
From: Barend Gehrels (barend)
Date: 2011-02-23 06:22:10
Hi Adam,
I will answer in fragments.
> I've added test visualizing the rtree using GLUT, but only to the
> https://svn.boost.org/svn/boost/sandbox-branches/geometry/index_080_nhch/
> branch. To run it you'll neeed e.g. this:
> http://www.opengl.org/resources/libraries/glut/glutdlls37beta.zip.
Just had a look there.
First this is quite cool! ;-)
Second the BOOST_GEOMETRY_INDEX_RTREE_ENABLE_GL_DRAW define makes the
rtree a bit messy. Can you extract that somehow? I understand why it is
there now, because it calls itself recursively, but that might be solved
otherwise.
Third, hmm, I thought it would be nice to demonstrate the combination of
Boost.Geometry with GL as it is done with Qt
<http://barendgehrels.blogspot.com/2011/02/qt-world-mapper-with-boostgeometry.html>
Meaning to convert a Boost.Geometry point automatically to a GL-point like
BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET(QPointF,double, cs::cartesian, x, y, setX, setY)
But in GL no point concepts but just c-arrays are used. Bruno once
created an adaption headerfile for them. Using them can draw a box like
this:
GLfloat ll[2], lr[2], ul[2], ur[2];
geometry::assign_box_corners(it->first, ll, lr, ul, ur);
glBegin(GL_LINE_LOOP);
glVertex2fv(ll);
glVertex2fv(lr);
glVertex2fv(ur);
glVertex2fv(ul);
glEnd();
Not exactly better but just shorter and maybe nicer. Or alternatively it
can be used in a gl rectangle drawing routine.
Would be nice for the examples too (like Qt - glut worldmapper). Anyway
this whole point is not related to the spatial index at all so do with
it what you like.
Regards, Barend
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/ggl/attachments/20110223/510b1939/attachment.html
Geometry list run by mateusz at loskot.net