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

Gerrick Bivins gbivins4 at gmail.com
Sun Jun 8 00:53:57 EDT 2008


No prob! I'm actually a newbie myself so I'm still learning! Anyway, the
example code below is just pseudo code, just to outline what you could do in
a vtk program.
So you'd have to convert the below snippet to the appropriate code for your
particular flavor of vtk (c++,python,tcl,java etc).

Are you using paraview to read in and visualize your dataset? If so, you can
just add the multiblock part  your program and write it out as a multiblock
file. Then,
use the Extract block filter in the paraview filters menu. It will display
the available blocks in the file you created and allow you select which
block to view via check boxes.



On Fri, Jun 6, 2008 at 5:26 PM, Ultra Cool <silverskater2k at yahoo.com> wrote:

> Yep. Thats more like what I am looking for. Thanks. I am kind of a newbie
> with Paraview.... so these little scripts i set as a "Programmable Filter"?
>
> ----- Original Message ----
> From: gbiv <gbivins4 at gmail.com>
> To: vtkusers at vtk.org
> Sent: Friday, June 6, 2008 2:21:15 PM
> Subject: Re: [vtkusers] Having 2 zones in 1 vtu file or combining 2 pieces
> of an unstructured grid
>
>
> 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.
>
> _______________________________________________
> 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
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080607/bcb3d5eb/attachment.htm>


More information about the vtkusers mailing list