diff --git a/common/src/FloatType.h b/common/src/FloatType.h
new file mode 100644
index 0000000000..f64778b306
--- /dev/null
+++ b/common/src/FloatType.h
@@ -0,0 +1,141 @@
+/*
+ Copyright (C) 2010-2017 Kristian Duske
+
+ This file is part of TrenchBroom.
+
+ TrenchBroom is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ TrenchBroom is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with TrenchBroom. If not, see .
+ */
+
+#pragma once
+
+#include "vm/constants.h"
+#include
+
+using FloatType = double;
+
+namespace vm
+{
+ enum class side;
+enum class direction;
+enum class rotation_axis;
+enum class plane_status;
+
+template
+class vec;
+
+using vec1f = vec;
+using vec1d = vec;
+using vec1i = vec;
+using vec1l = vec;
+using vec1s = vec;
+using vec1b = vec;
+
+using vec2f = vec;
+using vec2d = vec;
+using vec2i = vec;
+using vec2l = vec;
+using vec2s = vec;
+using vec2b = vec;
+
+using vec3f = vec;
+using vec3d = vec;
+using vec3i = vec;
+using vec3l = vec;
+using vec3s = vec;
+using vec3b = vec;
+
+using vec4f = vec;
+using vec4d = vec;
+using vec4i = vec;
+using vec4l = vec;
+using vec4s = vec;
+using vec4b = vec;
+
+template
+class mat;
+
+using mat2x2f = mat;
+using mat3x3f = mat;
+using mat4x4f = mat;
+using mat2x2d = mat;
+using mat3x3d = mat;
+using mat4x4d = mat;
+
+template
+class quat;
+
+using quatf = quat;
+using quatd = quat;
+
+template
+class bbox;
+
+using bbox1f = bbox;
+using bbox1d = bbox;
+using bbox2f = bbox;
+using bbox2d = bbox;
+using bbox3f = bbox;
+using bbox3d = bbox;
+
+template
+class line;
+
+using line3f = line;
+using line3d = line;
+
+template
+class plane;
+
+using plane3f = plane;
+using plane3d = plane;
+
+template
+class ray;
+
+using ray3f = ray;
+using ray3d = ray;
+
+template
+class segment;
+
+using segment3d = segment;
+using segment3f = segment;
+using segment2d = segment;
+using segment2f = segment;
+
+template
+class polygon;
+
+using polygon2f = polygon;
+using polygon2d = polygon;
+using polygon3f = polygon;
+using polygon3d = polygon;
+
+using vec3 = vec;
+using vec4 = vec;
+using vec2 = vec;
+using mat4x4 = mat;
+using quat3 = quat;
+using line3 = line;
+using line2 = line;
+using ray3 = ray;
+using segment3 = segment;
+using plane3 = plane;
+using polygon3 = polygon;
+using bbox3 = bbox;
+using bbox2 = bbox;
+
+using C = constants;
+
+} // namespace vm
diff --git a/common/src/View/GLContextManager.cpp b/common/src/View/GLContextManager.cpp
deleted file mode 100644
index 321905f728..0000000000
--- a/common/src/View/GLContextManager.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- Copyright (C) 2010-2017 Kristian Duske
-
- This file is part of TrenchBroom.
-
- TrenchBroom is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- TrenchBroom is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with TrenchBroom. If not, see .
- */
-
-#include "GLContextManager.h"
-
-#include "Error.h"
-#include "Exceptions.h"
-#include "Renderer/FontManager.h"
-#include "Renderer/GL.h"
-#include "Renderer/Shader.h"
-#include "Renderer/ShaderManager.h"
-#include "Renderer/ShaderProgram.h"
-#include "Renderer/Shaders.h"
-#include "Renderer/Vbo.h"
-
-#include "kdl/result.h"
-#include "kdl/result_fold.h"
-#include "kdl/vector_utils.h"
-
-#include
-#include
-
-namespace TrenchBroom
-{
-namespace View
-{
-std::string GLContextManager::GLVendor = "unknown";
-std::string GLContextManager::GLRenderer = "unknown";
-std::string GLContextManager::GLVersion = "unknown";
-
-GLContextManager::GLContextManager()
- : m_initialized(false)
- , m_shaderManager(std::make_unique())
- , m_vboManager(std::make_unique(m_shaderManager.get()))
- , m_fontManager(std::make_unique())
-{
-}
-
-GLContextManager::~GLContextManager() = default;
-
-bool GLContextManager::initialized() const
-{
- return m_initialized;
-}
-
-static void initializeGlew()
-{
- glewExperimental = GL_TRUE;
- const GLenum glewState = glewInit();
- /* The GLEW_ERROR_NO_GLX_DISPLAY error is thrown on Wayland systems */
- /* that otherwise function just fine. */
- if (glewState != GLEW_OK && glewState != GLEW_ERROR_NO_GLX_DISPLAY)
- {
- auto str = std::stringstream();
- str << "Error initializing glew: " << glewGetErrorString(glewState);
- throw RenderException(str.str());
- }
-}
-
-bool GLContextManager::initialize()
-{
- using namespace Renderer::Shaders;
-
- if (!m_initialized)
- {
- m_initialized = true;
-
- initializeGlew();
-
- GLVendor = reinterpret_cast(glGetString(GL_VENDOR));
- GLRenderer = reinterpret_cast(glGetString(GL_RENDERER));
- GLVersion = reinterpret_cast(glGetString(GL_VERSION));
-
- kdl::vec_transform(
- std::vector{
- Grid2DShader,
- VaryingPCShader,
- VaryingPUniformCShader,
- MiniMapEdgeShader,
- EntityModelShader,
- FaceShader,
- PatchShader,
- EdgeShader,
- ColoredTextShader,
- TextBackgroundShader,
- MaterialBrowserShader,
- MaterialBrowserBorderShader,
- HandleShader,
- ColoredHandleShader,
- CompassShader,
- CompassOutlineShader,
- CompassBackgroundShader,
- LinkLineShader,
- LinkArrowShader,
- TriangleShader,
- UVViewShader,
- },
- [&](const auto& shaderConfig) {
- return m_shaderManager->loadProgram(shaderConfig);
- })
- | kdl::fold
- | kdl::transform_error([&](const auto& e) { throw RenderException{e.msg}; });
-
- return true;
- }
- return false;
-}
-
-Renderer::VboManager& GLContextManager::vboManager()
-{
- return *m_vboManager;
-}
-
-Renderer::FontManager& GLContextManager::fontManager()
-{
- return *m_fontManager;
-}
-
-Renderer::ShaderManager& GLContextManager::shaderManager()
-{
- return *m_shaderManager;
-}
-} // namespace View
-} // namespace TrenchBroom
diff --git a/common/src/io/MapFileSerializer.cpp b/common/src/io/MapFileSerializer.cpp
index 37712cfb08..e3d69086a0 100644
--- a/common/src/io/MapFileSerializer.cpp
+++ b/common/src/io/MapFileSerializer.cpp
@@ -285,11 +285,11 @@ class N64FileSerializer : public Quake2FileSerializer
}
private:
- void doWriteBrushFooter(std::ostream& stream, const Model::Brush& brush) const override
+ void doWriteBrushFooter(std::ostream& stream, const mdl::Brush& brush) const override
{
writeVertexColors(stream, brush);
}
- void doWriteBrushFace(std::ostream& stream, const Model::BrushFace& face) const override
+ void doWriteBrushFace(std::ostream& stream, const mdl::BrushFace& face) const override
{
writeFacePoints(stream, face);
writeValveMaterialInfo(stream, face);
@@ -301,7 +301,7 @@ class N64FileSerializer : public Quake2FileSerializer
fmt::format_to(std::ostreambuf_iterator(stream), "\n");
}
- void writeVertexColors(std::ostream& stream, const Model::Brush& brush) const
+ void writeVertexColors(std::ostream& stream, const mdl::Brush& brush) const
{
fmt::format_to(std::ostreambuf_iterator(stream),
"[\n");
diff --git a/common/src/io/MapParser.h b/common/src/io/MapParser.h
index 06446cc8ba..b5a92e07be 100644
--- a/common/src/io/MapParser.h
+++ b/common/src/io/MapParser.h
@@ -55,7 +55,7 @@ class MapParser
virtual void onEndEntity(const FileLocation& endLocation, ParserStatus& status) = 0;
virtual void onBeginBrush(const FileLocation& location, ParserStatus& status) = 0;
virtual void onEndBrush(const FileLocation& endLocation, ParserStatus& status) = 0;
- virtual void onColorBlock(ParserStatus& status) = 0;
+ virtual void onColorBlock(const FileLocation& location, ParserStatus& status) = 0;
virtual void onStandardBrushFace(
const FileLocation& location,
mdl::MapFormat targetMapFormat,
@@ -75,14 +75,14 @@ class MapParser
const vm::vec3d& vAxis,
ParserStatus& status) = 0;
virtual void onN64BrushFace(
- size_t line,
- Model::MapFormat targetMapFormat,
- const vm::vec3& point1,
- const vm::vec3& point2,
- const vm::vec3& point3,
- const Model::BrushFaceAttributes& attribs,
- const vm::vec3& texAxisX,
- const vm::vec3& texAxisY,
+ const FileLocation& location,
+ mdl::MapFormat targetMapFormat,
+ const vm::vec3d& point1,
+ const vm::vec3d& point2,
+ const vm::vec3d& point3,
+ const mdl::BrushFaceAttributes& attribs,
+ const vm::vec3d& texAxisX,
+ const vm::vec3d& texAxisY,
ParserStatus& status) = 0;
virtual void onPatch(
const FileLocation& startLocation,
diff --git a/common/src/io/MapReader.cpp b/common/src/io/MapReader.cpp
index 6f2c00c097..dd4a2ca9c6 100644
--- a/common/src/io/MapReader.cpp
+++ b/common/src/io/MapReader.cpp
@@ -128,7 +128,7 @@ void MapReader::onEndEntity(const FileLocation& endLocation, ParserStatus& /* st
void MapReader::onBeginBrush(const FileLocation& location, ParserStatus& /* status */)
{
- m_objectInfos.emplace_back(BrushInfo{{}, location, std::nullopt, m_currentEntityInfo});
+ m_objectInfos.emplace_back(BrushInfo{{}, {}, location, std::nullopt, m_currentEntityInfo});
}
void MapReader::onEndBrush(const FileLocation& endLocation, ParserStatus& /* status */)
@@ -179,31 +179,31 @@ void MapReader::onValveBrushFace(
}
void MapReader::onN64BrushFace(
- const size_t line,
- const Model::MapFormat targetMapFormat,
- const vm::vec3& point1,
- const vm::vec3& point2,
- const vm::vec3& point3,
- const Model::BrushFaceAttributes& attribs,
- const vm::vec3& texAxisX,
- const vm::vec3& texAxisY,
+ const FileLocation& location,
+ const mdl::MapFormat targetMapFormat,
+ const vm::vec3d& point1,
+ const vm::vec3d& point2,
+ const vm::vec3d& point3,
+ const mdl::BrushFaceAttributes& attribs,
+ const vm::vec3d& texAxisX,
+ const vm::vec3d& texAxisY,
ParserStatus& status)
{
- Model::BrushFace::createFromValve(
+ mdl::BrushFace::createFromValve(
point1, point2, point3, attribs, texAxisX, texAxisY, targetMapFormat)
- .transform([&](Model::BrushFace&& face) {
- face.setFilePosition(line, 1u);
+ .transform([&](mdl::BrushFace&& face) {
+ face.setFilePosition(location.line, 1u);
onBrushFace(std::move(face), status);
})
- .transform_error([&](auto e) { status.error(line, "Skipping face: " + e.msg); });
+ .transform_error([&](auto e) { status.error(location, "Skipping face: " + e.msg); });
}
void MapReader::onPatch(
const FileLocation& startLocation,
const FileLocation& endLocation,
mdl::MapFormat,
- const size_t rowCount,
- const size_t columnCount,
+ size_t rowCount,
+ size_t columnCount,
std::vector> controlPoints,
std::string materialName,
ParserStatus&)
@@ -1020,13 +1020,13 @@ void MapReader::onBrushFace(mdl::BrushFace face, ParserStatus& /* status */)
auto& brush = std::get(m_objectInfos.back());
brush.faces.push_back(std::move(face));
}
-void MapReader::onColorBlock(ParserStatus& status)
+
+void MapReader::onColorBlock(const FileLocation& location, ParserStatus& status)
{
- size_t lineCount = m_tokenizer.line();
expect(QuakeMapToken::OBracket, m_tokenizer.nextToken());
assert(std::holds_alternative(m_objectInfos.back()));
- auto& brush = std::get(m_objectInfos.back());
+ auto& brush = std::get(m_objectInfos.back());
std::unordered_map cached_colors;
/// For each color found, put that color on the
@@ -1042,8 +1042,8 @@ void MapReader::onColorBlock(ParserStatus& status)
}
}
expect(QuakeMapToken::CBracket, m_tokenizer.nextToken());
-
- brush.lineCount += m_tokenizer.line() - lineCount;
+ brush.startLocation = location;
+ brush.endLocation = m_tokenizer.location();
brush.cached_colors = cached_colors;
}
} // namespace tb::io
diff --git a/common/src/io/MapReader.h b/common/src/io/MapReader.h
index 3fbdfa95c1..4af6598747 100644
--- a/common/src/io/MapReader.h
+++ b/common/src/io/MapReader.h
@@ -81,6 +81,7 @@ class MapReader : public StandardMapParser
struct BrushInfo
{
std::vector faces;
+ std::unordered_map cached_colors;
FileLocation startLocation;
std::optional endLocation;
std::optional parentIndex;
@@ -151,7 +152,7 @@ class MapReader : public StandardMapParser
void onEndEntity(const FileLocation& endLocation, ParserStatus& status) override;
void onBeginBrush(const FileLocation& location, ParserStatus& status) override;
void onEndBrush(const FileLocation& endLocation, ParserStatus& status) override;
- void onColorBlock(ParserStatus& status) override;
+ void onColorBlock(const FileLocation& location, ParserStatus& status) override;
void onStandardBrushFace(
const FileLocation& location,
mdl::MapFormat targetMapFormat,
@@ -171,14 +172,14 @@ class MapReader : public StandardMapParser
const vm::vec3d& vAxis,
ParserStatus& status) override;
void onN64BrushFace(
- size_t line,
- Model::MapFormat targetMapFormat,
- const vm::vec3& point1,
- const vm::vec3& point2,
- const vm::vec3& point3,
- const Model::BrushFaceAttributes& attribs,
- const vm::vec3& texAxisX,
- const vm::vec3& texAxisY,
+ const FileLocation& location,
+ mdl::MapFormat targetMapFormat,
+ const vm::vec3d& point1,
+ const vm::vec3d& point2,
+ const vm::vec3d& point3,
+ const mdl::BrushFaceAttributes& attribs,
+ const vm::vec3d& texAxisX,
+ const vm::vec3d& texAxisY,
ParserStatus& status) override;
void onPatch(
const FileLocation& startLocation,
diff --git a/common/src/io/StandardMapParser.cpp b/common/src/io/StandardMapParser.cpp
index ed913d21b6..e4d9a94583 100644
--- a/common/src/io/StandardMapParser.cpp
+++ b/common/src/io/StandardMapParser.cpp
@@ -382,7 +382,7 @@ void StandardMapParser::parseBrush(
{
if (beginBrushCalled)
{
- onColorBlock(status);
+ onColorBlock(token.location(), status);
}
}
break;
@@ -530,14 +530,14 @@ void StandardMapParser::parseQuake2ValveFace(ParserStatus& status)
void StandardMapParser::parseN64Face(ParserStatus& status)
{
- const auto line = m_tokenizer.line();
+ const auto location = m_tokenizer.location();
const auto [p1, p2, p3] = parseFacePoints(status);
const auto materialName = parseMaterialName(status);
const auto [texX, xOffset, texY, yOffset] = parseValveUVAxes(status);
- auto attribs = Model::BrushFaceAttributes(materialName);
+ auto attribs = mdl::BrushFaceAttributes(materialName);
attribs.setXOffset(xOffset);
attribs.setYOffset(yOffset);
attribs.setRotation(parseFloat());
@@ -554,7 +554,7 @@ void StandardMapParser::parseN64Face(ParserStatus& status)
// attribs.setSurfaceValue(parseFloat());
// }
- onN64BrushFace(line, m_targetMapFormat, p1, p2, p3, attribs, texX, texY, status);
+ onN64BrushFace(location, m_targetMapFormat, p1, p2, p3, attribs, texX, texY, status);
}
void StandardMapParser::parseHexen2Face(ParserStatus& status)
diff --git a/common/src/mdl/BrushFaceAttributes.cpp b/common/src/mdl/BrushFaceAttributes.cpp
index 6396e63d5b..7d455e17eb 100644
--- a/common/src/mdl/BrushFaceAttributes.cpp
+++ b/common/src/mdl/BrushFaceAttributes.cpp
@@ -251,10 +251,4 @@ bool BrushFaceAttributes::setColor(const std::optional& color)
}
return false;
}
-
-bool BrushFaceAttributes::setVertexColors(const vm::vec colors)
-{
- m_vertexColors = colors;
- return true;
-}
} // namespace tb::mdl
diff --git a/common/src/render/BrushRenderer.cpp b/common/src/render/BrushRenderer.cpp
index ac1cec32fb..a3a22dceb7 100644
--- a/common/src/render/BrushRenderer.cpp
+++ b/common/src/render/BrushRenderer.cpp
@@ -486,13 +486,18 @@ static void getMarkedEdgeIndices(
bool BrushRenderer::shouldDrawFaceInTransparentPass(
const mdl::BrushNode& brushNode, const mdl::BrushFace& face) const
{
- for(auto color : brushNode.brush().colors())
+
+ if (brushNode.brush().hasVertexColors())
+ {
+ for (auto color : brushNode.brush().colors())
{
- if(color.second.a() < 1.0)
- {
- return true;
- }
+ if (color.second.a() >= 0.0 && color.second.a() < 0.75)
+ {
+ return true;
+ }
}
+ }
+
if (m_transparencyAlpha >= 1.0f)
{
// In this case, draw everything in the opaque pass
diff --git a/common/src/ui/GLContextManager.cpp b/common/src/ui/GLContextManager.cpp
index 6577966795..c49940c817 100644
--- a/common/src/ui/GLContextManager.cpp
+++ b/common/src/ui/GLContextManager.cpp
@@ -58,7 +58,7 @@ bool GLContextManager::initialized() const
static void initializeGlew()
{
glewExperimental = GL_TRUE;
- if (const auto glewState = glewInit(); glewState != GLEW_OK)
+ if (const auto glewState = glewInit(); glewState != GLEW_OK && glewState != GLEW_ERROR_NO_GLX_DISPLAY)
{
throw RenderException{fmt::format(
"Error initializing glew: {}",
diff --git a/common/src/ui/VertexInspector.cpp b/common/src/ui/VertexInspector.cpp
index a656474f4e..8b2802bf80 100644
--- a/common/src/ui/VertexInspector.cpp
+++ b/common/src/ui/VertexInspector.cpp
@@ -17,84 +17,94 @@
along with TrenchBroom. If not, see .
*/
-#include
-#include
-#include
-#include
-#include
+#include "ui/VertexInspector.h"
+
#include
#include
#include
#include "Color.h"
-#include "View/MapDocument.h"
-#include "View/Splitter.h"
-#include "View/TabBook.h"
-#include "View/VertexInspector.h"
+#include "ui/MapDocument.h"
+#include "ui/Splitter.h"
+#include "ui/TabBook.h"
+
#include "kdl/memory_utils.h"
-namespace TrenchBroom::View{
+#include
+#include
+#include
+#include
+#include
+
+namespace tb::ui
+{
+
+// Stops the "Esc" key from closing the dialog
+void VertexColorDialog::reject()
+{
+ if (1 == 2)
+ {
+ done(0);
+ }
+}
- VertexInspector::VertexInspector(
- std::weak_ptr document, GLContextManager& contextManager, QWidget* parent)
+VertexInspector::VertexInspector(
+ std::weak_ptr document, GLContextManager& contextManager, QWidget* parent)
: TabBookPage{parent}
, m_document(std::move(document))
, m_model(nullptr)
- {
- createGui(contextManager);
- }
+{
+ createGui(contextManager);
+}
- void VertexInspector::createGui(GLContextManager& /* contextManager */ )
- {
- auto frame = new Splitter{Qt::Vertical};
- m_model = new QColorDialog{};
- m_model->setWindowFlags(Qt::Widget);
- m_model->setOptions(QColorDialog::DontUseNativeDialog
- | QColorDialog::NoButtons
- | QColorDialog::ShowAlphaChannel);
-
- frame->addWidget(m_model);
-
- auto applyButton = new QPushButton{"Apply to Selection"};
-
- frame->addWidget(applyButton);
-
-
- auto* layout = new QVBoxLayout{};
- layout->addWidget(frame);
-
- layout->setContentsMargins(0, 0, 0, 0);
- layout->setSpacing(0);
- layout->addStretch();
-
- setLayout(layout);
-
- // Connect OnChange and Apply to changing the verts
- connect(
- applyButton,
- &QPushButton::clicked,
- this,
- &VertexInspector::applyColor);
-
- connect(
- m_model,
- &QColorDialog::currentColorChanged,
- this,
- &VertexInspector::applyColor);
-
- }
+void VertexInspector::createGui(GLContextManager& /* contextManager */)
+{
+ auto frame = new Splitter{Qt::Vertical};
+ m_model = new VertexColorDialog{};
+ m_model->setWindowFlags(Qt::Widget);
+ m_model->setOptions(
+ QColorDialog::DontUseNativeDialog | QColorDialog::NoButtons
+ | QColorDialog::ShowAlphaChannel);
- void VertexInspector::applyColor(){
- auto document = kdl::mem_lock(m_document);
-
- auto color = m_model->currentColor();
- auto c = new Color(
- color.red(),
- color.green(),
- color.blue(),
- color.alpha()
- );
- document->setVertexColors(*c);
- }
+ frame->addWidget(m_model);
+
+ auto applyButton = new QPushButton{"Apply to Selection"};
+
+ frame->addWidget(applyButton);
+
+
+ auto* layout = new QVBoxLayout{};
+ layout->addWidget(frame);
+
+ layout->setContentsMargins(0, 0, 0, 0);
+ layout->setSpacing(0);
+ layout->addStretch();
+
+ setLayout(layout);
+
+ // Connect OnChange and Apply to changing the verts
+ connect(applyButton, &QPushButton::clicked, this, &VertexInspector::applyColor);
+
+ connect(
+ m_model, &QColorDialog::currentColorChanged, this, &VertexInspector::applyColor);
+}
+
+void VertexInspector::applyColor()
+{
+ auto document = kdl::mem_lock(m_document);
+
+ auto color = m_model->currentColor();
+ auto c = new Color(color.red(), color.green(), color.blue(), color.alpha());
+ document->setVertexColors(*c);
+}
+
+void VertexInspector::getColorFromSelection()
+{
+ auto document = kdl::mem_lock(m_document);
+
+ auto color = m_model->currentColor();
+ auto c = new Color(color.red(), color.green(), color.blue(), color.alpha());
+ document->setVertexColors(*c);
+}
-} // namespace Trenchbroom
+} // namespace tb::ui
diff --git a/common/src/ui/VertexInspector.h b/common/src/ui/VertexInspector.h
index d12924b154..45a85270e9 100644
--- a/common/src/ui/VertexInspector.h
+++ b/common/src/ui/VertexInspector.h
@@ -19,36 +19,43 @@
#pragma once
-#include "View/TabBook.h"
+#include "ui/TabBook.h"
#include
+#include
class QWidget;
class QColorDialog;
-namespace TrenchBroom::View
+namespace tb::ui
{
-
+
class GLContextManager;
class MapDocument;
+
+class VertexColorDialog : public QColorDialog
+{
+ void reject() override;
+};
+
class VertexInspector : public TabBookPage
{
Q_OBJECT
private:
std::weak_ptr m_document;
- QColorDialog* m_model;
+ VertexColorDialog* m_model;
public:
VertexInspector(
std::weak_ptr document,
GLContextManager& contextManager,
- QWidget* parent = nullptr);
+ QWidget* parent = nullptr);
~VertexInspector() override = default;
private:
void createGui(GLContextManager& contextManager);
void applyColor();
+ void getColorFromSelection();
};
-
-} // namespace TrenchBroom::View
+} // namespace tb::ui
diff --git a/common/src/ui/VertexTool.cpp b/common/src/ui/VertexTool.cpp
index e54ae68b02..b33e49ea67 100644
--- a/common/src/ui/VertexTool.cpp
+++ b/common/src/ui/VertexTool.cpp
@@ -40,8 +40,6 @@
#include
namespace tb::ui
-{
-namespace View
{
template
auto collectContainingGroups(const std::vector& nodes)
@@ -314,7 +312,7 @@ void VertexTool::applyVertexColor(Color color)
auto document = kdl::mem_lock(m_document);
for(auto& b : selectedBrushes())
{
- auto br = Model::Brush(b->brush());
+ auto br = mdl::Brush(b->brush());
for(auto& v : m_vertexHandles->selectedHandles())
{
br.addOrUpdateColor(v, color);