[vtkusers] Saving VtkPolydata

diego martinez damartinez80 at gmail.com
Mon Jun 15 11:31:58 EDT 2009


  Dear VtkUsers,
I have a set of unstructured points (Point Cloud). I use a vtkPoint to save
each point, and then I create a vtkCellArray. and Then I use a vtkPolydata
as it can be seen of the following part of my code.

        pvtkPoints->InsertPoint(n,x,y,z);
int iNo = this->pvtkPoints->GetNumberOfPoints();
for (int i=0; i<iNo; i++) {
 this->pvtkCellArray->InsertNextCell(1,&i);
 }
this->pvtkPolyData->SetPoints(this->pvtkPoints);
this->pvtkPolyData->SetPolys(this->pvtkCellArray);
this->pvtkPolyData->GetPointData()->SetScalars(this->intensities1);
        this->pvtkPolyDataMapper->SetInput(this->pvtkPolyData);
this->pvtkActor->SetMapper(this->pvtkPolyDataMapper);
this->pvtkActor->GetProperty()->SetRepresentationToPoints();
this->Props->AddItem( this->pvtkActor);

This works fine when I create a mapper and actor and added to the render. I
extract some planes with vtkExtractPolyDataGeometry(vtkEPDG)

        this->pvtkEPDG->SetInput(this->pvtkPolyData);
this->pvtkEPDG->SetImplicitFunction(this->pvtkPlanes_hull);
this->pvtkEPDG->SetExtractInside(1);
this->pvtkEPDG->Update();
this->pvtkPolyData= this->pvtkEPDG->GetOutput();

This works fine too, but when I want to extract the results and put this
into a plain txt files, it wont do it. I would basically used the old
vtkPolydata set of points

        for (int i=0; i<iNo; i++)
{
this->pvtkPolyData->GetPoint(i,x);
 fileHandle<<x[0]<<" "<<x[1]<<" "<<x[2]<<endl;
}


Does anyone know what would be the solution to this simple problem. I would
really appreciate any suggestion.

thanks


-- 
Diego Martinez
University of Nebraska at Lincoln
1110 S. 67st, PKI 108
Omaha, NE 68182
+1 - 402 - 575- 8881(Cell)
+1 - 402 - 554 - 3537(Lab)
+1 - 402 - 238 - 1908(SkypePC)



dmartinez at unomaha.edu
damartinez80 at gmail.com(personal)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090615/6e362667/attachment.htm>


More information about the vtkusers mailing list