Boost logo

Boost Users :

Subject: Re: [Boost-users] Connect holes in polygon (Barend Gehrels)
From: Macumber, Daniel (Daniel.Macumber_at_[hidden])
Date: 2010-06-16 12:07:54


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_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] On Behalf Of boost-users-request_at_[hidden]
Sent: Wednesday, June 16, 2010 9:45 AM
To: boost-users_at_[hidden]
Subject: Boost-users Digest, Vol 2392, Issue 2

Send Boost-users mailing list submissions to
        boost-users_at_[hidden]

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_at_[hidden]

You can reach the person managing the list at
        boost-users-owner_at_[hidden]

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" <Daniel.Macumber_at_[hidden]>
To: "boost-users_at_[hidden]" <boost-users_at_[hidden]>
Subject: [Boost-users] Connect holes in polygon
Message-ID:
        <07186B30C3DFE948B0EE2862AC1999F70A5B89E426_at_[hidden]>
Content-Type: text/plain; charset="us-ascii"

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_ref/Function_connect_holes.html. 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.

Thanks a lot,
Dan

------------------------------

Message: 2
Date: Wed, 16 Jun 2010 06:22:02 -0700
From: Steven Watanabe <watanabesj_at_[hidden]>
To: boost-users_at_[hidden]
Cc: Rene Rivera <grafikrobot_at_[hidden]>
Subject: Re: [Boost-users] config / cygwin question
Message-ID: <4C18CFFA.7010902_at_[hidden]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

AMDG

Fr?d?ric Bron wrote:
> # 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 <eric_at_[hidden]>
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] boost.xpressive: using placeholders with
        custom (check()) assertions
Message-ID: <4C18D1C2.6010208_at_[hidden]>
Content-Type: text/plain; charset=ISO-8859-1

On 6/16/2010 3:04 AM, Alex Dubov wrote:
> 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 <barend_at_[hidden]>
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] Connect holes in polygon
Message-ID: <4C18D8B0.7060902_at_[hidden]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Hi Dan,
Macumber, Daniel wrote:
> 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_ref/Function_connect_holes.html.  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" <rstewart_at_[hidden]>
To: <boost-users_at_[hidden]>
Subject: Re: [Boost-users] [boost] [log] Link error with trivial
        logging
Message-ID:
        <A9BF6EA2DF78AB47A87CC2A0F55437FA014A4831_at_[hidden]>
Content-Type: text/plain;       charset="utf-8"
> -----Original Message-----
> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
> bounces_at_[hidden]] On Behalf Of Igor R
> Sent: Wednesday, June 16, 2010 3:56 AM
> To: boost-users_at_[hidden]
> 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_at_system@boost@@YAABVerror_category_at_12@XZ)
> > referenced in function "void __cdecl boost::system::`dynamic
> > initializer for 'system_category''(void)"
> > (??__Esystem_category_at_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_at_[hidden]
> 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 <boost/log/sinks/text_file_backend.hpp>
This bug can be verified by declaring #define BOOST_LIB_DIAGNOSTIC and watching which libs get pulled in for linking when including or commenting out text_file_backend.hpp.
Roger S.
------------------------------
Message: 6
Date: Wed, 16 Jun 2010 16:37:57 +0200
From: Fr?d?ric Bron <frederic.bron_at_[hidden]>
To: boost-users_at_[hidden]
Cc: Rene Rivera <grafikrobot_at_[hidden]>
Subject: Re: [Boost-users] config / cygwin question
Message-ID:
        <AANLkTinaBs96oAkTOtfqmBoUpQJlfce3XnOKbSsFnkvK_at_[hidden]>
Content-Type: text/plain; charset="iso-8859-1"
>> # 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tools_regression.patch
Type: application/octet-stream
Size: 671 bytes
Desc: not available
URL: <http://lists.boost.org/MailArchives/boost-users/attachments/20100616/c7b766c6/attachment.obj>
------------------------------
Message: 7
Date: Wed, 16 Jun 2010 11:28:08 -0400
From: "Robert McCullough" <rob_at_[hidden]>
To: <boost-users_at_[hidden]>
Subject: Re: [Boost-users] [Serialization] Sometimes Fails Reading
        Binary  File
Message-ID: <002a01cb0d68$866b2600$93417200$@promessinc.com>
Content-Type: text/plain;       charset="us-ascii"
Steven,
I was able to compile and run my app on Windows 7.
Debugging using Visual Studio 2008 and using Boost 1.43.0 with the patch
from https://svn.boost.org/trac/boost/ticket/4257
The value of l at line 56 of boost/archive/impl/basic_binary_archive.ipp is
I = 369098752;
file_signature = ""
Line 56:   if(l == std::strlen(BOOST_ARCHIVE_SIGNATURE())) {      Fails!
Line  70:  if(file_signature != BOOST_ARCHIVE_SIGNATURE()) is true so, the
archive_exception::invalid_signature is thrown on line 73.
On my Window 7 PC,
sizeof(size_t) == 4
sizeof(library_version_type)  could not find definition of
library_version_type
sizeof(int) == 4
sizeof(long) == 4
sizeof(float) == 4
sizeof(double) == 8
Thanks,
Robert
> -----Original Message-----
> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
> bounces_at_[hidden]] On Behalf Of Steven Watanabe
> Sent: Tuesday, June 15, 2010 8:41 PM
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] [Serialization] Sometimes Fails Reading Binary
File
>
> AMDG
>
> Robert McCullough wrote:
> > Answers to your questions:
> > a) it yields different behavior for the same archive.
> > b) See attached source LegacyMonitorPersistentData.h
> > c) See attached source PersistentData.h
> > d)  I have not tried that.  I will give this a try.
> > This is what I am testing.
> > I have this archive file ^Press.dat. that was created once by our
customer.
> > I try to de-serializing using the loadPersistentData() function and it
> > works sometimes, but about every third try it throw one of the
> > exceptions.
> >
>
> Okay.  What version of Boost are you using?  Can you step through
> basic_binary_iarchive<Archive>::init() in a debugger?  It's at
> boost/archive/impl/basic_binary_archive.ipp line 50.
> What you ought to see is:
> l is set to 22.
> file_signature is set to "serialization::archive"
> input_library_version is set to 5
>
> "invalid signature" indicates that file_signature is wrong.
>
> Some info about the archive that you might want to verify:
> The platform is big-endian
> sizeof(size_t) == 4
> sizeof(library_version_type) == 1.
> sizeof(int) == 4
> sizeof(long) == 4
> sizeof(float) == 4
> sizeof(double) == 8
>
> In Christ,
> Steven Watanabe
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
------------------------------
Message: 8
Date: Wed, 16 Jun 2010 08:36:00 -0700
From: Steven Watanabe <watanabesj_at_[hidden]>
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] [Serialization] Sometimes Fails Reading
        Binary File
