| Attached Files | vtkGaussianSplatter-RequestInformation.patch.diff [^] (2,762 bytes) 2010-04-05 04:40 [Show Content] [Hide Content]diff -ur vtk-5.4.2~/Imaging/vtkGaussianSplatter.cxx vtk-5.4.2/Imaging/vtkGaussianSplatter.cxx
--- vtk-5.4.2~/Imaging/vtkGaussianSplatter.cxx 2008-01-15 06:26:18.000000000 +0900
+++ vtk-5.4.2/Imaging/vtkGaussianSplatter.cxx 2010-04-05 17:36:18.000000000 +0900
@@ -62,38 +62,15 @@
//----------------------------------------------------------------------------
int vtkGaussianSplatter::RequestInformation (
vtkInformation * vtkNotUsed(request),
- vtkInformationVector ** vtkNotUsed( inputVector ),
+ vtkInformationVector **inputVector,
vtkInformationVector *outputVector)
{
// get the info objects
vtkInformation* outInfo = outputVector->GetInformationObject(0);
-
- // use model bounds if set
- this->Origin[0] = 0;
- this->Origin[1] = 0;
- this->Origin[2] = 0;
- if ( this->ModelBounds[0] < this->ModelBounds[1] &&
- this->ModelBounds[2] < this->ModelBounds[3] &&
- this->ModelBounds[4] < this->ModelBounds[5] )
- {
- this->Origin[0] = this->ModelBounds[0];
- this->Origin[1] = this->ModelBounds[2];
- this->Origin[2] = this->ModelBounds[4];
- }
-
- outInfo->Set(vtkDataObject::ORIGIN(), this->Origin, 3);
-
- int i;
- for (i=0; i<3; i++)
- {
- this->Spacing[i] = (this->ModelBounds[2*i+1] - this->ModelBounds[2*i])
- / (this->SampleDimensions[i] - 1);
- if ( this->Spacing[i] <= 0.0 )
- {
- this->Spacing[i] = 1.0;
- }
- }
- outInfo->Set(vtkDataObject::SPACING(),this->Spacing,3);
+ vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
+ vtkDataSet *input = vtkDataSet::SafeDownCast(
+ inInfo->Get(vtkDataObject::DATA_OBJECT()));
+ ComputeModelBounds(input, NULL, outInfo);
outInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),
0, this->SampleDimensions[0] - 1,
@@ -162,7 +139,10 @@
this->Visited[i] = 0;
}
- output->SetDimensions(this->GetSampleDimensions());
+ if ( output != NULL )
+ {
+ output->SetDimensions(this->GetSampleDimensions());
+ }
this->ComputeModelBounds(input,output, outInfo);
// Set up function pointers to sample functions
@@ -320,7 +300,10 @@
this->ModelBounds[0],this->ModelBounds[2],
this->ModelBounds[4]);
memcpy(this->Origin,outInfo->Get(vtkDataObject::ORIGIN()), sizeof(double)*3);
- output->SetOrigin(this->Origin);
+ if ( output != NULL )
+ {
+ output->SetOrigin(this->Origin);
+ }
for (i=0; i<3; i++)
{
@@ -332,7 +315,10 @@
}
}
outInfo->Set(vtkDataObject::SPACING(),this->Spacing,3);
- output->SetSpacing(this->Spacing);
+ if ( output != NULL )
+ {
+ output->SetSpacing(this->Spacing);
+ }
// Determine the splat propagation distance...used later
for (i=0; i<3; i++)
|