[vtkusers] SetActiveVectors when there are many pipelines that use different arrays

Dan Lipsa dan.lipsa at kitware.com
Wed Oct 26 09:40:36 EDT 2016


Fernando,
Can you try vtkPassArray to pass the proper vector array to each of your
pipelines? Then you can set the active vector on the output of this
algorithm.

Dan


On Wed, Oct 26, 2016 at 6:23 AM, Fernando Nellmeldin <
f.nellmeldin at open-engineering.com> wrote:

> Hello.
> I would like to show the deformed mesh of a model based on the values of a
> point data array of dimension 3 (vectorial data).
>
> I have the following pipeline:
> UnstructuredGrid1 -> WarpVector -> GeometryFilter -> ExtractEdges ->
> PolyDataMapper -> Actor
> In the WarpVector, I call to say which array to use
> WarpVector->SetInputArrayToProcess(0,0,0, FIELD_ASSOCIATION_POINTS,"
> nameOfArray");
>
> The first time I load the actor in screen, everything is OK.
>
> Later, I would like to mirror the input UnstructuredGrid1 because it
> represents half the model. So I do the following:
> UnstructuredGrid1 -> ReflectionFilter -> UnstructuredGrid2
> {UnstructuredGrid1, UnstructuredGrid2} -> AppendFilter ->
> UnstructuredGridFull
>
> Then, I replace the input of WarpVector by UnstructuredGridFull, and I
> reload the actor.
> However, what I see on screen is the same deformed mesh than before, plus
> another deformed mesh that is not its mirror, it's something different and
> not correct, of course.
>
> If, however, I call:
> At the beginning: UnstructuredGrid1->GetPointData()->
> SetActiveVectors("nameOfArray");
> After I did the mirroring: UnstructuredGridFull->GetPointData()->
> SetActiveVectors("nameOfArray");
> I don't have the problem and everything works OK.
>
> Problem is, I don't want to call setActiveVectors because I can have more
> than one pipeline that makes uses of the same UnstructuredGrid with
> different vectorial data, and  I noticed that each call to setActive* will
> modify all the pipelines that makes use of the Scalars/Vectors/Tensors. So
> this doesn't seem an option.
>
> What is the alternative to use here to solve the problem?
>
> I tried with vtkAssignAttributes but didn't work.
> vtkSmartPointer<vtkAssignAttribute> aa = vtkSmartPointer<
> vtkAssignAttribute>::New();
> aa->SetInput(UnstructuredGridFull);
> aa->Assign("nameOfArray", vtkDataSetAttributes::VECTORS,
> vtkAssignAttribute::POINT_DATA);
> aa->Update();
>
> And then:
> AssignAttribute -> WarpVector instead of UnstructuredGridFull ->
> WarpVector.
> but same result...
>
> Thank you.
>
> --
> *Fernando NELLMELDIN*
> Software Engineer
> *_______________________________________________________________*
>
> *Open Engineering s.a.*
>
> Rue Bois Saint-Jean 15/1
> B-4102 Seraing (Belgium)
> Tel: +32.4.353.30.34
>
> http://www.open-engineering.com
> https://www.linkedin.com/company/open-engineering?trk=biz-companies-cym
>
> *_________________________________________________________________________*
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161026/1830a6ce/attachment.html>


More information about the vtkusers mailing list