[Paraview] Setting Min/Max for Data set

Sean Ziegeler seanzig at users.sourceforge.net
Tue Aug 28 17:45:31 EDT 2007


Well, in older versions of VTK, some filters didn't support grouped 
data.  Supposedly most of that's been fixed as of 5.0.2 or .3, I forget. 
  There may be a few filters left that won't work, but you can fix that 
by extracting one member of the group in PV.

I use a couple of readers (including vtkCSCSNetCDF and an ADCIRC reader) 
that use it.  They both do the following:

1. Include vtkMultiGroupDataInformation.h and vtkMultiGroupDataSet.h

2. Reader class derives from vtkMultiGroupDataSetAlgorithm

3. In RequestInformation, set up the number of groups, e.g.,:
    vtkMultiGroupDataInformation* groupInfo = 
vtkMultiGroupDataInformation::New();
    groupInfo->SetNumberOfGroups(2);   // Assuming you have 2 members
    outInfo->Set(vtkCompositeDataPipeline::COMPOSITE_DATA_INFORMATION(), 
groupInfo);
 
outInfo->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(), 
1);
    groupInfo->Delete();

4. In RequestData, do some set up as well.  Some of it is redundant, but 
I think it's still necessary:
    vtkInformation *outInfo = outputVector->GetInformationObject(0);
    vtkMultiGroupDataInformation *groupInfo = 
vtkMultiGroupDataInformation::SafeDownCast(
      outInfo->Get(vtkCompositeDataPipeline::COMPOSITE_DATA_INFORMATION()));
    vtkDataObject *doOutput = outInfo->Get(vtkDataObject::DATA_OBJECT());
    vtkMultiGroupDataSet *group = 
vtkMultiGroupDataSet::SafeDownCast(doOutput);
    group->SetMultiGroupDataInformation(groupInfo);
    group->SetNumberOfGroups(2);   // Same assumption as above

5. Later in RequestData, instead of setting data directly to output, set 
it to the group:
    group->SetDataSet(0, i, dataset);    // Group #0, dataset #i

All that seems to work fine in both readers.  At this point, you know as 
much as I do.  I think there's an example somewhere in VTK that also 
shows how to use it.

-Sean

Mike Jackson wrote:
> Is there anything special I should know about using a 
> vtkMultiGroupDataSet object? Any special Rendering things that I should 
> know about?
> 
> 
> On Aug 28, 2007, at 3:59 PM, Sean Ziegeler (Contractor) wrote:
> 
>> Well, if no one knows of any "global set bounds" functionality (I don't), there's one work-around you could use.  Your reader could create a multi-group data set.  Obviously one member of the group would be your current time-series data.  The other member could be a box or just 8 bounding points, or the convex-hull of all of your time-variant grids, or whatever makes the most sense for your data.  You might have to use points with no connectivity that way if you render as a surface, it won't occlude your actual data.  Anyway, you get the idea, create some static object in the group that forces the outer bounds to that size.
>>
>> Hope that's helpful,
>> Sean
>>
>> Mike Jackson wrote:
>>> I have a custom reader that I am developing. One of the issues I have is that I need to set the "boundaries" of the data set so that they will not change with each time step. I am generating an unstructured grid from my reader (which contains multiple data sets). The actual boundaries of the simulation is stored in the header of my file which I successfully read. I guess I am not sure what to do with this information now that I have it. The problem is that if I turn on the "Cube Axes" option, the animate through my file, the cube axes will grow as the limits of my simulation grow. How/what do I set in what object to fix these limits? Is this possible?
>>> Thanks for any and all help.
>>> -- 
>>> Mike Jackson
>>> imikejackson & gmail * com 



More information about the ParaView mailing list