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

Fernando Nellmeldin f.nellmeldin at open-engineering.com
Wed Oct 26 06:23:53 EDT 2016


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

*_________________________________________________________________________*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161026/5164a30d/attachment.html>


More information about the vtkusers mailing list