Subject: CGAL users discussion list
List archive
- From: Stephane Lesoinne <>
- To:
- Subject: [Fwd: Re: [cgal-discuss] Using cgal in C]
- Date: Tue, 11 Aug 2009 15:36:13 +0200
Thank you very much for your answer !
My mind is clearer now I've got an idea about the investment needed and it seems that it's much more than I can currently afford.
@ Sylvain :
"It might be simpler to compile your whole program with a C++ compiler. "
Sorry, already tried but due to some dependencies, it would also take extra time to compile with C++.
I think I'll stick to qhull and for possible extra tools needs later I'll check the best solution at that time.
Have a nice day.
Steph
-------- Message original --------
Sujet : Re: [cgal-discuss] Using cgal in C
Date : Tue, 11 Aug 2009 09:18:47 -0400
De : Ben Supnik
<>
Répondre à :
Pour :
Références : <> <> <>
It is if you write a C++ wrapper library with an "extern C" API.
The problem is that, because CGAL is so heavily templated, it won't be possible to create an API that really matches what CGAL's API does.
Instead you'll need to first instantiate every template to a specific type, then write an opaque API around those types (perhaps using ptrs) because the types can't be declared in C++ at all.
If you are doing an algorithm like "calculate one output from many inputs" you may only be doing raw data input and output and may never need to expose the CGAL type at all.
Finally, while you could implement C callbacks for things like functors in C++/CGAL, the performance will possibly be very poor because a C callback can't be inlined. So you'll probably need to explicitly instantiate all of the "important" parts of CGAL's algorithm performance wise.
If you just want standard kernels and simple structures, it wouldn't be an issue.
One last warning: you may not be able to output a structure into C and then re-input it without causing problems. For example, given a valid arrangement using an exact-constructions kernel, if you output the arrangement to C as a big list of double-precision points and then try to rapidly reconstruct the arrangement, the rounding from going to double-precision + C may cause topology errors in the arrangement.
cheers
Ben
Stephane Lesoinne wrote:
Yes, I already know qhull and I'm currently looking at it but maybe I'll need more functionalities in a near future.
So I'm wondering if cgal is a possible choice.
Stéphane Lesoinne
dmyan a écrit :
qhull?
----- Original Message ----- From: "Stephane Lesoinne" <>
To:
<>
Sent: Tuesday, August 11, 2009 3:20 PM
Subject: [cgal-discuss] Using cgal in C
Hello,
I would like to use a library to construct 3D convex hull in a acoustical raytracing program written in C but this library is only available in C++.
I'd like to know how I can use it in C or if another reliable library is freely available ?
--
S. Lesoinne
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
--
Scenery Home Page: http://scenery.x-plane.com/
Scenery blog: http://xplanescenery.blogspot.com/
Plugin SDK: http://www.xsquawkbox.net/xpsdk/
X-Plane Wiki: http://wiki.x-plane.com/
Scenery mailing list:
Developer mailing list:
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
--
Stéphane Lesoinne
- [Fwd: Re: [cgal-discuss] Using cgal in C], Stephane Lesoinne, 08/11/2009
Archive powered by MHonArc 2.6.16.