Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Extending TriangulationGraphicsItem<T> problem

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Extending TriangulationGraphicsItem<T> problem


Chronological Thread 
  • From: Yvan Maillot <>
  • To:
  • Subject: Re: [cgal-discuss] Extending TriangulationGraphicsItem<T> problem
  • Date: Mon, 26 Jul 2010 11:38:37 +0200 (CEST)
  • Organization: uha


Hello,

Thank you for your suggestion but apparently not, because I have exactly the same problem if I remove this statement. I think I have to do the right transformation (with the right matrix) but I don't how to do that and where to find this matrix. I have tried a lot of things like mapFromScene and so on... But nothing works.

I thought that I could used your PainterOstrean without doing any transformation. I have tried
PainterOstream<typename T::Geom_traits> pout(painter, this->sceneBoundingRect());
Perhaps It is not the right Rect...

Any other idea ?

Best regards

Yvan


Le 24 juil. 2010, 18:23, Andreas Fabri <> a écrit:

> Hello,
>
> This might have to do that we call
>
> // Turn the vertical axis upside down
> this->graphicsView->matrix().scale(1, -1);
>
>
> in the constructor of the Mainwindow class of demos.
>
> andreas
>
>
>
> On 23/07/2010 21:00, Yvan Maillot wrote:
> > Hi Again,
> >
> > Sorry to post this again but I am looking for my mistake for a while, in vain.
> > Any idea ?
> >
> > I am trying to extend TriangulationGraphicsItem<T> with a class I called
> > TriangulationGraphicsItemWithFaces<T> in order to also draw faces (triangles)
> > of a Delaunay triangulation.
> >
> > To do this I have overridden the drawAll method like as follow. It almost
> > works: faces are drawn. But they are drawn at a wrong place. Faces are
> > translated compared with edges and vertices. Indeed, the origin of the faces
> > seems to be on the left top of the screen instead of being in the middle. I
> > also tried to use resetMatrix() and so on, and other stuff but nothing works.
> > I
> > don't know at all where I'm wrong.
> >
> > What can I do to fix this problem?
> >
> > Thanks for your help.
> >
> > Yvan
> >
> > // The overridden method
> > template<typename T>
> > void
> > TriangulationGraphicsItemWithFaces<T>::drawAll(QPainter *painter) {
> > // Calling drawAll method of the TriangulationGraphicsItem<T> super class
> > TriangulationGraphicsItem<T>::drawAll(painter);
> > if (visible_faces) {
> > if (TriangulationGraphicsItem<T>::t->number_of_vertices()> 2) {
> > QColor color(::Qt::blue);
> > color.setAlpha(150);
> > faces_brush.setColor(color);
> > faces_brush.setStyle(::Qt::SolidPattern);
> > painter->setBrush(faces_brush);
> > painter->setPen(::Qt::NoPen);
> >
> > for (typename T::Finite_faces_iterator fit =
> >
> > TriangulationGraphicsItem<T>::t->finite_faces_begin();
> > fit != TriangulationGraphicsItem<T>::t->finite_faces_end();
> > ++fit) {
> >
> > TriangulationGraphicsItem<T>::painterostream<<
> >
> > TriangulationGraphicsItem<T>::t->triangle(fit);
> >
> > }
> > }
> > }
> > }
> >
>
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://lists-sop.inria.fr/wws/info/cgal-discuss
>


Archive powered by MHonArc 2.6.16.

Top of Page