[vtkusers] Having 2 zones in 1 vtu file or combining 2 pieces of an unstructured grid

gbiv gbivins4 at gmail.com
Fri Jun 6 15:21:15 EDT 2008


If you create a vtkMultiBlock dataset, you can use the vtkExtractBlock to
switch between which of the datasets to process....
//setup
multiblockDataset = new vtkMultiblockDataset()
multiblockDataset.setBlock( 0, volumeData )
multiblockDataset.setBlock(1, surfaceData )
blockExtractor.setInput( multiblockDataset )
//Use blockExtractor.getOutput() to get the vtkDataObject for whatever
filters you want
...
//When switching, just change the index in the block extractor
void updateView( boolean showVolume )
{
   blockExtractor.removeAllIndecies()
   if( showVolume )
      blockExtractor.addIndex( 0 )
   else
      blockExtractor.addIndex( 1 )
   
}

I'm using something like that. Might be overkill for you because you only
have two sub datasets, but works great for me because I have a more complex
hierarchy of data.


ultracool wrote:
> 
> That's just the same as writing the VTU file with the 2 pieces inside
> (which i have already done). Its not letting me separately control the
> visibility of each piece/grid. What I am looking for is 1 file with the 2
> pieces and the option of visibility on each one so I can toggle
> surface/volume zones. Thanks for the tip thou, that could help on group
> some other datasets I need, didnt see that filter in the menu...
> 
> 
> 
> Berk Geveci-2 wrote:
>> 
>> You need a vtm of 2 vtu files. The easiest way to get an example is
>> the following:
>> 
>> * Load these two files separately
>> * Group them in ParaView
>> * Save out as vtm
>> 
>> -berk
>> 
>> On Thu, Jun 5, 2008 at 10:58 AM, ultracool <davpersan at gmail.com> wrote:
>>>
>>> I am currently working on some dat files in tecplot and I'm trying to
>>> make
>>> vtu files that would have for example: a surface zone and a volume zone.
>>> Right now i have those but in 2 separate vtu files. I tried making one
>>> vtu
>>> file with 2 "pieces" but it doesn't give me the option to separate
>>> visibility on each one (maybe a programmable python filter?) although it
>>> does show both zones. I could go for vtk or vts format too as long as I
>>> can
>>> have both in the same file but separately toggle visibilitym but i would
>>> prefer vtu as all my programming tools are based on that format. I
>>> wonder if
>>> you guys could help me with what are my options here and how will I be
>>> able
>>> to perform them. I am using Paraview 3.2 for viewing the vtu's.
>>>
>>> Thanks in advance,
>>> David
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Having-2-zones-in-1-vtu-file-or-combining-2-pieces-of-an-unstructured-grid-tp17671893p17671893.html
>>> Sent from the VTK - Users mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> This is the private VTK discussion list.
>>> Please keep messages on-topic. Check the FAQ at:
>>> http://www.vtk.org/Wiki/VTK_FAQ
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.vtk.org/mailman/listinfo/vtkusers
>>>
>> _______________________________________________
>> This is the private VTK discussion list.
>> Please keep messages on-topic. Check the FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Having-2-zones-in-1-vtu-file-or-combining-2-pieces-of-an-unstructured-grid-tp17671893p17699469.html
Sent from the VTK - Users mailing list archive at Nabble.com.




More information about the vtkusers mailing list