[vtk-developers] vtkChartXY lines not visible when using logarithmic x axis

Mathieu Westphal mathieu.westphal at kitware.com
Tue Jul 26 05:56:15 EDT 2016


Hello

I indeed reproduce the problem, I will submit a bug report and ping Marcus
to see if he knows what is going on.
http://www.paraview.org/Bug/view.php?id=16797

Regards,

Mathieu Westphal

On Tue, Jul 26, 2016 at 11:19 AM, Hagen Mölle <h.moelle at googlemail.com>
wrote:

> Hi Andrew, Hi Mathieu,
>
> I can not see the line after it disappears. This might be a special
> feature of the open source radeon graphics driver under Linux.
>
> Just for completeness one can easily see the line thickness fluctuation by
> zooming into the scene just right before the line disappears. At this zoom
> level just drag the scene using the left mouse button and move the mouse
> around.
>
> In fact it would be very nice if this bug could be fixed at least when
> logarithmic x axis is enabled. Because when logarithmic x axis is enabled
> the error is visible after zooming in only a few steps.
>
> Hagen
>
>
> On 26.07.2016 10:57, Andrew Maclean wrote:
>
> Hi Hagen, Mathieu,
>
> I agree with you, if I zoom in when the logarithmic axis is disabled, the
> thick line vanishes, however if you look carefully there is a very faint
> thin line. It may be (2) as you outline below.
>
> Regards
>    Andrew
>
> Andrew Maclean
>
> On 26 Jul 2016 5:02 pm, "Hagen Mölle" <h.moelle at googlemail.com> wrote:
>
>> Hi Andrew, Hi Mathieu,
>>
>> That's exactly the behaviour I see. By the way I am using ATI/AMD video
>> cards in my Windows/Linux machine.
>>
>> !!!! UPDATE: The error also occurs when logarithmic x axis is not
>> enabled. But you have to zoom in a lot more. See attached pictures. I am
>> sorry for not realizing this earlier.
>>
>>
>> I am not that familiar with OpenGL. But I can imagine two things:
>>
>> (1) Line is clipped
>> (2) If shaders are used to draw the line thickness it might be a floating
>> point precision problem. Actually this could be the problem because the
>> line thickness starts fluctuating at some point of zoom level before it
>> finally disappears. See attached picture. The line thickness is about the
>> half the original line thickness.
>>
>>
>> I hope this helps to fix the bug. One might also contact Marcus D.
>> Hanwell. He is the developer who mainly implemented vtkCharts. I am not
>> sure if he is still responsible.
>>
>> Hagen
>>
>>
>> On 26.07.2016 01:52, Andrew Maclean wrote:
>>
>> Hi Hagen,
>>   I just tested your example and I get similar behaviou using an NVIDIA
>> Video card, OpenGL2,  VS2015 and the VTK Master.
>>
>> I can zoom in and, at some point the line disappears, but zooming out
>> immediately restores the line.
>>
>> It seeme to me that once a certain zoom level is reached the line is not
>> drawn, however zooming out restores it.
>>
>> Attached are two pngs showing the effect.When the line disappears it
>> should still be visible as the scales on the axes have only changed
>> slightly.
>>
>> Andrew
>>
>> ---------- Forwarded message ----------
>>> From: "Hagen Mölle" <h.moelle at googlemail.com>
>>> To: vtk-developers at vtk.org
>>> Cc:
>>> Date: Mon, 25 Jul 2016 10:14:21 +0200
>>> Subject: [vtk-developers] vtkChartXY lines not visible when using
>>> logarithmic x axis
>>> Hi,
>>>
>>> Due to spam reasons the bug tracker's user login is disabled right now.
>>> One should send bug reports to the vtk's user mailing list, which I did
>>> twice. My bug report was totally ignored. That's why I send it here again.
>>> Hopefully someone can finally create a ticket in the bug tracker. Thanks.
>>>
>>> I want to report a bug for vtkChartXY. So I already send this Email two
>>> days ago to the vtkUsers mailing list without receiving any answer. The bug
>>> is not visible in the vtk bug tracker too. Thus I send the Email again.
>>>
>>> Bug environment:
>>> a) I am using VTK 6.2. I checked my test code on machines running
>>> Windows 7 (Visual Studio 2012/2015) and Ubuntu 15.10/Ubuntu 16.04 (gcc). On
>>> all these systems the bug is visible.
>>> b) I can also reproduce the bug in VTK 7.0 (here I used an Ubuntu 16.04
>>> machine and compiled VTK 7.0 using OpenGL2 interface).
>>>
>>> Bug description:
>>>
>>> I am using vtkChartXY to display one line. I also enabled logarithmic x
>>> axis (chartXY->GetAxis(vtkAxis::BOTTOM)->SetLogScale(true);). Nothing more
>>> special. In the compiled application I start zooming into the chart using
>>> the mouse wheel, making sure I always have a line displayed in the view. At
>>> some zoom level this line just disappears. At the zoom level the line
>>> disappears I did the following:
>>>
>>> 1. Zooming more into the chart the line will not appear again.
>>> 2. Zooming out twice (with mouse wheel) the line will reappear.
>>>
>>> How to reproduce the bug:
>>>
>>> I basically used the LinePlot example for vtkChartXY (see
>>> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Plotting/LinePlot).
>>>
>>> I added one line to the example code marked with *** (line was added
>>> after line 54 in example code).
>>> I added the full code to the end of the Email.
>>> ---------------
>>>
>>> // Add multiple line plots, setting the colors etc
>>>     vtkSmartPointer<vtkChartXY >  chart= vtkSmartPointer<vtkChartXY
>>> >::New(); *** chart.Get()->GetAxis(vtkAxis::BOTTOM)->SetLogScale(true);
>>> view->GetScene()->AddItem(chart);
>>>
>>> ---------------
>>>
>>> Compile and execute the program. See my bug description above to
>>> visualize the bug.
>>>
>>>
>>> Please contact me if you need more information. I can also provide
>>> images of the bug if needed.
>>> I hope the bug can be fixed.
>>>
>>> Hagen.
>>>
>>>
>>>
>>>
>>> #include <vtkVersion.h>
>>> #include <vtkRenderer.h>
>>> #include <vtkRenderWindowInteractor.h>
>>> #include <vtkRenderWindow.h>
>>> #include <vtkSmartPointer.h>
>>> #include <vtkChartXY.h>
>>> #include <vtkAxis.h>
>>> #include <vtkTable.h>
>>> #include <vtkPlot.h>
>>> #include <vtkFloatArray.h>
>>> #include <vtkContextView.h>
>>> #include <vtkContextScene.h>
>>> #include <vtkPen.h>
>>>
>>> int main(int, char *[])
>>> {
>>>     // Create a table with some points in it
>>>     vtkSmartPointer<vtkTable> table =
>>>       vtkSmartPointer<vtkTable>::New();
>>>
>>>     vtkSmartPointer<vtkFloatArray> arrX =
>>>       vtkSmartPointer<vtkFloatArray>::New();
>>>     arrX->SetName("X Axis");
>>>     table->AddColumn(arrX);
>>>
>>>     vtkSmartPointer<vtkFloatArray> arrC =
>>>       vtkSmartPointer<vtkFloatArray>::New();
>>>     arrC->SetName("Cosine");
>>>     table->AddColumn(arrC);
>>>
>>>     vtkSmartPointer<vtkFloatArray> arrS =
>>>       vtkSmartPointer<vtkFloatArray>::New();
>>>     arrS->SetName("Sine");
>>>     table->AddColumn(arrS);
>>>
>>>     // Fill in the table with some example values
>>>     int numPoints = 69;
>>>     float inc = 7.5 / (numPoints-1);
>>>     table->SetNumberOfRows(numPoints);
>>>     for (int i = 0; i < numPoints; ++i)
>>>     {
>>>       table->SetValue(i, 0, i * inc);
>>>       table->SetValue(i, 1, cos(i * inc));
>>>       table->SetValue(i, 2, sin(i * inc));
>>>     }
>>>
>>>     // Set up the view
>>>     vtkSmartPointer<vtkContextView> view =
>>>       vtkSmartPointer<vtkContextView>::New();
>>>     view->GetRenderer()->SetBackground(1.0, 1.0, 1.0);
>>>
>>>     // Add multiple line plots, setting the colors etc
>>>     vtkSmartPointer<vtkChartXY> chart =
>>>       vtkSmartPointer<vtkChartXY>::New();
>>>     chart.Get()->GetAxis(vtkAxis::BOTTOM)->SetLogScale(true);
>>>     view->GetScene()->AddItem(chart);
>>>     vtkPlot *line = chart->AddPlot(vtkChart::LINE);
>>> #if VTK_MAJOR_VERSION <= 5
>>>     line->SetInput(table, 0, 1);
>>> #else
>>>     line->SetInputData(table, 0, 1);
>>> #endif
>>>     line->SetColor(0, 255, 0, 255);
>>>     line->SetWidth(1.0);
>>>     line = chart->AddPlot(vtkChart::LINE);
>>> #if VTK_MAJOR_VERSION <= 5
>>>     line->SetInput(table, 0, 2);
>>> #else
>>>     line->SetInputData(table, 0, 2);
>>> #endif
>>>     line->SetColor(255, 0, 0, 255);
>>>     line->SetWidth(5.0);
>>>
>>>     // For dotted line, the line type can be from 2 to 5 for different
>>> dash/dot
>>>     // patterns (see enum in vtkPen containing DASH_LINE, value 2):
>>> #ifndef WIN32
>>>     line->GetPen()->SetLineType(vtkPen::DASH_LINE);
>>> #endif
>>>     // (ifdef-ed out on Windows because DASH_LINE does not work on
>>> Windows
>>>     //  machines with built-in Intel HD graphics card...)
>>>
>>>     //view->GetRenderWindow()->SetMultiSamples(0);
>>>
>>>     // Start interactor
>>>     view->GetInteractor()->Initialize();
>>>     view->GetInteractor()->Start();
>>>
>>>     return EXIT_SUCCESS;
>>> }
>>>
>>>
>>> _______________________________________________
>>> Powered by www.kitware.com
>>>
>>> Visit other Kitware open-source projects at
>>> http://www.kitware.com/opensource/opensource.html
>>>
>>> Search the list archives at:
>>> http://markmail.org/search/?q=vtk-developers
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/vtk-developers
>>>
>>
>>
>>
>> --
>> ___________________________________________
>> Andrew J. P. Maclean
>>
>> ___________________________________________
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20160726/e699f4e4/attachment-0001.html>


More information about the vtk-developers mailing list