Filters/Core/Testing/Cxx/TestAppendDataSets.cxx
//////////////////////////////////////////////////////////////////////////////
// Fill a component of a data array with random values
//////////////////////////////////////////////////////////////////////////////
Fill a component of a data array with random values
Fill a component of a data array with random values
void FillComponentWithRandom(vtkIntArray* array, int component)
{
  int numberOfComponents = array->GetNumberOfComponents();
  int* values = static_cast<int*>(array->GetVoidPointer(0));
  for (vtkIdType i = 0; i < array->GetNumberOfTuples(); ++i)
  {
    values[i*numberOfComponents + component] = vtkMath::Random()*100000;
  }
}
void FillComponentWithRandom ( vtkIntArray * array , int component ) { int numberOfComponents = array -> GetNumberOfComponents ( ) ; int * values = static_cast < int * > ( array -> GetVoidPointer ( 0 ) ) ; for ( vtkIdType i = 0 ; i < array -> GetNumberOfTuples ( ) ; ++ i ) { values [ i * numberOfComponents + component ] = vtkMath :: Random ( ) * 100000 ; } }
Fill a component of a data array with random values
Fill a component of a data array with random values