Seamly2D
Code documentation
UnionDialog Class Reference

The UnionDialog class dialog for Union Tool. More...

#include <union_dialog.h>

Inheritance diagram for UnionDialog:
Collaboration diagram for UnionDialog:

Public Slots

virtual void ChosenObject (quint32 id, const SceneObject &type) Q_DECL_OVERRIDE
 ChoosedObject gets id and type of selected object. Save correct data and ignore wrong. More...
 
- Public Slots inherited from DialogTool
virtual void ChosenObject (quint32 id, const SceneObject &type)
 ChosenObject gets id and type of selected object. Save right data and ignore wrong. More...
 
virtual void SelectedObject (bool selected, quint32 object, quint32 tool)
 
void NamePointChanged ()
 NamePointChanged check name of point. More...
 
virtual void DialogAccepted ()
 DialogAccepted save data and emit signal about closed dialog. More...
 
virtual void DialogApply ()
 DialogApply save data and emit signal DialogApplied. More...
 
virtual void DialogRejected ()
 DialogRejected emit signal dialog rejected. More...
 
void FormulaChanged ()
 formula check formula More...
 
void FormulaChangedPlainText ()
 FormulaChangedPlainText check formula (plain text editor editor) More...
 
void ArrowUp ()
 ArrowUp set angle value 90 degree. More...
 
void ArrowDown ()
 ArrowDown set angle value 270 degree. More...
 
void ArrowLeft ()
 ArrowLeft set angle value 180 degree. More...
 
void ArrowRight ()
 ArrowRight set angle value 0 degree. More...
 
void ArrowLeftUp ()
 ArrowLeftUp set angle value 135 degree. More...
 
void ArrowLeftDown ()
 ArrowLeftDown set angle value 225 degree. More...
 
void ArrowRightUp ()
 ArrowRightUp set angle value 45 degree. More...
 
void ArrowRightDown ()
 ArrowRightDown set angle value 315 degree. More...
 
virtual void EvalFormula ()
 EvalFormula evaluate formula. More...
 
virtual void PointNameChanged ()
 