Message-ID: <4C18EF60.10208_at_[hidden]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
AMDG
Robert McCullough wrote:
> I was able to compile and run my app on Windows 7.
> Debugging using Visual Studio 2008 and using Boost 1.43.0 with the patch
> from https://svn.boost.org/trac/boost/ticket/4257
>
> The value of l at line 56 of boost/archive/impl/basic_binary_archive.ipp is
> I = 369098752;
>
= 0x16000000
indicating that you're trying to read the archive on a
little endian machine, when it was written on a big
endian machine.
> file_signature = ""
> Line 56:   if(l == std::strlen(BOOST_ARCHIVE_SIGNATURE())) {      Fails!
> Line  70:  if(file_signature != BOOST_ARCHIVE_SIGNATURE()) is true so, the
> archive_exception::invalid_signature is thrown on line 73.
>
> On my Window 7 PC,
> sizeof(size_t) == 4
> sizeof(library_version_type)  could not find definition of
> library_version_type
>
It's boost::archive::library_version_type defined in
boost/archive/basic_archive.hpp
> sizeof(int) == 4
> sizeof(long) == 4
> sizeof(float) == 4
> sizeof(double) == 8
>
In Christ,
Steven Watanabe
------------------------------
Message: 9
Date: Wed, 16 Jun 2010 11:45:10 -0400
From: "Robert McCullough" <rob_at_[hidden]>
To: <boost-users_at_[hidden]>
Subject: Re: [Boost-users] [Serialization] Sometimes Fails Reading
        Binary  File
Message-ID: <003401cb0d6a$e7969110$b6c3b330$@promessinc.com>
Content-Type: text/plain;       charset="us-ascii"
Steven,
Ok, thanks.  I was just wondering about that.
I guess I will have to go back to debugging it on my embedded PowerPC with
gcc and Eclipse.
I will try the same tests on the PowerPC.
Thanks, Robert
> -----Original Message-----
> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
> bounces_at_[hidden]] On Behalf Of Steven Watanabe
> Sent: Wednesday, June 16, 2010 11:36 AM
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] [Serialization] Sometimes Fails Reading Binary
File
>
> AMDG
>
> Robert McCullough wrote:
> > I was able to compile and run my app on Windows 7.
> > Debugging using Visual Studio 2008 and using Boost 1.43.0 with the
> > patch from https://svn.boost.org/trac/boost/ticket/4257
> >
> > The value of l at line 56 of
> > boost/archive/impl/basic_binary_archive.ipp is I = 369098752;
> >
>
> = 0x16000000
>
> indicating that you're trying to read the archive on a little endian
machine,
> when it was written on a big endian machine.
>
> > file_signature = ""
> > Line 56:   if(l == std::strlen(BOOST_ARCHIVE_SIGNATURE())) {      Fails!
> > Line  70:  if(file_signature != BOOST_ARCHIVE_SIGNATURE()) is true so,
> > the archive_exception::invalid_signature is thrown on line 73.
> >
> > On my Window 7 PC,
> > sizeof(size_t) == 4
> > sizeof(library_version_type)  could not find definition of
> > library_version_type
> >
>
> It's boost::archive::library_version_type defined in
> boost/archive/basic_archive.hpp
>
> > sizeof(int) == 4
> > sizeof(long) == 4
> > sizeof(float) == 4
> > sizeof(double) == 8
> >
>
> In Christ,
> Steven Watanabe
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
------------------------------
_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users
End of Boost-users Digest, Vol 2392, Issue 2
********************************************

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net