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

rakesh patil prakeshofficial at gmail.com
Wed Sep 14 10:41:17 EDT 2011


Hi,

In the code above, the scalars contains depth information. Which is negative
and positive both. So I want to convert positive values to negative. After
converting that, when I say scalars modified, delaunay's object is executed.
So is there any way to avoid the second time execution? Because when I load
a big data of say 30-40lakhs points, first time triangulation itself takes
ample amount of time. Then later when reversing the scalar, again
triangulation consumes more time which I want to avoid. Is there any way to
bypass it second time?

Thanks

Warm Regards

Rakesh Patil

On Wed, Sep 14, 2011 at 5:36 PM, David E DeMarle
<dave.demarle at kitware.com>wrote:

> 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
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110914/9968adde/attachment.htm>


More information about the vtkusers mailing list