WHOLE_EXTENT, ORIGIN, and SPACING together should be able to give you the bounding box.
Utkarsh On Wed, Nov 25, 2009 at 9:34 AM, Benjamin Schindler <[email protected]> wrote: > 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: [email protected] [mailto:[email protected]] >>> On Behalf Of Benjamin Schindler >>> Sent: 25 November 2009 10:08 >>> To: [email protected] >>> 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 >>> > > _______________________________________________ > 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 > _______________________________________________ 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
