[vtkusers] how does replaceCell work ?

Sebastien MARAUX maraux at ondim.fr
Thu Jan 16 08:31:29 EST 2003


Dear vtkusers

I am trying to change one pointID in 2 cells, which need to be
updated.

(I am trying to construct a kind of "connected" ribbons
to show contours, and when moving from one contour
end to another begining, I need to close last contour by
updating 1 point of the first contour band cell with the
value of one point of the last cell of the contour band).

I tried :
1.
      int pts[3];

pts[0]=LinesPolyData->GetCell(idFirstCellOfCurrentContour)->GetPointId(0);
      pts[1]=idIntersection;

pts[2]=LinesPolyData->GetCell(idFirstCellOfCurrentContour)->GetPointId(2);
      LinesPolyData->ReplaceCell(idFirstCellOfCurrentContour,3,pts);

      pts[0]=idIntersection;

pts[1]=LinesPolyData->GetCell(idFirstCellOfCurrentContour+1)->GetPointId(1);

pts[2]=LinesPolyData->GetCell(idFirstCellOfCurrentContour+1)->GetPointId(2);
      LinesPolyData->ReplaceCell(idFirstCellOfCurrentContour+1,3,pts);

and it had no effect.

2.

LinesPolyData->ReplaceCellPoint(idFirstCellOfCurrentContour,LinesPolyData->G
etCell(idFirstCellOfCurrentContour)->GetPointId(1),idIntersection);

LinesPolyData->ReplaceCellPoint(idFirstCellOfCurrentContour+1,LinesPolyData-
>GetCell(idFirstCellOfCurrentContour)->GetPointId(0),idIntersection);

and it had no effect

3.
LinesPolyData->ReplaceCellPoint(idFirstCellOfCurrentContour,1,idIntersection
);

LinesPolyData->ReplaceCellPoint(idFirstCellOfCurrentContour+1,0,idIntersecti
on);

and it had .... no effect.

first, is second argument of replaceCellpoint a local cell Id (from 0 to
nbpoints in cell)
or absolute ID (reference to vtkpoints associated, = nbpoints in
vtkPointsassociated) ?

What can I do to make this work ?

I didn't build any links, is there some default for this ?
shoould I use removLinkedCell instead of first try ?
should I build it ? (this case can occure from 0 to around 10 times during
execution)

Thanks everybhody.

Sebastien MARAUX





More information about the vtkusers mailing list