[vtkusers] Update vtkDelaunay2d object
Jordi Gutiérrez Hermoso
jordigh at gmail.com
Tue Feb 23 00:11:30 EST 2010
On 22 February 2010 20:59, David Doria <daviddoria+vtk at gmail.com> wrote:
> First, this:
> vtkSmartPointer<vtkPolyData> polydata = vtkPolyData::New();
> is very bad. You must use
> vtkSmartPointer<vtkPolyData> polydata =
> vtkSmartPointer<vtkPolyData>::New();
Interesting. Why? I was just treating vtkSmartPointer like
boost::shared_ptr, but I guess its API is not analogous.
> It shouldn't be a problem to do what you are asking, I think you can just
> get the output of the Delaunay filter and update its points:
> vtkPolyData* output = delaunay->GetOutput();
> output->SetPoints(newPoints);
> output->GetPointData()->SetScalars(newScalars);
> Maybe I misunderstood your question?
Maybe... unless vtkDelaunay2D or VTK in general is much smarter than I thought.
What I was hoping I could do was to iterate over the points in the
delaunay object and just update their z-coordinate, because I want to
run many iterations, and I don't want to compute the Delaunay
triangulation again each iteration. If I understand what you wrote
here, getting the output of vtkDelaunay2D, updating the points, and
then feeding it back to vtkDelauynay2D would ensue in a recomputation
of the triangulation?
Or will the triangulation stay in the points and I can just play with
their z-coordinates and their scalars?
More information about the vtkusers
mailing list