[Paraview] Assign scalars/vectors to mesh points in vtkRectilinearGrid, C++

Paw Møller pawsen at gmail.com
Tue Apr 2 16:20:25 EDT 2013


Superb,
That was it. Thanks, both of you.

But I have another question.
The automatic scaling of the vector field works as expected.
The scaling of the temperature however does not(array of floats). It set
the range to [0 1], regardless of the actual values.

Paraview(under information) gives the data range = [3.5 1333.5], which is
correct. And if I manually set the color range to this, everything is good.
Pressing the automatic color scale(rescale to data), the used interval is
set back to [0 1].
Why is that?

I use to code suggested by Joe,
    vtkFloatArray* temperature = vtkFloatArray::New();
    temperature->SetName("Temperature");
    temperature->SetNumberOfComponents(1);
    temperature->SetNumberOfValues(mesh.nn);
    for(int i=0;i<mesh.nn;i++){
       temperature->SetValue(i,3.5);
    }
    rgrid->GetPointData()->AddArray(temperature);

And is it possible to update the plot if I overwrite the .vtr file, without
closing and reopening the file?

Paw
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20130402/7a48cd57/attachment.htm>


More information about the ParaView mailing list