------------------------------------------------------------------------------
| 46 | |
| 47 | //------------------------------------------------------------------------------ |
| 48 | void vtkCameraPathRepresentation::BuildRepresentation() |
| 49 | { |
| 50 | if (this->NumberOfHandles < 1) |
| 51 | { |
| 52 | return; |
| 53 | } |
| 54 | this->ValidPick = 1; |
| 55 | // change spline's number of points |
| 56 | vtkPoints* points = this->ParametricSpline->GetPoints(); |
| 57 | if (points->GetNumberOfPoints() != this->NumberOfHandles) |
| 58 | { |
| 59 | points->SetNumberOfPoints(this->NumberOfHandles); |
| 60 | } |
| 61 | |
| 62 | vtkBoundingBox bbox; |
| 63 | for (int i = 0; i < this->NumberOfHandles; ++i) |
| 64 | { |
| 65 | double pt[3]; |
| 66 | this->CameraHandles[i]->GetPosition(pt); |
| 67 | points->SetPoint(i, pt); |
| 68 | bbox.AddPoint(pt); |
| 69 | } |
| 70 | this->ParametricSpline->SetClosed(this->Closed); |
| 71 | this->ParametricSpline->Modified(); |
| 72 | |
| 73 | this->ParametricFunctionSource->Update(); |
| 74 | |
| 75 | double bounds[6]; |
| 76 | bbox.GetBounds(bounds); |
| 77 | this->InitialLength = sqrt((bounds[1] - bounds[0]) * (bounds[1] - bounds[0]) + |
| 78 | (bounds[3] - bounds[2]) * (bounds[3] - bounds[2]) + |
| 79 | (bounds[5] - bounds[4]) * (bounds[5] - bounds[4])); |
| 80 | this->SizeHandles(); |
| 81 | } |
| 82 | |
| 83 | //------------------------------------------------------------------------------ |
| 84 | void vtkCameraPathRepresentation::AddCameraAt(vtkCamera* camera, int index) |
no test coverage detected