Hi everybody,

I am using Qwtplot3D 0.2.7 to plot 3D surface and it works fine.

On my own inherited class of SurfacePlot, I also need to plot a 3D polyline.
The only way I found to draw something is to overload the createData() function like this :

Qt Code:
  1. void PlotSurface::createData()
  2. {
  3. Qwt3D::SurfacePlot::createData();
  4. if(!ptrIsNul(_myData))
  5. {
  6. Qwt3D::setDeviceLineWidth( 2 );
  7. glColor3d(0., 1., 1.);
  8.  
  9.  
  10. glPushMatrix();
  11. glScaled(_scaleX,_scaleY,_scaleZ);
  12. glTranslated(_offsetX,_offsetY, _offsetZ);
  13. glRotated(_angleZ,0.0,0.0,1.0);
  14.  
  15. glBegin( GL_LINES );
  16.  
  17.  
  18.  
  19. for(unsigned int i = 0; i < _myData->getNbLines(); i ++)
  20. {
  21. for(unsigned int j =0; j < _myData->getLine(i)->getNbPoints()-1; j++ )
  22. {
  23. Point<float,3> p1 = _myData->getLine(i)->getPoint(j);
  24. Point<float,3> p2 = _myData->getLine(i)->getPoint(j+1);
  25. glVertex3d(p1[0], p1[1], p1[2]);
  26. glVertex3d(p2[0], p2[1], p2[2]);
  27. }
  28. }
  29.  
  30. glEnd();
  31. glPopMatrix();
  32.  
  33. }
  34. }
To copy to clipboard, switch view to plain text mode 

1) Is it the good way to do it ?

2) The lines are drawn. However, when I look the surface plot from above (I then see a X,Y plane), the lines are not at the correct coordinates. Moreover these coordinates depends on the Z values of my surface data. The _offsetX etc... parameters are set to 0 ans _scaleX etc... are set to 1.0. _angleZ is also equal to 0.0.
I would like to draw those lines like the grid of the surface is drawn but I can't find a way.

Any Idea ?

Thanks in advance.