[Paraview] Connecting glyph filter with data

Reuter, Michael A. reuterma at ornl.gov
Wed Jan 2 16:58:52 EST 2013


Hi Utkarsh,

	I love one line changes. Works like a charm.

Thanks,
M


On 1/2/13 3:09 PM, "Utkarsh Ayachit" <utkarsh.ayachit at kitware.com> wrote:

>Michael,
>
>In vtkPeaksReader::RequestData, instead of
>"glyphFilter->SetSourceData(sphere->GetOutput())", do
>
>EITHER
>   glyphFilter->SetSourceConnection(sphere->GetOutputPort())
>OR
>  sphere->Update()
>  glyphFilter->SetSourceData(sphere->GetOutput())
>
>Unlike the old SetInput()/SetSource() methods,
>SetInputData()/SetSourceData() don't set the pipeline connections
>between the produces and consumers. So when you called
>SetSourceData(sphere->GetOutput()), the current state of the output of
>vtkSphereSource was passed on to the glyph filter. Since the
>SphereSource hadn't executed yet, it was empty. So we can fix the
>problem by either setting up a true pipeline connection (using
>SetSourceConnection) or by ensuring that the SphereSource has produced
>valid data by calling sphere->Update()
>
>Utkarsh
>
>
>On Wed, Jan 2, 2013 at 10:50 AM, Michael Reuter <reuterma at ornl.gov> wrote:
>> Hi,
>>
>>     I have a plugin which I'm trying to get working in ParaView 3.98.
>>The
>> source code for the plugin can be found here:
>> 
>>http://github.com/mantidproject/mantid/blob/6315_build_pv_398/Code/Mantid
>>/Vates/ParaviewPlugins/ParaViewReaders/PeaksReader/vtkPeaksReader.cxx.
>> After fixing function calls on the vtkPVGlyphFilter to get it to compile
>> (lines 96 and 97), the plugin crashes at the vtkGlyphFilter::Update()
>>call
>> on vtkPoints::GetNumberOfPoints(). I checked the structuredMesh (it's
>> actually a vtkUnstructuredGrid) object used in the
>> vtkGlyphFilter::SetInputData() call and found that it does contain data
>> points (40 for the particular file I'm looking at).
>>     I did some digging about the vtkGlyphFilter::SetInputData() and
>>found
>> that it no longer sets up a pipeline connection. I think this might be
>>the
>> cause of the glyph filter not finding any data, but I'm unsure.
>>However, I'm
>> having trouble figuring out how to use
>>vtkGlyphFilter::SetInputConnection()
>> and the structuredMesh object. Is there anyway to make this work using
>>the
>> structuredMesh object or is the best thing to make another plugin to
>>create
>> the structuredMesh and then do
>> vtkGlyphFilter::SetInputConnection(newPlugin->GetOutputPort()) and
>>remove
>> the vtkGlyphFilter::SetInputData() call?
>>
>> Thanks,
>> M
>>
>> --
>> Dr. Michael Reuter
>> Data Analaysis and Visualization Group
>> Neutron Data Analysis and Visualization Division
>> Oak Ridge National Laboratory
>>
>> Office: 1-865-241-7216
>> Fax: 1-865-574-6080
>> Email: reuterma at ornl.gov
>>
>>
>> _______________________________________________
>> 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 ParaView Wiki at:
>> http://paraview.org/Wiki/ParaView
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.paraview.org/mailman/listinfo/paraview
>>



More information about the ParaView mailing list