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

Method ShowPickCell

Rendering/VR/vtkVRInteractorStyle.cxx:1371–1430  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1369
1370//------------------------------------------------------------------------------
1371void vtkVRInteractorStyle::ShowPickCell(vtkCell* cell, vtkProp3D* prop)
1372{
1373 vtkNew<vtkPolyData> pd;
1374 vtkNew<vtkPoints> pdpts;
1375 pdpts->SetDataTypeToDouble();
1376 vtkNew<vtkCellArray> lines;
1377
1378 this->PickActor->GetProperty()->SetColor(this->PickColor);
1379
1380 int nedges = cell->GetNumberOfEdges();
1381
1382 if (nedges)
1383 {
1384 for (int edgenum = 0; edgenum < nedges; ++edgenum)
1385 {
1386 vtkCell* edge = cell->GetEdge(edgenum);
1387 vtkPoints* pts = edge->GetPoints();
1388 int npts = edge->GetNumberOfPoints();
1389 lines->InsertNextCell(npts);
1390 for (int ep = 0; ep < npts; ++ep)
1391 {
1392 vtkIdType newpt = pdpts->InsertNextPoint(pts->GetPoint(ep));
1393 lines->InsertCellPoint(newpt);
1394 }
1395 }
1396 }
1397 else if (cell->GetCellType() == VTK_LINE || cell->GetCellType() == VTK_POLY_LINE)
1398 {
1399 vtkPoints* pts = cell->GetPoints();
1400 int npts = cell->GetNumberOfPoints();
1401 lines->InsertNextCell(npts);
1402 for (int ep = 0; ep < npts; ++ep)
1403 {
1404 vtkIdType newpt = pdpts->InsertNextPoint(pts->GetPoint(ep));
1405 lines->InsertCellPoint(newpt);
1406 }
1407 }
1408 else
1409 {
1410 return;
1411 }
1412
1413 pd->SetPoints(pdpts.Get());
1414 pd->SetLines(lines.Get());
1415
1416 if (prop)
1417 {
1418 this->PickActor->SetPosition(prop->GetPosition());
1419 this->PickActor->SetScale(prop->GetScale());
1420 this->PickActor->SetUserMatrix(prop->GetUserMatrix());
1421 }
1422 else
1423 {
1424 this->PickActor->SetPosition(0.0, 0.0, 0.0);
1425 this->PickActor->SetScale(1.0, 1.0, 1.0);
1426 }
1427 this->PickActor->SetOrientation(prop->GetOrientation());
1428 static_cast<vtkPolyDataMapper*>(this->PickActor->GetMapper())->SetInputData(pd);

Callers

nothing calls this directly

Calls 15

InsertCellPointMethod · 0.80
SetLinesMethod · 0.80
GetUserMatrixMethod · 0.80
GetMapperMethod · 0.80
SetColorMethod · 0.45
GetPropertyMethod · 0.45
GetNumberOfEdgesMethod · 0.45
GetEdgeMethod · 0.45
GetPointsMethod · 0.45
GetNumberOfPointsMethod · 0.45
InsertNextCellMethod · 0.45
InsertNextPointMethod · 0.45

Tested by

no test coverage detected