MCPcopy Create free account
hub / github.com/dartsim/dart / removeSimpleFrame

Method removeSimpleFrame

dart/simulation/World.cpp:640–670  ·  view source on GitHub ↗

==============================================================================

Source from the content-addressed store, hash-verified

638
639//==============================================================================
640void 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//==============================================================================
673std::set<dynamics::SimpleFramePtr> World::removeAllSimpleFrames()

Callers 6

WorldFunction · 0.80
handleMethod · 0.80
TESTFunction · 0.80
handleMethod · 0.80
handleMethod · 0.80
handleMethod · 0.80

Calls 7

findFunction · 0.85
removeNameMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
getNameMethod · 0.45
disconnectMethod · 0.45
getMethod · 0.45

Tested by 1

TESTFunction · 0.64