61 #include <QPushButton>
62 #include <QRegularExpression>
63 #include <QRegularExpressionMatch>
64 #include <QSharedPointer>
65 #include <QStringList>
66 #include <QToolButton>
70 #include "../../visualization/visualization.h"
71 #include "../../visualization/line/operation/vistoolmirrorbyline.h"
72 #include "../ifc/xml/vabstractpattern.h"
73 #include "../ifc/xml/vdomdocument.h"
74 #include "../qmuparser/qmudef.h"
75 #include "../vgeometry/vpointf.h"
76 #include "../vmisc/vabstractapplication.h"
77 #include "../vmisc/vcommonsettings.h"
78 #include "../vpatterndb/vcontainer.h"
79 #include "../vwidgets/vabstractmainwindow.h"
80 #include "../vwidgets/vmaingraphicsscene.h"
81 #include "ui_dialogmirrorbyline.h"
92 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
93 setWindowIcon(QIcon(
":/toolicon/32x32/mirror_by_line.png"));
95 ui->suffix_LineEdit->setText(
qApp->getCurrentDocument()->GenerateSuffix(
qApp->Settings()->getMirrorByLineSuffix()));
158 ui->suffix_LineEdit->setText(value);
191 scene->clearSelection();
208 qApp->getSceneView()->allowRubberBand(
false);
210 emit
ToolTip(tr(
"Select first mirror line point"));
229 [
id](
const SourceItem &item) { return item.id == id; });
236 emit
ToolTip(tr(
"Select first mirror line point that is not part of the list of objects"));
240 if (
SetObject(
id,
ui->firstLinePoint_ComboBox, tr(
"Select second mirror line point")))
252 emit
ToolTip(tr(
"Select second mirror line point that is not part of the list of objects"));
258 if (
SetObject(
id,
ui->secondLinePoint_ComboBox,
""))
287 [
id](
const SourceItem &item) { return item.id == id; });
311 QLineEdit* edit = qobject_cast<QLineEdit*>(sender());
314 const QString suffix = edit->text();
315 if (suffix.isEmpty())
328 for (
int i=0; i < uniqueNames.size(); ++i)
330 const QString name = uniqueNames.at(i) + suffix;
331 if (not rx.match(name).hasMatch() || not
data->
IsUnique(name))
360 AddVisualization<VisToolMirrorByLine>();
387 [id1](
const SourceItem &item) { return item.id == id1;});
391 [id2](
const SourceItem &item) { return item.id == id2;});
void setFirstLinePointId(quint32 value)
virtual void SaveData() Q_DECL_OVERRIDE
SaveData Put dialog data in local variables.
QString getSuffix() const
DialogMirrorByLine(const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
virtual void SelectedObject(bool selected, quint32 id, quint32 tool) Q_DECL_OVERRIDE
void setSourceObjects(const QVector< SourceItem > &value)
virtual void ShowVisualization() Q_DECL_OVERRIDE
void setSuffix(const QString &value)
quint32 getSecondLinePointId() const
Ui::DialogMirrorByLine * ui
void setSecondLinePointId(quint32 value)
virtual ~DialogMirrorByLine()
quint32 getFirstLinePointId() const
virtual void CheckState() Q_DECL_FINAL
CheckState enable, when all is correct, or disable, when something wrong, button ok.
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE
QVector< SourceItem > getSourceObjects() const
virtual void ShowDialog(bool click) Q_DECL_OVERRIDE
QVector< SourceItem > m_objects
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
QVector< quint32 > sourceToObjects(const QVector< SourceItem > &source)