[Paraview] vtkUniformGrid

Benjamin Schindler bschindler at inf.ethz.ch
Wed Nov 25 09:34:13 EST 2009


Hi John

To compute this information, I need the whole bounding box of the
incoming object. I assume it's not saved in WHOLE_EXTENT as it seems
integer based. Which key stores that info so I can output it in my reader?

Thanks - I tried these keys in the request_data function and it did have
some effect (I obviously need to do it earlier...)
Benjamin

Biddiscombe, John A. wrote:
> Benjamin
>
> make sure your request information looks a bit like this
>
> //----------------------------------------------------------------------------
> int vtkRegularGridSource::RequestInformation(
>   vtkInformation* request,
>   vtkInformationVector** inputVector,
>   vtkInformationVector* outputVector)
> {
>   this->ComputeInformation(request, inputVector, outputVector);
>   //
>   vtkInformation* outInfo = outputVector->GetInformationObject(0);
>   outInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), 
>     0, this->Dimension[0]-1, 
>     0, this->Dimension[1]-1, 
>     0, this->Dimension[2]-1 );
>   // Make sure these are correctly set
>   outInfo->Set(vtkDataObject::ORIGIN(), this->origin, 3);
>   outInfo->Set(vtkDataObject::SPACING(), this->spacing, 3);
>   return 1;
> }
> //----------------------------------------------------------------------------
>
>
>   
>> -----Original Message-----
>> From: paraview-bounces at paraview.org [mailto:paraview-bounces at paraview.org]
>> On Behalf Of Benjamin Schindler
>> Sent: 25 November 2009 10:08
>> To: paraview at paraview.org
>> Subject: [Paraview] vtkUniformGrid
>>
>> Hi
>>
>> I'm writing a filter which creates a vtkUniformGrid as its output. The
>> grid is setup is done using the following code:
>>
>>     vtkUniformGrid *grid =
>> vtkUnformGrid::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT));
>>     grid->Initialize();
>>     grid->SetOrigin(origin.data());
>>     grid->SetDimensions(bins.data());
>>     grid->GetDimensions(); // Call this so the dimensions array is set -
>> stupid VTK
>>     grid->SetNumberOfScalarComponents(3);
>>     grid->SetScalarTypeToDouble();
>>     grid->SetSpacing(spacing.data());
>>     grid->AllocateScalars();
>>
>> I checked that spacing, origin and bins are set correctly.
>>
>> Yet, when I run this filter (without setting any data, that data will
>> therefore be noise), I get an output in paraview without Extent, without
>> an Origin and without a bounding box, 0 cells etc.
>>
>> What am I doing wrong here?
>>
>> _______________________________________________
>> 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