------------------------------------------------------------------------------
| 1391 | |
| 1392 | //------------------------------------------------------------------------------ |
| 1393 | void vtkParallelCoordinatesRepresentation::LassoSelect( |
| 1394 | int brushClass, int brushOperator, vtkPoints* brushPoints) |
| 1395 | { |
| 1396 | if (brushPoints->GetNumberOfPoints() < 2) |
| 1397 | return; |
| 1398 | |
| 1399 | int position = -1, prevPosition = -1; |
| 1400 | |
| 1401 | vtkSmartPointer<vtkBivariateLinearTableThreshold> threshold = |
| 1402 | nullptr; // vtkSmartPointer<vtkBivariateLinearTableThreshold>::New(); |
| 1403 | vtkSmartPointer<vtkIdTypeArray> allIds = vtkSmartPointer<vtkIdTypeArray>::New(); |
| 1404 | |
| 1405 | // for every point in the brush, compute a line in XY space. A point in XY space satisfies |
| 1406 | // the threshold if it is contained WITHIN all such lines. |
| 1407 | vtkSmartPointer<vtkPoints> posPoints = vtkSmartPointer<vtkPoints>::New(); |
| 1408 | for (int i = 0; i < brushPoints->GetNumberOfPoints() - 1; i++) |
| 1409 | { |
| 1410 | double* p = brushPoints->GetPoint(i); |
| 1411 | position = this->ComputePointPosition(p); |
| 1412 | |
| 1413 | // if we have a valid position |
| 1414 | if (position >= 0 && position < this->NumberOfAxes) |
| 1415 | { |
| 1416 | // position has changed, that means we need to create a new threshold object. |
| 1417 | if (prevPosition != position && i > 0) |
| 1418 | { |
| 1419 | this->LassoSelectInternal(posPoints, allIds); |
| 1420 | posPoints->Initialize(); |
| 1421 | } |
| 1422 | |
| 1423 | posPoints->InsertNextPoint(p); |
| 1424 | } |
| 1425 | prevPosition = position; |
| 1426 | } |
| 1427 | |
| 1428 | if (posPoints->GetNumberOfPoints() > 0) |
| 1429 | { |
| 1430 | this->LassoSelectInternal(posPoints, allIds); |
| 1431 | } |
| 1432 | |
| 1433 | this->FunctionTextMapper->SetInput("No function selected."); |
| 1434 | this->FunctionTextActor->VisibilityOff(); |
| 1435 | this->SelectRows(brushClass, brushOperator, allIds); |
| 1436 | } |
| 1437 | |
| 1438 | //------------------------------------------------------------------------------ |
| 1439 | void vtkParallelCoordinatesRepresentation::LassoSelectInternal( |
no test coverage detected