Results 1 to 3 of 3

Thread: Contour correction

  1. #1
    Join Date
    Mar 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Contour correction

    When I check "Spectrogram, Contour Plot" example, I found that some contour lines close to the center of circle are not continues. There must be some wrong.

    After go through "qwt_raster_data.cpp", I found 2 bugs:

    1. intersect function:
    case 6:
    // e(-1,1,0), e(1,0,-1)
    line[0] = vertex[1].toPoint();
    line[1] = intersection( vertex[0], vertex[1] );
    break;
    should be:
    case 6:
    // e(-1,1,0), e(1,0,-1)
    line[0] = vertex[2].toPoint();
    line[1] = intersection( vertex[0], vertex[1] );
    break;

    2. contourLines function:
    if ( ignoreOutOfRange )
    {
    if ( !range.contains( zMin ) || !range.contains( zMax ) )
    continue;
    }
    this is not correct. How about rang.max>zMax and rang.min<zMin?
    should be:
    if ( ignoreOutOfRange )
    {
    if ( range.maxValue()<Min ) || range.minValue()> zMax ) )
    continue;
    }


    After correcting, example works perfect.
    before:
    t1.png
    After:
    t2.png

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

    Default Re: Contour correction

    I have added a bug report see: https://sourceforge.net/tracker/?fun...93&atid=113693

    Thanks for reporting,
    Uwe

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

    Default Re: Contour correction

    Quote Originally Posted by jwxiang View Post
    should be: line[0] = vertex[2].toPoint();
    Indeed, fixed in SVN: trunk and the 6.0 and 5.2 branches.

    if ( ignoreOutOfRange )
    {
    if ( !range.contains( zMin ) || !range.contains( zMax ) )
    continue;
    }
    this is not correct.
    AFAIR IgnoreOutOfRange is a flag to filter out invalid values of raster data with gaps, that are indicated by some special value outside the valid range. Of course this is somehow mysterious and I couldn't hardly remember the use case myself ( I will add note to the docs ). So the code above is correct - even if being the reason for the missing lines in the example.

    I modified the default setting of IgnoreOutOfRange ( to off ) in SVN trunk. For earlier versions I recommend to disable this flag in application code:

    Qt Code:
    1. spectrogram->setConrecFlag( QwtRasterData::IgnoreOutOfRange, false );
    To copy to clipboard, switch view to plain text mode 
    Uwe

Similar Threads

  1. QwtPlotSpectrogram and contour lines
    By toffkriss in forum Qwt
    Replies: 3
    Last Post: 8th March 2010, 11:49
  2. Help understanding QWT Contour Plot
    By jwieland in forum Qwt
    Replies: 11
    Last Post: 7th December 2009, 07:47
  3. Replies: 0
    Last Post: 15th September 2009, 03:34
  4. Replies: 3
    Last Post: 10th November 2008, 13:14
  5. Perspective correction with QTransform
    By dustparticle in forum Qt Programming
    Replies: 1
    Last Post: 4th June 2008, 00:01

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.