Results 1 to 20 of 21

Thread: Newbie : QwtCurveFitter and retrieve curve data

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,325
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Newbie : QwtCurveFitter and retrieve curve data

    Well, without understanding ( what is obvious from your code snippets ) what happens to your points you will fail. But what about the idea of using 2 QwtPlotCurves for your points: the first displaying the symbols only and a second one with a spline interpolated line ?

    Uwe

  2. #2
    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 07:40.

Similar Threads

  1. Replies: 0
    Last Post: 19th September 2009, 07:07
  2. Replies: 0
    Last Post: 14th September 2009, 11:57
  3. Retrieve Curve values
    By nenukino in forum Qwt
    Replies: 2
    Last Post: 26th February 2008, 14:33
  4. Sql Server cannot retrieve data from select
    By Atomino in forum Qt Programming
    Replies: 10
    Last Post: 7th September 2006, 16:37
  5. [QT4 & XP] retrieve data from QTreeView's model
    By incapacitant in forum Newbie
    Replies: 1
    Last Post: 2nd March 2006, 13: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
  •  
Qt is a trademark of The Qt Company.