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

Method PickNormal

Interaction/Widgets/vtkCoordinateFrameRepresentation.cxx:1381–1411  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1379
1380//------------------------------------------------------------------------------
1381bool vtkCoordinateFrameRepresentation::PickNormal(int X, int Y, bool snapToMeshPoint)
1382{
1383 this->HardwarePicker->SetSnapToMeshPoint(snapToMeshPoint);
1384 vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->HardwarePicker);
1385 if (path == nullptr) // actors of renderer were not touched
1386 {
1387 if (this->PickCameraFocalInfo)
1388 {
1389 double normal[3];
1390 this->HardwarePicker->GetPickNormal(normal);
1391 this->SetNormal(normal);
1392 this->BuildRepresentation();
1393 }
1394 return this->PickCameraFocalInfo;
1395 }
1396 else // actors of renderer were touched
1397 {
1398 double normal[3];
1399 this->HardwarePicker->GetPickNormal(normal);
1400 if (!std::isnan(normal[0]) || !std::isnan(normal[1]) || !std::isnan(normal[2]))
1401 {
1402 this->SetNormal(normal);
1403 this->BuildRepresentation();
1404 return true;
1405 }
1406 else
1407 {
1408 return false;
1409 }
1410 }
1411}
1412
1413//------------------------------------------------------------------------------
1414bool vtkCoordinateFrameRepresentation::PickDirectionPoint(int X, int Y, bool snapToMeshPoint)

Callers 2

PickNormalActionMethod · 0.45
PickNormalActionMethod · 0.45

Calls 4

SetNormalMethod · 0.95
BuildRepresentationMethod · 0.95
isnanFunction · 0.50
GetAssemblyPathMethod · 0.45

Tested by

no test coverage detected