Hey Luc,

If I understand you correctly, you want 2D glyphs on your points, but you want 
them oriented according to the normal vectors you've read from your file?

If you apply the Glyph filter to your data set, and then choose 2D Glyph from 
the Glyph Type combo-box, then you can set the type of 2d glyphs to Circle. If 
you want them to be oriented by the normals you've calculated, then just make 
sure the Orient check-box is checked, and your normals are chosen in the 
Vectors combo-box. I'll attach an example screen shot of the output so you can 
see if this is what you're looking for. (Note, I've also checked Filled to fill 
in the circles, but this isn't necessary.)

If I'm misunderstanding your question, feel free to rephrase it and we'll try 
again. :)

-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group

<<inline: 2dOrientedGlyphs.png>>

On May 12, 2010, at 2:25 AM, luc scholtes wrote:

> Hi all,
> 
> I am new to Paraview and I could not find any clear information on how 2D 
> glyphs are oriented. Is there a way to control their normals to the the 2D 
> plane?
> 
> Here is the code I use to generate a cloud of points from a text file to 
> which I would like to assign different filters (it can be 3D or 2D, but 
> circles oriented by their normals would be perfect...)
> 
> /// here is the part to recover the data
> std::ifstream file ("cracks.txt",std::ios::in);
>         if(file){
>              while ( !file.eof() ){ 
>                 std::string line;
>                 Real p0,p1,p2,s,o0,o1,o2;
>                 while ( std::getline(file, line) ){
>                     file >> p0 >> p1 >> p2 >> s >> o0 >> o1 >> o2;
>                     vtkIdType pid[1];
>                     pid[0] = crackPos->InsertNextPoint(p0, p1, p2);
>                     crackCells->InsertNextCell(1,pid);
>                     crackSize->InsertNextValue(s);
>                     float n[3] = { o0,o1,o2 };
>                     crackOri->InsertNextTupleValue(n);
>                 }
>              }
>              file.close();
> } 
>               
> /// here is the code to create the VTK file
> vtkSmartPointer<vtkUnstructuredGrid> crackUg = 
> vtkSmartPointer<vtkUnstructuredGrid>::New();
> crackUg->SetPoints(crackPos);
> crackUg->SetCells(VTK_VERTEX, crackCells);
> crackUg->GetPointData()->AddArray(crackSize);
> crackUg->GetPointData()->AddArray(crackOri); 
>     
> vtkSmartPointer<vtkXMLUnstructuredGridWriter> writer = 
> vtkSmartPointer<vtkXMLUnstructuredGridWriter>::New();
> string 
> fn=fileName+"cracks."+lexical_cast<string>scene->currentIteration)+".vtu";
> writer->SetFileName(fn.c_str());
> writer->SetInput(crackUg);
> writer->Write();
> 
> Do you have any advice?
> 
> Tahnks a lot in advance
> 
>   Luc
> 
> 
>  
> _______________________________________________
> 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

_______________________________________________
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

Reply via email to