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