[Paraview] Displaying texts from pointdata
Nehme Bilal
nehmebilal at gmail.com
Wed Oct 26 14:01:21 EDT 2011
The "Selection Inspector" of ParaView can probably do what you want:
http://paraview.org/OnlineHelpCurrent/SelectionInspector.html
Nehme
On Sun, Aug 7, 2011 at 7:42 PM, ChiaWeng Boon <chiaweng at gmail.com> wrote:
> Hi,
>
> I would like to display the ID numbers of my bodies. They are saved
> as a Point Data as follows from vtkUnstructuredGridWriter. Is there a
> way to display the IDs as texts using Paraview? I've been trying out
> different Filters for hours but am unsuccessful.
>
> vtkSmartPointer<vtkFloatArray> spheresId =
> vtkSmartPointer<vtkFloatArray>::New();
> spheresId->SetNumberOfComponents(1);
> spheresId->SetName("id");
> vtkSmartPointer<vtkUnstructuredGrid> spheresUg =
> vtkSmartPointer<vtkUnstructuredGrid>::New();
>
> FOR EVERY BODY:
> spheresUg->SetPoints(spheresPos);
> spheresUg->SetCells(VTK_VERTEX, spheresCells);
> spheresId->InsertNextValue(b->getId());
> spheresUg->GetPointData()->AddArray(spheresId);
> END FOR
>
> vtkSmartPointer<vtkXMLUnstructuredGridWriter> writer =
> vtkSmartPointer<vtkXMLUnstructuredGridWriter>::New();
> string fn=fileName+"spheres."+lexical_cast<string>(scene->iter)+".vtu";
> writer->SetFileName(fn.c_str());
> writer->SetInput(spheresUg);
> writer->Write();
>
>
> Yours faithfully,
>
> Boon
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20111026/2ce14a30/attachment.htm>
More information about the ParaView
mailing list