save cell and FindClosestPoint

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

save cell and FindClosestPoint

kaouther
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: save cell and FindClosestPoint

David Doria-2-3
n Sun, Sep 2, 2012 at 9:47 PM, kaouther <[hidden email]> wrote:

> 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

Please make a minimal example
(http://www.vtk.org/Wiki/VTK/MinimalExample) of your problem.

David
_______________________________________________
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 VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: save cell and FindClosestPoint

kaouther
CONTENTS DELETED
The author has deleted this message.