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

Method SetNumberOfHandles

Interaction/Widgets/vtkPolyLineRepresentation.cxx:86–128  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

84
85//------------------------------------------------------------------------------
86void vtkPolyLineRepresentation::SetNumberOfHandles(int npts)
87{
88 if (this->NumberOfHandles == npts)
89 {
90 return;
91 }
92 if (npts < 1)
93 {
94 vtkGenericWarningMacro(<< "vtkPolyLineRepresentation: minimum of 1 points required.");
95 return;
96 }
97
98 // Ensure that no handle is current
99 this->HighlightHandle(nullptr);
100
101 if (this->PolyLineSource->GetPoints())
102 {
103 this->ReconfigureHandles(npts);
104 }
105 else
106 {
107 // allocate the handles
108 this->CreateDefaultHandles(npts);
109 }
110
111 this->NumberOfHandles = npts;
112
113 if (this->Directional && this->NumberOfHandles >= 2)
114 {
115 this->PointHandles[this->NumberOfHandles - 1]->SetDirectional(true);
116 }
117
118 if (this->CurrentHandleIndex >= 0 && this->CurrentHandleIndex < this->NumberOfHandles)
119 {
120 this->CurrentHandleIndex = this->HighlightHandle(this->HandleActors[this->CurrentHandleIndex]);
121 }
122 else
123 {
124 this->CurrentHandleIndex = this->HighlightHandle(nullptr);
125 }
126
127 this->BuildRepresentation();
128}
129
130//------------------------------------------------------------------------------
131void vtkPolyLineRepresentation::ClearHandles()

Callers 2

InitializeHandlesMethod · 0.95

Calls 6

ReconfigureHandlesMethod · 0.95
CreateDefaultHandlesMethod · 0.95
BuildRepresentationMethod · 0.95
HighlightHandleMethod · 0.45
GetPointsMethod · 0.45
SetDirectionalMethod · 0.45

Tested by

no test coverage detected