Seamly2D
Code documentation
DialogSpline Class Reference

The DialogSpline class dialog for ToolSpline. Help create spline and edit option. More...

#include <dialogspline.h>

Inheritance diagram for DialogSpline:
Collaboration diagram for DialogSpline:

Public Slots

virtual void ChosenObject (quint32 id, const SceneObject &type) Q_DECL_OVERRIDE
 ChoosedObject gets id and type of selected object. Save right data and ignore wrong. More...
 
virtual void PointNameChanged () Q_DECL_OVERRIDE
 
virtual void ShowDialog (bool click) Q_DECL_OVERRIDE
 
- 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

 DialogSpline (const VContainer *data, const quint32 &toolId, QWidget *parent=nullptr)
 DialogSpline create dialog. More...
 
virtual ~DialogSpline () Q_DECL_OVERRIDE
 
VSpline GetSpline () const
 
void SetSpline (const VSpline &spline)
 
QString getPenStyle () const
 
void setPenStyle (const QString &value)
 
QString getLineWeight () const
 getLineWeight return weight of the lines More...
 
void setLineWeight (const QString &value)
 setLineWeight set weight of the lines More...
 
QString getLineColor () const
 
void setLineColor (const QString &value)
 
- 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
 

Protected Member Functions

virtual void CheckState () Q_DECL_FINAL
 CheckState enable, when all is correct, or disable, when something wrong, button ok. More...
 
virtual void ShowVisualization () Q_DECL_OVERRIDE
 
virtual void SaveData () Q_DECL_OVERRIDE
 SaveData Put dialog data in local variables. More...
 
virtual void closeEvent (QCloseEvent *event) Q_DECL_OVERRIDE
 closeEvent handle when dialog cloded More...
 
- Protected Member Functions inherited from DialogTool
virtual void keyPressEvent (QKeyEvent *event) Q_DECL_OVERRIDE
 
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
 
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)
 
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)
 

Private Slots

void DeployAngle1TextEdit ()
 
void DeployAngle2TextEdit ()
 
void DeployLength1TextEdit ()
 
void DeployLength2TextEdit ()
 
void Angle1Changed ()
 
void Angle2Changed ()
 
void Length1Changed ()
 
void Length2Changed ()
 
void FXAngle1 ()
 
void FXAngle2 ()
 
void FXLength1 ()
 
void FXLength2 ()
 

Private Member Functions

const QSharedPointer< VPointFGetP1 () const
 
const QSharedPointer< VPointFGetP4 () const
 
void EvalAngle1 ()
 
void EvalAngle2 ()
 
void EvalLength1 ()
 
void EvalLength2 ()
 
VSpline CurrentSpline () const
 

Private Attributes

Ui::DialogSpline * ui
 
VSpline spl
 ui keeps information about user interface More...
 
qint32 newDuplicate
 spl spline More...
 
int formulaBaseHeightAngle1
 formulaBaseHeight base height defined by dialogui More...
 
int formulaBaseHeightAngle2
 
int formulaBaseHeightLength1
 
int formulaBaseHeightLength2
 
QTimer * timerAngle1
 timerAngle1 timer of check first angle formula More...
 
QTimer * timerAngle2
 
QTimer * timerLength1
 
QTimer * timerLength2
 
bool flagAngle1
 flagAngle1 true if value of first angle is correct More...
 
bool flagAngle2
 
bool flagLength1
 
bool flagLength2
 

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)
 
- 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 DialogSpline class dialog for ToolSpline. Help create spline and edit option.

Definition at line 76 of file dialogspline.h.

Constructor & Destructor Documentation

◆ DialogSpline()

◆ ~DialogSpline()

DialogSpline::~DialogSpline ( )
virtual

Definition at line 188 of file dialogspline.cpp.

References ui.

Member Function Documentation

◆ Angle1Changed

void DialogSpline::Angle1Changed ( )
privateslot

◆ Angle2Changed

void DialogSpline::Angle2Changed ( )
privateslot

◆ CheckState()

void DialogSpline::CheckState ( )
protectedvirtual

CheckState enable, when all is correct, or disable, when something wrong, button ok.

Reimplemented from DialogTool.

Definition at line 598 of file dialogspline.cpp.

