[vtkusers] vtkPoints + InsertPoint

Bill Chivas noo134 at googlemail.com
Fri Mar 12 08:48:12 EST 2010


Thank you for your replies.

To everyone:
I did some tests and i think there is a bug.
Let's say i have the following:

 vtkPoints *points = vtkPoints::New();
points->InsertPoint(609836, x, y, z);
points->InsertPoint(609837, x, y, z);
points->InsertPoint(609839, x, y, z);
points->InsertPoint(609838, x, y, z);

The points->GetNumberOfPoints() gives 609840.
So it supposes that the ids are starting from 0 and it returns (the max_id
of all points plus 1) ?



2010/3/12 Rakesh Patil <rakeshthp at in.com>

> Hi,
>
> Check this
>
>
> http://www.vtk.org/doc/nightly/html/classvtkPoints.html#ab7f990c73fb291737abe4203994ce2a2
>
> So i think that the id falls out of range and it cannot allocate memory..
>
> Further explaination on how the memory is allocated can be explained by
> senior people here...
>
> Thanks
>
> Regards
> Rakesh Patil
>
>
> ---------- Original message ----------
> From:Bill Chivas< noo134 at googlemail.com >
>  Date: 12 Mar 10 16:54:35
> Subject: Re: [vtkusers] vtkPoints + InsertPoint
> To: Rakesh Patil
>
> Maybe it has to do with the vtkPoints and how the memory is allocated?
> I also tried the SetNumberOfPoints(2147483647), but i get runtime error.
>
> 2010/3/12 Bill Chivas <noo134 at googlemail.com>
>
>> The range of integers (signed) is 2147483647 which is much bigger than my
>> numbers (e.g. 60983688).
>> That's why i can't understand the error...
>>
>> 2010/3/12 Rakesh Patil <rakeshthp at in.com>
>>
>>
>>> Hi,
>>>
>>> According to me, InsertPoint()'s first parameter is of type vtkIdType
>>> which is in turn typedef of integer..
>>>
>>> Being an integer variable, of 4 bytes, it has a limit of range... See
>>> this
>>>
>>> http://msdn.microsoft.com/en-us/library/s3f49ktz%28VS.80%29.aspx
>>>
>>> Thus, i guess, it goes out of the range and it produces this error.. As
>>> you said, for small numbers it works fine, That should be the cause..
>>>
>>> Thanks
>>>
>>> Regards
>>> Rakesh Patil
>>>
>>>
>>> ---------- Original message ----------
>>> From:Bill Chivas< noo134 at googlemail.com >
>>> Date: 12 Mar 10 15:53:19
>>> Subject: [vtkusers] vtkPoints + InsertPoint
>>> To: vtkusers at vtk.org
>>>
>>> Hi all,
>>>  i use
>>>  vtkPoints *points = vtkPoints::New();
>>> points->InsertPoint(60983688, x, y, z);
>>> points->InsertPoint(60984688, x, y, z);
>>> points->InsertPoint(60985688, x, y, z);
>>> points->InsertPoint(60986688, x, y, z);
>>> and so on (10 points)
>>>  and i get the error: "ERROR: In c:\vtk\common\vtkDataArrayTemplate.txx,
>>> line 358
>>> vtkFloatArray (03A17E38): Unable to allocate 366022158 elements of size 4
>>> bytes."
>>>  I think it has to do with the fact i set as id a big number (NOT out of
>>> range, though).
>>> When i set small numbers as ids, i get no errors.
>>>  Can anyone help?
>>>  Thanks,
>>> Bill
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100312/9fd0625e/attachment.htm>


More information about the vtkusers mailing list