<div dir="ltr">Hello, I am still having problems.... <div>I added the casting as you suggested:<div><br></div><div>-----<br><div><div style="font-size:12.8px">// given that model is first an UnstructuredGrid1 and then UnstructuredGridFull</div><div style="font-size:12.8px"><div>vtkSmartPointer<vtkPassArrays> passArrays = vtkSmartPointer<vtkPassArrays><wbr>::New();</div><div>passArrays->SetInput(model); </div><div>passArrays->UseFieldTypesOn(); // restrict to only pass what I say</div><div>passArrays->AddFieldType(<wbr>vtkDataObject::POINT); <br></div><div>passArrays->AddArray(<wbr>fieldType, "nameOfArray");</div><div>passArrays->Update();</div><div><br></div><div>// modelForFilter is a vtkUnstructuredGrid</div><div>modelForFilter = vtkUnstructuredGrid::SafeDownCast(passArrays->GetOutput()); // cast to UnstructuredGrid</div><div>modelForFilter->GetPointData()->SetActiveVectors("nameOfArray"); // set the active vectors in the new data</div><div>modelForFilter->Update();</div></div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">//warping vector is a vtkWarpVector</div><div style="font-size:12.8px">warpingVector-><wbr>SetInputConnection(modelForFilter-<wbr>>GetProducerPort());</div><div style="font-size:12.8px">warpingVector-><wbr>SetInputArrayToProcess(0, 0, 0, vtkDataObject::FIELD_<wbr>ASSOCIATION_POINTS, "nameOfArray");</div><div style="font-size:12.8px">// the rest of the pipeline is the same...</div></div></div><div style="font-size:12.8px"><span style="font-size:12.8px">-----</span><br></div><div style="font-size:12.8px">The result is the same. I put some modelForFilter->Print(std::cout) and I can see that the selected array is indeed the active vectors... </div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Other thing I tried:</div><div style="font-size:12.8px">modelForFilter->DeepCopy(model); // full copy the model to the new </div><div style="font-size:12.8px"><span style="font-size:12.8px">modelForFilter->GetPointData()->SetActiveVectors("nameOfArray"); // set the active in the new</span><br></div><div style="font-size:12.8px"><span style="font-size:12.8px">modelForFilter->Update();</span></div><div style="font-size:12.8px"><span style="font-size:12.8px">Still, same result.</span></div><div style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px"><span style="font-size:12.8px">The only thing that works is:</span></div><div style="font-size:12.8px"><span style="font-size:12.8px">modelForFilter = model;</span></div><div style="font-size:12.8px"><span style="font-size:12.8px">But of course, here I only copy the vtkSmartPointer and not the data, so this is the thing I want to avoid.</span></div></div><div style="font-size:12.8px"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px"><span style="font-size:12.8px">Any ideas? </span></div><div style="font-size:12.8px">Thank you!</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 26 October 2016 at 16:54, Dan Lipsa <span dir="ltr"><<a href="mailto:dan.lipsa@kitware.com" target="_blank">dan.lipsa@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Can you cast the data object to an unstructured grid and then set the active vector on it? Make sure you call update before you do that.<span class="HOEnZb"><font color="#888888"><div><br></div><div>Dan</div><div><br></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 26, 2016 at 10:44 AM, Fernando Nellmeldin <span dir="ltr"><<a href="mailto:f.nellmeldin@open-engineering.com" target="_blank">f.nellmeldin@open-<wbr>engineering.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello and thank you for your reply!<div><br><div>After your suggestion, I tried using vtkPassArray, but I can't find how to set the Active Vectors. The output is a vtkDataObject*, which of course doesn't have the PointsData and therefore no setActiveVectors.</div><div>The result is the same as before, when I change the input to Full, I see the wrong deformed mesh.</div><div><br></div><div>This is my modified code:</div><div><br></div><div>// given that model is first an UnstructuredGrid1 and then UnstructuredGridFull</div><div><div>vtkSmartPointer<vtkPassArrays> passArrays = vtkSmartPointer<vtkPassArrays><wbr>::New();</div><div>passArrays->SetInput(model); </div><div>passArrays->UseFieldTypesOn(); // restrict to only pass what I say</div><div>passArrays->AddFieldType(vtkDa<wbr>taObject::POINT); <br></div><div>passArrays->AddArray(fieldType<wbr>, "nameOfArray");</div><div>passArrays->Update();</div></div><div><br></div><div>//warping vector is a vtkWarpVector</div><div>warpingVector->SetInputConnect<wbr>ion(passArrays-><wbr>GetProducerPort());</div><div>warpingVector->SetInputArrayTo<wbr>Process(0, 0, 0, vtkDataObject::FIELD_ASSOCI<wbr>ATION_POINTS, "nameOfArray"); // I don't know why this line is needed to see something</div><div>// the rest of the pipeline is the same...</div><div><br></div><div>Am I missing something?<br></div><div><br></div><div>Thank you.</div><div><br></div><div><br></div></div></div><div class="m_6358112856424925610HOEnZb"><div class="m_6358112856424925610h5"><div class="gmail_extra"><br><div class="gmail_quote">On 26 October 2016 at 15:40, Dan Lipsa <span dir="ltr"><<a href="mailto:dan.lipsa@kitware.com" target="_blank">dan.lipsa@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Fernando,<div>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.</div><div><br></div><div>Dan</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_6358112856424925610m_8045613482271177067h5">On Wed, Oct 26, 2016 at 6:23 AM, Fernando Nellmeldin <span dir="ltr"><<a href="mailto:f.nellmeldin@open-engineering.com" target="_blank">f.nellmeldin@open-engineering<wbr>.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_6358112856424925610m_8045613482271177067h5"><div dir="ltr">Hello.<div>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).</div><div><br><div>I have the following pipeline:</div><div>UnstructuredGrid1 -> WarpVector -> GeometryFilter -> ExtractEdges -> PolyDataMapper -> Actor<br clear="all"><div>In the WarpVector, I call to say which array to use</div><div>WarpVector->SetInputArrayToPro<wbr>cess(0,0,0, FIELD_ASSOCIATION_POINTS,"name<wbr>OfArray");</div><div><br></div><div>The first time I load the actor in screen, everything is OK.</div><div><br></div><div>Later, I would like to mirror the input UnstructuredGrid1 because it represents half the model. So I do the following:</div><div>UnstructuredGrid1 -> ReflectionFilter -> UnstructuredGrid2</div><div>{UnstructuredGrid1, UnstructuredGrid2} -> AppendFilter -> UnstructuredGridFull</div><div><br></div><div>Then, I replace the input of WarpVector by UnstructuredGridFull, and I reload the actor. </div><div>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.</div><div><br></div><div>If, however, I call:</div><div>At the beginning: UnstructuredGrid1->GetPointDat<wbr>a()->SetActiveVectors("nameOfA<wbr>rray"); <br>After I did the mirroring: UnstructuredGridFull->GetPoint<wbr>Data()->SetActiveVectors("name<wbr>OfArray"); </div><div>I don't have the problem and everything works OK.</div><div><br></div><div>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.</div><div><br></div><div>What is the alternative to use here to solve the problem?</div><div><br></div><div>I tried with vtkAssignAttributes but didn't work.</div><div><div>vtkSmartPointer<vtkAssignAttri<wbr>bute> aa = vtkSmartPointer<vtkAssignAttri<wbr>bute>::New();</div><div>aa->SetInput(UnstructuredGridF<wbr>ull);</div><div>aa->Assign("nameOfArray", vtkDataSetAttributes::VECTORS,<wbr>vtkAssignAttribute::POINT_DATA<wbr>);</div><div>aa->Update();</div></div><div><br></div><div>And then:</div><div>AssignAttribute -> WarpVector instead of UnstructuredGridFull -> WarpVector.</div><div>but same result...</div><div><br></div><div>Thank you.</div><div><br></div>-- <br><div class="m_6358112856424925610m_8045613482271177067m_-2562078329492644039m_-215323534472359152gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><b>Fernando NELLMELDIN</b><br>Software Engineer<div style="font-size:12.8px"><b style="font-size:12.8px"><font color="#cc0000">______________________________<wbr>______________________________<wbr>___</font></b><br></div><div><div style="font-size:12.8px"><b style="font-size:12.8px"><font color="#000000"><br></font></b></div><div style="font-size:12.8px"><b style="font-size:12.8px"><font color="#000000">O</font><font color="#cc0000">pen E</font><font color="#000000">ngineering s.a.</font></b><br></div><div style="font-size:12.8px"><font color="#000000"><br></font></div><div style="font-size:12.8px"><font color="#000000">Rue Bois Saint-Jean 15/1</font></div><div style="font-size:12.8px"><font color="#000000">B-4102 Seraing (Belgium)</font></div><div><font color="#000000" style="font-size:12.8px">Tel: </font><a href="tel:%2B32.4.353.30.34" value="+3243533034" target="_blank">+32.4.353.30.34</a> </div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><a href="http://www.open-engineering.com/" style="color:rgb(17,85,204)" target="_blank">http://www.open-engineering.co<wbr>m</a></div><div style="font-size:12.8px"><a href="https://www.linkedin.com/company/open-engineering?trk=biz-companies-cym" style="color:rgb(17,85,204)" target="_blank">https://www.linkedin.com/compa<wbr>ny/open-engineering?trk=biz-co<wbr>mpanies-cym</a><br></div><div style="font-size:12.8px"><b><font color="#cc0000"><span style="font-family:"arial black",sans-serif;font-size:12.8px">______________________________<wbr>______________________________<wbr>_____________<br></span></font></b></div></div></div></div></div></div></div>
</div></div></div>
<br></div></div>______________________________<wbr>_________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FA<wbr>Q</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=<wbr>vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="m_6358112856424925610m_8045613482271177067gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><b>Fernando NELLMELDIN</b><br>Software Engineer<div style="font-size:12.8px"><b style="font-size:12.8px"><font color="#cc0000">______________________________<wbr>______________________________<wbr>___</font></b><br></div><div><div style="font-size:12.8px"><b style="font-size:12.8px"><font color="#000000"><br></font></b></div><div style="font-size:12.8px"><b style="font-size:12.8px"><font color="#000000">O</font><font color="#cc0000">pen E</font><font color="#000000">ngineering s.a.</font></b><br></div><div style="font-size:12.8px"><font color="#000000"><br></font></div><div style="font-size:12.8px"><font color="#000000">Rue Bois Saint-Jean 15/1</font></div><div style="font-size:12.8px"><font color="#000000">B-4102 Seraing (Belgium)</font></div><div><font color="#000000" style="font-size:12.8px">Tel: </font><a href="tel:%2B32.4.353.30.34" value="+3243533034" target="_blank">+32.4.353.30.34</a> </div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><a href="http://www.open-engineering.com/" style="color:rgb(17,85,204)" target="_blank">http://www.open-engineering.co<wbr>m</a></div><div style="font-size:12.8px"><a href="https://www.linkedin.com/company/open-engineering?trk=biz-companies-cym" style="color:rgb(17,85,204)" target="_blank">https://www.linkedin.com/compa<wbr>ny/open-engineering?trk=biz-<wbr>companies-cym</a><br></div><div style="font-size:12.8px"><b><font color="#cc0000"><span style="font-family:'arial black',sans-serif;font-size:12.8px">______________________________<wbr>______________________________<wbr>_____________<br></span></font></b></div></div></div></div></div></div></div>
</div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><b>Fernando NELLMELDIN</b><br>Software Engineer<div style="font-size:12.8px"><b style="font-size:12.8px"><font color="#cc0000">_______________________________________________________________</font></b><br></div><div><div style="font-size:12.8px"><b style="font-size:12.8px"><font color="#000000"><br></font></b></div><div style="font-size:12.8px"><b style="font-size:12.8px"><font color="#000000">O</font><font color="#cc0000">pen E</font><font color="#000000">ngineering s.a.</font></b><br></div><div style="font-size:12.8px"><font color="#000000"><br></font></div><div style="font-size:12.8px"><font color="#000000">Rue Bois Saint-Jean 15/1</font></div><div style="font-size:12.8px"><font color="#000000">B-4102 Seraing (Belgium)</font></div><div><font color="#000000" style="font-size:12.8px">Tel: </font>+32.4.353.30.34 </div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px"><a href="http://www.open-engineering.com/" style="color:rgb(17,85,204)" target="_blank">http://www.open-engineering.com</a></div><div style="font-size:12.8px"><a href="https://www.linkedin.com/company/open-engineering?trk=biz-companies-cym" style="color:rgb(17,85,204)" target="_blank">https://www.linkedin.com/company/open-engineering?trk=biz-companies-cym</a><br></div><div style="font-size:12.8px"><b><font color="#cc0000"><span style="font-family:'arial black',sans-serif;font-size:12.8px">_________________________________________________________________________<br></span></font></b></div></div></div></div></div></div></div>
</div>