Public Member Functions

 UnionDialog (const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
 UnionDialog create dialog. More...
 
virtual ~UnionDialog () Q_DECL_OVERRIDE
 
quint32 getPiece1Id () const
 getPiece1Id return id first piece More...
 
quint32 getPiece2Id () const
 getPiece2Id return id second piece More...
 
int getPiece1Index () const
 getPiece1Index return index edge first piece More...
 
int getPiece2Index () const
 getPiece2Index return index edge second piece More...
 
bool retainPieces () const
 
- Public Member Functions inherited from DialogTool
 DialogTool (const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
 DialogTool create dialog. More...
 
virtual ~DialogTool () Q_DECL_OVERRIDE
 
VAbstractToolGetAssociatedTool ()
 
void SetAssociatedTool (VAbstractTool *tool)
 
virtual void ShowDialog (bool click)
 
virtual void Build (const Tool &type)
 
virtual void SetPiecesList (const QVector< quint32 > &list)
 
quint32 GetToolId () const
 
void SetToolId (const quint32 &value)
 
QString getPointName () const
 

Private Member Functions

bool CheckObject (const quint32 &id, const quint32 &pieceId) const
 CheckObject check if piece contains this id. More...
 
bool checkPiece (const quint32 &pieceId) const
 
void chosenPiece (const quint32 &id, const SceneObject &type, quint32 &pieceId, int &index)
 chosenPiece help save information about piece and points on piece More...
 

Private Attributes

Ui::UnionDialog * ui
 
int piece1_Index
 ui keeps information about user interface More...
 
int piece2_Index
 piece1_Index index edge first piece More...
 
quint32 d1
 piece2_Index index edge second piece More...
 
quint32 d2
 d1 id first piece More...
 
qint32 numberD
 d2 id second piece More...
 
qint32 numberP
 numberD number of piece, what we already have More...
 
quint32 p1
 numberP number of points, what we already have More...
 
quint32 p2
 p1 id first point of piece More...
 
QSound * m_beep
 p2 id second point of piece More...
 

Additional Inherited Members

- Signals inherited from DialogTool
void DialogClosed (int result)
 DialogClosed signal dialog closed. More...
 
void DialogApplied ()
 DialogApplied emit signal dialog apply changes. More...
 
void ToolTip (const QString &toolTip)
 ToolTip emit tooltipe for tool. More...
 
- Static Public Member Functions inherited from DialogTool
static void moveListRowTop (QListWidget *list)
 
static void moveListRowUp (QListWidget *list)
 
static void moveListRowDown (QListWidget *list)
 
static void moveListRowBottom (QListWidget *list)
 
- Protected Member Functions inherited from DialogTool
virtual void keyPressEvent (QKeyEvent *event) Q_DECL_OVERRIDE
 
virtual void closeEvent (QCloseEvent *event) Q_DECL_OVERRIDE
 closeEvent handle when dialog cloded More...
 
virtual void showEvent (QShowEvent *event) Q_DECL_OVERRIDE
 showEvent handle when window show More...
 
void FillComboBoxPiecesList (QComboBox *box, const QVector< quint32 > &list)
 
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. More...
 
void FillComboBoxArcs (QComboBox *box, FillComboBox rule=FillComboBox::Whole, const quint32 &ch1=NULL_ID, const quint32 &ch2=NULL_ID) const
 
void FillComboBoxSplines (QComboBox *box) const
 
void FillComboBoxSplinesPath (QComboBox *box) const
 
void FillComboBoxCurves (QComboBox *box) const
 
void FillComboBoxTypeLine (QComboBox *box, const QMap< QString, QIcon > &stylesPics) const
 FillComboBoxTypeLine fill comboBox list of type lines. More...
 
void FillComboBoxLineColors (QComboBox *box) const
 
void FillComboBoxCrossCirclesPoints (QComboBox *box) const
 
void FillComboBoxVCrossCurvesPoint (QComboBox *box) const
 
void FillComboBoxHCrossCurvesPoint (QComboBox *box) const
 
virtual void CheckState ()
 CheckState enable, when all is correct, or disable, when something wrong, button ok. More...
 
QString GetComboBoxCurrentData (const QComboBox *box, const QString &def) const
 
void ChangeCurrentData (QComboBox *box, const QVariant &value) const
 ChangeCurrentData select item in combobox by id. More...
 
void ValFormulaChanged (bool &flag, QLineEdit *edit, QTimer *timer, const QString &postfix=QString())
 ValFormulaChanged handle change formula. More...
 
void ValFormulaChanged (bool &flag, QPlainTextEdit *edit, QTimer *timer, const QString &postfix=QString())
 
qreal Eval (const QString &text, bool &flag, QLabel *label, const QString &postfix, bool checkZero=true, bool checkLessThanZero=false)
 Eval evaluate formula and show result. More...
 
qreal normalize (const qreal value, const qreal start, const qreal end)
 
void setCurrentPointId (QComboBox *box, const quint32 &value, FillComboBox rule=FillComboBox::NoChildren, const quint32 &ch1=NULL_ID, const quint32 &ch2=NULL_ID) const
 
void setCurrentSplineId (QComboBox *box, const quint32 &value) const
 setCurrentSplineId set current spline id in combobox More...
 
void setCurrentArcId (QComboBox *box, const quint32 &value, FillComboBox rule=FillComboBox::NoChildren, const quint32 &ch1=NULL_ID, const quint32 &ch2=NULL_ID) const
 setCurrentArcId More...
 
void setCurrentSplinePathId (QComboBox *box, const quint32 &value) const
 setCurrentSplinePathId set current splinePath id in combobox More...
 
void setCurrentCurveId (QComboBox *box, const quint32 &value) const
 
quint32 getCurrentObjectId (QComboBox *box) const
 getCurrentPointId return current point id stored in combobox More...
 
template<typename T >
getCurrentCrossPoint (QComboBox *box) const
 
bool SetObject (const quint32 &id, QComboBox *box, const QString &toolTip)
 
void DeployFormula (QPlainTextEdit *formula, QPushButton *buttonGrowLength, int formulaBaseHeight)
 
template<typename T >
void initializeOkCancelApply (T *ui)
 initializeOkCancelApply initialize OK / Cancel and Apply buttons More...
 
template<typename T >
void initializeOkCancel (T *ui)
 initializeOkCancel initialize OK and Cancel buttons More...
 
template<typename T >
void initializeFormulaUi (T *ui)
 initializeFormulaUi initialize ui object for the formula field More...
 
template<typename T >
void AddVisualization ()
 
template<typename T >
QVector< T > GetListInternals (const QListWidget *list) const
 
void ChangeColor (QWidget *widget, const QColor &color)
 
virtual void ShowVisualization ()
 
virtual void SaveData ()
 SaveData Put dialog data in local variables. More...
 
void MoveCursorToEnd (QPlainTextEdit *plainTextEdit) const
 
virtual bool eventFilter (QObject *object, QEvent *event) Q_DECL_OVERRIDE
 
quint32 DNumber (const QString &baseName) const
 
NodeInfo getNodeInfo (const VPieceNode &node, bool showNotch=false) const
 
void newNodeItem (QListWidget *listWidget, const VPieceNode &node, bool nodeExcluded=true, bool isDuplicate=false)
 
void initializeNodeAngles (QComboBox *box)
 
- Static Protected Member Functions inherited from DialogTool
static int FindNotExcludedNodeDown (QListWidget *listWidget, int candidate)
 
static int FindNotExcludedNodeUp (QListWidget *listWidget, int candidate)
 
static bool isFirstPointSameAsLast (QListWidget *listWidget)
 
static bool doublePointsExist (QListWidget *listWidget)
 
static bool isEachPointNameUnique (QListWidget *listWidget)
 
static QString DialogWarningIcon ()
 
static QFont NodeFont (bool nodeExcluded)
 
- Protected Attributes inherited from DialogTool
const VContainerdata
 data container with data More...
 
bool isInitialized
 isInitialized true if window is initialized More...
 
bool flagName
 flagName true if name is correct More...
 
bool flagFormula
 flagFormula true if formula correct More...
 
bool flagError
 flagError use this flag if for you do not enought More...
 
QTimer * timerFormula
 timerFormula timer for check formula More...
 
QPushButton * ok_Button
 ok_Button button ok More...
 
QPushButton * apply_Button
 apply_Button button apply More...
 
QDoubleSpinBox * spinBoxAngle
 spinBoxAngle spinbox for angle More...
 
QPlainTextEdit * plainTextEditFormula
 plainTextEditFormula formula More...
 
QLabel * labelResultCalculation
 labelResultCalculation label with result of calculation More...
 
QLabel * labelEditNamePoint
 labelEditNamePoint label used when need show wrong name of point More...
 
QLabel * labelEditFormula
 labelEditFormula label used when need show wrong formula More...
 
const QColor okColor
 
const QColor errorColor
 
VAbstractToolassociatedTool
 associatedTool vdrawtool associated with opened dialog. More...
 
quint32 toolId
 
bool prepare
 prepare show if we prepare. Show dialog after finish working with visual part of tool More...
 
QString pointName
 pointName name of point More...
 
qint32 number
 number number of handled objects More...
 
QPointer< Visualizationvis
 

Detailed Description

The UnionDialog class dialog for Union Tool.

Definition at line 74 of file union_dialog.h.

Constructor & Destructor Documentation

◆ UnionDialog()

UnionDialog::UnionDialog ( const VContainer data,
const quint32 &  toolId,
QWidget *  parent = nullptr 
)

UnionDialog create dialog.

Parameters
datacontainer with data
parentparent widget

Definition at line 71 of file union_dialog.cpp.

References DialogTool::initializeOkCancel(), and ui.

◆ ~UnionDialog()

UnionDialog::~UnionDialog ( )
virtual

Definition at line 89 of file union_dialog.cpp.

References ui.

Member Function Documentation

◆ CheckObject()

bool UnionDialog::CheckObject ( const quint32 &  id,
const quint32 &  pieceId 
) const
private

CheckObject check if piece contains this id.

Parameters
idid of item
pieceIdpiece id
Returns
true if contain

Definition at line 125 of file union_dialog.cpp.

References VPiecePath::Contains(), DialogTool::data, VPiece::GetPath(), VContainer::GetPiece(), and NULL_ID.

Referenced by chosenPiece().

◆ checkPiece()

bool UnionDialog::checkPiece ( const quint32 &  pieceId) const
private

◆ ChosenObject

void UnionDialog::ChosenObject ( quint32  id,
const SceneObject type 
)
virtualslot

ChoosedObject gets id and type of selected object. Save correct data and ignore wrong.

Parameters
idid of point or piece
typetype of object

Definition at line 106 of file union_dialog.cpp.

References chosenPiece(), d1, d2, numberD, piece1_Index, and piece2_Index.

◆ chosenPiece()

void UnionDialog::chosenPiece ( const quint32 &  id,
const SceneObject type,
quint32 &  pieceId,
int &  index 
)
private

chosenPiece help save information about piece and points on piece

Parameters
idid selected object
typetype selected object
pieceIdid of piece
indexindex of edge

Definition at line 166 of file union_dialog.cpp.

References CheckObject(), checkPiece(), DialogTool::data, VPiecePath::Edge(), VPiece::GetPath(), VContainer::GetPiece(), m_beep, NULL_ID, numberD, numberP, VPiecePath::OnEdge(), p1, p2, Piece, Point, and DialogTool::ToolTip().

Referenced by ChosenObject().

◆ getPiece1Id()

quint32 UnionDialog::getPiece1Id ( ) const
inline

getPiece1Id return id first piece

Returns
id

Definition at line 119 of file union_dialog.h.

References d1.

◆ getPiece1Index()

int UnionDialog::getPiece1Index ( ) const
inline

getPiece1Index return index edge first piece

Returns
index

Definition at line 139 of file union_dialog.h.

References piece1_Index.

◆ getPiece2Id()

quint32 UnionDialog::getPiece2Id ( ) const
inline

getPiece2Id return id second piece

Returns
id

Definition at line 129 of file union_dialog.h.

References d2.

◆ getPiece2Index()

int UnionDialog::getPiece2Index ( ) const
inline

getPiece2Index return index edge second piece

Returns
index

Definition at line 149 of file union_dialog.h.

References piece2_Index.

◆ retainPieces()

bool UnionDialog::retainPieces ( ) const

Definition at line 95 of file union_dialog.cpp.

References ui.

Member Data Documentation

◆ d1

quint32 UnionDialog::d1
private

piece2_Index index edge second piece

Definition at line 99 of file union_dialog.h.

Referenced by ChosenObject(), and getPiece1Id().

◆ d2

quint32 UnionDialog::d2
private

d1 id first piece

Definition at line 100 of file union_dialog.h.

Referenced by ChosenObject(), and getPiece2Id().

◆ m_beep

QSound* UnionDialog::m_beep
private

p2 id second point of piece

Definition at line 105 of file union_dialog.h.

Referenced by chosenPiece().

◆ numberD

qint32 UnionDialog::numberD
private

d2 id second piece

Definition at line 101 of file union_dialog.h.

Referenced by ChosenObject(), and chosenPiece().

◆ numberP

qint32 UnionDialog::numberP
private

numberD number of piece, what we already have

Definition at line 102 of file union_dialog.h.

Referenced by chosenPiece().

◆ p1

quint32 UnionDialog::p1
private

numberP number of points, what we already have

Definition at line 103 of file union_dialog.h.

Referenced by chosenPiece().

◆ p2

quint32 UnionDialog::p2
private

p1 id first point of piece

Definition at line 104 of file union_dialog.h.

Referenced by chosenPiece().

◆ piece1_Index

int UnionDialog::piece1_Index
private

ui keeps information about user interface

Definition at line 97 of file union_dialog.h.

Referenced by ChosenObject(), and getPiece1Index().

◆ piece2_Index

int UnionDialog::piece2_Index
private

piece1_Index index edge first piece

Definition at line 98 of file union_dialog.h.

Referenced by ChosenObject(), and getPiece2Index().

◆ ui

Ui::UnionDialog* UnionDialog::ui
private

Definition at line 96 of file union_dialog.h.

Referenced by checkPiece(), retainPieces(), UnionDialog(), and ~UnionDialog().


The documentation for this class was generated from the following files: