------------------------------------------------------------------------------
| 433 | |
| 434 | //------------------------------------------------------------------------------ |
| 435 | void vtkCameraInterpolator::InterpolateCamera(double t, vtkCamera* camera) |
| 436 | { |
| 437 | if (this->CameraList->empty()) |
| 438 | { |
| 439 | return; |
| 440 | } |
| 441 | |
| 442 | // Make sure the camera and this class are initialized properly |
| 443 | this->InitializeInterpolation(); |
| 444 | |
| 445 | // Evaluate the interpolators |
| 446 | if (t < this->CameraList->front().Time) |
| 447 | { |
| 448 | t = this->CameraList->front().Time; |
| 449 | } |
| 450 | |
| 451 | else if (t > this->CameraList->back().Time) |
| 452 | { |
| 453 | t = this->CameraList->back().Time; |
| 454 | } |
| 455 | |
| 456 | double P[3], FP[3], VUP[3], CR[2], VA[1], PS[1]; |
| 457 | this->PositionInterpolator->InterpolateTuple(t, P); |
| 458 | this->FocalPointInterpolator->InterpolateTuple(t, FP); |
| 459 | this->ViewUpInterpolator->InterpolateTuple(t, VUP); |
| 460 | this->ClippingRangeInterpolator->InterpolateTuple(t, CR); |
| 461 | this->ViewAngleInterpolator->InterpolateTuple(t, VA); |
| 462 | this->ParallelScaleInterpolator->InterpolateTuple(t, PS); |
| 463 | |
| 464 | camera->SetPosition(P); |
| 465 | camera->SetFocalPoint(FP); |
| 466 | camera->SetViewUp(VUP); |
| 467 | camera->SetClippingRange(CR); |
| 468 | camera->SetViewAngle(VA[0]); |
| 469 | camera->SetParallelScale(PS[0]); |
| 470 | } |
| 471 | |
| 472 | //------------------------------------------------------------------------------ |
| 473 | void vtkCameraInterpolator::PrintSelf(ostream& os, vtkIndent indent) |