mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-20 16:23:52 +00:00
74e7cfc023
remove unused imports: part2 revert one tidy we will keep for c++20
38 lines
951 B
C++
38 lines
951 B
C++
#include "commands.hpp"
|
|
|
|
#include <components/debug/debuglog.hpp>
|
|
|
|
#include "terrainshapemode.hpp"
|
|
#include "worldspacewidget.hpp"
|
|
|
|
CSVRender::DrawTerrainSelectionCommand::DrawTerrainSelectionCommand(WorldspaceWidget* worldspaceWidget, QUndoCommand* parent)
|
|
: mWorldspaceWidget(worldspaceWidget)
|
|
{ }
|
|
|
|
void CSVRender::DrawTerrainSelectionCommand::redo()
|
|
{
|
|
tryUpdate();
|
|
}
|
|
|
|
void CSVRender::DrawTerrainSelectionCommand::undo()
|
|
{
|
|
tryUpdate();
|
|
}
|
|
|
|
void CSVRender::DrawTerrainSelectionCommand::tryUpdate()
|
|
{
|
|
if (!mWorldspaceWidget)
|
|
{
|
|
Log(Debug::Verbose) << "Can't update terrain selection, no WorldspaceWidget found!";
|
|
return;
|
|
}
|
|
|
|
auto terrainMode = dynamic_cast<CSVRender::TerrainShapeMode*>(mWorldspaceWidget->getEditMode());
|
|
if (!terrainMode)
|
|
{
|
|
Log(Debug::Verbose) << "Can't update terrain selection in current EditMode";
|
|
return;
|
|
}
|
|
|
|
terrainMode->getTerrainSelection()->update();
|
|
}
|