Re: [Boost-users] Connect holes in polygon (Barend Gehrels)

Hi Barend, thanks for the reply. As I understand it the algorithm is not that simple but I would be happy to find out I am wrong. The requirements I have are that the "seams" cannot cut through any holes, the connect_holes algorithm does prevent seams crossing holes this but may have to create new vertices for seam "take-offs" to travel to other holes. I have tried using the QPolygon class in Qt, it has an simple implementation that just iterates around all the holes but can lead to seams crossing holes (or seams going out of the boundary of the outer polygon). Do you think an easy solution exists given these requirements?
Dan
-----Original Message-----
From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of boost-users-request@lists.boost.org
Sent: Wednesday, June 16, 2010 9:45 AM
To: boost-users@lists.boost.org
Subject: Boost-users Digest, Vol 2392, Issue 2
Send Boost-users mailing list submissions to
boost-users@lists.boost.org
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.boost.org/mailman/listinfo.cgi/boost-users
or, via email, send a message with subject or body 'help' to
boost-users-request@lists.boost.org
You can reach the person managing the list at
boost-users-owner@lists.boost.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Boost-users digest..."
Today's Topics:
1. Connect holes in polygon (Macumber, Daniel)
2. Re: config / cygwin question (Steven Watanabe)
3. Re: boost.xpressive: using placeholders with custom (check())
assertions (Eric Niebler)
4. Re: Connect holes in polygon (Barend Gehrels)
5. Re: [boost] [log] Link error with trivial logging (Roger Stewart)
6. Re: config / cygwin question (Fr?d?ric Bron)
7. Re: [Serialization] Sometimes Fails Reading Binary File
(Robert McCullough)
8. Re: [Serialization] Sometimes Fails Reading Binary File
(Steven Watanabe)
9. Re: [Serialization] Sometimes Fails Reading Binary File
(Robert McCullough)
----------------------------------------------------------------------
Message: 1
Date: Wed, 16 Jun 2010 06:07:15 -0600
From: "Macumber, Daniel"
# Uploading log archive "/cygdrive/d/boost_regression/cygwin/results/bronf-cygwin-1.7.zip" to ftp://anonymous@boost.cowic.de/boost/do-not-publish-this-url/results//trunk
Rene, I think you're going to have to change this again.
In Christ,
Steven Watanabe
------------------------------
Message: 3
Date: Wed, 16 Jun 2010 09:29:38 -0400
From: Eric Niebler
Greetings.
Xpressive allows the use of object placeholders in semantic actions, which are being replaced by actual object references during the match, like in this simple example:
placeholder<string> p_string; sregex r = (expr)[do_something(p_string, _)];
When executed, do_something() functor will receive a reference to string, as expected.
However, if functor is wrapped with assertion, this won't work:
sregex r = (expr)[check(do_something(p_string, _))];
Compilation will fail, because do_something has no method which accepts xpressive::placeholder<> objects.
It should if it is a lazy function. How is do_something defined? Can you send a self-contained program that demonstrates the problem you're having?
And even if such method was to be added, there's no obvious way to obtain a run-time reference to actual object out of placeholder.
xpressive will do that for you.
This leads to some question: 1. Is there any trick allowing to use placeholders within check() assertions? 2. Alternatively, may there be a way to declare a semantic action functor, returning bool, in such a way, that it will act as custom assertion? It seems to me, that some cunning trick involving boost::proto construct may exist, even though I can't think of any particular way to do so.
In light of the above, I also thought about sort of feature request: 3. Sometimes, custom assertion applies only to a part of the match, something like:
*((expr)[check(cond)] | _)
That is, a desire is to consume everything, until some specific "expr" token matches a precondition.
Yes, that should work.
However, raised assertion will not stop the matching, because it only applies to one branch of the regexp. It could be very handy if there was a way to signal from assertion that a larger containing expression matched it results.
I don't understand that last sentence. Can you clarify?
--
Eric Niebler
BoostPro Computing
http://www.boostpro.com
------------------------------
Message: 4
Date: Wed, 16 Jun 2010 15:59:12 +0200
From: Barend Gehrels
Does anyone know how to use boost Polygon or boost GGL to take a convert a polygon with holes to a polygon with no holes? I am looking for functionality similar to this http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Boolean_set_operations_2.... I have already found a way to extract trapezoids using boost Polygon but I was hoping there was a method more similar to connect_holes.
As also described on the GGL-mailing list:
No, Boost.Geometry does not (yet) provide conversion from polygons with holes to so-called key-holed polygons as you describe. Normally this is necessary or useful for graphic user interfaces. The algorithm is not that difficult, visiting the outer polygon and after that the inner rings, while pushing the first point of the outer polygon between all inner rings, is normally enough. This can be done by normal iterators.
Regards, Barend
------------------------------
Message: 5
Date: Wed, 16 Jun 2010 10:00:20 -0400
From: "Roger Stewart"
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Igor R Sent: Wednesday, June 16, 2010 3:56 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] [boost] [log] Link error with trivial logging
libboost_log-vc80-mt-sgd-1_43.lib(trivial.obj) : error LNK2019: unresolved external symbol "class boost::system::error_category const & __cdecl boost::system::get_system_category(void)" (?get_system_category@system@boost@@YAABVerror_category@12@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'system_category''(void)" (??__Esystem_category@system@boost@@YAXXZ)
Any thoughts on what might be causing this? ?Below is my main(). ?Thanks!
Do you have libboost_system-vc80-mt-sgd-1_43.lib ? This lib should be linked as well. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
I am using msvc90 with boost 1.43 and receive the same linking errors when compiling a simple trivial console project.
I can get the project to link successfully if I include a backend sink, i.e.:
#include
# Uploading log archive "/cygdrive/d/boost_regression/cygwin/results/bronf-cygwin-1.7.zip" to
ftp://anonymous@...
Rene, I think you're going to have to change this again.
Oh! I am terribly sorry for this mistake. May I propose the attached patch so that this will never happen again. Regards, Fr?d?ric

Hi Dan, Macumber, Daniel wrote:
Hi Barend, thanks for the reply. As I understand it the algorithm is not that simple but I would be happy to find out I am wrong. The requirements I have are that the "seams" cannot cut through any holes, the connect_holes algorithm does prevent seams crossing holes this but may have to create new vertices for seam "take-offs" to travel to other holes. I have tried using the QPolygon class in Qt, it has an simple implementation that just iterates around all the holes but can lead to seams crossing holes (or seams going out of the boundary of the outer polygon). Do you think an easy solution exists given these requirements?
There are configurations (with multiple holes) thinkable where these requirements are not possible, where a straight seam cannot reach the outer ring without cutting a hole, even if new vertices are created. Unless it is allowed for the seams to connect holes (and from there to exterior ring). Anyway, for simple configurations it is of course possible to create a solution, but it is not yet implemented or planned in Boost.Geometry. What is the use case for this requirement? Regards, Barend
participants (2)
-
Barend Gehrels
-
Macumber, Daniel