Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef QCUSTOMRHOMBUS_H
- #define QCUSTOMRHOMBUS_H
- #include "qcustomquadrangle.h"
- class QDebug;
- class QCustomRhombus : public QCustomQuadrangle
- {
- public:
- QCustomRhombus(QCustomPlot *parent);
- bool isRhombus(QPointF _p1, QPointF _p2,
- QPointF _p3, QPointF _p4) {
- // ну вообще тут типа будет проверка на перепендикулярность диагоналей
- // и равность сторон, но пока тут нихуя нет
- if (this->getLineLength(_p1, _p2) == this->getLineLength(_p3, _p4))
- return true;
- else
- return false;
- }
- };
- #endif // QCUSTOMRHOMBUS_H
- // как пытаюсь использовать
- if (QCustomRhombus::isRhombus(p1, p2, p3, p4) ) {
- QMessageBox::information(this, tr("Информация"),
- tr("Это ромб!"));
- isRhombus = true;
- } else {
- isRhombus = false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement