PDA

View Full Version : problem by executing a simple example of Qwt3dplot, surface plot from mesh file



AgrobotX
8th February 2011, 20:10
Hello everybody,

I'm a scientific programmer, who starts now with the Qt environment and the openCV vision library. :cool: I successfully compiled and runned an openCV stereovision application, obtaining the depth map ( a 3d point cloud ). My goal now is to plot in 3d this point cloud coming from the cameras and openCV,possibly in real-time. Since I work with Qt I turned towards Qwt3dplot, which seems to be quite powerful....and then started the pain! I compiled easily the "simple plot" example , a surface plot of the Rosembrock function. But when I try to run the example about "Grid data files"...I got segmentation fault.

I create an istance of NativeReader named "pippo", then I pass to pippo the name of the file where the mesh is....a simple text file:

jk:11051895-17021986
MESH
4 4
0 1
0 1
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

I'm confident that this file is of correct format, in fact no error message comes from the program.
The Qt Debugger indicates that segmentation occurs AFTER the reading of the file,
and precisely in the method SurfacePlot::loadFromData which is called immediately after the reading and closing of the mesh file. If someone can help...at this point I'm really out of ideas. :-(

the code :
int main(int argc, char **argv)
{
QApplication *my=new QApplication(argc,argv);
QMainWindow a;
QString ss="blabla";
QLabel *ee=new QLabel(ss,0);
a.setCentralWidget(ee);
a.show();


Plot3D* plot=0;
NativeReader pippo;
pippo.minz_=-30;
pippo.maxz_=30;
pippo(plot, "file.txt");
return my->exec();

}

Uwe
9th February 2011, 07:30
Better ask on the QwtPlot3D Forum (sourceforge.net/projects/qwtplot3d/forums/forum/374844).

Uwe