Page 2 of 2 FirstFirst 12
Results 21 to 21 of 21

Thread: Newbie : QwtCurveFitter and retrieve curve data

  1. #21
    Join Date
    Jun 2010
    Posts
    12
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Newbie : QwtCurveFitter and retrieve curve data

    Yes Uwe... I was a little stubborn and moreover kind of lost... please accept my appologies !
    I know that my code is very far from perfect .. I do my best ... but as I said...a newbie...

    I read this post form the beginning in order to have a fresh view on your advices and #4 is now clear to me...
    Yes I tried yesterday with 2 curves ...
    Qt Code:
    1. for (int ii = 0 ; ii < 2 ; ii ++)
    2. {
    3. m_UniqueCurve[ii] = new QwtPlotCurve();
    4. m_UniqueCurveFitter[ii] = new QwtSplineCurveFitter();
    5. m_UniqueCurveFitter[ii]->setFitMode(m_UniqueCurveFitter[ii]->ParametricSpline);
    6. m_UniqueCurveFitter[ii]->setSplineSize(4096);
    7. m_UniqueCurve[ii]->setCurveFitter(m_UniqueCurveFitter[ii]);
    8. }
    9.  
    10. m_UniqueCurve[0]->setCurveAttribute(QwtPlotCurve::Fitted, true);
    11. m_UniqueCurve[1]->setCurveAttribute(QwtPlotCurve::Fitted, false);
    12. m_UniqueCurve[0]->setStyle(QwtPlotCurve::Lines);
    13. m_UniqueCurve[1]->setStyle(QwtPlotCurve::Dots);
    14.  
    15.  
    16. m_UniqueCurve[0]->setPen(QColor(Qt::transparent));
    17. m_UniqueCurve[0]->setSymbol(QwtSymbol(QwtSymbol::Ellipse,Qt::gray, QColor(Qt::black), QSize(8,8)));
    18.  
    19. m_UniqueCurve[1]->setPen(QColor(Qt::black));
    20.  
    21. QPolygonF OriginalPoints,InterpolatedPoints;
    22. for ( int i = 0; i < TabX.count() ; i++ )
    23. {
    24. OriginalPoints+= QPointF(TabX[i], TabY[i]);
    25. }
    26.  
    27. InterpolatedPoints= m_RedCurveFitter[1]->fitCurve(points);
    28.  
    29. m_UniqueCurve[0]->setData(TabX.data(), TabY.data(),TabX.count());
    30. m_UniqueCurve[1]->setData(InterpolatedPoints);
    To copy to clipboard, switch view to plain text mode 

    And then I had to patch some lines in tne canvaspicker to be abble to select the good curve and move them together...

    So again I'm deeply sorry for hte bad quality of my code and my eyes while reading your posts

    Thanks a lot for your help

    Best regards

    Paul
    Last edited by sapym; 22nd July 2010 at 08:40.

Similar Threads

  1. Replies: 0
    Last Post: 19th September 2009, 08:07
  2. Replies: 0
    Last Post: 14th September 2009, 12:57
  3. Retrieve Curve values
    By nenukino in forum Qwt
    Replies: 2
    Last Post: 26th February 2008, 15:33
  4. Sql Server cannot retrieve data from select
    By Atomino in forum Qt Programming
    Replies: 10
    Last Post: 7th September 2006, 17:37
  5. [QT4 & XP] retrieve data from QTreeView's model
    By incapacitant in forum Newbie
    Replies: 1
    Last Post: 2nd March 2006, 14:02

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.