------------------------------------------------------------------------------
| 137 | |
| 138 | //------------------------------------------------------------------------------ |
| 139 | void 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 | //------------------------------------------------------------------------------ |
| 181 | void vtkCameraPathRepresentation::SetParametricSpline(vtkParametricSpline* spline) |
no test coverage detected