Documentation for MainWindow class.

--HG--
branch : develop
This commit is contained in:
dismine 2014-01-23 12:11:42 +02:00
parent 52aa68d31b
commit 24fc6e474c

View File

@ -45,325 +45,340 @@ namespace Ui
} }
/** /**
* @brief The MainWindow class * @brief The MainWindow class main windows.
*/ */
class MainWindow : public QMainWindow class MainWindow : public QMainWindow
{ {
Q_OBJECT Q_OBJECT
public: public:
/** /**
* @brief MainWindow * @brief MainWindow constructor.
* @param parent * @param parent parent widget.
*/ */
explicit MainWindow(QWidget *parent = 0); explicit MainWindow(QWidget *parent = 0);
~MainWindow(); ~MainWindow();
/** /**
* @brief OpenPattern * @brief OpenPattern open pattern file.
* @param fileName * @param fileName name of file.
*/ */
void OpenPattern(const QString &fileName); void OpenPattern(const QString &fileName);
public slots: public slots:
/** /**
* @brief mouseMove * @brief mouseMove save mouse position and show user.
* @param scenePos * @param scenePos position mouse.
*/ */
void mouseMove(const QPointF &scenePos); void mouseMove(const QPointF &scenePos);
/** /**
* @brief ActionAroowTool * @brief ActionAroowTool set arrow tool. Cansel tool what was before.
*/ */
void ActionAroowTool(); void ActionAroowTool();
/** /**
* @brief ActionDraw * @brief ActionDraw show draw scene.
* @param checked * @param checked true - button checked.
*/ */
void ActionDraw(bool checked); void ActionDraw(bool checked);
/** /**
* @brief ActionDetails * @brief ActionDetails show details scene.
* @param checked * @param checked true - button checked.
*/ */
void ActionDetails(bool checked); void ActionDetails(bool checked);
/** /**
* @brief ActionNewDraw * @brief ActionNewDraw add to scene new pattern peace.
*/ */
void ActionNewDraw(); void ActionNewDraw();
/** /**
* @brief ActionSaveAs * @brief ActionSaveAs save as pattern file.
*/ */
void ActionSaveAs(); void ActionSaveAs();
/** /**
* @brief ActionSave * @brief ActionSave save pattern file.
*/ */
void ActionSave(); void ActionSave();
/** /**
* @brief ActionOpen * @brief ActionOpen ask user select pattern file.
*/ */
void ActionOpen(); void ActionOpen();
/** /**
* @brief ActionNew * @brief ActionNew create new empty pattern.
*/ */
void ActionNew(); void ActionNew();
/** /**
* @brief ActionTable * @brief ActionTable show table with variables.
* @param checked * @param checked true - button checked.
*/ */
void ActionTable(bool checked); void ActionTable(bool checked);
/** /**
* @brief ActionHistory * @brief ActionHistory show tool history.
* @param checked * @param checked true - button checked.
*/ */
void ActionHistory(bool checked); void ActionHistory(bool checked);
/** /**
* @brief ActionLayout * @brief ActionLayout begin creation layout.
* @param checked * @param checked true - button checked.
*/ */
void ActionLayout(bool checked); void ActionLayout(bool checked);
/** /**
* @brief currentDrawChanged * @brief currentDrawChanged change active pattern peace.
* @param index * @param index index in combobox.
*/ */
void currentDrawChanged( int index ); void currentDrawChanged( int index );
/** /**
* @brief OptionDraw * @brief OptionDraw help change name of pattern peace.
*/ */
void OptionDraw(); void OptionDraw();
/** /**
* @brief haveChange * @brief haveChange enable action save if we have unsaved change.
*/ */
void haveChange(); void haveChange();
/** /**
* @brief ChangedSize * @brief ChangedSize change new size value.
* @param text * @param text value size.
*/ */
void ChangedSize(const QString &text); void ChangedSize(const QString &text);
/** /**
* @brief ChangedGrowth * @brief ChangedGrowth change new height value.
* @param text * @param text value height.
*/ */
void ChangedGrowth(const QString & text); void ChangedGrowth(const QString & text);
/** /**
* @brief ClosedActionTable * @brief ClosedActionTable actions after closing table with variables.
*/ */
void ClosedActionTable(); void ClosedActionTable();
/** /**
* @brief ClosedActionHistory * @brief ClosedActionHistory actions after closing history window with variables.
*/ */
void ClosedActionHistory(); void ClosedActionHistory();
/** /**
* @brief ToolEndLine * @brief ToolEndLine handler tool endLine.
* @param checked * @param checked true - button checked.
*/ */
void ToolEndLine(bool checked); void ToolEndLine(bool checked);
/** /**
* @brief ToolLine * @brief ToolLine handler tool line.
* @param checked * @param checked true - button checked.
*/ */
void ToolLine(bool checked); void ToolLine(bool checked);
/** /**
* @brief ToolAlongLine * @brief ToolAlongLine handler tool alongLine.
* @param checked * @param checked true - button checked.
*/ */
void ToolAlongLine(bool checked); void ToolAlongLine(bool checked);
/** /**
* @brief ToolShoulderPoint * @brief ToolShoulderPoint handler tool shoulderPoint.
* @param checked * @param checked true - button checked.
*/ */
void ToolShoulderPoint(bool checked); void ToolShoulderPoint(bool checked);
/** /**
* @brief ToolNormal * @brief ToolNormal handler tool normal.
* @param checked * @param checked true - button checked.
*/ */
void ToolNormal(bool checked); void ToolNormal(bool checked);
/** /**
* @brief ToolBisector * @brief ToolBisector handler tool bisector.
* @param checked * @param checked true - button checked.
*/ */
void ToolBisector(bool checked); void ToolBisector(bool checked);
/** /**
* @brief ToolLineIntersect * @brief ToolLineIntersect handler tool lineIntersect.
* @param checked * @param checked true - button checked.
*/ */
void ToolLineIntersect(bool checked); void ToolLineIntersect(bool checked);
/** /**
* @brief ToolSpline * @brief ToolSpline handler tool spline.
* @param checked * @param checked true - button checked.
*/ */
void ToolSpline(bool checked); void ToolSpline(bool checked);
/** /**
* @brief ToolCutSpline handler tool CutSpline * @brief ToolCutSpline handler tool CutSpline.
* @param checked true - button is checked * @param checked true - button is checked
*/ */
void ToolCutSpline(bool checked); void ToolCutSpline(bool checked);
/** /**
* @brief ToolArc * @brief ToolArc handler tool arc.
* @param checked * @param checked true - button checked.
*/ */
void ToolArc(bool checked); void ToolArc(bool checked);
/** /**
* @brief ToolSplinePath * @brief ToolSplinePath handler tool splinePath.
* @param checked * @param checked true - button checked.
*/ */
void ToolSplinePath(bool checked); void ToolSplinePath(bool checked);
/** /**
* @brief ToolCutSplinePath handler tool CutSplinePath * @brief ToolCutSplinePath handler tool CutSplinePath.
* @param checked true - button is checked * @param checked true - button is checked
*/ */
void ToolCutSplinePath(bool checked); void ToolCutSplinePath(bool checked);
/** /**
* @brief ToolPointOfContact * @brief ToolPointOfContact handler tool pointOfContact.
* @param checked * @param checked true - button checked.
*/ */
void ToolPointOfContact(bool checked); void ToolPointOfContact(bool checked);
/** /**
* @brief ToolDetail * @brief ToolDetail handler tool detail.
* @param checked * @param checked true - button checked.
*/ */
void ToolDetail(bool checked); void ToolDetail(bool checked);
/** /**
* @brief ToolHeight * @brief ToolHeight handler tool height.
* @param checked * @param checked true - button checked.
*/ */
void ToolHeight(bool checked); void ToolHeight(bool checked);
/** /**
* @brief ToolTriangle * @brief ToolTriangle handler tool triangle.
* @param checked * @param checked true - button checked.
*/ */
void ToolTriangle(bool checked); void ToolTriangle(bool checked);
/** /**
* @brief ToolPointOfIntersection * @brief ToolPointOfIntersection handler tool pointOfIntersection.
* @param checked * @param checked true - button checked.
*/ */
void ToolPointOfIntersection(bool checked); void ToolPointOfIntersection(bool checked);
/**
* @brief ToolUnionDetails handler tool unionDetails.
* @param checked true - button checked.
*/
void ToolUnionDetails(bool checked); void ToolUnionDetails(bool checked);
/**
* @brief ToolCutArc handler tool cutArc.
* @param checked true - button checked.
*/
void ToolCutArc(bool checked); void ToolCutArc(bool checked);
/** /**
* @brief ClosedDialogEndLine * @brief ClosedDialogEndLine actions after closing DialogEndLine.
* @param result * @param result result of dialog working.
*/ */
void ClosedDialogEndLine(int result); void ClosedDialogEndLine(int result);
/** /**
* @brief ClosedDialogLine * @brief ClosedDialogLine actions after closing DialogLine.
* @param result * @param result result of dialog working.
*/ */
void ClosedDialogLine(int result); void ClosedDialogLine(int result);
/** /**
* @brief ClosedDialogAlongLine * @brief ClosedDialogAlongLine actions after closing DialogAlongLine.
* @param result * @param result result of dialog working.
*/ */
void ClosedDialogAlongLine(int result); void ClosedDialogAlongLine(int result);
/** /**
* @brief ClosedDialogShoulderPoint * @brief ClosedDialogShoulderPoint actions after closing DialogShoulderPoint.
* @param result * @param result result of dialog working.
*/ */
void ClosedDialogShoulderPoint(int result); void ClosedDialogShoulderPoint(int result);
/** /**
* @brief ClosedDialogNormal * @brief ClosedDialogNormal actions after closing DialogNormal.
* @param result * @param result result of dialog working.
*/ */
void ClosedDialogNormal(int result); void ClosedDialogNormal(int result);
/** /**
* @brief ClosedDialogBisector * @brief ClosedDialogBisector actions after closing DialogBisector.
* @param result * @param result result of dialog working.
*/ */
void ClosedDialogBisector(int result); void ClosedDialogBisector(int result);
/** /**
* @brief ClosedDialogLineIntersect * @brief ClosedDialogLineIntersect actions after closing DialogLineIntersect.
* @param result * @param result result of dialog working.
*/ */
void ClosedDialogLineIntersect(int result); void ClosedDialogLineIntersect(int result);
/** /**
* @brief ClosedDialogSpline * @brief ClosedDialogSpline actions after closing DialogSpline.
* @param result * @param result result of dialog working.
*/ */
void ClosedDialogSpline(int result); void ClosedDialogSpline(int result);
/** /**
* @brief ClosedDialogArc * @brief ClosedDialogArc actions after closing DialogArc.
* @param result * @param result result of dialog working..
*/ */
void ClosedDialogArc(int result); void ClosedDialogArc(int result);
/** /**
* @brief ClosedDialogSplinePath * @brief ClosedDialogSplinePath actions after closing DialogSplinePath.
* @param result * @param result result of dialog working.
*/ */
void ClosedDialogSplinePath(int result); void ClosedDialogSplinePath(int result);
/** /**
* @brief ClosedDialogCutSplinePath handler close event tool CutSplinePath * @brief ClosedDialogCutSplinePath actions after closing DialogCutSplinePath.
* @param result result of working of dialog * @param result result of dialog working.
*/ */
void ClosedDialogCutSplinePath(int result); void ClosedDialogCutSplinePath(int result);
/** /**
* @brief ClosedDialogPointOfContact * @brief ClosedDialogPointOfContact actions after closing DialogPointOfContact.
* @param result * @param result result of dialog working.
*/ */
void ClosedDialogPointOfContact(int result); void ClosedDialogPointOfContact(int result);
/** /**
* @brief ClosedDialogDetail * @brief ClosedDialogDetail actions after closing DialogDetail.
* @param result * @param result result of dialog working.
*/ */
void ClosedDialogDetail(int result); void ClosedDialogDetail(int result);
/** /**
* @brief ClosedDialogHeight * @brief ClosedDialogHeight actions after closing DialogHeight.
* @param result * @param result result of dialog working.
*/ */
void ClosedDialogHeight(int result); void ClosedDialogHeight(int result);
/** /**
* @brief ClosedDialogTriangle * @brief ClosedDialogTriangle actions after closing DialogTriangle.
* @param result * @param result result of dialog working.
*/ */
void ClosedDialogTriangle(int result); void ClosedDialogTriangle(int result);
/** /**
* @brief ClosedDialogPointOfIntersection * @brief ClosedDialogPointOfIntersection actions after closing DialogPointOfIntersection.
* @param result * @param result result of dialog working.
*/ */
void ClosedDialogPointOfIntersection(int result); void ClosedDialogPointOfIntersection(int result);
/**
* @brief ClosedDialogUnionDetails actions after closing DialogUnionDetails.
* @param result result of dialog working.
*/
void ClosedDialogUnionDetails(int result); void ClosedDialogUnionDetails(int result);
/** /**
* @brief ClosedDialogCutSpline handler close event tool CutSpline * @brief ClosedDialogCutSpline actions after closing DialogCutSpline.
* @param result result of working of dialog * @param result result of dialog working.
*/ */
void ClosedDialogCutSpline(int result); void ClosedDialogCutSpline(int result);
/**
* @brief ClosedDialogCutArc actions after closing DialogCutArc.
* @param result result of dialog working.
*/
void ClosedDialogCutArc(int result); void ClosedDialogCutArc(int result);
/** /**
* @brief About * @brief About show widows about.
*/ */
void About(); void About();
/** /**
* @brief AboutQt * @brief AboutQt show widows aboutQt.
*/ */
void AboutQt(); void AboutQt();
/** /**
* @brief ShowToolTip * @brief ShowToolTip show tools tooltip.
* @param toolTip * @param toolTip tooltip text.
*/ */
void ShowToolTip(const QString &toolTip); void ShowToolTip(const QString &toolTip);
/** /**
* @brief tableClosed Слот, що виконується при отриманні сигналу закриття вікна укладання * @brief tableClosed handle after close layout window.
*деталей моделі.
*/ */
void tableClosed(); void tableClosed();
signals: signals:
/** /**
* @brief ModelChosen Сигнал, що висилається після розрахунку всіх деталей моделі. * @brief ModelChosen emit after calculation all details.
* @param listDetails Список детайле моделі. * @param listDetails list of details.
*/ */
void ModelChosen(QVector<VItem*> listDetails, const QString &fileName); void ModelChosen(QVector<VItem*> listDetails, const QString &fileName);
protected: protected:
/** /**
* @brief keyPressEvent * @brief keyPressEvent handle key press events.
* @param event * @param event key event.
*/ */
virtual void keyPressEvent ( QKeyEvent * event ); virtual void keyPressEvent ( QKeyEvent * event );
/** /**
* @brief showEvent * @brief showEvent handle after show window.
* @param event * @param event show event.
*/ */
virtual void showEvent( QShowEvent *event ); virtual void showEvent( QShowEvent *event );
/** /**
* @brief closeEvent * @brief closeEvent handle after close window.
* @param event * @param event close event.
*/ */
virtual void closeEvent( QCloseEvent * event ); virtual void closeEvent( QCloseEvent * event );
/** /**
* @brief Clear * @brief Clear reset to default window.
*/ */
void Clear(); void Clear();
private: private:
@ -381,184 +396,145 @@ private:
*/ */
VDomDocument *doc; VDomDocument *doc;
/** /**
* @brief tool * @brief tool current tool
*/ */
Tool::Tools tool; Tool::Tools tool;
/** /**
* @brief currentScene * @brief currentScene pointer to current scene.
*/ */
VMainGraphicsScene *currentScene; VMainGraphicsScene *currentScene;
/** /**
* @brief sceneDraw * @brief sceneDraw draw scene.
*/ */
VMainGraphicsScene *sceneDraw; VMainGraphicsScene *sceneDraw;
/** /**
* @brief sceneDetails * @brief sceneDetails details scene.
*/ */
VMainGraphicsScene *sceneDetails; VMainGraphicsScene *sceneDetails;
/** /**
* @brief mouseCoordinate * @brief mouseCoordinate pointer to label who show mouse coordinate.
*/ */
QLabel *mouseCoordinate; QLabel *mouseCoordinate;
/** /**
* @brief helpLabel * @brief helpLabel help show tooltip.
*/ */
QLabel *helpLabel; QLabel *helpLabel;
/** /**
* @brief view * @brief view show current scene.
*/ */
VMainGraphicsView *view; VMainGraphicsView *view;
/** /**
* @brief isInitialized * @brief isInitialized true after first show window.
*/ */
bool isInitialized; bool isInitialized;
/**
* @brief dialogTable
*/
DialogIncrements *dialogTable; DialogIncrements *dialogTable;
/**
* @brief dialogEndLine
*/
QSharedPointer<DialogEndLine> dialogEndLine; QSharedPointer<DialogEndLine> dialogEndLine;
/**
* @brief dialogLine
*/
QSharedPointer<DialogLine> dialogLine; QSharedPointer<DialogLine> dialogLine;
/**
* @brief dialogAlongLine
*/
QSharedPointer<DialogAlongLine> dialogAlongLine; QSharedPointer<DialogAlongLine> dialogAlongLine;
/**
* @brief dialogShoulderPoint
*/
QSharedPointer<DialogShoulderPoint> dialogShoulderPoint; QSharedPointer<DialogShoulderPoint> dialogShoulderPoint;
/**
* @brief dialogNormal
*/
QSharedPointer<DialogNormal> dialogNormal; QSharedPointer<DialogNormal> dialogNormal;
/**
* @brief dialogBisector
*/
QSharedPointer<DialogBisector> dialogBisector; QSharedPointer<DialogBisector> dialogBisector;
/**
* @brief dialogLineIntersect
*/
QSharedPointer<DialogLineIntersect> dialogLineIntersect; QSharedPointer<DialogLineIntersect> dialogLineIntersect;
/**
* @brief dialogSpline
*/
QSharedPointer<DialogSpline> dialogSpline; QSharedPointer<DialogSpline> dialogSpline;
/**
* @brief dialogArc
*/
QSharedPointer<DialogArc> dialogArc; QSharedPointer<DialogArc> dialogArc;
/**
* @brief dialogSplinePath
*/
QSharedPointer<DialogSplinePath> dialogSplinePath; QSharedPointer<DialogSplinePath> dialogSplinePath;
/**
* @brief dialogPointOfContact
*/
QSharedPointer<DialogPointOfContact> dialogPointOfContact; QSharedPointer<DialogPointOfContact> dialogPointOfContact;
/**
* @brief dialogDetail
*/
QSharedPointer<DialogDetail> dialogDetail; QSharedPointer<DialogDetail> dialogDetail;
/**
* @brief dialogHeight
*/
QSharedPointer<DialogHeight> dialogHeight; QSharedPointer<DialogHeight> dialogHeight;
/**
* @brief dialogTriangle
*/
QSharedPointer<DialogTriangle> dialogTriangle; QSharedPointer<DialogTriangle> dialogTriangle;
/**
* @brief dialogPointOfIntersection
*/
QSharedPointer<DialogPointOfIntersection> dialogPointOfIntersection; QSharedPointer<DialogPointOfIntersection> dialogPointOfIntersection;
/**
* @brief dialogCutSpline pointer to the dialog tool cut spline
*/
QSharedPointer<DialogCutSpline> dialogCutSpline; QSharedPointer<DialogCutSpline> dialogCutSpline;
/**
* @brief dialogCutSplinePath pointer to the dialog tool cut spline path
*/
QSharedPointer<DialogCutSplinePath> dialogCutSplinePath; QSharedPointer<DialogCutSplinePath> dialogCutSplinePath;
/**
* @brief dialogUnionDetails
*/
QSharedPointer<DialogUnionDetails> dialogUnionDetails; QSharedPointer<DialogUnionDetails> dialogUnionDetails;
QSharedPointer<DialogCutArc> dialogCutArc; QSharedPointer<DialogCutArc> dialogCutArc;
/**
* @brief dialogHistory
*/
DialogHistory *dialogHistory; DialogHistory *dialogHistory;
/** /**
* @brief comboBoxDraws * @brief comboBoxDraws comboc who show name of pattern peaces.
*/ */
QComboBox *comboBoxDraws; QComboBox *comboBoxDraws;
/** /**
* @brief fileName * @brief fileName name current pattern file.
*/ */
QString fileName; QString fileName;
/** /**
* @brief changeInFile * @brief changeInFile true if exist change in file.
*/ */
bool changeInFile; bool changeInFile;
/** /**
* @brief mode * @brief mode keep current draw mode.
*/ */
Draw::Draws mode; Draw::Draws mode;
/**
* @brief currentDrawIndex save current selected pattern peace.
*/
qint32 currentDrawIndex; qint32 currentDrawIndex;
/**
* @brief currentToolBoxIndex save current set of tools.
*/
qint32 currentToolBoxIndex; qint32 currentToolBoxIndex;
/**
* @brief drawMode true if we current draw scene.
*/
bool drawMode; bool drawMode;
/** /**
* @brief ToolBarOption * @brief ToolBarOption enable option toolbar.
*/ */
void ToolBarOption(); void ToolBarOption();
/** /**
* @brief ToolBarDraws * @brief ToolBarDraws enable draw toolbar.
*/ */
void ToolBarDraws(); void ToolBarDraws();
/** /**
* @brief CanselTool * @brief CanselTool cansel tool.
*/ */
void CancelTool(); void CancelTool();
/** /**
* @brief ArrowTool * @brief ArrowTool enable arrow tool.
*/ */
void ArrowTool(); void ArrowTool();
/** /**
* @brief SetEnableWidgets * @brief SetEnableWidgets enable action button.
* @param enable * @param enable enable value.
*/ */
void SetEnableWidgets(bool enable); void SetEnableWidgets(bool enable);
/** /**
* @brief SetEnableTool * @brief SetEnableTool enable button.
* @param enable * @param enable enable value.
*/ */
void SetEnableTool(bool enable); void SetEnableTool(bool enable);
void SaveCurrentScene();
void RestoreCurrentScene();
/** /**
* * @brief SaveCurrentScene save scene options before set another.
*/ */
void SaveCurrentScene();
/**
* @brief RestoreCurrentScene restore scene options after change.
*/
void RestoreCurrentScene();
template <typename Dialog, typename Func> template <typename Dialog, typename Func>
/** /**
* @brief SetToolButton * @brief SetToolButton set tool and show dialog.
* @param checked * @param checked true if tool button checked.
* @param t * @param t tool type.
* @param cursor * @param cursor path tool cursor icon.
* @param toolTip * @param toolTip first tooltipe.
* @param dialog * @param dialog pointer to dialog.
* @param closeDialogSlot * @param closeDialogSlot function what handle after close dialog.
*/ */
void SetToolButton(bool checked, Tool::Tools t, const QString &cursor, const QString &toolTip, void SetToolButton(bool checked, Tool::Tools t, const QString &cursor, const QString &toolTip,
QSharedPointer<Dialog> &dialog, Func closeDialogSlot); QSharedPointer<Dialog> &dialog, Func closeDialogSlot);
/** /**
* @brief MinimumScrollBar * @brief MinimumScrollBar set scroll bar to minimum.
*/ */
void MinimumScrollBar(); void MinimumScrollBar();
/**
* @brief ValidatePattern validate pattern file by xsd schema.
* @param schema path to schema file.
* @param fileName name of pattern file.
* @param errorMsg error message.
* @param errorLine number error line.
* @param errorColumn number error column.
* @return true if validation successful.
*/
bool ValidatePattern(const QString &schema, const QString &fileName, QString &errorMsg, qint64 &errorLine, bool ValidatePattern(const QString &schema, const QString &fileName, QString &errorMsg, qint64 &errorLine,
qint64 &errorColumn) const; qint64 &errorColumn) const;
template <typename T> template <typename T>
@ -579,13 +555,13 @@ private:
*/ */
void ClosedDialog(QSharedPointer<Dialog> &dialog, int result); void ClosedDialog(QSharedPointer<Dialog> &dialog, int result);
/** /**
* @brief SafeSaveing * @brief SafeSaveing safe saving pattern file.
* @param fileName * @param fileName pattern file name.
* @return * @return true if all is all right.
*/ */
bool SafeSaveing(const QString &fileName)const; bool SafeSaveing(const QString &fileName)const;
/** /**
* @brief AutoSavePattern * @brief AutoSavePattern start safe saving.
*/ */
void AutoSavePattern(); void AutoSavePattern();
}; };