MCPcopy Create free account
hub / github.com/Kitware/VTK / BuildAxis

Method BuildAxis

Rendering/Annotation/vtkAxisActor2D.cxx:1022–1073  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1020
1021//------------------------------------------------------------------------------
1022void 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//------------------------------------------------------------------------------
1076vtkPoints* vtkAxisActor2D::GetTickPositions()

Callers 3

RenderOpaqueGeometryMethod · 0.95
RenderOverlayMethod · 0.95

Calls 14

ShouldRebuildMethod · 0.95
UpdateAdjustedRangeMethod · 0.95
BuildTicksPolyDataMethod · 0.95
BuildLabelsMethod · 0.95
BuildTitleMethod · 0.95
NewFunction · 0.50
SetPropertyMethod · 0.45
GetPropertyMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected