[vtkusers] vtkTransformDataSet

David Gobbi david.gobbi at gmail.com
Mon Jan 18 14:27:12 EST 2010


As long as people use GetOutputPort() instead of GetOutput() things
will work fine, but you're right that the return type of GetOutput()
is a problem.  A work-around is for TransformPolyDataFilter to
piggy-back on TransformFilter's RequestData method without actually
being a subclass.  This would be possible if the body of
TransformFilter's RequestData method was put into a static method that
TransformPolyData filter could call.

  David


On Mon, Jan 18, 2010 at 11:50 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> Interesting. I guess since it only operates on Points the
> transformation code is the same. It must still output PolyData
> however. I'm not familiar with the new pipeline, but I assume it will
> be OK?
>
> Bill
>
> On Mon, Jan 18, 2010 at 12:54 PM, David Gobbi <david.gobbi at gmail.com> wrote:
>> I was curious so I did a quick diff between them.  IMHO there is no
>> longer any reason for TransformPolyDataFilter to be anything but an
>> alias to TransformFilter.  The only differences are:
>>
>> TransformFilter does this:
>>
>>  output->CopyStructure(input);
>>
>> while TransformPolyDataFilter does this:
>>
>>  output->SetVerts(input->GetVerts());
>>  output->SetLines(input->GetLines());
>>  output->SetPolys(input->GetPolys());
>>  output->SetStrips(input->GetStrips());
>>
>> Also, oddly, TransformFilter does some copying of FieldData that
>> TransformPolyDataFilter doesn't do... so maybe TransformFilter is
>> duplicating some work that the pipeline does automatically?
>>
>>   David
>>
>>
>> On Mon, Jan 18, 2010 at 10:31 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
>>> I believe TransformPolyDataFilter is optimized for polydata(as is
>>> stated in the header). Looking at the source is a good exercise.
>>>
>>> Bill
>>>
>>> On Mon, Jan 18, 2010 at 12:20 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
>>>> On Mon, Jan 18, 2010 at 12:16 PM, David Gobbi <david.gobbi at gmail.com> wrote:
>>>>> On Mon, Jan 18, 2010 at 10:03 AM, David Doria <daviddoria+vtk at gmail.com> wrote:
>>>>>> There is a vtkTransformPolyDataFilter, but what about
>>>>>> vtkTransformStructuredGridFilter and
>>>>>> vtkTransformUnstructuredGridFilter? Couldn't these all be accomplished
>>>>>> with a vtkTransformDataSet filter?
>>>>>>
>>>>>> How would you currently transform an unstructured grid?
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> David
>>>>>
>>>>> The vtkTransformFilter is supposed to do those things, it works on all
>>>>> vtkPointSet derived data object, which includes all the ones you
>>>>> mentioned.  A generic vtkTransformDataSetFilter isn't possible because
>>>>> for some data sets (i.e. vtkImageData) the points in the data are
>>>>> implicit and must stay aligned with the x, y, and z axes.
>>>>>
>>>>>   David
>>>>>
>>>>
>>>> I see. So why is there a vtkTransformPolyDataFilter if you can
>>>> transform a PolyData with vtkTransformFilter?
>>>>
>>>> Thanks,
>>>>
>>>> David
>>>> _______________________________________________
>>>> 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
>>>>
>>> _______________________________________________
>>> 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
>>>
>>
>



More information about the vtkusers mailing list