MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / updateSelection_

Method updateSelection_

source/MRViewer/MRSceneObjectsListDrawer.cpp:749–777  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

747}
748
749void SceneObjectsListDrawer::updateSelection_( Object* objPtr, const std::vector<std::shared_ptr<Object>>& selected, const std::vector<std::shared_ptr<Object>>& all )
750{
751 auto newSelection = getPreSelection_( objPtr, ImGui::GetIO().KeyShift, ImGui::IsKeyDown( UI::getImGuiModPrimaryCtrl() ), selected, all );
752 if ( ImGui::IsKeyDown( UI::getImGuiModPrimaryCtrl() ) )
753 {
754 for ( auto& sel : newSelection )
755 {
756 const bool select = ImGui::GetIO().KeyShift || !sel->isSelected();
757 sel->select( select );
758 if ( showNewSelectedObjects_ && select )
759 sel->setGlobalVisibility( true );
760 }
761 }
762 else
763 {
764 for ( const auto& data : selected )
765 {
766 auto inNewSelList = std::find( newSelection.begin(), newSelection.end(), data.get() );
767 if ( inNewSelList == newSelection.end() )
768 data->select( false );
769 }
770 for ( auto& sel : newSelection )
771 {
772 sel->select( true );
773 if ( showNewSelectedObjects_ )
774 sel->setGlobalVisibility( true );
775 }
776 }
777}
778
779}

Callers

nothing calls this directly

Calls 8

getImGuiModPrimaryCtrlFunction · 0.85
isSelectedMethod · 0.80
setGlobalVisibilityMethod · 0.80
findFunction · 0.50
selectMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected