Seamly2D
Code documentation
dialogtool.h
Go to the documentation of this file.
1 /***************************************************************************
2  ** @file dialogtool.cpp
3  ** @author Douglas S Caskey
4  ** @date Dec 11, 2022
5  **
6  ** @copyright
7  ** Copyright (C) 2017 - 2022 Seamly, LLC
8  ** https://github.com/fashionfreedom/seamly2d
9  **
10  ** @brief
11  ** Seamly2D is free software: you can redistribute it and/or modify
12  ** it under the terms of the GNU General Public License as published by
13  ** the Free Software Foundation, either version 3 of the License, or
14  ** (at your option) any later version.
15  **
16  ** Seamly2D is distributed in the hope that it will be useful,
17  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
18  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  ** GNU General Public License for more details.
20  **
21  ** You should have received a copy of the GNU General Public License
22  ** along with Seamly2D. If not, see <http://www.gnu.org/licenses/>.
23  **************************************************************************/
24 
25 /************************************************************************
26  **
27  ** @file dialogtool.h
28  ** @author Roman Telezhynskyi <dismine(at)gmail.com>
29  ** @date November 15, 2013
30  **
31  ** @brief
32  ** @copyright
33  ** This source code is part of the Valentina project, a pattern making
34  ** program, whose allow create and modeling patterns of clothing.
35  ** Copyright (C) 2013 Valentina project
36  ** <https://bitbucket.org/dismine/valentina> All Rights Reserved.
37  **
38  ** Valentina is free software: you can redistribute it and/or modify
39  ** it under the terms of the GNU General Public License as published by
40  ** the Free Software Foundation, either version 3 of the License, or
41  ** (at your option) any later version.
42  **
43  ** Valentina is distributed in the hope that it will be useful,
44  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
45  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46  ** GNU General Public License for more details.
47  **
48  ** You should have received a copy of the GNU General Public License
49  ** along with Valentina. If not, see <http://www.gnu.org/licenses/>.
50  **
51  *************************************************************************/
52 
53 #ifndef DIALOGTOOL_H
54 #define DIALOGTOOL_H
55 
56 #include <qcompilerdetection.h>
57 #include <QCheckBox>
58 #include <QColor>
59 #include <QComboBox>
60 #include <QDialog>
61 #include <QDialogButtonBox>
62 #include <QLineEdit>
63 #include <QList>
64 #include <QListWidget>
65 #include <QLocale>
66 #include <QMap>
67 #include <QMetaObject>
68 #include <QObject>
69 #include <QPointer>
70 #include <QPushButton>
71 #include <QRadioButton>
72 #include <QString>
73 #include <QVariant>
74 #include <QtGlobal>
75 
76 #include "../vtools/visualization/visualization.h" // Issue on Windows
77 #include "../ifc/xml/vabstractpattern.h"
78 #include "../ifc/ifcdef.h"
79 #include "../vgeometry/vgeometrydef.h"
80 #include "../vmisc/def.h"
81 #include "../vmisc/logging.h"
82 #include "../vmisc/vabstractapplication.h"
83 #include "../vmisc/vcommonsettings.h"
84 #include "../vwidgets/vmaingraphicsscene.h"
85 
86 struct NodeInfo
87 {
88  QString icon{};
89  QString name{};
90 };
91 
92 template <class T> class QSharedPointer;
93 
94 Q_DECLARE_LOGGING_CATEGORY(vDialog)
95 
96 class QDoubleSpinBox;
97 class QLabel;
98 class QPlainTextEdit;
99 class VAbstractTool;
100 
101 enum class FillComboBox : char { Whole, NoChildren};
102 
103 /**
104  * @brief The DialogTool class parent for all dialog of tools.
105  */
106 class DialogTool : public QDialog
107 {
108  Q_OBJECT
109 public:
110  DialogTool(const VContainer *data, const quint32 &toolId, QWidget *parent = nullptr);
111  virtual ~DialogTool() Q_DECL_OVERRIDE;
112 
114  void SetAssociatedTool(VAbstractTool* tool);
115 
116  virtual void ShowDialog(bool click);
117  virtual void Build(const Tool &type);
118  virtual void SetPiecesList(const QVector<quint32> &list);
119 
120  quint32 GetToolId() const;
121  void SetToolId(const quint32 &value);
122 
123  QString getPointName() const;
124 
125  static void moveListRowTop(QListWidget *list);
126  static void moveListRowUp(QListWidget *list);
127  static void moveListRowDown(QListWidget *list);
128  static void moveListRowBottom(QListWidget *list);
129 
130 signals:
131  /**
132  * @brief DialogClosed signal dialog closed
133  * @param result keep result
134  */
135  void DialogClosed(int result);
136  /**
137  * @brief DialogApplied emit signal dialog apply changes
138  */
140  /**
141  * @brief ToolTip emit tooltipe for tool
142  * @param toolTip text tooltipe
143  */
144  void ToolTip(const QString &toolTip);
145 
146 public slots:
147  virtual void ChosenObject(quint32 id, const SceneObject &type);
148  virtual void SelectedObject(bool selected, quint32 object, quint32 tool);
149  void NamePointChanged();
150  virtual void DialogAccepted();
151  /**
152  * @brief DialogApply save data and emit signal DialogApplied.
153  */
154  virtual void DialogApply();
155  virtual void DialogRejected();
156  void FormulaChanged();
157  /**
158  * @brief FormulaChangedPlainText check formula (plain text editor editor)
159  */
161  void ArrowUp();
162  void ArrowDown();
163  void ArrowLeft();
164  void ArrowRight();
165  void ArrowLeftUp();
166  void ArrowLeftDown();
167  void ArrowRightUp();
168  void ArrowRightDown();
169  virtual void EvalFormula();
170 
171  virtual void PointNameChanged() {}
172 protected:
173  Q_DISABLE_COPY(DialogTool)
174 
175  /** @brief data container with data */
176  // cppcheck-suppress duplInheritedMember
177  const VContainer *data;
178 
179  /** @brief isInitialized true if window is initialized */
181 
182  /** @brief flagName true if name is correct */
183  bool flagName;
184 
185  /** @brief flagFormula true if formula correct */
187 
188  /** @brief flagError use this flag if for you do not enought @see flagName and @see flagFormula.
189  *
190  * In many cases you will need more flags fore checking if all data are valid.
191  * By default this flag is true.
192  */
193  bool flagError;
194 
195  /** @brief timerFormula timer for check formula */
196  QTimer *timerFormula;
197 
198  /** @brief ok_Button button ok */
199  QPushButton *ok_Button;
200 
201  /** @brief apply_Button button apply */
202  QPushButton *apply_Button;
203 
204  /** @brief spinBoxAngle spinbox for angle */
205  QDoubleSpinBox *spinBoxAngle;
206 
207  /** @brief plainTextEditFormula formula */
208  QPlainTextEdit *plainTextEditFormula;
209 
210  /** @brief labelResultCalculation label with result of calculation */
212 
213  /** @brief labelEditNamePoint label used when need show wrong name of point */
215 
216  /** @brief labelEditFormula label used when need show wrong formula */
218 
219  const QColor okColor;
220  const QColor errorColor;
221  /**
222  * @brief associatedTool vdrawtool associated with opened dialog.
223  */
225  quint32 toolId;
226 
227  /** @brief prepare show if we prepare. Show dialog after finish working with visual part of tool*/
228  bool prepare;
229 
230  /** @brief pointName name of point */
231  QString pointName;
232 
233  /** @brief number number of handled objects */
234  qint32 number;
235 
236  QPointer<Visualization> vis;
237  virtual void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
238  virtual void closeEvent ( QCloseEvent * event ) Q_DECL_OVERRIDE;
239  virtual void showEvent( QShowEvent *event ) Q_DECL_OVERRIDE;
240 
241  void FillComboBoxPiecesList(QComboBox *box, const QVector<quint32> &list);
242  void FillComboBoxPoints(QComboBox *box, FillComboBox rule = FillComboBox::Whole,
243  const quint32 &ch1 = NULL_ID, const quint32 &ch2 = NULL_ID)const;
244  void FillComboBoxArcs(QComboBox *box, FillComboBox rule = FillComboBox::Whole,
245  const quint32 &ch1 = NULL_ID, const quint32 &ch2 = NULL_ID)const;
246  void FillComboBoxSplines(QComboBox *box)const;
247  void FillComboBoxSplinesPath(QComboBox *box)const;
248  void FillComboBoxCurves(QComboBox *box)const;
249  void FillComboBoxTypeLine(QComboBox *box, const QMap<QString, QIcon> &stylesPics) const;
250  void FillComboBoxLineColors(QComboBox *box)const;
251  void FillComboBoxCrossCirclesPoints(QComboBox *box) const;
252  void FillComboBoxVCrossCurvesPoint(QComboBox *box) const;
253  void FillComboBoxHCrossCurvesPoint(QComboBox *box) const;
254 
255  virtual void CheckState();
256  QString GetComboBoxCurrentData(const QComboBox *box, const QString &def)const;
257  void ChangeCurrentData(QComboBox *box, const QVariant &value) const;
258  void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer * timer, const QString &postfix = QString());
259  void ValFormulaChanged(bool &flag, QPlainTextEdit *edit, QTimer * timer,
260  const QString &postfix = QString());
261  qreal Eval(const QString &text, bool &flag, QLabel *label, const QString &postfix,
262  bool checkZero = true, bool checkLessThanZero = false);
263 
264  qreal normalize(const qreal value, const qreal start, const qreal end) ;
265 
266  void setCurrentPointId(QComboBox *box, const quint32 &value,
268  const quint32 &ch1 = NULL_ID, const quint32 &ch2 = NULL_ID) const;
269  void setCurrentSplineId(QComboBox *box, const quint32 &value) const;
270  void setCurrentArcId(QComboBox *box, const quint32 &value,
272  const quint32 &ch1 = NULL_ID, const quint32 &ch2 = NULL_ID) const;
273  void setCurrentSplinePathId(QComboBox *box, const quint32 &value) const;
274  void setCurrentCurveId(QComboBox *box, const quint32 &value) const;
275 
276  quint32 getCurrentObjectId(QComboBox *box) const;
277 
278  template <typename T>
279  T getCurrentCrossPoint(QComboBox *box) const;
280 
281  bool SetObject(const quint32 &id, QComboBox *box, const QString &toolTip);
282  void DeployFormula(QPlainTextEdit *formula, QPushButton *buttonGrowLength, int formulaBaseHeight);
283 
284  template <typename T>
285  void initializeOkCancelApply(T *ui);
286 
287  template <typename T>
288  void initializeOkCancel(T *ui);
289 
290  template <typename T>
291  void initializeFormulaUi(T *ui);
292 
293  template <typename T>
294  void AddVisualization();
295 
296  template <typename T>
297  QVector<T> GetListInternals(const QListWidget *list) const;
298 
299  void ChangeColor(QWidget *widget, const QColor &color);
300  virtual void ShowVisualization() {}
301  /**
302  * @brief SaveData Put dialog data in local variables
303  */
304  virtual void SaveData() {}
305  void MoveCursorToEnd(QPlainTextEdit *plainTextEdit) const;
306  virtual bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE;
307  quint32 DNumber(const QString &baseName) const;
308 
309  static int FindNotExcludedNodeDown(QListWidget *listWidget, int candidate);
310  static int FindNotExcludedNodeUp(QListWidget *listWidget, int candidate);
311  static bool isFirstPointSameAsLast(QListWidget *listWidget);
312  static bool doublePointsExist(QListWidget *listWidget);
313  static bool isEachPointNameUnique(QListWidget *listWidget);
314  static QString DialogWarningIcon();
315  static QFont NodeFont(bool nodeExcluded);
316 
317  NodeInfo getNodeInfo(const VPieceNode &node, bool showNotch = false) const;
318  void newNodeItem(QListWidget *listWidget, const VPieceNode &node,
319  bool nodeExcluded = true, bool isDuplicate = false);
320 
321  void initializeNodeAngles(QComboBox *box);
322 
323 private:
324  void FillList(QComboBox *box, const QMap<QString, quint32> &list)const;
325 
326  template <typename T>
327  void PrepareList(QMap<QString, quint32> &list, quint32 id) const;
328 
329  bool IsSpline(const QSharedPointer<VGObject> &obj) const;
330  bool IsSplinePath(const QSharedPointer<VGObject> &obj) const;
331 
332  template <typename GObject>
333  void FillCombo(QComboBox *box, GOType gType, FillComboBox rule = FillComboBox::Whole,
334  const quint32 &ch1 = NULL_ID, const quint32 &ch2 = NULL_ID) const;
335 
336 
337 };
338 
339 //---------------------------------------------------------------------------------------------------------------------
340 template <typename T>
341 QVector<T> DialogTool::GetListInternals(const QListWidget *list) const
342 {
343  SCASSERT(list != nullptr)
344  QVector<T> internals;
345  for (qint32 i = 0; i < list->count(); ++i)
346  {
347  QListWidgetItem *item = list->item(i);
348  internals.append(qvariant_cast<T>(item->data(Qt::UserRole)));
349  }
350  return internals;
351 }
352 
353 //---------------------------------------------------------------------------------------------------------------------
355 {
356  return this->associatedTool;
357 }
358 
359 //---------------------------------------------------------------------------------------------------------------------
360 template <typename T>
361 /**
362  * @brief initializeOkCancelApply initialize OK / Cancel and Apply buttons
363  * @param ui Dialog container
364  */
366 {
367  initializeOkCancel(ui);
368  apply_Button = ui->buttonBox->button(QDialogButtonBox::Apply);
369  SCASSERT(apply_Button != nullptr)
370  connect(apply_Button, &QPushButton::clicked, this, &DialogTool::DialogApply);
371 }
372 
373 //---------------------------------------------------------------------------------------------------------------------
374 template <typename T>
375 /**
376  * @brief initializeOkCancel initialize OK and Cancel buttons
377  * @param ui Dialog container
378  */
380 {
381  ok_Button = ui->buttonBox->button(QDialogButtonBox::Ok);
382  SCASSERT(ok_Button != nullptr)
383  connect(ok_Button, &QPushButton::clicked, this, &DialogTool::DialogAccepted);
384 
385  QPushButton *bCancel = ui->buttonBox->button(QDialogButtonBox::Cancel);
386  SCASSERT(bCancel != nullptr)
387  connect(bCancel, &QPushButton::clicked, this, &DialogTool::DialogRejected);
388 
389  qApp->Settings()->GetOsSeparator() ? setLocale(QLocale()) : setLocale(QLocale::c());
390 }
391 
392 //---------------------------------------------------------------------------------------------------------------------
393 template <typename T>
394 /**
395  * @brief initializeFormulaUi initialize ui object for the formula field
396  * @param ui Dialog container
397  */
399 {
400  labelResultCalculation = ui->labelResultCalculation;
401  plainTextEditFormula = ui->plainTextEditFormula;
402  labelEditFormula = ui->labelEditFormula;
403 }
404 
405 //---------------------------------------------------------------------------------------------------------------------
406 template <typename T>
408 {
409  if (prepare == false)
410  {
411  VMainGraphicsScene *scene = qobject_cast<VMainGraphicsScene *>(qApp->getCurrentScene());
412  SCASSERT(scene != nullptr)
413 
414  T *toolVis = qobject_cast<T *>(vis);
415  SCASSERT(toolVis != nullptr)
416 
417  if (not scene->items().contains(toolVis))
418  {
419  scene->addItem(toolVis);
420  }
421 
422  toolVis->SetMode(Mode::Show);
423  toolVis->RefreshGeometry();
424  }
425 }
426 
427 //---------------------------------------------------------------------------------------------------------------------
428 template <typename T>
429 inline T DialogTool::getCurrentCrossPoint(QComboBox *box) const
430 {
431  int value;
432  bool ok = false;
433  value = box->currentData().toInt(&ok);
434 
435  if (not ok)
436  {
437  return static_cast<T>(1);
438  }
439 
440  switch(value)
441  {
442  case 1:
443  case 2:
444  return static_cast<T>(value);
445  default:
446  return static_cast<T>(1);
447  }
448 }
449 
450 #endif // DIALOGTOOL_H
The DialogTool class parent for all dialog of tools.
Definition: dialogtool.h:107
void setCurrentPointId(QComboBox *box, const quint32 &value, FillComboBox rule=FillComboBox::NoChildren, const quint32 &ch1=NULL_ID, const quint32 &ch2=NULL_ID) const
Definition: dialogtool.cpp:896
void ChangeCurrentData(QComboBox *box, const QVariant &value) const
ChangeCurrentData select item in combobox by id.
Definition: dialogtool.cpp:419
quint32 DNumber(const QString &baseName) const
Definition: dialogtool.cpp:476
void ArrowDown()
ArrowDown set angle value 270 degree.
virtual void DialogRejected()
DialogRejected emit signal dialog rejected.
const QColor okColor
Definition: dialogtool.h:219
QDoubleSpinBox * spinBoxAngle
spinBoxAngle spinbox for angle
Definition: dialogtool.h:205
void ArrowLeftUp()
ArrowLeftUp set angle value 135 degree.
qreal normalize(const qreal value, const qreal start, const qreal end)
Definition: dialogtool.cpp:886
void setCurrentArcId(QComboBox *box, const quint32 &value, FillComboBox rule=FillComboBox::NoChildren, const quint32 &ch1=NULL_ID, const quint32 &ch2=NULL_ID) const
setCurrentArcId
Definition: dialogtool.cpp:924
static bool isFirstPointSameAsLast(QListWidget *listWidget)
Definition: dialogtool.cpp:552
void ToolTip(const QString &toolTip)
ToolTip emit tooltipe for tool.
virtual void CheckState()
CheckState enable, when all is correct, or disable, when something wrong, button ok.
void FillComboBoxPoints(QComboBox *box, FillComboBox rule=FillComboBox::Whole, const quint32 &ch1=NULL_ID, const quint32 &ch2=NULL_ID) const
FillComboBoxPoints fill comboBox list of points.
Definition: dialogtool.cpp:242
void ArrowLeft()
ArrowLeft set angle value 180 degree.
VAbstractTool * GetAssociatedTool()
Definition: dialogtool.h:354
virtual void ChosenObject(quint32 id, const SceneObject &type)
ChosenObject gets id and type of selected object. Save right data and ignore wrong.
void DialogClosed(int result)
DialogClosed signal dialog closed.
virtual void ShowVisualization()
Definition: dialogtool.h:300
static int FindNotExcludedNodeUp(QListWidget *listWidget, int candidate)
Definition: dialogtool.cpp:521
void ArrowRightDown()
ArrowRightDown set angle value 315 degree.
void NamePointChanged()
NamePointChanged check name of point.
bool flagName
flagName true if name is correct
Definition: dialogtool.h:183
void ArrowUp()
ArrowUp set angle value 90 degree.
void FillComboBoxCrossCirclesPoints(QComboBox *box) const
Definition: dialogtool.cpp:373
void MoveCursorToEnd(QPlainTextEdit *plainTextEdit) const
Definition: dialogtool.cpp:432
QPushButton * ok_Button
ok_Button button ok
Definition: dialogtool.h:199
void FormulaChanged()
formula check formula
void ArrowRight()
ArrowRight set angle value 0 degree.
bool flagFormula
flagFormula true if formula correct
Definition: dialogtool.h:186
void setCurrentSplineId(QComboBox *box, const quint32 &value) const
setCurrentSplineId set current spline id in combobox
Definition: dialogtool.cpp:913
QString pointName
pointName name of point
Definition: dialogtool.h:231
static bool doublePointsExist(QListWidget *listWidget)
Definition: dialogtool.cpp:565
static void moveListRowBottom(QListWidget *list)
qreal Eval(const QString &text, bool &flag, QLabel *label, const QString &postfix, bool checkZero=true, bool checkLessThanZero=false)
Eval evaluate formula and show result.
Definition: dialogtool.cpp:805
void SetAssociatedTool(VAbstractTool *tool)
static void moveListRowDown(QListWidget *list)
void initializeOkCancel(T *ui)
initializeOkCancel initialize OK and Cancel buttons
Definition: dialogtool.h:379
NodeInfo getNodeInfo(const VPieceNode &node, bool showNotch=false) const
Definition: dialogtool.cpp:628
void PrepareList(QMap< QString, quint32 > &list, quint32 id) const
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE
showEvent handle when window show
Definition: dialogtool.cpp:203
void FillComboBoxSplinesPath(QComboBox *box) const
Definition: dialogtool.cpp:278
const QColor errorColor
Definition: dialogtool.h:220
virtual void ShowDialog(bool click)
qint32 number
number number of handled objects
Definition: dialogtool.h:234
bool IsSpline(const QSharedPointer< VGObject > &obj) const
void newNodeItem(QListWidget *listWidget, const VPieceNode &node, bool nodeExcluded=true, bool isDuplicate=false)
Definition: dialogtool.cpp:679
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE
closeEvent handle when dialog cloded
Definition: dialogtool.cpp:192
void ValFormulaChanged(bool &flag, QLineEdit *edit, QTimer *timer, const QString &postfix=QString())
ValFormulaChanged handle change formula.
Definition: dialogtool.cpp:744
void FillList(QComboBox *box, const QMap< QString, quint32 > &list) const
FillList fill combobox list.
bool SetObject(const quint32 &id, QComboBox *box, const QString &toolTip)
Definition: dialogtool.cpp:974
void AddVisualization()
Definition: dialogtool.h:407
virtual void DialogAccepted()
DialogAccepted save data and emit signal about closed dialog.
void ArrowRightUp()
ArrowRightUp set angle value 45 degree.
void FillComboBoxLineColors(QComboBox *box) const
Definition: dialogtool.cpp:350
QPushButton * apply_Button
apply_Button button apply
Definition: dialogtool.h:202
bool isInitialized
isInitialized true if window is initialized
Definition: dialogtool.h:180
static void moveListRowTop(QListWidget *list)
void FillComboBoxSplines(QComboBox *box) const
Definition: dialogtool.cpp:254
QString getPointName() const
QLabel * labelEditNamePoint
labelEditNamePoint label used when need show wrong name of point
Definition: dialogtool.h:214
quint32 toolId
Definition: dialogtool.h:225
static QFont NodeFont(bool nodeExcluded)
Definition: dialogtool.cpp:618
void FillComboBoxArcs(QComboBox *box, FillComboBox rule=FillComboBox::Whole, const quint32 &ch1=NULL_ID, const quint32 &ch2=NULL_ID) const
Definition: dialogtool.cpp:248
QLabel * labelEditFormula
labelEditFormula label used when need show wrong formula
Definition: dialogtool.h:217
void FillComboBoxCurves(QComboBox *box) const
Definition: dialogtool.cpp:302
static int FindNotExcludedNodeDown(QListWidget *listWidget, int candidate)
Definition: dialogtool.cpp:490
void FillCombo(QComboBox *box, GOType gType, FillComboBox rule=FillComboBox::Whole, const quint32 &ch1=NULL_ID, const quint32 &ch2=NULL_ID) const
void initializeOkCancelApply(T *ui)
initializeOkCancelApply initialize OK / Cancel and Apply buttons
Definition: dialogtool.h:365
void FillComboBoxVCrossCurvesPoint(QComboBox *box) const
Definition: dialogtool.cpp:382
void setCurrentSplinePathId(QComboBox *box, const quint32 &value) const
setCurrentSplinePathId set current splinePath id in combobox
Definition: dialogtool.cpp:938
bool flagError
flagError use this flag if for you do not enought
Definition: dialogtool.h:193
const VContainer * data
data container with data
Definition: dialogtool.h:177
QPlainTextEdit * plainTextEditFormula
plainTextEditFormula formula
Definition: dialogtool.h:208
QString GetComboBoxCurrentData(const QComboBox *box, const QString &def) const
Definition: dialogtool.cpp:400
bool prepare
prepare show if we prepare. Show dialog after finish working with visual part of tool
Definition: dialogtool.h:228
virtual void SaveData()
SaveData Put dialog data in local variables.
Definition: dialogtool.h:304
void SetToolId(const quint32 &value)
virtual void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE
Definition: dialogtool.cpp:174
VAbstractTool * associatedTool
associatedTool vdrawtool associated with opened dialog.
Definition: dialogtool.h:224
static bool isEachPointNameUnique(QListWidget *listWidget)
Definition: dialogtool.cpp:583
virtual void Build(const Tool &type)
QLabel * labelResultCalculation
labelResultCalculation label with result of calculation
Definition: dialogtool.h:211
void ArrowLeftDown()
ArrowLeftDown set angle value 225 degree.
void DialogApplied()
DialogApplied emit signal dialog apply changes.
void initializeNodeAngles(QComboBox *box)
Definition: dialogtool.cpp:717
virtual void DialogApply()
DialogApply save data and emit signal DialogApplied.
QTimer * timerFormula
timerFormula timer for check formula
Definition: dialogtool.h:196
void initializeFormulaUi(T *ui)
initializeFormulaUi initialize ui object for the formula field
Definition: dialogtool.h:398
virtual bool eventFilter(QObject *object, QEvent *event) Q_DECL_OVERRIDE
Definition: dialogtool.cpp:441
virtual void PointNameChanged()
Definition: dialogtool.h:171
virtual void EvalFormula()
EvalFormula evaluate formula.
static QString DialogWarningIcon()
Definition: dialogtool.cpp:604
virtual ~DialogTool() Q_DECL_OVERRIDE
Definition: dialogtool.cpp:163
void FillComboBoxHCrossCurvesPoint(QComboBox *box) const
Definition: dialogtool.cpp:391
void setCurrentCurveId(QComboBox *box, const quint32 &value) const
Definition: dialogtool.cpp:946
QVector< T > GetListInternals(const QListWidget *list) const
Definition: dialogtool.h:341
virtual void SetPiecesList(const QVector< quint32 > &list)
virtual void SelectedObject(bool selected, quint32 object, quint32 tool)
static void moveListRowUp(QListWidget *list)
void FillComboBoxPiecesList(QComboBox *box, const QVector< quint32 > &list)
Definition: dialogtool.cpp:224
QPointer< Visualization > vis
Definition: dialogtool.h:236
void FormulaChangedPlainText()
FormulaChangedPlainText check formula (plain text editor editor)
void FillComboBoxTypeLine(QComboBox *box, const QMap< QString, QIcon > &stylesPics) const
FillComboBoxTypeLine fill comboBox list of type lines.
Definition: dialogtool.cpp:332
DialogTool(const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
DialogTool create dialog.
Definition: dialogtool.cpp:133
T getCurrentCrossPoint(QComboBox *box) const
Definition: dialogtool.h:429
void ChangeColor(QWidget *widget, const QColor &color)
void DeployFormula(QPlainTextEdit *formula, QPushButton *buttonGrowLength, int formulaBaseHeight)
Definition: dialogtool.cpp:992
quint32 GetToolId() const
quint32 getCurrentObjectId(QComboBox *box) const
getCurrentPointId return current point id stored in combobox
Definition: dialogtool.cpp:959
bool IsSplinePath(const QSharedPointer< VGObject > &obj) const
Definition: dialogtool.cpp:731
The VAbstractTool abstract class for all tools.
Definition: vabstracttool.h:80
The VContainer class container of all variables.
Definition: vcontainer.h:141
The VMainGraphicsScene class main scene.
#define SCASSERT(cond)
Definition: def.h:317
SceneObject
Definition: def.h:103
Tool
Definition: def.h:161
FillComboBox
Definition: dialogtool.h:101
#define NULL_ID
Definition: ifcdef.h:76
QString name
Definition: dialogtool.h:89
QString icon
Definition: dialogtool.h:88
#define qApp
Definition: vapplication.h:67
GOType
Definition: vgeometrydef.h:56