<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Yes, thanks, that is exactly what I
needed.<br>
<br>
PS<br>
I was getting memory errors when using
myArrray->InsertNextTuple1( value )<br>
This cleared up when I switched to myArrray->InsertTuple1(
index, value ).<br>
<br>
<br>
On 07/02/2015 04:40 AM, Cory Quammen wrote:<br>
</div>
<blockquote
cite="mid:CAB5Fpx4fs2en+LDUK0WcYj9kaA=iW0yv8MhaLaZAK-1=SUZqLA@mail.gmail.com"
type="cite">
<div dir="ltr">Hi Norman,
<div><br>
</div>
<div>To set point data, you can first get the point data object
with</div>
<div><br>
</div>
<div>vtkPointData* pointData = polydata->GetPointData();</div>
<div><br>
</div>
<div>Then you can add arrays to it:</div>
<div><br>
</div>
<div>vtkFloatArray* myArrray = vtkFloatArray::New();</div>
<div>myArray->SetName("myArray");</div>
<div>myArray->SetNumberOfComponents(1);<br>
</div>
<div>myArray->SetNumberOfTuples(polydata->GetNumberOfPoints());</div>
<div>// Set array elements here...</div>
<div><br>
</div>
<div>pointData->AddArray(myArray);</div>
<div><br>
</div>
<div>The same holds true for cell data, just replace PointData
with CellData, and set the number of tuples to the number of
cells instead of the number of points.</div>
<div><br>
</div>
<div>Hope this helps,</div>
<div><br>
</div>
<div>Cory</div>
<div><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Jul 2, 2015 at 1:57 AM, Norman
Goldstein <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:normvcr@telus.net" target="_blank">normvcr@telus.net</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> From net examples and
on-line docs, I have gleaned some of the info to create a
full 1-piece vtp file:<br>
<br>
Call<br>
vtkXMLPolyDataWriter::SetInputData( <a
moz-do-not-send="true"
href="http://www.vtk.org/doc/nightly/html/classvtkDataObject.html"
target="_blank">vtkDataObject</a> *)<br>
<br>
where you pass in a vtkPolyData, which you first set up
with the methods:<br>
<br>
SetVerts<br>
SetLines<br>
SetPolys<br>
SetStrips<br>
<br>
and the parent method<br>
<br>
SetPoints<br>
<br>
What I have not figured out is how to set the vtp fields<br>
PointData and CellData<br>
<br>
Any pointers much appreciated ...<br>
<br>
<br>
<br>
<br>
</div>
<br>
_______________________________________________<br>
Powered by <a moz-do-not-send="true"
href="http://www.kitware.com" rel="noreferrer"
target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a
moz-do-not-send="true"
href="http://www.kitware.com/opensource/opensource.html"
rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ParaView Wiki
at: <a moz-do-not-send="true"
href="http://paraview.org/Wiki/ParaView" rel="noreferrer"
target="_blank">http://paraview.org/Wiki/ParaView</a><br>
<br>
Search the list archives at: <a moz-do-not-send="true"
href="http://markmail.org/search/?q=ParaView"
rel="noreferrer" target="_blank">http://markmail.org/search/?q=ParaView</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a moz-do-not-send="true"
href="http://public.kitware.com/mailman/listinfo/paraview"
rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/paraview</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature">Cory Quammen<br>
R&D Engineer<br>
Kitware, Inc.</div>
</div>
</blockquote>
<br>
</body>
</html>