------------------------------------------------------------------------------
| 658 | |
| 659 | //------------------------------------------------------------------------------ |
| 660 | int vtkParallelCoordinatesRepresentation::ComputeDataProperties() |
| 661 | { |
| 662 | // if the data hasn't changed, there's no reason to recompute |
| 663 | if (this->BuildTime > this->GetInput()->GetMTime()) |
| 664 | { |
| 665 | return 1; |
| 666 | } |
| 667 | |
| 668 | int numberOfInputArrays = this->InputArrayTable->GetNumberOfColumns(); |
| 669 | int newNumberOfAxes = 0; |
| 670 | int newNumberOfSamples = 0; |
| 671 | |
| 672 | // stores the array names, if there are any |
| 673 | vtkSmartPointer<vtkStringArray> newtitles = vtkSmartPointer<vtkStringArray>::New(); |
| 674 | |
| 675 | for (int i = 0; i < numberOfInputArrays; i++) |
| 676 | { |
| 677 | vtkAbstractArray* array = this->InputArrayTable->GetColumn(i); |
| 678 | int numTuples = array->GetNumberOfTuples(); |
| 679 | |
| 680 | if (i > 0 && newNumberOfSamples != numTuples) |
| 681 | { |
| 682 | vtkErrorMacro(<< "Error: all arrays must have the same number of values!"); |
| 683 | return 0; |
| 684 | } |
| 685 | else |
| 686 | { |
| 687 | newNumberOfSamples = numTuples; |
| 688 | } |
| 689 | |
| 690 | newNumberOfAxes++; |
| 691 | |
| 692 | if (array->GetName()) |
| 693 | { |
| 694 | newtitles->InsertNextValue(array->GetName()); |
| 695 | } |
| 696 | } |
| 697 | |
| 698 | if (newNumberOfAxes <= 0 || newNumberOfSamples <= 0) |
| 699 | { |
| 700 | return 0; |
| 701 | } |
| 702 | |
| 703 | // did the number of axes change? reinitialize EVERYTHING. |
| 704 | if (newNumberOfAxes != this->NumberOfAxes || newNumberOfSamples != this->NumberOfSamples) |
| 705 | { |
| 706 | // make sure that the old ones get removed |
| 707 | for (int i = 0; i < this->NumberOfAxes; i++) |
| 708 | { |
| 709 | this->RemovePropOnNextRender(this->Axes[i]); |
| 710 | } |
| 711 | |
| 712 | this->NumberOfAxes = newNumberOfAxes; |
| 713 | this->NumberOfSamples = newNumberOfSamples; |
| 714 | |
| 715 | this->ReallocateInternals(); |
| 716 | } |
| 717 |
no test coverage detected