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

Method PickOrigin

Interaction/Widgets/vtkCoordinateFrameRepresentation.cxx:1348–1378  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1346
1347//------------------------------------------------------------------------------
1348bool vtkCoordinateFrameRepresentation::PickOrigin(int X, int Y, bool snapToMeshPoint)
1349{
1350 this->HardwarePicker->SetSnapToMeshPoint(snapToMeshPoint);
1351 vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->HardwarePicker);
1352 if (path == nullptr) // actors of renderer were not touched
1353 {
1354 if (this->PickCameraFocalInfo)
1355 {
1356 double pos[3];
1357 this->HardwarePicker->GetPickPosition(pos);
1358 this->SetOrigin(pos);
1359 this->BuildRepresentation();
1360 }
1361 return this->PickCameraFocalInfo;
1362 }
1363 else // actors of renderer were touched
1364 {
1365 double pos[3];
1366 this->HardwarePicker->GetPickPosition(pos);
1367 if (!std::isnan(pos[0]) || !std::isnan(pos[1]) || !std::isnan(pos[2]))
1368 {
1369 this->SetOrigin(pos);
1370 this->BuildRepresentation();
1371 return true;
1372 }
1373 else
1374 {
1375 return false;
1376 }
1377 }
1378}
1379
1380//------------------------------------------------------------------------------
1381bool vtkCoordinateFrameRepresentation::PickNormal(int X, int Y, bool snapToMeshPoint)

Callers 2

PickOriginActionMethod · 0.45
PickOriginActionMethod · 0.45

Calls 5

SetOriginMethod · 0.95
BuildRepresentationMethod · 0.95
GetPickPositionMethod · 0.80
isnanFunction · 0.50
GetAssemblyPathMethod · 0.45

Tested by

no test coverage detected