References DialogTool::apply_Button, flagAngle1, flagAngle2, DialogTool::flagError, flagLength1, flagLength2, DialogTool::ok_Button, and SCASSERT.

Referenced by DialogSpline(), EvalLength1(), EvalLength2(), and PointNameChanged().

◆ ChosenObject

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

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

Parameters
idid of point or detail
typetype of object

Definition at line 199 of file dialogspline.cpp.

References DialogTool::getCurrentObjectId(), DialogTool::number, Point, DialogTool::prepare, SCASSERT, DialogTool::SetObject(), ui, and DialogTool::vis.

◆ closeEvent()

void DialogSpline::closeEvent ( QCloseEvent *  event)
protectedvirtual

closeEvent handle when dialog cloded

Parameters
eventevent

Reimplemented from DialogTool.

Definition at line 262 of file dialogspline.cpp.

References DialogTool::closeEvent(), and ui.

◆ CurrentSpline()

VSpline DialogSpline::CurrentSpline ( ) const
private

◆ DeployAngle1TextEdit

void DialogSpline::DeployAngle1TextEdit ( )
privateslot

Definition at line 272 of file dialogspline.cpp.

References DialogTool::DeployFormula(), formulaBaseHeightAngle1, and ui.

Referenced by DialogSpline(), FXAngle1(), and FXAngle2().

◆ DeployAngle2TextEdit

void DialogSpline::DeployAngle2TextEdit ( )
privateslot

Definition at line 278 of file dialogspline.cpp.

References DialogTool::DeployFormula(), formulaBaseHeightAngle2, and ui.

Referenced by DialogSpline().

◆ DeployLength1TextEdit

void DialogSpline::DeployLength1TextEdit ( )
privateslot

Definition at line 284 of file dialogspline.cpp.

References DialogTool::DeployFormula(), formulaBaseHeightLength1, and ui.

Referenced by DialogSpline(), and FXLength1().

◆ DeployLength2TextEdit

void DialogSpline::DeployLength2TextEdit ( )
privateslot

Definition at line 290 of file dialogspline.cpp.

References DialogTool::DeployFormula(), formulaBaseHeightLength2, and ui.

Referenced by DialogSpline(), and FXLength2().

◆ EvalAngle1()

void DialogSpline::EvalAngle1 ( )
private

Definition at line 434 of file dialogspline.cpp.

References degreeSymbol, DialogTool::Eval(), flagAngle1, DialogTool::labelEditFormula, and ui.

Referenced by DialogSpline().

◆ EvalAngle2()

void DialogSpline::EvalAngle2 ( )
private

Definition at line 441 of file dialogspline.cpp.

References degreeSymbol, DialogTool::Eval(), flagAngle2, DialogTool::labelEditFormula, and ui.

Referenced by DialogSpline().

◆ EvalLength1()

void DialogSpline::EvalLength1 ( )
private

◆ EvalLength2()

void DialogSpline::EvalLength2 ( )
private

◆ FXAngle1

void DialogSpline::FXAngle1 ( )
privateslot

◆ FXAngle2

void DialogSpline::FXAngle2 ( )
privateslot

◆ FXLength1

void DialogSpline::FXLength1 ( )
privateslot

◆ FXLength2

void DialogSpline::FXLength2 ( )
privateslot

◆ getLineColor()

QString DialogSpline::getLineColor ( ) const

Definition at line 671 of file dialogspline.cpp.

References ColorBlack, DialogTool::GetComboBoxCurrentData(), and ui.

Referenced by VToolSpline::setDialog().

◆ getLineWeight()

QString DialogSpline::getLineWeight ( ) const

getLineWeight return weight of the lines

Returns
type

Definition at line 687 of file dialogspline.cpp.

References DialogTool::GetComboBoxCurrentData(), and ui.

Referenced by VToolSpline::setDialog().

◆ GetP1()

const QSharedPointer< VPointF > DialogSpline::GetP1 ( ) const
private

◆ GetP4()

const QSharedPointer< VPointF > DialogSpline::GetP4 ( ) const
private

◆ getPenStyle()

QString DialogSpline::getPenStyle ( ) const

Definition at line 659 of file dialogspline.cpp.

References DialogTool::GetComboBoxCurrentData(), LineTypeSolidLine, and ui.

◆ GetSpline()

