[vtkusers] save cell and FindClosestPoint

kaouther boutara.kaouther at gmail.com
Sun Sep 2 21:47:27 EDT 2012


hello everybody,
I save a coordinate of  point selectsed in the file.xyz by code
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/CellPointNeighbors
selectedcells = vtkSmartPointer<vtkUnstructuredGrid>::New();
selectedcells->ShallowCopy(extractSelection->GetOutput());
writer =vtkSmartPointer<vtkSimplePointsWriter>::New();
writer->SetFileName(this->FileName);
writer->SetInputConnection(selectedcells->GetProducerPort());
writer->Write();
I developed a function to read the file , load the sphere and colored the
cell records by code :
vtkSmartPointer<vtkCellLocator> cellLocator = 
	vtkSmartPointer<vtkCellLocator>::New();
	cellLocator->SetDataSet(atlas->GetOutput());
	cellLocator->BuildLocator();
double OnePoint[3];

		double closestPoint[3];//the coordinates of the closest point will be
returned here //unused here
		double closestPointDist2; //the squared distance to the closest point will
be returned here //unused here
		vtkIdType cellId; //the cell id of the cell containing the closest point
will be returned here
		int subId; //this is rarely used (in triangle strips only, I believe)
//unused here

		std::list<vtkIdType> CellIdList;
		mainCellMapper = vtkSmartPointer<vtkDataSetMapper>::New();
OnePoint[0] = OsseletTab[k].x;
			OnePoint[1] = OsseletTab[k].y;
			OnePoint[2] = OsseletTab[k].z;

			cellLocator->FindClosestPoint(OnePoint, closestPoint, cellId, subId,
closestPointDist2);

			CellIdList.push_back(cellId);
I then select the CellIdList  but unfortunately i don't have the same cells
why?
http://vtk.1045678.n5.nabble.com/file/n5715782/1.png 
http://vtk.1045678.n5.nabble.com/file/n5715782/2.png 
help me please 



--
View this message in context: http://vtk.1045678.n5.nabble.com/save-cell-and-FindClosestPoint-tp5715782.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list