[Insight-users] Empty method : itk::PolygonCell::SetPointIds !!!

Luis Ibanez luis . ibanez at kitware . com
Mon, 06 Oct 2003 16:26:14 -0400


Hi Sergio,

Thanks for pointing this out.

The SetPointIds( PointIdConstIterator) is empty because its
API cannot be satisfied in the case of the Polygoncell.

PolygonCell is the only ITK Cell whose number of points is dynamically
defined. All other cells know from instantiation time how many points
they will have. Thanks to that, the other cells can copy points by just
requiring an starting point Id iterator.

In the case of the PolygonCell, a single iterator is not enough...

The fact that MakeCopy() is invoking this empty method is actually a
bug, as you just pointed out.

The method to be used is another instance of SetPointIds() which
accepts as second parameter the number of points. This has been
fixed in the CVS repository. You may apply the same change in
your local code according to the following diff:


diff -r1.23 itkPolygonCell.txx
37c37,38
<   cellPointer->SetPointIds(this->GetPointIds());
---
 >   const unsigned long numberOfPoints =
 >                            cellPointer->GetNumberOfPoints();
 >   cellPointer->SetPointIds(0, numberOfPoints, this->GetPointIds());


You may still want to enter this as a bug in the bugtracker
(the fact that the SetPointIds() method is empty)

           http://www . itk . org/Bug/

(Note that anybody has write access to the bugtracker, just need to
  create your own account and don't need any authorization for doing so.)



Please let us know if you find further problems.



Thanks


   Luis



----------------------
Sergio Andrés wrote:
>  Hello all!
> 
>  I would like to warn you that the method itk::PolygonCell::SetPointIds is
> empty!!
> 
> Furthermore, when you have to use the method CellInterface<..>::MakeCopy(), 
> it does not work with PolygonCells because it uses the previous method
>  (SetPointIds()) to make the copy. As a result, you get an empty PolygonCell.
> 
> So, when I want to copy a PolygonCell, what should I do?
> 
> 
> Sergio.
> 
> ___________________________________________________
> Yahoo! Messenger - Nueva versión GRATIS
> Super Webcam, voz, caritas animadas, y más...
> http://messenger . yahoo . es
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk . org
> http://www . itk . org/mailman/listinfo/insight-users
>