VSpline DialogSpline::GetSpline ( ) const

Definition at line 616 of file dialogspline.cpp.

References spl.

◆ Length1Changed

void DialogSpline::Length1Changed ( )
privateslot

◆ Length2Changed

void DialogSpline::Length2Changed ( )
privateslot

◆ PointNameChanged

◆ SaveData()

void DialogSpline::SaveData ( )
protectedvirtual

◆ setLineColor()

void DialogSpline::setLineColor ( const QString &  value)

Definition at line 677 of file dialogspline.cpp.

References DialogTool::ChangeCurrentData(), and ui.

◆ setLineWeight()

void DialogSpline::setLineWeight ( const QString &  value)

setLineWeight set weight of the lines

Parameters
valuetype

Definition at line 697 of file dialogspline.cpp.

References DialogTool::ChangeCurrentData(), ui, and DialogTool::vis.

◆ setPenStyle()

void DialogSpline::setPenStyle ( const QString &  value)

Definition at line 665 of file dialogspline.cpp.

References DialogTool::ChangeCurrentData(), and ui.

◆ SetSpline()

◆ ShowDialog

◆ ShowVisualization()

void DialogSpline::ShowVisualization ( )
protectedvirtual

Reimplemented from DialogTool.

Definition at line 610 of file dialogspline.cpp.

Member Data Documentation

◆ flagAngle1

bool DialogSpline::flagAngle1
private

flagAngle1 true if value of first angle is correct

Definition at line 145 of file dialogspline.h.

Referenced by Angle1Changed(), CheckState(), and EvalAngle1().

◆ flagAngle2

bool DialogSpline::flagAngle2
private

Definition at line 146 of file dialogspline.h.

Referenced by Angle2Changed(), CheckState(), and EvalAngle2().

◆ flagLength1

bool DialogSpline::flagLength1
private

Definition at line 147 of file dialogspline.h.

Referenced by CheckState(), EvalLength1(), and Length1Changed().

◆ flagLength2

bool DialogSpline::flagLength2
private

Definition at line 148 of file dialogspline.h.

Referenced by CheckState(), EvalLength2(), and Length2Changed().

◆ formulaBaseHeightAngle1

int DialogSpline::formulaBaseHeightAngle1
private

formulaBaseHeight base height defined by dialogui

Definition at line 133 of file dialogspline.h.

Referenced by DeployAngle1TextEdit(), and DialogSpline().

◆ formulaBaseHeightAngle2

int DialogSpline::formulaBaseHeightAngle2
private

Definition at line 134 of file dialogspline.h.

Referenced by DeployAngle2TextEdit(), and DialogSpline().

◆ formulaBaseHeightLength1

int DialogSpline::formulaBaseHeightLength1
private

Definition at line 135 of file dialogspline.h.

Referenced by DeployLength1TextEdit(), and DialogSpline().

◆ formulaBaseHeightLength2

int DialogSpline::formulaBaseHeightLength2
private

Definition at line 136 of file dialogspline.h.

Referenced by DeployLength2TextEdit(), and DialogSpline().

◆ newDuplicate

qint32 DialogSpline::newDuplicate
private

spl spline

Definition at line 130 of file dialogspline.h.

Referenced by PointNameChanged(), and SaveData().

◆ spl

VSpline DialogSpline::spl
private

ui keeps information about user interface

Definition at line 129 of file dialogspline.h.

Referenced by GetSpline(), PointNameChanged(), SaveData(), SetSpline(), and ShowDialog().

◆ timerAngle1

QTimer* DialogSpline::timerAngle1
private

timerAngle1 timer of check first angle formula

Definition at line 139 of file dialogspline.h.

Referenced by Angle1Changed(), and DialogSpline().

◆ timerAngle2

QTimer* DialogSpline::timerAngle2
private

Definition at line 140 of file dialogspline.h.

Referenced by Angle2Changed(), and DialogSpline().

◆ timerLength1

QTimer* DialogSpline::timerLength1
private

Definition at line 141 of file dialogspline.h.

Referenced by DialogSpline(), and Length1Changed().

◆ timerLength2

QTimer* DialogSpline::timerLength2
private

Definition at line 142 of file dialogspline.h.

Referenced by DialogSpline(), and Length2Changed().

◆ ui


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