[Paraview-developers] ParaView and rendering composite datasets

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Tue Sep 21 13:34:15 EDT 2010


Paul,
The output of vtkPVGeometryFilter is either a vtkPolyData or a
multi-block of vtkPolyData's. Something as following will work, just
ensure that your filter overrides
vtkAlgorithm::CreateDefaultExecutive() to return a
vtkCompositeDataPipeline instance.

int vtkMyGeometryFilter::RequestData(vtkInformation* request,
                                     vtkInformationVector** inputVector,
                                     vtkInformationVector* outputVector)
{
  if (!this->Superclass::RequestData(request, inputVector, outputVector))
    {
    return 0;
    }

  vtkDataObject *output = vtkPolyData::GetData(outputVector, 0);
  vtkDataObject* clone = output->NewInstance();
  clone->ShallowCopy(output);

  // now pass the clone through a filter

  vtkMyFilter* filter = vtkMyFilter::New();
  filter->SetInput(clone)
  filter->Update
  output->ShallowCopy(filter->GetOutputDataObject(0));
  filter->Delete();
  clone->Delete();

  return 1;
}

On Tue, Sep 21, 2010 at 1:09 PM, Paul Edwards <paul.m.edwards at gmail.com> wrote:
> Utkarsh,
> I've only just updated and noticed that some of my custom representations
> are not working now.  I have been subclassing vtkPVGeometryFilter and
> implementing RequestData as follows:
> 8<---------------------------------------------------------------------
> int vtkMyGeometryFilter::RequestData(vtkInformation* request,
>                                      vtkInformationVector** inputVector,
>                                      vtkInformationVector* outputVector)
> {
>   if (!this->Superclass::RequestData(request, inputVector, outputVector))
>     {
>     return 0;
>     }
>   vtkPolyData *output = vtkPolyData::GetData(outputVector, 0);
>
>   vtkPolyData* clone = vtkPolyData::New();
>   clone->ShallowCopy(output);
>   // now pass the clone through a filter
>   vtkMyFilter* filter = vtkMyFilter::New();
>   filter->SetInput(clone)
>   filter->Update
>   output->ShallowCopy(filter->GetOutputDataObject(0));
>   filter->Delete();
>   clone->Delete();
>   return 1;
> }
> --------------------------------------------------------------------->8
> This now fails as output is not necessarily polydata.  What's the best
> solution here?
> Thanks,
> Paul
>
> On 31 August 2010 21:57, Utkarsh Ayachit <utkarsh.ayachit at kitware.com>
> wrote:
>>
>> Folks,
>>
>> Since the introduction of composite datasets into ParaView, there was
>> one oddity when it came to rendering: we appended all the blocks into
>> a single polydata and then rendered it. It had several advantages -
>> esp. since it kept the rendering code simple esp when dealing with
>> delivery and M-to-N data movement when render server was involved and
>> with surface selection. However, it was a major bottleneck as well
>> when dealing with really large number of blocks. The appending of data
>> was slow which resulted in delays.
>>
>> I've just pushed a change that resolves this issue
>> (http://paraview.org/Bug/view.php?id=11133). We no longer append
>> blocks together before rendering. Most of the issues like
>> data-delivery, selection etc. have been addressed. But if you notice
>> any other quirks, please feel free to raise them so that we can
>> address them as soon as possible.
>>
>> Utkarsh
>> _______________________________________________
>> Paraview-developers mailing list
>> Paraview-developers at paraview.org
>> http://public.kitware.com/mailman/listinfo/paraview-developers
>
>


More information about the Paraview-developers mailing list