[vtkusers] how to attach multi-attributes to the same dataset?

Alex Malyushytskyy alexmalvtk at gmail.com
Mon Jul 16 19:09:21 EDT 2012


I have no experience with python,
but normally y SetActiveScalars is a function you are looking for normally.
and it should be called for dataset.

For  regular dataset it would probably look like :
sgrid.GetPointData().SetActiveScalars("ScalarNameYouWantToMakeActive")

You will have to test it yourself with multiblock dataset yourself though


Regards,
      Alex



On Mon, Jul 16, 2012 at 1:53 AM, April.Q <qinjiameilf at 163.com> wrote:
> Thanks David E DeMarle, it works.
> Now i get many StructuredGrids , all of them has two attributes scalar_1 and
> scalar_2.
> Then i use these StructuredGrids build a vtkMultiBlockDataset.
> I want to render these vtkMultiBlockDataset and find one topic about it ,and
> see your advice .
> How to tell the filter to operate on a specific array(eg. only render a
> slice of scalar_2)??Tell which filter ??
>
> I use python ,and i do like this:
>
>      pipeline = vtk.vtkCompositeDataPipeline()
>      algorithm = vtk.vtkAlgorithm()
>      algorithm.SetDefaultExecutivePrototype(pipeline)
>
>      compositeFilter = vtk.vtkCompositeDataGeometryFilter()
>      compositeFilter.SetInput(MyMultiBlockDataset)
>      compositeFilter.Update()
>
>      colors = vtk.vtkImageMapToColors()
>      colors.SetInputConnection(compositeFilter.GetOutputPort())
>      colors.SetLookupTable(MyLookupTable)
>      colors.Update()
>
>      imageReslice = vtk.vtkImageReslice()
>      imageReslice.SetInput(colors.GetOutput())
>
>      sliceMapper = vtk.vtkImageMapper()
>      sliceMapper.SetInputConnection(imageReslice.GetOutputPort())
>
>      sliceActor = vtk.vtkActor()
>      sliceActor.SetMapper(sliceMapper)
> #ValueError: method requires a vtkMapper, a
> #  vtkOpenGLImageMapper was provided.
>
>      renderer...
>      renWin...
>      iren...
>       ... ...
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/how-to-attach-multi-attributes-to-the-same-dataset-tp5714692p5714714.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> 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 VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list