hi!
i want to display the number of every node in a 3d surfaceplot i add the data with loadFromData(Qwt3D::TripleField,Qwt3D::CellField ); but i only get the lines(edges) in 3dspace
Qwt3D::SurfacePlot *sp = new Qwt3D::SurfacePlot(this); ui.verticalLayout->addWidget(sp);
sp->setPlotStyle(Qwt3D::WIREFRAME);
//do blue…. Qwt3D::RGBA rgba; rgba.r = 0.0; rgba.g = 0.0; rgba.b = 1.0; sp->setMeshColor(rgba);
Qwt3D::TripleField tf; Qwt3D::CellField cf; Qwt3D::Cell c1;
tf.clear(); cf.clear(); c1.clear();
const QModelIndex mi; dvector dvx = ptm->getColumn("x"); dvector dvy = ptm->getColumn("y"); dvector dvz = ptm->getColumn("z"); for (unsigned i = 0; i < dvx.size(); i++) { tf.push_back(Qwt3D::Triple(dvx_, dvy, dvz)); c1.push_back(i); } cf.push_back(c1);
sp->loadFromData(tf, cf);
sp->setRotation(30,0,15); sp->setShift(0.15,0,0); sp->coordinates()->axes.setLabelString("x-axis"); sp->coordinates()->axes.setLabelString("y-axis"); sp->coordinates()->axes.setLabelString("z-axis");
sp->setMeshLineWidth(2);
sp->setCoordinateStyle(Qwt3D::FRAME);
sp->updateData(); sp->updateGL();
}
_
Log in to post a comment.
hi!
i want to display the number of every node in a 3d surfaceplot
i add the data with loadFromData(Qwt3D::TripleField,Qwt3D::CellField );
but i only get the lines(edges) in 3dspace
{
ui.setupUi(this);
Qwt3D::SurfacePlot *sp = new Qwt3D::SurfacePlot(this);
ui.verticalLayout->addWidget(sp);
sp->setPlotStyle(Qwt3D::WIREFRAME);
//do blue….
Qwt3D::RGBA rgba;
rgba.r = 0.0;
rgba.g = 0.0;
rgba.b = 1.0;
sp->setMeshColor(rgba);
Qwt3D::TripleField tf;
Qwt3D::CellField cf;
Qwt3D::Cell c1;
tf.clear();
cf.clear();
c1.clear();
const QModelIndex mi;
dvector dvx = ptm->getColumn("x");
dvector dvy = ptm->getColumn("y");
dvector dvz = ptm->getColumn("z");
for (unsigned i = 0; i < dvx.size(); i++) {
tf.push_back(Qwt3D::Triple(dvx_, dvy, dvz));
c1.push_back(i);
}
cf.push_back(c1);
sp->loadFromData(tf, cf);
sp->setRotation(30,0,15);
sp->setShift(0.15,0,0);
sp->coordinates()->axes.setLabelString("x-axis");
sp->coordinates()->axes.setLabelString("y-axis");
sp->coordinates()->axes.setLabelString("z-axis");
sp->setMeshLineWidth(2);
sp->setCoordinateStyle(Qwt3D::FRAME);
sp->updateData();
sp->updateGL();
}
_