Sun, 09 Apr 2023 00:56:49 +0300
Hopefully fixed all problems with determining polygon winding
#pragma once #include <QSyntaxHighlighter> #include <QRegularExpression> class LDrawSyntaxHighlighter final : public QSyntaxHighlighter { Q_OBJECT QRegularExpression commentPattern; QRegularExpression bfcPattern; QRegularExpression refPattern; QRegularExpression trianglePattern; QRegularExpression quadrilateralPattern; QRegularExpression cedgePattern; QTextCharFormat lineTypeFormat; QTextCharFormat colorFormat; QTextCharFormat point1Format; QTextCharFormat point2Format; QTextCharFormat point3Format; QTextCharFormat point4Format; QTextCharFormat bfcFormat; QTextCharFormat nameFormat; QTextCharFormat errorFormat; public: LDrawSyntaxHighlighter(QTextDocument* parent = nullptr); // QSyntaxHighlighter interface protected: void highlightBlock(const QString& text) override; };