[vtk-developers] Bug in vtkCompositeDataPipeline?

Berk Geveci berk.geveci at gmail.com
Thu May 25 16:55:35 EDT 2006


I am not sure I understand. You have a few datasets, you add these to a
multiblock dataset, you process this multiblock dataset with a filter. Is
that right?

On 5/25/06, Bill McGrory <mcgrory at aerosft.com> wrote:
>
> I've been trying to get a
> vtkMultiBlockDataSet to work properly with vtkStructuredGrid's which are
> output from a vtkStructuredGridSource
>
> >From what I can tell, it appears that the the  vtkCompositeDataPipeline
> is unaware of child vtkDataObject->Source, so none of the data ever gets
> loaded.
>
> I have constructed a work-around which appears (superficially at least)
> to work for my particular case, which is basically, if a Source exists
> for the original vtkDataObject in the *ForBlock() routines, call the
> relevant Update's before performing the ShallowCopy
>
> patch is as follows
>
> Index: vtkCompositeDataPipeline.cxx
> ===================================================================
> RCS file: /cvsroot/VTK/VTK/Filtering/vtkCompositeDataPipeline.cxx,v
> retrieving revision 1.34
> diff -u -r1.34 vtkCompositeDataPipeline.cxx
> --- vtkCompositeDataPipeline.cxx        7 Dec 2005 16:21:29 -0000
> 1.34
> +++ vtkCompositeDataPipeline.cxx        25 May 2006 19:48:48 -0000
> @@ -35,6 +35,8 @@
> #include "vtkStructuredGrid.h"
> #include "vtkUniformGrid.h"
>
> +#include "vtkSource.h"
> +
> vtkCxxRevisionMacro(vtkCompositeDataPipeline, "$Revision: 1.34 $");
> vtkStandardNewMacro(vtkCompositeDataPipeline);
>
> @@ -46,6 +48,28 @@
>
> vtkInformationKeyMacro(vtkCompositeDataPipeline,INPUT_REQUIRED_COMPOSITE_DATA_TYPE,
> String);
> vtkInformationKeyMacro(vtkCompositeDataPipeline,UPDATE_BLOCKS,
> ObjectBase);
>
> +class vtkCompositeDataPipelineToDataObjectFriendship
> +{
> +public:
> +  static void UpdateDataObject(vtkDataObject* obj)
> +    {
> +               if(obj->Source)
> +               {
> +                       obj->Source->Update();
> +               }
> +
> +    }
> +
> +  static void UpdateInformation(vtkDataObject* obj)
> +    {
> +               if(obj->Source)
> +               {
> +                       obj->Source->UpdateInformation();
> +               }
> +
> +    }
> +};
> +
>
> //----------------------------------------------------------------------------
> vtkCompositeDataPipeline::vtkCompositeDataPipeline()
> {
> @@ -490,6 +514,7 @@
>          info->Get(vtkDataObject::DATA_OBJECT());
>        if (dobj && dobjCopy)
>          {
> +
> vtkCompositeDataPipelineToDataObjectFriendship::UpdateInformation(dobj);
>          dobjCopy->ShallowCopy(dobj);
>          dobjCopy->CopyInformation(dobj);
>          }
> @@ -1089,6 +1114,7 @@
>
>          if (dobj && dobjCopy)
>            {
> +
> vtkCompositeDataPipelineToDataObjectFriendship::UpdateDataObject(dobj);
>            dobjCopy->ShallowCopy(dobj);
>            }
>          }
>
>
> Is this really a bug, and is this an appropriate fix?
> Or am I doing something wrong up the pipeline, such that I shouldn't
> need to do this?
>
> Regards
> Bill
> --
> Dr. William D. McGrory    AeroSoft, Inc.
> mcgrory at aerosft.com       Suite 1275
> (540) 557-1904            1872 Pratt Drive
> (540) 557-1919 (FAX)      Blacksburg, VA 24060
>
> _______________________________________________
> vtk-developers mailing list
> vtk-developers at vtk.org
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20060525/f4454235/attachment.html>


More information about the vtk-developers mailing list