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

Method BuildRepresentation

Interaction/Widgets/vtkCameraPathRepresentation.cxx:48–81  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

46
47//------------------------------------------------------------------------------
48void 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//------------------------------------------------------------------------------
84void vtkCameraPathRepresentation::AddCameraAt(vtkCamera* camera, int index)

Callers 1

RebuildRepresentationMethod · 0.95

Calls 12

SizeHandlesMethod · 0.95
sqrtFunction · 0.50
GetPointsMethod · 0.45
GetNumberOfPointsMethod · 0.45
SetNumberOfPointsMethod · 0.45
GetPositionMethod · 0.45
SetPointMethod · 0.45
AddPointMethod · 0.45
SetClosedMethod · 0.45
ModifiedMethod · 0.45
UpdateMethod · 0.45
GetBoundsMethod · 0.45

Tested by

no test coverage detected