This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <opencv2/opencv.hpp> | |
| #include <uc/logger.h> | |
| #include <uc/command_line.h> | |
| #include <uc/timer.h> | |
| #include <uc/math_common.h> | |
| #include <uc/dimensions.h> | |
| #include <uc/math_geometric.h> | |
| #include "draw_utils.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <QMimeData> | |
| #include <QIcon> | |
| #include "structure_model.h" | |
| #include "helpers.h" | |
| StructureModel::StructureModel(const QStringList& headers, const std::vector<std::shared_ptr<Room>>& rooms, QObject* parent) : | |
| QAbstractItemModel(parent), rooms_(rooms) { | |
| QVector<QVariant> root_data; | |
| for (const QString& header : headers) root_data << header; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bool Helpers::isPointOnLine(QPointF lineStart, QPointF lineEnd, QPointF point) { | |
| // qreal AB = sqrt((lineEnd.x() - lineStart.x()) * (lineEnd.x() - lineStart.x()) + | |
| // (lineEnd.y() - lineStart.y()) * (lineEnd.y() - lineStart.y()) + (z2 - z1) * (z2 - z1)); | |
| // qreal AP = sqrt((point.x() - lineStart.x()) * (point.x() - lineStart.x()) + | |
| // (point.y() - lineStart.y()) * (point.y() - lineStart.y()) + (z - z1) * (z - z1)); | |
| // qreal PB = sqrt((lineEnd.x() - point.x()) * (lineEnd.x() - point.x()) + (lineEnd.y() - point.y()) * (lineEnd.y() - | |
| // point.y()) + | |
| // (z2 - z) * (z2 - z)); | |
| // if (AB == AP + PB) { | |
| // return true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void PuzzleWindow::paint() | |
| { | |
| QFont font; | |
| QPen pen; | |
| QDir dir = QDir(home->projectDir.filePath("planojums/")); | |
| QJsonObject puzzle = {}; | |
| if (dir.exists()) { | |
| QFile dataFile(dir.filePath("data.json")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void PuzzleWindow::paint() | |
| { | |
| QFont font; | |
| QPen pen; | |
| QDir dir = QDir(home->projectDir.filePath("planojums/")); | |
| QJsonObject puzzle = {}; | |
| if (dir.exists()) { | |
| QFile dataFile(dir.filePath("data.json")); |