[vtkusers] give direction to cylinder

Gonzalo Amadio gonzaloamadio at gmail.com
Wed Jul 18 07:14:04 EDT 2012


Thank you for the response..

I am reading this : http://www.vtk.org/doc/release/5.6/html/a02007.html that
I think is what I need. Because I don't have all the mapper and actor part
and as it is said there, if I am not understanding wrong, vtkTransfrom work
on the actor and rendering part, and vtkTransformPolyDataFilter directly on
the rotation of the figure itself :

" The difference between the two methods is that vtkActor's transformation
> simply effects where objects are rendered (via the graphics pipeline),
> whereasvtkTransformPolyDataFilter<http://www.vtk.org/doc/release/5.6/html/a02007.html> actually
> modifies point coordinates in the visualization pipeline"


A piece of my code to make it clear :

mitk::DataNode::Pointer resNode = mynode;
>


 // Create a cylinder
> vtkSmartPointer<vtkCylinderSource> cylinderSource =
> vtkSmartPointer<vtkCylinderSource>::New();
> cylinderSource->SetCenter(cen[0], cen[1], cen[2]);
> cylinderSource->SetRadius(5.0);
> cylinderSource->SetHeight(200.0);
> cylinderSource->SetResolution(100);
>

> //Rotation of the cylinder here , I need a polydata as an output

// i.e the cylinder rotated



mitk::Surface::Pointer surface = mitk::Surface::New();
> surface->SetVtkPolyData(cylinder);
> resNode->SetData(surface);
>


mitk::DataStorage::Pointer dsp = myDataStorage;
> dsp->Add(resNode);


Am I right?


Thank you!



2012/7/17 Bill Lorensen <bill.lorensen at gmail.com>

> You must apply TransformPolyData.
>
> See:  http://vtk.org/Wiki/VTK/Examples/Cxx/PolyData/TransformPipeline
>
> On Tue, Jul 17, 2012 at 3:11 PM, Gonzalo Amadio <gonzaloamadio at gmail.com>wrote:
>
>> Can I give a cylinder a specific direction?
>>
>> http://www.vtk.org/doc/nightly/html/classvtkCylinderSource.html
>>
>> I looked in there, but I can sete radius, height, center, but not
>> direction.
>>
>> Thank you!
>>
>> --
>> --------
>> Gonzalo Amadio
>>
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>>
>
>
> --
> Unpaid intern in BillsBasement at noware dot com
>
>


-- 
--------
Gonzalo Amadio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120718/9dd7de39/attachment.htm>


More information about the vtkusers mailing list