| 1256 | } |
| 1257 | |
| 1258 | void vtkBrokenLineWidget::InsertHandleOnLine(double* pos) |
| 1259 | { |
| 1260 | if (this->NumberOfHandles < 2) |
| 1261 | { |
| 1262 | return; |
| 1263 | } |
| 1264 | |
| 1265 | vtkIdType id = this->LinePicker->GetCellId(); |
| 1266 | if (id == -1) |
| 1267 | { |
| 1268 | return; |
| 1269 | } |
| 1270 | |
| 1271 | vtkIdType subid = this->LinePicker->GetSubId(); |
| 1272 | vtkPoints* newpoints = vtkPoints::New(VTK_DOUBLE); |
| 1273 | newpoints->SetNumberOfPoints(this->NumberOfHandles + 1); |
| 1274 | |
| 1275 | int istart = subid; |
| 1276 | int istop = istart + 1; |
| 1277 | int count = 0; |
| 1278 | int i; |
| 1279 | for (i = 0; i <= istart; ++i) |
| 1280 | { |
| 1281 | newpoints->SetPoint(count++, this->HandleGeometry[i]->GetCenter()); |
| 1282 | } |
| 1283 | |
| 1284 | newpoints->SetPoint(count++, pos); |
| 1285 | |
| 1286 | for (i = istop; i < this->NumberOfHandles; ++i) |
| 1287 | { |
| 1288 | newpoints->SetPoint(count++, this->HandleGeometry[i]->GetCenter()); |
| 1289 | } |
| 1290 | |
| 1291 | this->InitializeHandles(newpoints); |
| 1292 | newpoints->Delete(); |
| 1293 | } |
| 1294 | |
| 1295 | void vtkBrokenLineWidget::EraseHandle(const int& index) |
| 1296 | { |
no test coverage detected