------------------------------------------------------------------------------
| 1020 | |
| 1021 | //------------------------------------------------------------------------------ |
| 1022 | void vtkAxisActor2D::BuildAxis(vtkViewport* viewport) |
| 1023 | { |
| 1024 | if (!this->ShouldRebuild(viewport)) |
| 1025 | { |
| 1026 | return; |
| 1027 | } |
| 1028 | |
| 1029 | vtkDebugMacro(<< "Rebuilding axis"); |
| 1030 | |
| 1031 | this->AxisActor->SetProperty(this->GetProperty()); |
| 1032 | |
| 1033 | this->UpdateAdjustedRange(); |
| 1034 | |
| 1035 | this->UpdateTicksValueAndPosition(viewport); |
| 1036 | |
| 1037 | int nLabels = this->NumberOfLabelsBuilt; |
| 1038 | |
| 1039 | if (this->LabelActors.size() < static_cast<size_t>(nLabels)) |
| 1040 | { |
| 1041 | size_t oldSize = this->LabelActors.size(); |
| 1042 | this->LabelActors.resize(nLabels); |
| 1043 | this->LabelMappers.resize(nLabels); |
| 1044 | |
| 1045 | for (size_t i = oldSize; i < static_cast<size_t>(nLabels); ++i) |
| 1046 | { |
| 1047 | this->LabelMappers[i] = vtkSmartPointer<vtkTextMapper>::New(); |
| 1048 | this->LabelActors[i] = vtkSmartPointer<vtkActor2D>::New(); |
| 1049 | this->LabelActors[i]->SetMapper(this->LabelMappers[i]); |
| 1050 | } |
| 1051 | } |
| 1052 | else if (this->LabelActors.size() > static_cast<size_t>(nLabels)) |
| 1053 | { |
| 1054 | this->LabelActors.resize(nLabels); |
| 1055 | this->LabelMappers.resize(nLabels); |
| 1056 | } |
| 1057 | |
| 1058 | this->BuildTicksPolyData(viewport); |
| 1059 | |
| 1060 | if (this->LabelVisibility) |
| 1061 | { |
| 1062 | this->BuildLabels(viewport); |
| 1063 | } |
| 1064 | |
| 1065 | if (this->Title != nullptr && this->Title[0] != 0 && this->TitleVisibility) |
| 1066 | { |
| 1067 | this->BuildTitle(viewport); |
| 1068 | } |
| 1069 | |
| 1070 | this->UpdateCachedInformations(viewport); |
| 1071 | |
| 1072 | this->BuildTime.Modified(); |
| 1073 | } |
| 1074 | |
| 1075 | //------------------------------------------------------------------------------ |
| 1076 | vtkPoints* vtkAxisActor2D::GetTickPositions() |
no test coverage detected