| 1401 | } |
| 1402 | |
| 1403 | CSVRender::DropObjectHeightHandler::DropObjectHeightHandler(WorldspaceWidget* worldspacewidget) |
| 1404 | : mWorldspaceWidget(worldspacewidget) |
| 1405 | { |
| 1406 | std::vector<osg::ref_ptr<TagBase>> selection = mWorldspaceWidget->getSelection(Mask_Reference); |
| 1407 | for (osg::ref_ptr<TagBase> tag : selection) |
| 1408 | { |
| 1409 | if (CSVRender::ObjectTag* objectTag = dynamic_cast<CSVRender::ObjectTag*>(tag.get())) |
| 1410 | { |
| 1411 | osg::ref_ptr<osg::Group> objectNodeWithGUI = objectTag->mObject->getRootNode(); |
| 1412 | osg::ref_ptr<osg::Group> objectNodeWithoutGUI = objectTag->mObject->getBaseNode(); |
| 1413 | |
| 1414 | osg::ComputeBoundsVisitor computeBounds; |
| 1415 | computeBounds.setTraversalMask(Mask_Reference); |
| 1416 | objectNodeWithoutGUI->accept(computeBounds); |
| 1417 | osg::BoundingBox bounds = computeBounds.getBoundingBox(); |
| 1418 | float boundingBoxOffset = 0.0f; |
| 1419 | if (bounds.valid()) |
| 1420 | boundingBoxOffset = bounds.zMin(); |
| 1421 | |
| 1422 | mObjectHeights.emplace_back(boundingBoxOffset); |
| 1423 | mOldMasks.emplace_back(objectNodeWithGUI->getNodeMask()); |
| 1424 | |
| 1425 | objectNodeWithGUI->setNodeMask(0); |
| 1426 | } |
| 1427 | } |
| 1428 | } |
| 1429 | |
| 1430 | CSVRender::DropObjectHeightHandler::~DropObjectHeightHandler() |
| 1431 | { |
nothing calls this directly
no test coverage detected