fix: Replace QMap with std::map for custom comparator support
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
@@ -24,7 +24,7 @@
|
|||||||
#include <QtMath>
|
#include <QtMath>
|
||||||
#include <QOpenGLShaderProgram>
|
#include <QOpenGLShaderProgram>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QMap>
|
#include <map>
|
||||||
|
|
||||||
struct PntComparator {
|
struct PntComparator {
|
||||||
bool operator()(const gp_Pnt& a, const gp_Pnt& b) const {
|
bool operator()(const gp_Pnt& a, const gp_Pnt& b) const {
|
||||||
@@ -747,7 +747,7 @@ void ViewportWidget::drawSketch(const SketchFeature* sketch)
|
|||||||
glPointSize(5.0f);
|
glPointSize(5.0f);
|
||||||
|
|
||||||
QVector<GLfloat> lineVertices;
|
QVector<GLfloat> lineVertices;
|
||||||
QMap<gp_Pnt, int, PntComparator> vertexCounts;
|
std::map<gp_Pnt, int, PntComparator> vertexCounts;
|
||||||
|
|
||||||
for (const auto& obj : sketch->objects()) {
|
for (const auto& obj : sketch->objects()) {
|
||||||
if (obj->type() == SketchObject::ObjectType::Line) {
|
if (obj->type() == SketchObject::ObjectType::Line) {
|
||||||
@@ -763,9 +763,9 @@ void ViewportWidget::drawSketch(const SketchFeature* sketch)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QVector<GLfloat> pointVertices;
|
QVector<GLfloat> pointVertices;
|
||||||
for (auto it = vertexCounts.constBegin(); it != vertexCounts.constEnd(); ++it) {
|
for (const auto& pair : vertexCounts) {
|
||||||
if (it.value() == 1) {
|
if (pair.second == 1) {
|
||||||
const gp_Pnt& p = it.key();
|
const gp_Pnt& p = pair.first;
|
||||||
pointVertices << p.X() << p.Y() << p.Z();
|
pointVertices << p.X() << p.Y() << p.Z();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user