mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-01 06:12:01 +08:00
Fix two compilation issues
One was due to enums not having a std::hash below c++17 The other was due to overloaded methods prefering ones in the same namespace (I think)
This commit is contained in:
parent
b235640e88
commit
2bbd43c373
@ -73,7 +73,7 @@ int UI_Slider::get_int() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string UI_Slider::get_string() {
|
std::string UI_Slider::get_string() {
|
||||||
return trim_zeroes(std::to_string(static_cast<double>(this->_slider->GetValue()) / this->_scale));
|
return _trim_zeroes(std::to_string(static_cast<double>(this->_slider->GetValue()) / this->_scale));
|
||||||
}
|
}
|
||||||
|
|
||||||
void UI_Slider::set_scale(size_t new_scale) {
|
void UI_Slider::set_scale(size_t new_scale) {
|
||||||
|
@ -12,7 +12,7 @@ using namespace std;
|
|||||||
namespace Slic3r { namespace Test {
|
namespace Slic3r { namespace Test {
|
||||||
|
|
||||||
// Mesh enumeration to name mapping
|
// Mesh enumeration to name mapping
|
||||||
const std::unordered_map<TestMesh, const char*> mesh_names {
|
const std::unordered_map<TestMesh, const char*, TestMeshHash> mesh_names {
|
||||||
std::make_pair<TestMesh, const char*>(TestMesh::A,"A"),
|
std::make_pair<TestMesh, const char*>(TestMesh::A,"A"),
|
||||||
std::make_pair<TestMesh, const char*>(TestMesh::L,"L"),
|
std::make_pair<TestMesh, const char*>(TestMesh::L,"L"),
|
||||||
std::make_pair<TestMesh, const char*>(TestMesh::V,"V"),
|
std::make_pair<TestMesh, const char*>(TestMesh::V,"V"),
|
||||||
|
@ -33,8 +33,15 @@ enum class TestMesh {
|
|||||||
two_hollow_squares
|
two_hollow_squares
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Neccessary for <c++17
|
||||||
|
struct TestMeshHash {
|
||||||
|
std::size_t operator()(TestMesh tm) const {
|
||||||
|
return static_cast<std::size_t>(tm);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/// Mesh enumeration to name mapping
|
/// Mesh enumeration to name mapping
|
||||||
extern const std::unordered_map<TestMesh, const char*> mesh_names;
|
extern const std::unordered_map<TestMesh, const char*, TestMeshHash> mesh_names;
|
||||||
|
|
||||||
/// Port of Slic3r::Test::mesh
|
/// Port of Slic3r::Test::mesh
|
||||||
/// Basic cubes/boxes should call TriangleMesh::make_cube() directly and rescale/translate it
|
/// Basic cubes/boxes should call TriangleMesh::make_cube() directly and rescale/translate it
|
||||||
|
Loading…
x
Reference in New Issue
Block a user