Get the target object of a direction vector definition. Return an empty selection if it's missing or refers to an object that doesn't exist.
| 1417 | // Get the target object of a direction vector definition. Return an |
| 1418 | // empty selection if it's missing or refers to an object that doesn't exist. |
| 1419 | static Selection |
| 1420 | getVectorTarget(const Universe& universe, Hash* vectorData) |
| 1421 | { |
| 1422 | string targetName; |
| 1423 | if (!vectorData->getString("Target", targetName)) |
| 1424 | { |
| 1425 | clog << "Bad two-vector frame: no target specified for vector.\n"; |
| 1426 | return Selection(); |
| 1427 | } |
| 1428 | |
| 1429 | Selection targetObject = universe.findPath(targetName, NULL, 0); |
| 1430 | if (targetObject.empty()) |
| 1431 | { |
| 1432 | clog << "Bad two-vector frame: target object '" << targetName << "' of vector not found.\n"; |
| 1433 | return Selection(); |
| 1434 | } |
| 1435 | |
| 1436 | return targetObject; |
| 1437 | } |
| 1438 | |
| 1439 | |
| 1440 | // Get the observer object of a direction vector definition. Return an |
no test coverage detected