/
ArtemNech
/
simpleOpenGL
Обзор
Документация
Войти
/
ArtemNech
/
simpleOpenGL
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
backend/graphics-units/NLine.h
73 строки
2 KB
Artem Nechitaylenko
Qt GUI isolated from backend except QEvent. Need fix
18 май 2026, 13:41
18 май 2026, 13:41
f09d1f2
Код
Авторство
О чём код?
// // Created by artem on 20.10.25. // #ifndef NYM_PROJECT_NLINE_H #define NYM_PROJECT_NLINE_H #include "NPointF.h" namespace ngraph { class NLine { public: NLine(); NLine(const NPoint& p1, const NPoint& p2); NLine(const NLine& other); [[nodiscard]] NPoint p1() const; [[nodiscard]] NPoint p2() const; [[nodiscard]] int x1() const; [[nodiscard]] int x2() const; [[nodiscard]] int y1() const; [[nodiscard]] int y2() const; void setP1(const NPoint& p1); void setP2(const NPoint& p2); [[nodiscard]] double length() const; [[nodiscard]] NPoint center() const; [[nodiscard]] bool isVertical() const; [[nodiscard]] bool isHorizontal() const; private: NPoint m_p1; NPoint m_p2; }; class NLineF { public: NLineF(); NLineF(const NPointF &p1, const NPointF & p2); NLineF(const NLineF & other); [[nodiscard]] double x1() const; [[nodiscard]] double x2() const; [[nodiscard]] double y1() const; [[nodiscard]] double y2() const; [[nodiscard]] NPointF p1() const; [[nodiscard]] NPointF p2() const; void setP1(const NPointF& p1); void setP2(const NPointF& p2); [[nodiscard]] double width() const; void setWidth(const double & width); [[nodiscard]] double length() const; [[nodiscard]] NPointF center() const; [[nodiscard]] bool isVertical() const; [[nodiscard]] bool isHorizontal() const; bool operator==(const NLineF & other) const; private: NPointF m_p1; NPointF m_p2; double m_width{1.0}; }; } // #endif //NYM_PROJECT_NLINE_H