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/vistoolmove.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_dialogmove.h"
87 #include "../../tools/drawTools/operation/vabstractoperation.h"
98 , lengthTimer(nullptr)
101 , rotationTimer(nullptr)
106 , useOriginPoint(false)
109 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
110 setWindowIcon(QIcon(
":/toolicon/32x32/move.png"));
112 ui->angle_PlainTextEdit->installEventFilter(
this);
113 ui->length_PlainTextEdit->installEventFilter(
this);
114 ui->rotation_PlainTextEdit->installEventFilter(
this);
116 ui->suffix_LineEdit->setText(
qApp->getCurrentDocument()->GenerateSuffix(
qApp->Settings()->getMoveSuffix()));
130 ui->rotationPoint_ComboBox->blockSignals(
true);
131 ui->rotationPoint_ComboBox->addItem(tr(
"Center point"),
NULL_ID);
132 ui->rotationPoint_ComboBox->blockSignals(
false);
225 ui->suffix_LineEdit->setText(value);
258 scene->clearSelection();
279 qApp->getSceneView()->allowRubberBand(
false);
303 if (QGuiApplication::keyboardModifiers() == Qt::ControlModifier)
333 if (type ==
SceneObject::Point && QGuiApplication::keyboardModifiers() == Qt::ControlModifier)
335 if (
SetObject(
id,
ui->rotationPoint_ComboBox, QString()))
355 [
id](
const SourceItem &item) { return item.id == id; });
404 dialog->setWindowTitle(tr(
"Edit angle"));
407 if (dialog->exec() == QDialog::Accepted)
418 dialog->setWindowTitle(tr(
"Edit length"));
421 if (dialog->exec() == QDialog::Accepted)
432 dialog->setWindowTitle(tr(
"Edit rotation"));
435 if (dialog->exec() == QDialog::Accepted)
445 QLineEdit* edit = qobject_cast<QLineEdit*>(sender());
448 const QString suffix = edit->text();
449 if (suffix.isEmpty())
462 for (
int i=0; i < uniqueNames.size(); ++i)
464 const QString name = uniqueNames.at(i) + suffix;
465 if (not rx.match(name).hasMatch() || not
data->
IsUnique(name))
487 if (text ==
"Center Point")
512 AddVisualization<VisToolMove>();
543 ui->angle_PlainTextEdit->blockSignals(
true);
544 ui->length_PlainTextEdit->blockSignals(
true);
545 ui->rotation_PlainTextEdit->blockSignals(
true);
577 Eval(
ui->length_PlainTextEdit->toPlainText(),
lengthFlag,
ui->lengthResult_Label, postfix);
void originChanged(const QString &text)
void SetAngle(const QString &value)
QString getRotation() const
QString angleFormula
angleFlag true if value of angle is correct */
quint32 getOriginPointId() const
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE
closeEvent handle when dialog cloded
virtual void SaveData() Q_DECL_OVERRIDE
SaveData Put dialog data in local variables.
QVector< SourceItem > m_objects
rotationTimer timer of check formula of rotation */
void setSuffix(const QString &value)
QString rotationFormula
rotationFlag true if value of length is correct */
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE
QString lengthFormula
lengthFlag true if value of length is correct */
virtual void SelectedObject(bool selected, quint32 id, quint32 tool) Q_DECL_OVERRIDE
bool lengthFlag
angleTimer timer of check formula of angle */
void setOriginPointId(const quint32 &value)
void SetLength(const QString &value)
virtual void CheckState() Q_DECL_FINAL
CheckState enable, when all is correct, or disable, when something wrong, button ok.
virtual void ShowDialog(bool click) Q_DECL_OVERRIDE
bool rotationFlag
lengthTimer timer of check formula of length */
QTimer * angleTimer
angle formula of angle */
QString GetLength() const
QTimer * lengthTimer
length formula of length */
QVector< SourceItem > getSourceObjects() const
void setSourceObjects(const QVector< SourceItem > &value)
QString getSuffix() const
void setRotation(const QString &value)
DialogMove(const VContainer *data, quint32 toolId, QWidget *parent=nullptr)
void editRotationFormula()
QTimer * rotationTimer
rotationFormula of rotation */
virtual void ShowVisualization() Q_DECL_OVERRIDE
virtual void ShowToolTip(const QString &toolTip)=0
The VContainer class container of all variables.
static bool IsUnique(const QString &name)
static QStringList AllUniqueNames()
The VMainGraphicsScene class main scene.
void ToggleArcHover(bool enabled)
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)
void setObjects(QVector< quint32 > objects)
virtual void VisualMode(const quint32 &pointId=NULL_ID) Q_DECL_OVERRIDE
QString CurrentToolTip() const
void ToolTip(const QString &toolTip)
const QString degreeSymbol
QString UnitsToStr(const Unit &unit, const bool translate)
UnitsToStr translate unit to string.
QVector< quint32 > sourceToObjects(const QVector< SourceItem > &source)