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/vistoolmirrorbyaxis.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_dialogmirrorbyaxis.h"
92 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
93 setWindowIcon(QIcon(
":/toolicon/32x32/mirror_by_axis.png"));
95 ui->suffix_LineEdit->setText(
qApp->getCurrentDocument()->GenerateSuffix(
qApp->Settings()->getMirrorByAxisSuffix()));
135 return getCurrentCrossPoint<AxisType>(
ui->axisType_ComboBox);
141 auto index =
ui->axisType_ComboBox->findData(
static_cast<int>(type));
144 ui->axisType_ComboBox->setCurrentIndex(index);
146 auto operation = qobject_cast<VisToolMirrorByAxis *>(
vis);
148 operation->setAxisType(type);
162 ui->suffix_LineEdit->setText(value);
195 scene->clearSelection();
212 qApp->getSceneView()->allowRubberBand(
false);
214 emit
ToolTip(tr(
"Select axis rotation point"));
233 [
id](
const SourceItem &item) { return item.id == id; });
237 emit
ToolTip(tr(
"Select axis rotation point that is not part of the list of objects"));
261 [
id](
const SourceItem &item) { return item.id == id; });
285 QLineEdit* edit = qobject_cast<QLineEdit*>(sender());
288 const QString suffix = edit->text();
289 if (suffix.isEmpty())
302 for (
int i=0; i < uniqueNames.size(); ++i)
304 const QString name = uniqueNames.at(i) + suffix;
305 if (not rx.match(name).hasMatch() || not
data->
IsUnique(name))
334 AddVisualization<VisToolMirrorByAxis>();
357 [
id](
const SourceItem &item) { return item.id == id;});
static void fillComboBoxAxisType(QComboBox *box)
Ui::DialogMirrorByAxis * ui
quint32 getOriginPointId() const
DialogMirrorByAxis(const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
virtual void ChosenObject(quint32 id, const SceneObject &type) Q_DECL_OVERRIDE
void setSourceObjects(const QVector< SourceItem > &value)
QString getSuffix() const
AxisType getAxisType() const
void setOriginPointId(quint32 value)
virtual ~DialogMirrorByAxis()
void setSuffix(const QString &value)
virtual void CheckState() Q_DECL_FINAL
CheckState enable, when all is correct, or disable, when something wrong, button ok.
QVector< SourceItem > getSourceObjects() const
void setAxisType(AxisType type)
virtual void ShowDialog(bool click) Q_DECL_OVERRIDE
virtual void SaveData() Q_DECL_OVERRIDE
SaveData Put dialog data in local variables.
virtual void ShowVisualization() Q_DECL_OVERRIDE
virtual void SelectedObject(bool selected, quint32 id, quint32 tool) 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)