[vtkusers] why does Updating scalars updates Delaunay Object too?

David E DeMarle dave.demarle at kitware.com
Wed Sep 14 08:06:24 EDT 2011


The pipeline isn't smart enough to differentiate between changes to
the geometry/topology and attributes (fairly easy to do) and to know
what matters to all of the downstream results (fairly hard to do). So
it takes the safe approach and says that if anything changes,
everything downstream must re-execute.

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909



On Wed, Sep 14, 2011 at 6:35 AM, rakesh patil <prakeshofficial at gmail.com> wrote:
> Hello,
>
> vtkPoints *pnts = vtkPoints::New();
> pnts->SetNumberOfPoints(num);
>
> vtkDoubleArray *scalar = vtkDoubleArray::New();
> scalar->SetNumberOfTuples(num);
>
>
> vtkCellArray *pVertex = vtkCellArray::New();
>
> for (vtkIdType i = 0; i < num; i++)
> {
>    readFile >> xval >> yval >> zval;
>    pnts->InsertPoint(i, xval, yval, 0);
>    scalar->InsertTuple1(i, zval);
>
>    pVertex->InsertNextCell(1, &i);
> }
>
> vtkPolyData *pd = vtkPolyData::New();
> pd->SetPoints(pnts);
> pd->SetVerts(pVertex);
> pd->GetPointData()->SetScalars(scalar);
>
> vtkDelaunay2D *del = vtkDelaunay2D::New();
>
> del->SetInput(pd);
> del->SetTolerance(0.00001);
> del->Update();
>
> vtkPolyDataMapper *mapp = vtkPolyDataMapper::New();
> mapp->SetInputConnection( del->GetOutputPort() );
> mapp->ScalarVisibilityOn();
>
>
> vtkActor *actor = vtkActor::New();
> actor->SetMapper(mapp);
> actor->GetProperty()->SetColor(1, 0, 0);
> actor->GetProperty()->SetPointSize(3);
>
> renderer->AddActor(actor);
>
> After adding actor to the renderer, suppose I do some changes in the scalar
> array, and say modified, I observe that delaunay object is also updated and
> again triangulation takes place.
>
>
> Why is this so?
> ;
>
> _______________________________________________
> 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
>
>



More information about the vtkusers mailing list