vtkRandomAttributeGenerator.cxx 23.3 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/*=========================================================================

  Program:   Visualization Toolkit
  Module:    vtkRandomAttributeGenerator.cxx

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
#include "vtkRandomAttributeGenerator.h"

17
#include "vtkBitArray.h"
18
#include "vtkCellData.h"
19 20 21 22 23
#include "vtkCharArray.h"
#include "vtkCompositeDataSet.h"
#include "vtkCompositeDataIterator.h"
#include "vtkDataSet.h"
#include "vtkDoubleArray.h"
24
#include "vtkFieldData.h"
25 26
#include "vtkFloatArray.h"
#include "vtkIdTypeArray.h"
27 28
#include "vtkInformation.h"
#include "vtkInformationVector.h"
29 30
#include "vtkIntArray.h"
#include "vtkLongArray.h"
31
#include "vtkLongLongArray.h"
32
#include "vtkMath.h"
33
#include "vtkNew.h"
34
#include "vtkObjectFactory.h"
35
#include "vtkPointData.h"
36 37 38
#include "vtkUnsignedCharArray.h"
#include "vtkUnsignedIntArray.h"
#include "vtkUnsignedLongArray.h"
39
#include "vtkUnsignedLongLongArray.h"
40 41 42
#include "vtkUnsignedShortArray.h"
#include "vtkShortArray.h"
#include "vtkSmartPointer.h"
43 44 45

vtkStandardNewMacro(vtkRandomAttributeGenerator);

46
// ----------------------------------------------------------------------------
47 48 49
vtkRandomAttributeGenerator::vtkRandomAttributeGenerator()
{
  this->DataType = VTK_FLOAT;
50
  this->NumberOfComponents = 1;
51 52 53
  this->NumberOfTuples = 0;
  this->MinimumComponentValue = 0.0;
  this->MaximumComponentValue = 1.0;
54

55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
  this->GeneratePointScalars = 0;
  this->GeneratePointVectors = 0;
  this->GeneratePointNormals = 0;
  this->GeneratePointTCoords = 0;
  this->GeneratePointTensors = 0;
  this->GeneratePointArray = 0;

  this->GenerateCellScalars = 0;
  this->GenerateCellVectors = 0;
  this->GenerateCellNormals = 0;
  this->GenerateCellTCoords = 0;
  this->GenerateCellTensors = 0;
  this->GenerateCellArray = 0;

  this->GenerateFieldArray = 0;
70 71 72 73 74 75 76 77 78 79 80 81 82 83
  this->AttributesConstantPerBlock = false;
}

// ----------------------------------------------------------------------------
template <class T>
void GenerateRandomTuple (T *data,
                          vtkIdType i,
                          int numComp,
                          int minComp,
                          int maxComp,
                          double min,
                          double max)
{
  for ( int comp=minComp; comp <= maxComp; comp++ )
84
  {
85 86
    // Now generate a random component value
    data[i*numComp + comp] = static_cast<T>(vtkMath::Random(min,max));
87
  }
88 89 90 91 92 93 94 95 96
}

// ----------------------------------------------------------------------------
void GenerateRandomTupleBit (vtkDataArray* data,
                             vtkIdType i,
                             int minComp,
                             int maxComp)
{
  for ( int comp=minComp; comp <= maxComp; comp++ )
97
  {
98 99 100
    // Now generate a random component value
    data->SetComponent(i,comp,
                       vtkMath::Random(0.0,1.0)<0.5?0:1);
101
  }
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
}


// ----------------------------------------------------------------------------
template <class T>
void CopyTupleFrom0 (T *data,
                     vtkIdType i,
                     int numComp,
                     int minComp,
                     int maxComp)
{
  memcpy(data + i * numComp + minComp, data + minComp,
         (maxComp - minComp + 1) * sizeof (T));
}
// ----------------------------------------------------------------------------
void CopyTupleFrom0Bit (vtkDataArray* data,
                        vtkIdType i,
                        int minComp,
                        int maxComp)
{
  for ( int comp=minComp; comp <= maxComp; comp++ )
123
  {
124
    data->SetComponent(i, comp, data->GetComponent(0, comp));
125
  }
126 127
}

128
// ----------------------------------------------------------------------------
129 130 131
// This function template creates random attributes within a given range. It is
// assumed that the input data array may have a variable number of components.
template <class T>
132 133 134 135 136 137 138
void vtkRandomAttributeGenerator::GenerateRandomTuples(T *data,
                                                       vtkIdType numTuples,
                                                       int numComp,
                                                       int minComp,
                                                       int maxComp,
                                                       double min,
                                                       double max)
139
{
140 141
  if (numTuples == 0)
    return;
142 143
  vtkIdType total = numComp * numTuples;
  vtkIdType tenth = total/10 + 1;
144 145
  GenerateRandomTuple(data, 0, numComp, minComp, maxComp, min, max);
  for ( vtkIdType i=1; i < numTuples; i++ )
146
  {
luz.paz's avatar
luz.paz committed
147
    // update progress and check for aborts
148
    if ( ! (i % tenth) )
149
    {
150 151
      this->UpdateProgress(static_cast<double>(i)/total);
      if ( this->GetAbortExecute() )
152
      {
153 154
        break;
      }
155
    }
156
    if (this->AttributesConstantPerBlock)
157
    {
158
      CopyTupleFrom0 (data, i, numComp, minComp, maxComp);
159
    }
160
    else
161
    {
162 163
      GenerateRandomTuple (data, i, numComp, minComp, maxComp, min, max);
    }
164
  }
165 166
}

167
// ----------------------------------------------------------------------------
168
// This method does the data type allocation and switching for various types.
169 170
vtkDataArray *vtkRandomAttributeGenerator::GenerateData(int dataType,
                                                        vtkIdType numTuples,
171
                                                        int numComp,
172 173 174 175
                                                        int minComp,
                                                        int maxComp,
                                                        double min,
                                                        double max)
176
{
177
  vtkDataArray *dataArray=nullptr;
178

179
  switch(dataType)
180
  {
181
    case VTK_CHAR:
182
    {
183 184 185 186
      dataArray = vtkCharArray::New();
      dataArray->SetNumberOfComponents(numComp);
      dataArray->SetNumberOfTuples(numTuples);
      char *data = static_cast<vtkCharArray*>(dataArray)->GetPointer(0);
187 188
      this->GenerateRandomTuples(data,numTuples,numComp,
                                 minComp,maxComp,min,max);
189
    }
190 191
      break;
    case VTK_UNSIGNED_CHAR:
192
    {
193 194 195
      dataArray = vtkUnsignedCharArray::New();
      dataArray->SetNumberOfComponents(numComp);
      dataArray->SetNumberOfTuples(numTuples);
196 197
      unsigned char *data=
        static_cast<vtkUnsignedCharArray*>(dataArray)->GetPointer(0);
198 199
      this->GenerateRandomTuples(data,numTuples,numComp,
                                 minComp,maxComp,min,max);
200
    }
201 202
      break;
    case VTK_SHORT:
203
    {
204 205 206 207
      dataArray = vtkShortArray::New();
      dataArray->SetNumberOfComponents(numComp);
      dataArray->SetNumberOfTuples(numTuples);
      short *data = static_cast<vtkShortArray*>(dataArray)->GetPointer(0);
208 209
      this->GenerateRandomTuples(data,numTuples,numComp,
                                 minComp,maxComp,min,max);
210
    }
211 212
      break;
    case VTK_UNSIGNED_SHORT:
213
    {
214 215 216
      dataArray = vtkUnsignedShortArray::New();
      dataArray->SetNumberOfComponents(numComp);
      dataArray->SetNumberOfTuples(numTuples);
217 218
      unsigned short *data=
        static_cast<vtkUnsignedShortArray*>(dataArray)->GetPointer(0);
219 220
      this->GenerateRandomTuples(data,numTuples,numComp,
                                 minComp,maxComp,min,max);
221
    }
222 223
      break;
    case VTK_INT:
224
    {
225 226 227 228
      dataArray = vtkIntArray::New();
      dataArray->SetNumberOfComponents(numComp);
      dataArray->SetNumberOfTuples(numTuples);
      int *data = static_cast<vtkIntArray*>(dataArray)->GetPointer(0);
229 230
      this->GenerateRandomTuples(data,numTuples,numComp,
                                 minComp,maxComp,min,max);
231
    }
232 233
      break;
    case VTK_UNSIGNED_INT:
234
    {
235 236 237
      dataArray = vtkUnsignedIntArray::New();
      dataArray->SetNumberOfComponents(numComp);
      dataArray->SetNumberOfTuples(numTuples);
238 239
      unsigned int *data =
        static_cast<vtkUnsignedIntArray*>(dataArray)->GetPointer(0);
240 241
      this->GenerateRandomTuples(data,numTuples,numComp,
                                 minComp,maxComp,min,max);
242
    }
243 244
      break;
    case VTK_LONG:
245
    {
246 247 248 249
      dataArray = vtkLongArray::New();
      dataArray->SetNumberOfComponents(numComp);
      dataArray->SetNumberOfTuples(numTuples);
      long *data = static_cast<vtkLongArray*>(dataArray)->GetPointer(0);
250 251
      this->GenerateRandomTuples(data,numTuples,numComp,
                                 minComp,maxComp,min,max);
252
    }
253 254
      break;
    case VTK_UNSIGNED_LONG:
255
    {
256 257 258
      dataArray = vtkUnsignedLongArray::New();
      dataArray->SetNumberOfComponents(numComp);
      dataArray->SetNumberOfTuples(numTuples);
259 260
      unsigned long *data =
        static_cast<vtkUnsignedLongArray*>(dataArray)->GetPointer(0);
261 262
      this->GenerateRandomTuples(data,numTuples,numComp,
                                 minComp,maxComp,min,max);
263
    }
264
      break;
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
    case VTK_LONG_LONG:
    {
      dataArray = vtkLongLongArray::New();
      dataArray->SetNumberOfComponents(numComp);
      dataArray->SetNumberOfTuples(numTuples);
      long long* data = static_cast<vtkLongLongArray*>(dataArray)->GetPointer(0);
      this->GenerateRandomTuples(data,numTuples,numComp,
                                 minComp,maxComp,min,max);
    }
      break;
    case VTK_UNSIGNED_LONG_LONG:
    {
      dataArray = vtkUnsignedLongLongArray::New();
      dataArray->SetNumberOfComponents(numComp);
      dataArray->SetNumberOfTuples(numTuples);
      unsigned long long* data =
        static_cast<vtkUnsignedLongLongArray*>(dataArray)->GetPointer(0);
      this->GenerateRandomTuples(data,numTuples,numComp,
                                 minComp,maxComp,min,max);
    }
      break;
286
    case VTK_FLOAT:
287
    {
288 289 290 291
      dataArray = vtkFloatArray::New();
      dataArray->SetNumberOfComponents(numComp);
      dataArray->SetNumberOfTuples(numTuples);
      float *data = static_cast<vtkFloatArray*>(dataArray)->GetPointer(0);
292 293
      this->GenerateRandomTuples(data,numTuples,numComp,
                                 minComp,maxComp,min,max);
294
    }
295 296
      break;
    case VTK_DOUBLE:
297
    {
298 299 300 301
      dataArray = vtkDoubleArray::New();
      dataArray->SetNumberOfComponents(numComp);
      dataArray->SetNumberOfTuples(numTuples);
      double *data = static_cast<vtkDoubleArray*>(dataArray)->GetPointer(0);
302 303
      this->GenerateRandomTuples(data,numTuples,numComp,
                                 minComp,maxComp,min,max);
304
    }
305 306
      break;
    case VTK_ID_TYPE:
307
    {
308 309 310 311
      dataArray = vtkIdTypeArray::New();
      dataArray->SetNumberOfComponents(numComp);
      dataArray->SetNumberOfTuples(numTuples);
      vtkIdType *data = static_cast<vtkIdTypeArray*>(dataArray)->GetPointer(0);
312 313
      this->GenerateRandomTuples(data,numTuples,numComp,
                                 minComp,maxComp,min,max);
314
    }
315 316
      break;
    case VTK_BIT: //we'll do something special for bit arrays
317
    {
318 319 320 321 322
      vtkIdType total = numComp * numTuples;
      vtkIdType tenth = total/10 + 1;
      dataArray = vtkBitArray::New();
      dataArray->SetNumberOfComponents(numComp);
      dataArray->SetNumberOfTuples(numTuples);
323 324 325 326
      if (numTuples == 0)
        break;
      GenerateRandomTupleBit (dataArray, 0, minComp, maxComp);
      for ( vtkIdType i=1; i < numTuples; i++ )
327
      {
luz.paz's avatar
luz.paz committed
328
        // update progress and check for aborts
329
        if ( ! (i % tenth) )
330
        {
331 332
          this->UpdateProgress(static_cast<double>(i)/total);
          if ( this->GetAbortExecute() )
333
          {
334 335
            break;
          }
336
        }
337
        if (this->AttributesConstantPerBlock)
338
        {
339
          CopyTupleFrom0Bit (dataArray, i, minComp, maxComp);
340
        }
341
        else
342
        {
343 344
          GenerateRandomTupleBit (dataArray, i, minComp, maxComp);
        }
345
      }
346
    }
347 348 349 350
      break;

    default:
      vtkGenericWarningMacro("Cannot create random data array\n");
351
  }
352

353 354 355
  return dataArray;
}

356
// ----------------------------------------------------------------------------
357
int vtkRandomAttributeGenerator::RequestData(
358 359
  vtkCompositeDataSet *input,
  vtkCompositeDataSet *output)
360
{
361
  if (input == nullptr || output == nullptr)
362
  {
363
    return 0;
364
  }
365
  output->CopyStructure(input);
366

367 368 369
  vtkSmartPointer<vtkCompositeDataIterator> it;
  it.TakeReference (input->NewIterator());
  for (it->InitTraversal(); !it->IsDoneWithTraversal(); it->GoToNextItem())
370
  {
371 372 373 374 375
    vtkDataSet* inputDS = vtkDataSet::SafeDownCast(it->GetCurrentDataObject());
    vtkSmartPointer<vtkDataSet> outputDS;
    outputDS.TakeReference(inputDS->NewInstance ());
    output->SetDataSet (it, outputDS);
    RequestData (inputDS, outputDS);
376
  }
377 378
  return 1;
}
379 380


381 382 383 384 385
// ----------------------------------------------------------------------------
int vtkRandomAttributeGenerator::RequestData(
  vtkDataSet *input,
  vtkDataSet *output)
{
386 387 388 389 390
  vtkDebugMacro(<< "Producing random attributes");
  vtkIdType numPts = input->GetNumberOfPoints();
  vtkIdType numCells = input->GetNumberOfCells();

  if ( numPts < 1 )
391
  {
392 393
    vtkDebugMacro(<< "No input!");
    return 1;
394
  }
395 396 397 398 399 400 401 402

  // Configure the output
  output->CopyStructure(input);
  output->CopyAttributes(input);

  // Produce the appropriate output
  // First the point data
  if ( this->GeneratePointScalars)
403
  {
404 405 406 407 408
    vtkDataArray *ptScalars = this->GenerateData(this->DataType,numPts,
                                                 this->NumberOfComponents,0,
                                                 this->NumberOfComponents-1,
                                                 this->MinimumComponentValue,
                                                 this->MaximumComponentValue);
409
    ptScalars->SetName("RandomPointScalars");
410 411
    output->GetPointData()->SetScalars(ptScalars);
    ptScalars->Delete();
412
  }
413
  if ( this->GeneratePointVectors)
414
  {
415 416 417
    vtkDataArray *ptVectors = this->GenerateData(this->DataType,numPts,3,0,2,
                                                 this->MinimumComponentValue,
                                                 this->MaximumComponentValue);
418
    ptVectors->SetName("RandomPointVectors");
419 420
    output->GetPointData()->SetVectors(ptVectors);
    ptVectors->Delete();
421
  }
422
  if ( this->GeneratePointNormals)
423
  {
424 425 426
    vtkDataArray *ptNormals = this->GenerateData(this->DataType,numPts,3,0,2,
                                                 this->MinimumComponentValue,
                                                 this->MaximumComponentValue);
427 428
    double v[3];
    for ( vtkIdType id=0; id < numPts; id++ )
429
    {
430 431 432
      ptNormals->GetTuple(id,v);
      vtkMath::Normalize(v);
      ptNormals->SetTuple(id,v);
433
    }
434 435
    output->GetPointData()->SetNormals(ptNormals);
    ptNormals->Delete();
436
  }
437
  if ( this->GeneratePointTensors)
438
  {
439 440 441 442
    // fill in 6 components, and then shift them around to make them symmetric
    vtkDataArray *ptTensors = this->GenerateData(this->DataType,numPts,9,0,5,
                                                 this->MinimumComponentValue,
                                                 this->MaximumComponentValue);
443
    ptTensors->SetName("RandomPointTensors");
444 445
    double t[9];
    for ( vtkIdType id=0; id < numPts; id++ )
446
    {
447 448 449 450 451 452
      ptTensors->GetTuple(id,t);
      t[8] = t[3];//make sure the tensor is symmetric
      t[3] = t[1];
      t[6] = t[2];
      t[7] = t[5];
      ptTensors->SetTuple(id,t);
453
    }
454 455
    output->GetPointData()->SetTensors(ptTensors);
    ptTensors->Delete();
456
  }
457
  if ( this->GeneratePointTCoords)
458
  {
459 460 461 462 463 464
    int numComp = this->NumberOfComponents < 1 ? 1
      :(this->NumberOfComponents > 3 ? 3 : this->NumberOfComponents);
    vtkDataArray *ptTCoords = this->GenerateData(this->DataType,numPts,numComp,
                                                 0,this->NumberOfComponents-1,
                                                 this->MinimumComponentValue,
                                                 this->MaximumComponentValue);
465 466
    output->GetPointData()->SetTCoords(ptTCoords);
    ptTCoords->Delete();
467
  }
468
  if ( this->GeneratePointArray)
469
  {
470 471 472 473 474 475 476 477
    vtkDataArray *ptData = this->GenerateData(this->DataType,numPts,
                                              this->NumberOfComponents,0,
                                              this->NumberOfComponents-1,
                                              this->MinimumComponentValue,
                                              this->MaximumComponentValue);
    ptData->SetName("RandomPointArray");
    output->GetPointData()->AddArray(ptData);
    ptData->Delete();
478
  }
479

480 481

  if ( numCells < 1 )
482
  {
483 484
    vtkDebugMacro(<< "No input!");
    return 1;
485
  }
486 487


488 489
  // Now the cell data
  if ( this->GenerateCellScalars)
490
  {
491 492 493 494 495 496 497 498
    vtkDataArray *cellScalars = this->GenerateData(this->DataType,numCells,
                                                   this->NumberOfComponents,0,
                                                   this->NumberOfComponents-1,
                                                   this->MinimumComponentValue,
                                                   this->MaximumComponentValue);
    cellScalars->SetName("RandomCellScalars");
    output->GetCellData()->SetScalars(cellScalars);
    cellScalars->Delete();
499
  }
500
  if ( this->GenerateCellVectors)
501
  {
502 503 504 505 506 507
    vtkDataArray *cellVectors = this->GenerateData(this->DataType,numCells,3,0,2,
                                                   this->MinimumComponentValue,
                                                   this->MaximumComponentValue);
    cellVectors->SetName("RandomCellVectors");
    output->GetCellData()->SetVectors(cellVectors);
    cellVectors->Delete();
508
  }
509
  if ( this->GenerateCellNormals)
510
  {
511 512 513
    vtkDataArray *cellNormals = this->GenerateData(this->DataType,numCells,3,0,2,
                                                   this->MinimumComponentValue,
                                                   this->MaximumComponentValue);
514 515
    double v[3];
    for ( vtkIdType id=0; id < numCells; id++ )
516
    {
517
      cellNormals->GetTuple(id,v);
518
      vtkMath::Normalize(v);
519
      cellNormals->SetTuple(id,v);
520
    }
521 522
    output->GetCellData()->SetNormals(cellNormals);
    cellNormals->Delete();
523
  }
524
  if ( this->GenerateCellTensors)
525
  {
526 527 528 529
    vtkDataArray *cellTensors = this->GenerateData(this->DataType,numCells,9,0,5,
                                                   this->MinimumComponentValue,
                                                   this->MaximumComponentValue);
    cellTensors->SetName("RandomCellTensors");
530 531
    double t[9];
    for ( vtkIdType id=0; id < numCells; id++ )
532
    {
533
      cellTensors->GetTuple(id,t);
534 535 536
      t[6] = t[1];//make sure the tensor is symmetric
      t[7] = t[2];
      t[8] = t[4];
537
      cellTensors->SetTuple(id,t);
538
    }
539 540
    output->GetCellData()->SetTensors(cellTensors);
    cellTensors->Delete();
541
  }
542
  if ( this->GenerateCellTCoords)
543
  {
544 545
    int numComp = this->NumberOfComponents < 1 ? 1
      : (this->NumberOfComponents > 3 ? 3 : this->NumberOfComponents);
546 547 548 549 550 551 552
    vtkDataArray *cellTCoords = this->GenerateData(this->DataType,numCells,
                                                   numComp,0,
                                                   this->NumberOfComponents-1,
                                                   this->MinimumComponentValue,
                                                   this->MaximumComponentValue);
    output->GetCellData()->SetTCoords(cellTCoords);
    cellTCoords->Delete();
553
  }
554
  if ( this->GenerateCellArray)
555
  {
556
    vtkDataArray *cellArray = this->GenerateData(this->DataType,numCells,
557 558 559 560
                                                 this->NumberOfComponents,0,
                                                 this->NumberOfComponents-1,
                                                 this->MinimumComponentValue,
                                                 this->MaximumComponentValue);
561 562 563
    cellArray->SetName("RandomCellArray");
    output->GetCellData()->AddArray(cellArray);
    cellArray->Delete();
564
  }
565

566 567
  // Finally any field data
  if ( this->GenerateFieldArray)
568
  {
569 570 571 572 573 574
    vtkDataArray *data = this->GenerateData(this->DataType,
                                            this->NumberOfTuples,
                                            this->NumberOfComponents,0,
                                            this->NumberOfComponents-1,
                                            this->MinimumComponentValue,
                                            this->MaximumComponentValue);
575
    data->SetName("RandomFieldArray");
576 577
    output->GetFieldData()->AddArray(data);
    data->Delete();
578
  }
579 580 581
  return 1;
}

582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597
// ----------------------------------------------------------------------------
int vtkRandomAttributeGenerator::RequestData(
  vtkInformation *vtkNotUsed(request),
  vtkInformationVector **inputVector,
  vtkInformationVector *outputVector)
{
  // get the info objects
  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
  vtkInformation *outInfo = outputVector->GetInformationObject(0);


  // get the input and output
  vtkDataObject *input = inInfo->Get(vtkDataObject::DATA_OBJECT());
  vtkDataObject *output = outInfo->Get(vtkDataObject::DATA_OBJECT());

  if (input->IsA ("vtkDataSet"))
598
  {
599 600
    return this->RequestData (vtkDataSet::SafeDownCast (input),
                              vtkDataSet::SafeDownCast (output));
601
  }
602
  else
603
  {
604 605
    return this->RequestData (vtkCompositeDataSet::SafeDownCast (input),
                              vtkCompositeDataSet::SafeDownCast (output));
606
  }
607 608
}

609
// ----------------------------------------------------------------------------
610 611 612 613
void vtkRandomAttributeGenerator::PrintSelf(ostream& os, vtkIndent indent)
{
  this->Superclass::PrintSelf(os,indent);

614 615 616 617 618 619 620
  os << indent << "Data Type: " << this->DataType << endl;
  os << indent << "Number of Components: " << this->NumberOfComponents << endl;
  os << indent << "Number of Tuples: " << this->NumberOfTuples << endl;
  os << indent << "Minimum Component Value: " << this->MinimumComponentValue
     << endl;
  os << indent << "Maximum Component Value: " << this->MaximumComponentValue
     << endl;
621

622
  os << indent << "Generate Point Scalars: "
623
     << (this->GeneratePointScalars ? "On\n" : "Off\n");
624
  os << indent << "Generate Point Vectors: "
625
     << (this->GeneratePointVectors ? "On\n" : "Off\n");
626
  os << indent << "Generate Point Normals: "
627
     << (this->GeneratePointNormals ? "On\n" : "Off\n");
628
  os << indent << "Generate Point TCoords: "
629
     << (this->GeneratePointTCoords ? "On\n" : "Off\n");
630
  os << indent << "Generate Point Tensors: "
631
     << (this->GeneratePointTensors ? "On\n" : "Off\n");
632
  os << indent << "Generate Point Array: "
633
     << (this->GeneratePointArray ? "On\n" : "Off\n");
634 635

  os << indent << "Generate Cell Scalars: "
636
     << (this->GenerateCellScalars ? "On\n" : "Off\n");
637
  os << indent << "Generate Cell Vectors: "
638
     << (this->GenerateCellVectors ? "On\n" : "Off\n");
639
  os << indent << "Generate Cell Normals: "
640
     << (this->GenerateCellNormals ? "On\n" : "Off\n");
641
  os << indent << "Generate Cell TCoords: "
642
     << (this->GenerateCellTCoords ? "On\n" : "Off\n");
643
  os << indent << "Generate Cell Tensors: "
644
     << (this->GenerateCellTensors ? "On\n" : "Off\n");
645
  os << indent << "Generate Cell Array: "
646
     << (this->GenerateCellArray ? "On\n" : "Off\n");
647 648 649

  os << indent << "Generate Field Array: "
     << (this->GenerateFieldArray ? "On\n" : "Off\n");
650
}
651 652 653 654 655 656 657 658

int vtkRandomAttributeGenerator::FillInputPortInformation(
  int vtkNotUsed(port), vtkInformation* info)
{
  info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkDataSet");
  info->Append(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkCompositeDataSet");
  return 1;
}