==============================================================================
| 638 | |
| 639 | //============================================================================== |
| 640 | void World::removeSimpleFrame(const dynamics::SimpleFramePtr& _frame) |
| 641 | { |
| 642 | DART_ASSERT( |
| 643 | _frame != nullptr |
| 644 | && "Attempted to remove nullptr SimpleFrame from world"); |
| 645 | |
| 646 | std::vector<dynamics::SimpleFramePtr>::iterator it |
| 647 | = find(mSimpleFrames.begin(), mSimpleFrames.end(), _frame); |
| 648 | |
| 649 | if (it == mSimpleFrames.end()) { |
| 650 | dtwarn << "[World::removeFrame] Frame named [" << _frame->getName() |
| 651 | << "] is not in the world.\n"; |
| 652 | return; |
| 653 | } |
| 654 | |
| 655 | std::size_t index = it - mSimpleFrames.begin(); |
| 656 | |
| 657 | // Remove the frame |
| 658 | mSimpleFrames.erase(mSimpleFrames.begin() + index); |
| 659 | |
| 660 | // Disconnect the name change monitor |
| 661 | mNameConnectionsForSimpleFrames[index].disconnect(); |
| 662 | mNameConnectionsForSimpleFrames.erase( |
| 663 | mNameConnectionsForSimpleFrames.begin() + index); |
| 664 | |
| 665 | // Remove from NameManager |
| 666 | mNameMgrForSimpleFrames.removeName(_frame->getName()); |
| 667 | |
| 668 | // Remove from the pointer map |
| 669 | mSimpleFrameToShared.erase(_frame.get()); |
| 670 | } |
| 671 | |
| 672 | //============================================================================== |
| 673 | std::set<dynamics::SimpleFramePtr> World::removeAllSimpleFrames() |