Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

display the number of every node

General
panagiotis
2012-10-08
2013-04-22
  • panagiotis
    panagiotis
    2012-10-08

    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

    how can i display also a number for every node??
    the code that i use is
    PlotWindow3D::PlotWindow3D(QWidget *parent, PTModel *ptm)
    : QWidget(parent)
    {
    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();

    }

    _