[vtk-developers] Re: Understanding vtkMultiGroupDataGroupFilter
Bill McGrory
mcgrory at aerosft.com
Fri Jun 2 13:34:39 EDT 2006
Hi Berk,
I've created a pipeline that is my
multiple vtkStructuredGridSource's feeding into a
vtkMultiGroupDataGroupFilter.
that feeds into a vtkStreamTracer, and is mapped.
So, this is a composite aware pipeline.
First time I render, everything works great.
Now, if In my event loop, I remove one of the vtkStructuredGridSource's,
and re-issue a render, I have problems with the updateextents.
the problem is this.
when it goes to copy the CopyDefaultInformation in the at the
vtkStreamingDemandDrivenPipeline level on the associated
vtkMultiGroupDataGroupFilter, the output port has a vtkStructuredGrid
attached to outInfo->Get(vtkDataObject::DATA_OBJECT())
But that's not the real output object for this filter. really it's the
COMPOSITE_DATA_SET, so when it goes to pass extents, it tries to pass
the extent request of the structuredgrid that's in the DATA_OBJECT. Now,
that works for the first grid (since the extents are the same), but it
tries to copy the extent request of all the input vtkStructuredGrid's to
the single DATA_OBJECT. and I get extent out of range errors, and the
update fails.
To get around this, I applied the following patch to
vtkStreamingDemandDrivenPipeline.cxx
#include "vtkDataSet.h"
+#include "vtkCompositeDataSet.h"
#include "vtkExtentTranslator.h"
#include "vtkInformation.h"
#include "vtkInformationDoubleKey.h"
@@ -374,7 +375,16 @@
// there is output information with a data object.
vtkInformation* outInfo =
outInfoVec->GetInformationObject((outputPort >= 0)?
outputPort : 0);
- vtkDataObject* outData =
outInfo->Get(vtkDataObject::DATA_OBJECT());
+
+ vtkDataObject* outData = NULL;
+
+ if(outInfo->Has(vtkCompositeDataSet::COMPOSITE_DATA_SET())) {
+ outData = outInfo->Get(vtkCompositeDataSet::COMPOSITE_DATA_SET());
+ printf("Output Has Composite DataSet, here\n");
+ } else {
+ outData = outInfo->Get(vtkDataObject::DATA_OBJECT());
+ }
+
// Loop over all input ports.
for(int i=0; i < this->Algorithm->GetNumberOfInputPorts(); ++i)
@@ -972,7 +982,17 @@
modified |= this->SetUpdatePiece(info, piece);
modified |= this->SetUpdateNumberOfPieces(info, numPieces);
modified |= this->SetUpdateGhostLevel(info, ghostLevel);
- if(vtkDataObject* data = info->Get(vtkDataObject::DATA_OBJECT()))
+
+ vtkDataObject* data;
+
+ if(info->Has(vtkCompositeDataSet::COMPOSITE_DATA_SET())) {
+ data = info->Get(vtkCompositeDataSet::COMPOSITE_DATA_SET());
+ printf("Has Composite DataSet, here\n");
+ } else {
+ data = info->Get(vtkDataObject::DATA_OBJECT());
+ }
+
+ if(data)
Note that one of these checks, is for the vtkStreamTracer Algorithm and
prevents the wrong extent request from being passed along it. (so this
issue of a port using a DATA_SET instead of a COMPOSITE_DATA_SET is
actually an issue with the vtkStreamTracer as well, but that is not a
catastrophic passing issue.
I think I need to add extra logic to handle the vtkCompositePipeline
InSubPass case, because I believe in this case, I may want to look at
the data_object, and not the composite_data_object. for passing extents,
but I have other issues with my composite pipeline with simple
algorihtms in between.
I'll tackle that with another post.
--
Bill McGrory
More information about the vtk-developers
mailing list