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

Method SetNumberOfHandles

Interaction/Widgets/vtkCameraPathRepresentation.cxx:139–178  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

137
138//------------------------------------------------------------------------------
139void vtkCameraPathRepresentation::SetNumberOfHandles(int npts)
140{
141 if (this->NumberOfHandles == npts)
142 {
143 return;
144 }
145
146 if (npts < 0)
147 {
148 vtkErrorMacro(<< "ERROR: Invalid npts, must be >= 0\n");
149 return;
150 }
151
152 if (npts == 0)
153 {
154 this->ClearCameraHandles();
155 this->NumberOfHandles = 0;
156 this->CleanRepresentation();
157 vtkGenericWarningMacro(
158 << "vtkCameraPathRepresentation: there is not any camera handle defined at the moment.");
159 return;
160 }
161
162 // Ensure no handle is highlighted
163 this->HighlightHandle(nullptr);
164
165 if (this->GetParametricSpline() && this->NumberOfHandles > 1)
166 {
167 this->ReconfigureHandles(npts, this->NumberOfHandles);
168 }
169 else
170 {
171 // reallocate the handles
172 this->CreateDefaultHandles(npts);
173 }
174
175 this->NumberOfHandles = npts;
176
177 this->RebuildRepresentation();
178}
179
180//------------------------------------------------------------------------------
181void vtkCameraPathRepresentation::SetParametricSpline(vtkParametricSpline* spline)

Callers 3

SetParametricSplineMethod · 0.95
InitializeHandlesMethod · 0.95

Calls 6

ClearCameraHandlesMethod · 0.95
ReconfigureHandlesMethod · 0.95
CreateDefaultHandlesMethod · 0.95
RebuildRepresentationMethod · 0.95
CleanRepresentationMethod · 0.80
HighlightHandleMethod · 0.45

Tested by

no test coverage detected