------------------------------------------------------------------------------
| 84 | |
| 85 | //------------------------------------------------------------------------------ |
| 86 | void vtkPolyLineRepresentation::SetNumberOfHandles(int npts) |
| 87 | { |
| 88 | if (this->NumberOfHandles == npts) |
| 89 | { |
| 90 | return; |
| 91 | } |
| 92 | if (npts < 1) |
| 93 | { |
| 94 | vtkGenericWarningMacro(<< "vtkPolyLineRepresentation: minimum of 1 points required."); |
| 95 | return; |
| 96 | } |
| 97 | |
| 98 | // Ensure that no handle is current |
| 99 | this->HighlightHandle(nullptr); |
| 100 | |
| 101 | if (this->PolyLineSource->GetPoints()) |
| 102 | { |
| 103 | this->ReconfigureHandles(npts); |
| 104 | } |
| 105 | else |
| 106 | { |
| 107 | // allocate the handles |
| 108 | this->CreateDefaultHandles(npts); |
| 109 | } |
| 110 | |
| 111 | this->NumberOfHandles = npts; |
| 112 | |
| 113 | if (this->Directional && this->NumberOfHandles >= 2) |
| 114 | { |
| 115 | this->PointHandles[this->NumberOfHandles - 1]->SetDirectional(true); |
| 116 | } |
| 117 | |
| 118 | if (this->CurrentHandleIndex >= 0 && this->CurrentHandleIndex < this->NumberOfHandles) |
| 119 | { |
| 120 | this->CurrentHandleIndex = this->HighlightHandle(this->HandleActors[this->CurrentHandleIndex]); |
| 121 | } |
| 122 | else |
| 123 | { |
| 124 | this->CurrentHandleIndex = this->HighlightHandle(nullptr); |
| 125 | } |
| 126 | |
| 127 | this->BuildRepresentation(); |
| 128 | } |
| 129 | |
| 130 | //------------------------------------------------------------------------------ |
| 131 | void vtkPolyLineRepresentation::ClearHandles() |
no test coverage detected