| 988 | } |
| 989 | |
| 990 | void RadiantSelectionSystem::initialiseModule(const IApplicationContext& ctx) |
| 991 | { |
| 992 | _pivot.initialise(); |
| 993 | |
| 994 | // Add manipulators |
| 995 | registerManipulator(std::make_shared<DragManipulator>(_pivot, *this, *this)); |
| 996 | registerManipulator(std::make_shared<ClipManipulator>()); |
| 997 | registerManipulator(std::make_shared<TranslateManipulator>(_pivot, 2, 64.0f)); |
| 998 | registerManipulator(std::make_shared<RotateManipulator>(_pivot, 8, 64.0f)); |
| 999 | registerManipulator(std::make_shared<ModelScaleManipulator>(_pivot)); |
| 1000 | |
| 1001 | _defaultManipulatorType = IManipulator::Drag; |
| 1002 | setActiveManipulator(_defaultManipulatorType); |
| 1003 | pivotChanged(); |
| 1004 | |
| 1005 | _sigSelectionChanged.connect( |
| 1006 | sigc::mem_fun(this, &RadiantSelectionSystem::pivotChangedSelection) |
| 1007 | ); |
| 1008 | |
| 1009 | _sigSelectionChanged.connect( |
| 1010 | sigc::mem_fun(this, &RadiantSelectionSystem::checkComponentModeSelectionMode) |
| 1011 | ); |
| 1012 | |
| 1013 | GlobalGrid().signal_gridChanged().connect( |
| 1014 | sigc::mem_fun(this, &RadiantSelectionSystem::pivotChanged) |
| 1015 | ); |
| 1016 | |
| 1017 | GlobalCommandSystem().addCommand("ToggleManipulatorMode", |
| 1018 | std::bind(&RadiantSelectionSystem::toggleManipulatorModeCmd, this, std::placeholders::_1), { cmd::ARGTYPE_STRING }); |
| 1019 | |
| 1020 | GlobalCommandSystem().addCommand("ToggleEntitySelectionMode", std::bind(&RadiantSelectionSystem::toggleEntityMode, this, std::placeholders::_1)); |
| 1021 | GlobalCommandSystem().addCommand("ToggleGroupPartSelectionMode", std::bind(&RadiantSelectionSystem::toggleGroupPartMode, this, std::placeholders::_1)); |
| 1022 | GlobalCommandSystem().addCommand("ToggleMergeActionSelectionMode", std::bind(&RadiantSelectionSystem::toggleMergeActionMode, this, std::placeholders::_1)); |
| 1023 | |
| 1024 | GlobalCommandSystem().addWithCheck("ToggleSelectionFocus", |
| 1025 | [this](const auto&) { toggleSelectionFocus(); }, |
| 1026 | [this]() { return _selectionFocusActive || _selectionInfo.totalCount > 0; }); |
| 1027 | |
| 1028 | GlobalCommandSystem().addCommand("ToggleComponentSelectionMode", |
| 1029 | std::bind(&RadiantSelectionSystem::toggleComponentModeCmd, this, std::placeholders::_1), { cmd::ARGTYPE_STRING }); |
| 1030 | |
| 1031 | selection::algorithm::registerCommands(); |
| 1032 | brush::algorithm::registerCommands(); |
| 1033 | |
| 1034 | GlobalCommandSystem().addCommand("UnSelectSelection", std::bind(&RadiantSelectionSystem::deselectCmd, this, std::placeholders::_1)); |
| 1035 | |
| 1036 | GlobalCommandSystem().addCommand("RotateSelectedEulerXYZ", selection::algorithm::rotateSelectedEulerXYZ, { cmd::ARGTYPE_VECTOR3 }); |
| 1037 | GlobalCommandSystem().addCommand("ScaleSelected", selection::algorithm::scaleSelectedCmd, { cmd::ARGTYPE_VECTOR3 }); |
| 1038 | |
| 1039 | IPreferencePage& page = GlobalPreferenceSystem().getPage(_("Settings/Selection")); |
| 1040 | |
| 1041 | page.appendCheckBox(_("Ignore light volume bounds when calculating default rotation pivot location"), |
| 1042 | SceneManipulationPivot::RKEY_DEFAULT_PIVOT_LOCATION_IGNORES_LIGHT_VOLUMES); |
| 1043 | |
| 1044 | // Connect the bounds changed caller |
| 1045 | GlobalSceneGraph().signal_boundsChanged().connect( |
| 1046 | sigc::mem_fun(this, &RadiantSelectionSystem::onSceneBoundsChanged) |
| 1047 | ); |
nothing calls this directly
no test coverage detected