<div class="gmail_extra"><div class="gmail_quote"><div class="gmail_extra">Hi Stefan,</div><div class="gmail_extra"><br></div><div class="gmail_extra">VTK clamps linewidth to values 0 -> VTK_LARGE_FLOAT (ie 1 x 10^38) ... that's not your limitation.</div>
<div class="gmail_extra">
<br></div><div class="gmail_extra">OpenGL clamps linewidth to value 1 -> implementation max, ie, depends on your video card and driver.</div><div class="gmail_extra"><br></div><div class="gmail_extra">cf:
<a href="http://www.opengl.org/sdk/docs/man/xhtml/glLineWidth.xml" target="_blank">http://www.opengl.org/sdk/docs/man/xhtml/glLineWidth.xml</a></div><div class="gmail_extra"><br></div><div class="gmail_extra">So, I guess 20 is your implementation max.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">If you want to keep a 2d element, try using a vtkPolygon. Otherwise go with vtkTubeFilter as Jothy suggested.</div><div class="gmail_extra"><br></div><div class="gmail_extra">
hth</div><span class="HOEnZb"><font color="#888888"><div class="gmail_extra"><br></div></font></span><div class="gmail_extra"><span class="HOEnZb"><font color="#888888">Goodwin</font></span><div><div class="h5"><br><br><div class="gmail_quote">
2012/4/26 Stefan Köhnen <span dir="ltr"><<a href="mailto:stefan.khnen@googlemail.com" target="_blank">stefan.khnen@googlemail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks, that is exactly what we need. Especially this part "This is<br>
helpful because when you zoom the camera, the thickness of a line<br>
remains constant, while the thickness of a tube varies."<br>
<br>
I will look into it. Thanks for your reply Jothy.<br>
<br>
But just to clarify, there is a limit for the width of a vtkPolyLine?<br>
<br>
Greetings,<br>
<br>
Stefan<br>
<br>
<br>
2012/4/26 Jothybasu Selvaraj <<a href="mailto:jothybasu@gmail.com" target="_blank">jothybasu@gmail.com</a>>:<br>
<div><div>> If you want such a thick line, why don't you use vtkTubeFilter?<br>
><br>
> Jothy<br>
><br>
> On Thu, Apr 26, 2012 at 1:11 PM, Stefan Köhnen <<a href="mailto:stefan.khnen@googlemail.com" target="_blank">stefan.khnen@googlemail.com</a>><br>
> wrote:<br>
>><br>
>> Hello,<br>
>><br>
>> I have a problem while trying to increase the width of a vtkPolyLine.<br>
>> No matter what I try, the width never seems to become bigger for<br>
>> values above 20.<br>
>><br>
>> For values below 20, the method SetLineWidth works as expected.<br>
>><br>
>> My question is if there is a limitation that prevents me to increase<br>
>> the width further or is there an error in my implementation.<br>
>><br>
>> To explain my problem better I modified the PolyLine-Example.<br>
>> I added SetLineWidth for the vtkProperty of the vtkActor.<br>
>><br>
>><br>
>> Greetings,<br>
>><br>
>> Stefan Köhnen<br>
>><br>
>> Here is the code:<br>
>><br>
>> #include <vtkVersion.h><br>
>> #include <vtkSmartPointer.h><br>
>> #include <vtkCellArray.h><br>
>> #include <vtkCellData.h><br>
>> #include <vtkDoubleArray.h><br>
>> #include <vtkPoints.h><br>
>> #include <vtkPolyLine.h><br>
>> #include <vtkPolyData.h><br>
>> #include <vtkPolyDataMapper.h><br>
>> #include <vtkActor.h><br>
>> #include <vtkRenderWindow.h><br>
>> #include <vtkRenderer.h><br>
>> #include <vtkRenderWindowInteractor.h><br>
>> #include <vtkProperty.h><br>
>><br>
>> int main(int, char *[])<br>
>> {<br>
>> // Create five points.<br>
>> double origin[3] = {0.0, 0.0, 0.0};<br>
>> double p0[3] = {1.0, 0.0, 0.0};<br>
>> double p1[3] = {0.0, 1.0, 0.0};<br>
>> double p2[3] = {0.0, 1.0, 2.0};<br>
>> double p3[3] = {1.0, 2.0, 3.0};<br>
>><br>
>> // Create a vtkPoints object and store the points in it<br>
>> vtkSmartPointer<vtkPoints> points =<br>
>> vtkSmartPointer<vtkPoints>::New();<br>
>> points->InsertNextPoint(origin);<br>
>> points->InsertNextPoint(p0);<br>
>> points->InsertNextPoint(p1);<br>
>> points->InsertNextPoint(p2);<br>
>> points->InsertNextPoint(p3);<br>
>><br>
>> vtkSmartPointer<vtkPolyLine> polyLine =<br>
>> vtkSmartPointer<vtkPolyLine>::New();<br>
>> polyLine->GetPointIds()->SetNumberOfIds(5);<br>
>> for(unsigned int i = 0; i < 5; i++)<br>
>> {<br>
>> polyLine->GetPointIds()->SetId(i,i);<br>
>> }<br>
>><br>
>> // Create a cell array to store the lines in and add the lines to it<br>
>> vtkSmartPointer<vtkCellArray> cells =<br>
>> vtkSmartPointer<vtkCellArray>::New();<br>
>> cells->InsertNextCell(polyLine);<br>
>><br>
>> // Create a polydata to store everything in<br>
>> vtkSmartPointer<vtkPolyData> polyData =<br>
>> vtkSmartPointer<vtkPolyData>::New();<br>
>><br>
>> // Add the points to the dataset<br>
>> polyData->SetPoints(points);<br>
>><br>
>> // Add the lines to the dataset<br>
>> polyData->SetLines(cells);<br>
>><br>
>> // Setup actor and mapper<br>
>> vtkSmartPointer<vtkPolyDataMapper> mapper =<br>
>> vtkSmartPointer<vtkPolyDataMapper>::New();<br>
>> #if VTK_MAJOR_VERSION <= 5<br>
>> mapper->SetInput(polyData);<br>
>> #else<br>
>> mapper->SetInputData(polyData);<br>
>> #endif<br>
>><br>
>> vtkSmartPointer<vtkActor> actor =<br>
>> vtkSmartPointer<vtkActor>::New();<br>
>> actor->SetMapper(mapper);<br>
>><br>
>><br>
>> ////////////////////////////////////////////////////////////////////////////<br>
>> // Here is the explained change - Set width of line<br>
>> actor->GetProperty()->SetLineWidth(30.0f);<br>
>><br>
>> ////////////////////////////////////////////////////////////////////////////<br>
>><br>
>><br>
>> // Setup render window, renderer, and interactor<br>
>> vtkSmartPointer<vtkRenderer> renderer =<br>
>> vtkSmartPointer<vtkRenderer>::New();<br>
>> vtkSmartPointer<vtkRenderWindow> renderWindow =<br>
>> vtkSmartPointer<vtkRenderWindow>::New();<br>
>> renderWindow->AddRenderer(renderer);<br>
>> vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =<br>
>> vtkSmartPointer<vtkRenderWindowInteractor>::New();<br>
>> renderWindowInteractor->SetRenderWindow(renderWindow);<br>
>> renderer->AddActor(actor);<br>
>><br>
>> renderWindow->Render();<br>
>> renderWindowInteractor->Start();<br>
>><br>
>> return EXIT_SUCCESS;<br>
>> }<br>
>> _______________________________________________<br>
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Please keep messages on-topic and check the VTK FAQ at:<br>
>> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
><br>
><br>
> --<br>
> Jothy<br>
><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div></div></div>
</div><br></div>