Subject: CGAL users discussion list
List archive
- From: Andreas Fabri <>
- To:
- Subject: Re: [cgal-discuss] CGAL_Qt4 and CGAL::Projection_traits_xy_3
- Date: Tue, 27 Nov 2012 21:47:29 +0100
- Organization: GeometryFactory
Hello,
To get the graphicsitem compiled, it would be enough to throw out
Ray, Line, Iso_rectangle from the classes
CGAL::Qt::Converter, which converts CGAL and Qt points,...
CGAL::Qt::Painter_ostream, which calls the Qt drawing functions.
I write "enough", as you are looking for a quick hack.
Best regards,
andreas fabri
On 27/11/2012 19:05, Anthony Truchet wrote:
Hello,
Thanks for whose taking some moment to read this information request and
please does not hesitate to tell me if I break unwillingly some courtesy
of this mailing list.
I'm working with terrain data : basically level curves (polylines whose
points all have the same elevation).
I thus use constrained Delaunay triangulation in the spirit of exemple
[37.5.2] to be able to evaluate the estimated elevation of any point. I
would like to draw the 2D projection in Qt thanks to CGAL_Qt4.
The code below works fine if I use pure 2D triangulations ::
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
//typedef CGAL::Projection_traits_xy_3<K> Gt;
typedef K Gt; // XXX Dummy typedef to stay in pure 2D
typedef CGAL::Triangulation_vertex_base_2<Gt> Vb;
typedef CGAL::Triangulation_face_base_with_info_2<FaceInfo, Gt> Fbb;
typedef CGAL::Constrained_triangulation_face_base_2<Gt, Fbb> Fb;
typedef CGAL::Triangulation_data_structure_2<Vb, Fb> TDS;
typedef CGAL::Exact_predicates_tag Itag;
typedef CGAL::Constrained_Delaunay_triangulation_2<Gt, TDS, Itag> CDT;
typedef CDT::Point CGAL_Point;
typedef CGAL::Polygon_2<Gt> CGAL_Polygon;
[...]
CGAL::Qt::TriangulationGraphicsItem<CDT>* p_cdt_gitem =
new CGAL::Qt::TriangulationGraphicsItem<CDT>(&cdt);
[...]
CGAL::Qt::PolygonGraphicsItem<CGAL_Polygon>* p_gi =
new CGAL::Qt::PolygonGraphicsItem<CGAL_Polygon>(p_p);
But when I define the Geometric Traits Gt to be
CGAL::Projection_traits_xy_3<K>, then the compilatioon fails deep inside
CGAL::Qt functions in way I don't understand.
I've tried blindly to use "pure 2D" variants of CDT, Point, Polygon
together with the projected one but it of course failed because I was
just trying blindly :-(
So here are the questions :
* is there an known way to get CGAL::Qt::TriangulationGraphicsItem and
the like worh with CGAL::Projection_traits_xy_3<K>
* if not, is there a way to build a pure 2D triangulation from a
"projected 2D" triangulation, so that I could visualize the former to
debug the latter (I don't mind for perf consideration as this will be a
debug only visualization)
* what are the right entry points to understand what's going on and
contribute a working exemple back ?
Thanks for your attention and have a nice day / evening / night :-)
--
Anthony Truchet
Logilab S.A.
PS : I'm using latest CGAL (4.1) compiled from sources on Debian Linux
stable with GCC 4.4.5
[37.5.2]
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Triangulation_2/Chapter_main.html#Subsection_37.5.2
--
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project
phone: +33.492.954.912 skype: andreas.fabri
- [cgal-discuss] CGAL_Qt4 and CGAL::Projection_traits_xy_3, Anthony Truchet, 11/27/2012
- Re: [cgal-discuss] CGAL_Qt4 and CGAL::Projection_traits_xy_3, Andreas Fabri, 11/27/2012
- Re: [cgal-discuss] CGAL_Qt4 and CGAL::Projection_traits_xy_3, Anthony Truchet, 11/28/2012
- Re: [cgal-discuss] CGAL_Qt4 and CGAL::Projection_traits_xy_3, Andreas Fabri, 11/28/2012
- Re: [cgal-discuss] CGAL_Qt4 and CGAL::Projection_traits_xy_3, Anthony Truchet, 11/28/2012
- Re: [cgal-discuss] CGAL_Qt4 and CGAL::Projection_traits_xy_3, Andreas Fabri, 11/27/2012
Archive powered by MHonArc 2.6.18.