60 #include <QPlainTextEdit>
63 #include <QPushButton>
64 #include <QRegularExpression>
65 #include <QRegularExpressionMatch>
66 #include <QSharedPointer>
67 #include <QStringList>
69 #include <QToolButton>
73 #include "../../visualization/visualization.h"
74 #include "../../visualization/line/operation/vistoolrotation.h"
75 #include "../ifc/xml/vabstractpattern.h"
76 #include "../ifc/xml/vdomdocument.h"
77 #include "../qmuparser/qmudef.h"
78 #include "../support/edit_formula_dialog.h"
79 #include "../vgeometry/vpointf.h"
80 #include "../vmisc/vabstractapplication.h"
81 #include "../vmisc/vcommonsettings.h"
82 #include "../vpatterndb/vcontainer.h"
83 #include "../vpatterndb/vtranslatevars.h"
84 #include "../vwidgets/vabstractmainwindow.h"
85 #include "../vwidgets/vmaingraphicsscene.h"
86 #include "ui_dialogrotation.h"
98 , m_firstRelease(false)
101 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
102 setWindowIcon(QIcon(
":/toolicon/32x32/rotation.png"));
104 ui->plainTextEditFormula->installEventFilter(
this);
105 ui->suffix_LineEdit->setText(
qApp->getCurrentDocument()->GenerateSuffix(
qApp->Settings()->getRotateSuffix()));
175 ui->suffix_LineEdit->setText(value);
208 scene->clearSelection();
225 qApp->getSceneView()->allowRubberBand(
false);
227 emit
ToolTip(tr(
"Select rotation point"));
245 const QLineF line = QLineF(
static_cast<QPointF
>(*point), scene->
getScenePos());
280 [
id](
const SourceItem &item) { return item.id == id; });
293 emit
ToolTip(tr(
"Select rotation point that is not part of the list of objects"));
321 [
id](
const SourceItem &item) { return item.id == id; });
354 dialog->setWindowTitle(tr(
"Edit angle"));
357 if (dialog->exec() == QDialog::Accepted)
367 QLineEdit* edit = qobject_cast<QLineEdit*>(sender());
370 const QString suffix = edit->text();
371 if (suffix.isEmpty())
384 for (
int i=0; i < uniqueNames.size(); ++i)
386 const QString name = uniqueNames.at(i) + suffix;
387 if (not rx.match(name).hasMatch() || not
data->
IsUnique(name))
416 AddVisualization<VisToolRotation>();
439 ui->plainTextEditFormula->blockSignals(
true);
449 [
id](
const SourceItem &item) { return item.id == id; });
virtual void CheckState() Q_DECL_FINAL
CheckState enable, when all is correct, or disable, when something wrong, button ok.
void SetAngle(const QString &value)
virtual void ShowVisualization() Q_DECL_OVERRIDE
virtual ~DialogRotation()
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE
closeEvent handle when dialog cloded
void setOriginPointId(const quint32 &value)
DialogRotation(const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
QVector< SourceItem > getSourceObjects() const
virtual void ShowDialog(bool click) Q_DECL_OVERRIDE
QVector< SourceItem > m_objects
angle formula of angle
virtual void SelectedObject(bool selected, quint32 id, quint32 tool) Q_DECL_OVERRIDE
void setSuffix(const QString &value)
virtual void SaveData() Q_DECL_OVERRIDE
SaveData Put dialog data in local variables.
QString getSuffix() const
QString angleFormula
angleTimer timer of check formula of angle */
quint32 getOriginPointId() const
void setSourceObjects(const QVector< SourceItem > &value)
QTimer * angleTimer
angleFlag true if value of angle is correct */
virtual void ShowToolTip(const QString &toolTip)=0
The VContainer class container of all variables.
static bool IsUnique(const QString &name)
const QSharedPointer< T > GeometricObject(const quint32 &id) const
static QStringList AllUniqueNames()
The VExceptionBadId class for exception bad id.
The VMainGraphicsScene class main scene.
void ToggleArcHover(bool enabled)
QPointF getScenePos() const
void ToggleSplinePathSelection(bool enabled)
void ToggleElArcHover(bool enabled)
void ToggleElArcSelection(bool enabled)
void ToggleSplinePathHover(bool enabled)
void ToggleSplineHover(bool enabled)
void ToggleSplineSelection(bool enabled)
void ToggleArcSelection(bool enabled)
The VPointF class keep data of point.
void setObjects(QVector< quint32 > objects)
virtual void VisualMode(const quint32 &pointId=NULL_ID) Q_DECL_OVERRIDE
void ToolTip(const QString &toolTip)
const QString degreeSymbol
qreal sceneScale(QGraphicsScene *scene)
qreal scaledRadius(qreal scale)
QVector< quint32 > sourceToObjects(const QVector< SourceItem > &source)