[vtkusers] vtkDoubleArray -- you can set the number of values but you can't get the number of values?
Francois Bertel
francois.bertel at kitware.com
Wed Feb 18 13:49:10 EST 2009
It is not the number of tuples. It is the number of tuples times the
number of components, at least according to this implementation:
VTK/Common/vtkDataArrayTemplate.txx:
//----------------------------------------------------------------------------
// Set the number of n-tuples in the array.
template <class T>
void vtkDataArrayTemplate<T>::SetNumberOfTuples(vtkIdType number)
{
this->SetNumberOfValues(number*this->NumberOfComponents);
this->DataChanged();
}
On Wed, Feb 18, 2009 at 1:44 PM, Michael Jackson
<mike.jackson at bluequartz.net> wrote:
> You can also use
> vtkIdType GetNumberOfTuples ();
> since vtkArrays are based off the "Tuple" concept. Look at the
> vtkAbstractArray class which vtkDoubleArray descends from.
>
> _________________________________________________________
> Mike Jackson mike.jackson at bluequartz.net
> BlueQuartz Software www.bluequartz.net
> Principal Software Engineer Dayton, Ohio
>
>
>
> On Feb 18, 2009, at 1:34 PM, kent williams wrote:
>
>> I've been staring for some time at the Doxygen man pages for
>> vtkDoubleArray and vtkDataArray. It seems that there is a member
>> function vtkDoubleArray::SetNumberOfValues(), but no corresponding
>> vtkDoubleArray::GetNumberOfValues().
>>
>> This seems to indicate that you have to make sure that you never try
>> to read out more values than you've put in to the array, because
>> there's no way to check this.
>>
>> Or am I missing something?
>> _______________________________________________
>> 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
>
> _______________________________________________
> 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
>
--
François Bertel, PhD | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
| Clifton Park NY 12065, USA
More information about the vtkusers
mailing list