Filters/Core/Testing/Cxx/TestAppendDataSets.cxx
//////////////////////////////////////////////////////////////////////////////
// Returns 1 on success, 0 otherwise
//////////////////////////////////////////////////////////////////////////////
Returns 1 on success, 0 otherwise
Returns 1 on success 0 otherwise
int AppendDatasetsAndCheckMergedArrayLengths(vtkAppendDataSets* append)
{
  append->MergePointsOn();
  append->Update();
  vtkDataSet * output = append->GetOutput();
  if (output->GetPointData()->GetNumberOfArrays() > 0 &&
      output->GetPointData()->GetArray(0)->GetNumberOfTuples() != output->GetNumberOfPoints())
  {
    std::cerr << "Wrong number of tuples in output point data arrays\n";
    return 0;
  }
  if (output->GetCellData()->GetNumberOfArrays() > 0 &&
      output->GetCellData()->GetArray(0)->GetNumberOfTuples() != output->GetNumberOfCells())
  {
    std::cerr << "Wrong number of tuples in output cell data arrays\n";
    return 0;
  }
  if (output->GetPointData()->GetGlobalIds() != nullptr)
  {
    std::cerr << "Point global ids should have been discarded after merge!\n";
    return 0;
  }
  if (output->GetCellData()->GetGlobalIds() == nullptr)
  {
    std::cerr << "Cell global ids should have been preserved after merge!\n";
    return 0;
  }
  return 1;
}
int AppendDatasetsAndCheckMergedArrayLengths ( vtkAppendDataSets * append ) { append -> MergePointsOn ( ) ; append -> Update ( ) ; vtkDataSet * output = append -> GetOutput ( ) ; if ( output -> GetPointData ( ) -> GetNumberOfArrays ( ) > 0 && output -> GetPointData ( ) -> GetArray ( 0 ) -> GetNumberOfTuples ( ) != output -> GetNumberOfPoints ( ) ) { std :: cerr << " \n " ; return 0 ; } if ( output -> GetCellData ( ) -> GetNumberOfArrays ( ) > 0 && output -> GetCellData ( ) -> GetArray ( 0 ) -> GetNumberOfTuples ( ) != output -> GetNumberOfCells ( ) ) { std :: cerr << " \n " ; return 0 ; } if ( output -> GetPointData ( ) -> GetGlobalIds ( ) != nullptr ) { std :: cerr << " \n " ; return 0 ; } if ( output -> GetCellData ( ) -> GetGlobalIds ( ) == nullptr ) { std :: cerr << " \n " ; return 0 ; } return 1 ; }
Returns 1 on success, 0 otherwise
Returns 1 on success 0 otherwise