<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">I recommend that you check out the extensive examples:</div><div class="gmail_default"><font face="verdana, sans-serif"><a href="https://lorensen.github.io/VTKExamples/site/">https://lorensen.github.io/VTKExamples/site/</a></font><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">See for example:</div><div class="gmail_default"><font face="verdana, sans-serif"><a href="https://lorensen.github.io/VTKExamples/site/Cxx/VTKConcepts/Scalars/">https://lorensen.github.io/VTKExamples/site/Cxx/VTKConcepts/Scalars/</a></font><br></div><div class="gmail_default"><font face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font face="verdana, sans-serif">Or grep "GetPointData()" or "GetCellData()" in the VTK source code.</font></div><div class="gmail_default"><font face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font face="verdana, sans-serif">Basic ideas:</font></div><div class="gmail_default"><font face="verdana, sans-serif">- A dataset represents geometry + topology e.g., vtkUnstructuredGrid.</font></div><div class="gmail_default"><font face="verdana, sans-serif">- Attribute data (point data and cell data) is associated on a 1-for-1 with dataset points and cells.</font></div><div class="gmail_default"><font face="verdana, sans-serif">- Attributes (e.g., scalars) are created in vtkDataArrays using tuples of one or more components</font></div><div class="gmail_default"><font face="verdana, sans-serif">- Attributes can be associated with dataset via dataset->GetPointData()->SetScalars(attrArray) or using AddArray() etc</font></div><div class="gmail_default"><font face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font face="verdana, sans-serif">Also see VTK/*/*/Testing/Cxx and
<span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">VTK/*/*/Testing/Python there are literally more than a thousand tests.</span></font></div><div class="gmail_default"><font face="verdana, sans-serif"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></font></div><div class="gmail_default"><font face="verdana, sans-serif"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Finally, I strongly recommend that you read the <a href="https://lorensen.github.io/VTKExamples/site/VTKBook/">book</a> (these are works in progress): either <a href="https://raw.githubusercontent.com/lorensen/VTKExamples/master/src/VTKBookLaTex/VTKTextBook.pdf">on-line LaTeX book</a> created by Andrew Maclean & friends;</span></font></div><div class="gmail_default"><font face="verdana, sans-serif"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">or the <a href="https://lorensen.github.io/VTKExamples/site/VTKBook/01Chapter1/">Markdown document</a> created by Bill Lorensen & friends.</span></font></div><div class="gmail_default"><font face="verdana, sans-serif"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></font></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jun 15, 2018 at 11:34 AM rclaveria <<a href="mailto:rclaveria@dim.uchile.cl">rclaveria@dim.uchile.cl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello,<br>
<br>
I need to access and modify the data attributes of VTK geometric objects <br>
(e.g., an unstructured grid) from the code. For example, I'd like to <br>
write algorithm to assign a pressure or temperature value to each cell <br>
(or point) of my mesh according to a certain physical model. However, I <br>
haven't found code examples where data attributes are set, accessed or <br>
modified using C++ or python code. So far, I've relied on external code <br>
(python's FEniCS library, to be precise) to generate meshes, run <br>
simulations and set attributes, saving the output in a format readable <br>
by ParaView (.vtk extension with the flag UNSTRUCTURED_GRID).<br>
<br>
I'd be grateful to receive guidelines on how to set the attributes of a <br>
mesh using the VTK library.<br>
<br>
Thanks<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
ParaView development discussion is moving! Please visit <a href="https://discourse.paraview.org/" rel="noreferrer" target="_blank">https://discourse.paraview.org/</a> for future posts.<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/opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=Paraview-developers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=Paraview-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/paraview-developers" rel="noreferrer" target="_blank">https://public.kitware.com/mailman/listinfo/paraview-developers</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>William J. Schroeder, PhD<br>Kitware, Inc. - Building the World's Technical Computing Software<br>28 Corporate Drive<br>Clifton Park, NY 12065<br><a href="mailto:will.schroeder@kitware.com" target="_blank">will.schroeder@kitware.com</a><br><a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br>(518) 881-4902</div></div></div></div>