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

Method LassoSelect

Views/Infovis/vtkParallelCoordinatesRepresentation.cxx:1393–1436  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1391
1392//------------------------------------------------------------------------------
1393void 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//------------------------------------------------------------------------------
1439void vtkParallelCoordinatesRepresentation::LassoSelectInternal(

Callers 1

SelectDataMethod · 0.80

Calls 9

ComputePointPositionMethod · 0.95
LassoSelectInternalMethod · 0.95
SelectRowsMethod · 0.95
NewFunction · 0.50
GetNumberOfPointsMethod · 0.45
GetPointMethod · 0.45
InitializeMethod · 0.45
InsertNextPointMethod · 0.45
SetInputMethod · 0.45

Tested by

no test coverage detected