[vtkusers] Creating simple Polygon data

mirko heuegger mheuegger at gmail.com
Tue Sep 14 02:34:43 EDT 2010


Hello!

On Tue, Sep 14, 2010 at 4:44 AM, Ashika Umanga Umagiliya
<aumanga at biggjapan.com> wrote:
>  [cut]
>
>             //VTK: to VTK points
>             vtkCrvPoints->InsertNextPoint(tmp->getX(),tmp->getY(),0.0);
>             //VTK: add vertex to vtkCurve
>             vtkCurve->GetPointIds()->SetId(ccount,ncount); //Crash Here!!!!!

According to the documentation
<http://www.vtk.org/doc/nightly/html/classvtkIdList.html#a7e1b87799a2b013b218350644a904efd>
SetId requires memory allocation before using this command, this could
be done over the SetNumberOfIds() command.
Or you may use InsertId
<http://www.vtk.org/doc/nightly/html/classvtkIdList.html#a0b601275c162f3637773650eef2bf755>,
range checking and memory allocation will done automatically.

hth

mirko

-- 
Real programmers don't document; if it was
hard to write, it should be hard to understand.



More information about the vtkusers mailing list