[Paraview] About 2D Glyph orientation
luc scholtes
lscholtes63 at gmail.com
Wed May 12 02:25:58 EDT 2010
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100512/42193a81/attachment.htm>
More information about the ParaView
mailing list