------------------------------------------------------------------------------ update colors and such.
| 737 | //------------------------------------------------------------------------------ |
| 738 | // update colors and such. |
| 739 | int vtkParallelCoordinatesRepresentation::UpdatePlotProperties(vtkStringArray* inputTitles) |
| 740 | { |
| 741 | |
| 742 | this->PlotActor->GetProperty()->SetColor(this->LineColor); |
| 743 | this->PlotActor->GetProperty()->SetOpacity(this->LineOpacity); |
| 744 | this->PlotTitleActor->GetProperty()->SetColor(this->AxisLabelColor); |
| 745 | |
| 746 | if (inputTitles) |
| 747 | { |
| 748 | this->AxisTitles->DeepCopy(inputTitles); |
| 749 | } |
| 750 | // make sure we have sufficient plot titles |
| 751 | if (this->NumberOfAxes != this->AxisTitles->GetNumberOfValues()) |
| 752 | { |
| 753 | vtkWarningMacro(<< "Warning: wrong number of axis titles, using default labels."); |
| 754 | |
| 755 | this->AxisTitles->Initialize(); |
| 756 | for (int i = 0; i < this->NumberOfAxes; i++) |
| 757 | { |
| 758 | char title[16]; |
| 759 | auto result = vtk::format_to_n(title, sizeof(title), "{:c}", i + 65); |
| 760 | *result.out = '\0'; |
| 761 | this->AxisTitles->InsertNextValue(title); |
| 762 | } |
| 763 | } |
| 764 | |
| 765 | // set everything on the axes |
| 766 | for (int i = 0; i < this->NumberOfAxes; i++) |
| 767 | { |
| 768 | this->Axes[i]->SetTitle(this->AxisTitles->GetValue(i).c_str()); |
| 769 | this->Axes[i]->SetRange( |
| 770 | this->Mins[i] + this->MinOffsets[i], this->Maxs[i] + this->MaxOffsets[i]); |
| 771 | this->Axes[i]->GetProperty()->SetColor(this->AxisColor); |
| 772 | this->Axes[i]->GetTitleTextProperty()->SetColor(this->AxisLabelColor); |
| 773 | this->Axes[i]->GetLabelTextProperty()->SetColor(this->AxisLabelColor); |
| 774 | this->Axes[i]->AdjustLabelsOff(); |
| 775 | this->Axes[i]->GetProperty()->SetLineWidth(2.0); |
| 776 | this->Axes[i]->SetLabelFactor(0.5); |
| 777 | this->Axes[i]->TickVisibilityOff(); |
| 778 | this->Axes[i]->SetNumberOfLabels(this->NumberOfAxisLabels); |
| 779 | this->Axes[i]->SetTitlePosition(0); |
| 780 | this->Axes[i]->GetTitleTextProperty()->ItalicOff(); |
| 781 | this->Axes[i]->GetTitleTextProperty()->BoldOff(); |
| 782 | this->Axes[i]->GetLabelTextProperty()->ItalicOff(); |
| 783 | this->Axes[i]->GetLabelTextProperty()->BoldOff(); |
| 784 | this->Axes[i]->SetFontFactor(this->FontSize); |
| 785 | this->Axes[i]->GetTitleTextProperty()->Modified(); |
| 786 | } |
| 787 | |
| 788 | for (int i = 0; i < (int)this->I->SelectionActors.size(); i++) |
| 789 | { |
| 790 | this->I->SelectionActors[i]->GetProperty()->SetOpacity(this->LineOpacity); |
| 791 | this->I->SelectionActors[i]->GetProperty()->SetColor(this->I->GetColor(i)); |
| 792 | } |
| 793 | |
| 794 | return 1; |
| 795 | } |
| 796 |
no test coverage detected