It seems as though edges are not converted to lines or whatever it is necessary to do in a vtk file to view a "wireframe" in Paraview.<br><br>An example would be something like this:<br><br>#include "itkQuadEdgeMesh.h"<br>
#include "itkLineCell.h"<br>#include "/home/doriad/src/Insight/Code/Review/itkVTKPolyDataWriter.h"<br><br>#include <string><br><br>const unsigned int Dimension = 3;<br>typedef itk::QuadEdgeMesh< float, Dimension > MeshType;<br>
<br><br>int main(int argc, char * argv[])<br>{<br> if(argc != 2)<br> {<br> std::cout << "Required arguments: Filename" << std::endl;<br> exit(-1);<br> }<br> <br> std::string Filename = argv[1];<br>
<br> MeshType::Pointer mesh = MeshType::New();<br><br> //create points<br> MeshType::PointType p0,p1,p2,p3;<br> <br> p0[0] = -1.0; p0[1]= -1.0; p0[2]= 0.0; // first point ( -1, -1, 0 )<br> p1[0] = 1.0; p1[1]= -1.0; p1[2]= 0.0; // second point ( 1, -1, 0 )<br>
p2[0] = 1.0; p2[1]= 1.0; p2[2]= 0.0; // third point ( 1, 1, 0 )<br> p3[0] = 1.0; p3[1]= 1.0; p3[2]= 1.0; // third point ( 1, 1, 1 )<br><br> mesh->SetPoint( 0, p0 );<br> mesh->SetPoint( 1, p1 );<br>
mesh->SetPoint( 2, p2 );<br> mesh->SetPoint( 3, p3 );<br><br> std::cout << "NumPoints = " << mesh->GetNumberOfPoints() << std::endl;<br><br> //create 2 edges<br> mesh->AddEdge(0, 1);<br>
mesh->AddEdge(1, 2);<br><br> std::cout << "NumEdges = " << mesh->GetNumberOfEdges() << std::endl;<br> <br> typedef itk::VTKPolyDataWriter< MeshType > WriterType;<br> WriterType::Pointer SubmeshWriter = WriterType::New();<br>
<br> SubmeshWriter->SetFileName(Filename);<br> SubmeshWriter->SetInput(mesh);<br> SubmeshWriter->Update();<br> SubmeshWriter->Write();<br> <br> return 0;<br>}<br> <br>I would expect to be able to see these two edges in Paraview. Anyone agree/disagree?<br>
<br clear="all">Thanks,<br><br>David<br>