From 94c52123e0eea5d367b26565dad679ced38e10a7 Mon Sep 17 00:00:00 2001 From: codereader Date: Fri, 17 Sep 2021 19:53:34 +0200 Subject: [PATCH] #5746: Move TextureToolRotateManipulator class to textool namespace --- radiantcore/CMakeLists.txt | 2 +- .../TextureToolRotateManipulator.cpp | 12 ++++++------ .../TextureToolRotateManipulator.h | 10 +++++----- .../selection/textool/TextureToolSelectionSystem.cpp | 4 ++-- tools/msvc/DarkRadiantCore.vcxproj | 4 ++-- tools/msvc/DarkRadiantCore.vcxproj.filters | 12 ++++++------ 6 files changed, 22 insertions(+), 22 deletions(-) rename radiantcore/selection/{manipulators => textool}/TextureToolRotateManipulator.cpp (94%) rename radiantcore/selection/{manipulators => textool}/TextureToolRotateManipulator.h (90%) diff --git a/radiantcore/CMakeLists.txt b/radiantcore/CMakeLists.txt index e7c45b86ea..8de0dad05e 100644 --- a/radiantcore/CMakeLists.txt +++ b/radiantcore/CMakeLists.txt @@ -248,7 +248,6 @@ add_library(radiantcore MODULE selection/manipulators/ModelScaleManipulator.cpp selection/manipulators/RotateManipulator.cpp selection/manipulators/ScaleManipulator.cpp - selection/manipulators/TextureToolRotateManipulator.cpp selection/manipulators/TranslateManipulator.cpp selection/RadiantSelectionSystem.cpp selection/SelectedNodeList.cpp @@ -261,6 +260,7 @@ add_library(radiantcore MODULE selection/shaderclipboard/ShaderClipboard.cpp selection/shaderclipboard/Texturable.cpp selection/textool/TextureToolManipulationPivot.cpp + selection/textool/TextureToolRotateManipulator.cpp selection/textool/TextureToolSceneGraph.cpp selection/textool/TextureToolSelectionSystem.cpp selection/TransformationVisitors.cpp diff --git a/radiantcore/selection/manipulators/TextureToolRotateManipulator.cpp b/radiantcore/selection/textool/TextureToolRotateManipulator.cpp similarity index 94% rename from radiantcore/selection/manipulators/TextureToolRotateManipulator.cpp rename to radiantcore/selection/textool/TextureToolRotateManipulator.cpp index 6e57693917..2dd3f7b09b 100644 --- a/radiantcore/selection/manipulators/TextureToolRotateManipulator.cpp +++ b/radiantcore/selection/textool/TextureToolRotateManipulator.cpp @@ -7,7 +7,7 @@ #include "pivot.h" #include "math/Matrix3.h" -namespace selection +namespace textool { void TextureRotator::beginTransformation(const Matrix4& pivot2world, const VolumeTest& view, const Vector2& devicePoint) @@ -89,12 +89,12 @@ void TextureToolRotateManipulator::setId(std::size_t id) _id = id; } -IManipulator::Type TextureToolRotateManipulator::getType() const +selection::IManipulator::Type TextureToolRotateManipulator::getType() const { return IManipulator::Rotate; } -IManipulator::Component* TextureToolRotateManipulator::getActiveComponent() +selection::IManipulator::Component* TextureToolRotateManipulator::getActiveComponent() { return &_rotator; } @@ -111,7 +111,7 @@ bool TextureToolRotateManipulator::isSelected() const void TextureToolRotateManipulator::testSelect(SelectionTest& test, const Matrix4& pivot2world) { - SelectionPool selector; + selection::SelectionPool selector; test.BeginMesh(pivot2world, false); @@ -135,9 +135,9 @@ void TextureToolRotateManipulator::renderComponents(const Matrix4& pivot2World) { _shader = GlobalRenderSystem().capture("$WIRE_OVERLAY"); - auto manipulatorFontStyle = registry::getValue(RKEY_MANIPULATOR_FONTSTYLE) == "Sans" ? + auto manipulatorFontStyle = registry::getValue(selection::RKEY_MANIPULATOR_FONTSTYLE) == "Sans" ? IGLFont::Style::Sans : IGLFont::Style::Mono; - auto manipulatorFontSize = registry::getValue(RKEY_MANIPULATOR_FONTSIZE); + auto manipulatorFontSize = registry::getValue(selection::RKEY_MANIPULATOR_FONTSIZE); _glFont = GlobalOpenGL().getFont(manipulatorFontStyle, manipulatorFontSize); } diff --git a/radiantcore/selection/manipulators/TextureToolRotateManipulator.h b/radiantcore/selection/textool/TextureToolRotateManipulator.h similarity index 90% rename from radiantcore/selection/manipulators/TextureToolRotateManipulator.h rename to radiantcore/selection/textool/TextureToolRotateManipulator.h index 43f824bb69..862d6aed7b 100644 --- a/radiantcore/selection/manipulators/TextureToolRotateManipulator.h +++ b/radiantcore/selection/textool/TextureToolRotateManipulator.h @@ -2,15 +2,15 @@ #include "imanipulator.h" #include "../BasicSelectable.h" -#include "ManipulatorComponents.h" +#include "selection/manipulators/ManipulatorComponents.h" #include "../Renderables.h" #include "selection/textool/TextureToolManipulationPivot.h" -namespace selection +namespace textool { class TextureRotator : - public ManipulatorComponentBase + public selection::ManipulatorComponentBase { private: Vector2 _start; @@ -43,14 +43,14 @@ class TextureRotator : }; class TextureToolRotateManipulator : - public ITextureToolManipulator + public selection::ITextureToolManipulator { private: textool::TextureToolManipulationPivot& _pivot; std::size_t _id; - BasicSelectable _selectableZ; + selection::BasicSelectable _selectableZ; TextureRotator _rotator; RenderableCircle _renderableCircle; diff --git a/radiantcore/selection/textool/TextureToolSelectionSystem.cpp b/radiantcore/selection/textool/TextureToolSelectionSystem.cpp index fdc66b4a6e..1963c7afef 100644 --- a/radiantcore/selection/textool/TextureToolSelectionSystem.cpp +++ b/radiantcore/selection/textool/TextureToolSelectionSystem.cpp @@ -2,7 +2,7 @@ #include "itextstream.h" #include "module/StaticModule.h" -#include "../manipulators/TextureToolRotateManipulator.h" +#include "../textool/TextureToolRotateManipulator.h" namespace textool { @@ -24,7 +24,7 @@ void TextureToolSelectionSystem::initialiseModule(const IApplicationContext& ctx rMessage() << getName() << "::initialiseModule called." << std::endl; _manipulationPivot.setFromMatrix(Matrix4::getIdentity()); - registerManipulator(std::make_shared(_manipulationPivot)); + registerManipulator(std::make_shared(_manipulationPivot)); _defaultManipulatorType = selection::IManipulator::Rotate; setActiveManipulator(_defaultManipulatorType); diff --git a/tools/msvc/DarkRadiantCore.vcxproj b/tools/msvc/DarkRadiantCore.vcxproj index ab46345b41..4a23f2036e 100644 --- a/tools/msvc/DarkRadiantCore.vcxproj +++ b/tools/msvc/DarkRadiantCore.vcxproj @@ -660,7 +660,6 @@ - @@ -674,6 +673,7 @@ + @@ -1013,7 +1013,6 @@ - @@ -1032,6 +1031,7 @@ + diff --git a/tools/msvc/DarkRadiantCore.vcxproj.filters b/tools/msvc/DarkRadiantCore.vcxproj.filters index 1c030db864..01c3fe8480 100644 --- a/tools/msvc/DarkRadiantCore.vcxproj.filters +++ b/tools/msvc/DarkRadiantCore.vcxproj.filters @@ -1087,12 +1087,12 @@ src\selection - - src\selection\manipulators - src\selection\textool + + src\selection\textool + @@ -2208,9 +2208,6 @@ src\map\format - - src\selection\manipulators - src\selection\textool @@ -2232,5 +2229,8 @@ src\selection\textool + + src\selection\textool + \ No newline at end of file