------------------------------------------------------------------------------
| 350 | |
| 351 | //------------------------------------------------------------------------------ |
| 352 | int vtkCameraPathRepresentation::InsertHandleOnLine(double* pos) |
| 353 | { |
| 354 | if (this->NumberOfHandles < 2 || pos == nullptr) |
| 355 | { |
| 356 | return -1; |
| 357 | } |
| 358 | |
| 359 | vtkIdType id = this->LinePicker->GetCellId(); |
| 360 | if (id == -1) |
| 361 | { |
| 362 | return -1; |
| 363 | } |
| 364 | |
| 365 | vtkIdType subid = this->LinePicker->GetSubId(); |
| 366 | |
| 367 | int istart = vtkMath::Floor( |
| 368 | subid * (this->NumberOfHandles + this->Closed - 1.0) / static_cast<double>(this->Resolution)); |
| 369 | |
| 370 | istart++; |
| 371 | |
| 372 | // insert new camera |
| 373 | vtkNew<vtkCamera> cam; |
| 374 | cam->SetPosition(pos); |
| 375 | |
| 376 | // calculate the new focal point |
| 377 | vtkVector3d focusPoint1(this->CameraHandles[istart - 1]->GetDirection()); |
| 378 | vtkVector3d focusPoint2(this->CameraHandles[istart % this->NumberOfHandles]->GetDirection()); |
| 379 | focusPoint1 = (focusPoint1 + focusPoint2) / vtkVector3d(2.0); |
| 380 | cam->SetFocalPoint(focusPoint1.GetData()); |
| 381 | |
| 382 | this->AddCameraAt(cam, istart); |
| 383 | return istart; |
| 384 | } |
| 385 | |
| 386 | //------------------------------------------------------------------------------ |
| 387 | void vtkCameraPathRepresentation::EraseHandle(const int& index) |
nothing calls this directly
no test coverage detected