52 #include "../vmisc/vlockguard.h"
63 class QFileSystemWatcher;
90 explicit MainWindow(QWidget *parent =
nullptr);
93 bool LoadPattern(
const QString &fileName,
const QString &customMeasureFile = QString());
99 virtual void ShowToolTip(
const QString &toolTip) Q_DECL_OVERRIDE;
142 virtual void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
144 virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE;
145 virtual void changeEvent(QEvent* event) Q_DECL_OVERRIDE;
146 virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
147 virtual void customEvent(QEvent * event) Q_DECL_OVERRIDE;
166 #if defined(Q_OS_MAC)
167 void CreateMeasurements();
253 #if defined(Q_OS_MAC)
254 void OpenAt(QAction *where);
328 std::shared_ptr<VLockGuard<char>>
lock;
370 template <
typename Dialog,
typename Func>
371 void SetToolButton(
bool checked,
Tool t,
const QString &cursor,
const QString &toolTip,
372 Func closeDialogSlot);
373 template <
typename Dialog,
typename Func,
typename Func2>
375 Func closeDialogSlot, Func2 applyDialogSlot);
376 template <
typename DrawTool>
379 template <
typename DrawTool>
381 template <
typename DrawTool>
383 template <
typename DrawTool>
385 template <
typename DrawTool>
387 template <
typename DrawTool>
389 template <
typename DrawTool>
392 bool SavePattern(
const QString &fileName, QString &error);
435 bool SetSize(
const QString &text);
The DialogVariables class show dialog increments. Tables of all variables in program will be here.
The HistoryDialog class show dialog history.
The MainWindow class main windows.
void handlePointFromArcAndTangentTool(bool checked)
void handlePointOfIntersectionArcsTool(bool checked)
void selectPieceTool() const
void updateToolBarVisibility()
void EnableLabelSelection(bool enable) const
void EnableElArcSelection(bool enable) const
void ReopenFilesAfterCrash(QStringList &args)
QSharedPointer< VMeasurements > OpenMeasurementFile(const QString &path)
void ToolSelectSplinePath() const
void handleAlongLineTool(bool checked)
handleAlongLineTool handler for point along Line tools.
void ToolSelectPointArc() const
void initToolBarVisibility()
void enablePieceSelection(bool enable) const
void zoomScaleChanged(qreal scale)
void zoomFirstShow()
zoomFirstShow Fit scene size to best size for first show
QPointer< QComboBox > gradationSizes
void EnableElArcHover(bool enable) const
QPointer< MouseCoordinates > mouseCoordinates
mouseCoordinates pointer to label who show mouse coordinate.
void handleTriangleTool(bool checked)
handleTriangleTool handler Point - Intersect Axis and Triangle.
virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE
closeEvent handle after close window.
void EnableNodeLabelHover(bool enable) const
void handleUnionTool(bool checked)
handleUnionTool handler for Union tool.
QPointer< HistoryDialog > historyDialog
void changeDraftBlock(int index, bool zoomBestFit=true)
void signalZoomToAreaActive(bool enable) const
bool UpdateMeasurements(const QString &path, int size, int height)
void updateZoomToPointComboBox(QStringList namesList)
updateZoomToPointComboBox updates the list of points included in the toolbar combobox.
virtual void ShowToolTip(const QString &toolTip) Q_DECL_OVERRIDE
ShowTool highlight tool.Tip show tools tooltip.
void showDraftMode(bool checked)
showDraftMode show draw scene.
void handleArcWithLengthTool(bool checked)
void EnableSplinePathHover(bool enable) const
QLabel * helpLabel
helpLabel help show tooltip.
void ClosedDrawDialogWithApply(int result)
bool isInitialized
isInitialized true after first show window.
void setToolBarVisibility(QToolBar *toolbar, bool visible)
QPointF draftBlockStartPosition() const
void UnloadMeasurements()
bool SetHeight(const QString &text)
void addSelectedItemsToGroup()
void initPenToolBar()
initPenToolBar enable default color, line wight & type toolbar.
void AutoSavePattern()
AutoSavePattern start safe saving.
bool Save()
Save save pattern file.
void ClosedDialogInternalPath(int result)
void EnableLineSelection(bool enable) const
void handleTrueDartTool(bool checked)
void handleShoulderPointTool(bool checked)
handleShoulderPointTool handler for shoulderPoint tool.
virtual void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE
keyPressEvent handle key press events.
virtual void customEvent(QEvent *event) Q_DECL_OVERRIDE
Ui::MainWindow * ui
ui keeps information about user interface
bool SavePattern(const QString &fileName, QString &error)
SavePattern save pattern file.
void EnablePointSelection(bool enable) const
void setCurrentFile(const QString &fileName)
setCurrentFile the function is called to reset the state of a few variables when a file is loaded or ...
void SetToolButtonWithApply(bool checked, Tool t, const QString &cursor, const QString &toolTip, Func closeDialogSlot, Func2 applyDialogSlot)
SetToolButtonWithApply set tool and show dialog.
void ToolSelectPoint() const
QComboBox * fontSizeComboBox
void zoomPan(bool checked)
void addDraftBlock(const QString &blockName)
QAction * recentFileActs[MaxRecentFiles]
void handleInternalPathTool(bool checked)
VMainGraphicsScene * draftScene
draftScene draft block scene.
void ToolSelectCurve() const
void handleCurveIntersectCurveTool(bool checked)
void handlePointAtDistanceAngleTool(bool checked)
handlePointAtDistanceAngleTool handler for handlePointAtDistanceAngle tool.
void handleSplineWithControlPointsTool(bool checked)
QFontComboBox * fontComboBox
void UpdateHeightsList(const QStringList &list)
void ReadSettings()
ReadSettings read setting for app.
void EnablePointHover(bool enable) const
void New()
NewPattern create new empty pattern.
void enablePieceHover(bool enable) const
void showZoomToPointDialog()
zoomToPoint show dialog for choosing a point and update the graphics view to focus on it.
QPointer< QLabel > gradationSizesLabel
void EnableItemMove(bool move)
void handleMirrorByLineTool(bool checked)
void handleRotationTool(bool checked)
virtual void changeEvent(QEvent *event) Q_DECL_OVERRIDE
void ClosedInsertNodesDialog(int result)
void WriteSettings()
WriteSettings save setting for app.
void ChangedHeight(int index)
ChangedGrowth change new height value.
void EnableLineHover(bool enable) const
QString createDraftBlockName(const QString &text)
void ClosedDialogAnchorPoint(int result)
bool SaveAs()
SaveAs save as pattern file.
VToolOptionsPropertyBrowser * toolProperties
bool isLayoutsDockVisible
void handleLineIntersectTool(bool checked)
handleLineIntersectTool handler for lineIntersect tool.
virtual void CleanLayout() Q_DECL_OVERRIDE
void ClosedEditGroupDialog(int result)
void handleNewLayout(bool checked)
handleNewLayout handler for New Layout tool.
void handleCurveWithControlPointsTool(bool checked)
void handleEllipticalArcTool(bool checked)
handleEllipticalArcTool handler for EllipticalArc tool.
void MouseMove(const QPointF &scenePos)
mouseMove save mouse position and show user.
void handleSplineTool(bool checked)
handleSplineTool handler for spline tool.
void Open()
Open ask user select pattern file.
void exportDraftBlocksAs()
void zoomToPoint(const QString &pointName)
zoomToPoint show dialog for choosing a point and update the graphics view to focus on it.
void SetLayoutModeActions()
virtual void showEvent(QShowEvent *event) Q_DECL_OVERRIDE
showEvent handle after show window.
void ToolSelectOperationObjects() const
void ClosedDialogWithApply(int result, VMainGraphicsScene *scene)
ClosedDialogWithApply handle close dialog that has apply button.
Tool lastUsedTool
tool last used tool
void showLayoutMode(bool checked)
showLayoutMode show layout scene.
PenToolBar * m_penToolBar
for selecting the current pen
virtual void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE
keyReleaseEvent handle key press events.
PiecesWidget * patternPiecesWidget
void deleteGroupFromList()
GroupsWidget * groupsWidget
void RestoreCurrentScene()
RestoreCurrentScene restore scene options after change.
void handleGroupTool(bool checked)
void EnableSplineSelection(bool enable) const
void handleArrowTool(bool checked)
handleArrowTool enable arrow tool.
void handleNormalTool(bool checked)
handleNormalTool handler point on perpendicular tool.
virtual ~MainWindow() Q_DECL_OVERRIDE
void handleArcTool(bool checked)
handleArcTool handler for arc tool.
void handleArcIntersectAxisTool(bool checked)
void zoomToArea(bool checked)
QFileSystemWatcher * watcher
virtual void exportToCSVData(const QString &fileName, const DialogExportToCSV &dialog) Q_DECL_FINAL
QComboBox * m_zoomToPointComboBox
void ItemsSelection(SelectionType type) const
bool LoadMeasurements(const QString &path)
void MeasurementsChanged(const QString &path)
void EnableSplinePathSelection(bool enable) const
QPointer< DialogVariables > dialogTable
void handleBisectorTool(bool checked)
handleBisectorTool handler for bisector tool.
bool SetSize(const QString &text)
bool IgnoreLocking(int error, const QString &path)
bool isToolboxDockVisible
bool OpenNewSeamly2D(const QString &fileName=QString()) const
MainWindow(QWidget *parent=nullptr)
MainWindow constructor.
void ToolSelectPointByRelease() const
void EnableArcSelection(bool enable) const
void handleLineTool(bool checked)
handleLineTool handler for line tool.
void ChangedSize(int index)
ChangedSize change new size value.
bool LoadPattern(const QString &fileName, const QString &customMeasureFile=QString())
LoadPattern open pattern file.
void selectAllDraftObjectsTool() const
Tool currentTool
tool current tool
VMainGraphicsScene * pieceScene
pieceScene pattern piece scene.
void handleLineIntersectAxisTool(bool checked)
void EnableNodeLabelSelection(bool enable) const
void SaveCurrentScene()
SaveCurrentScene save scene options before set another.
void setEnableTools(bool enable)
setEnableTools enable button.
void handleMoveTool(bool checked)
QString CheckPathToMeasurements(const QString &patternPath, const QString &path)
void ToolSelectPointByPress() const
void handlePointOfIntersectionCirclesTool(bool checked)
void handleMirrorByAxisTool(bool checked)
void handlePointOfContactTool(bool checked)
handlePointOfContactTool handler for pointOfContact tool.
void PatternChangesWereSaved(bool saved)
haveChange enable action save if we have unsaved change.
void handleMidpointTool(bool checked)
void EndVisualization(bool click=false)
EndVisualization try show dialog after and working with tool visualization.
QPointer< QComboBox > gradationHeights
QStringList GetUnlokedRestoreFileList() const
void handlePointAlongArcTool(bool checked)
handlePointAlongArcTool handler for PointAlongArc tool.
void initStatusBar()
initStatusBar initialize horizontal bar for presenting status information
void ToolSelectGroupObjects() const
void showLayoutPages(int index)
QString GetPatternFileName()
void SetToolButton(bool checked, Tool t, const QString &cursor, const QString &toolTip, Func closeDialogSlot)
SetToolButton set tool and show dialog.
void closeUnionDialog(int result)
closeUnionDialog actions after closing Union tool dialog.
void EnableSplineHover(bool enable) const
void signalZoomPanActive(bool enable) const
void initDraftToolBar()
initDraftToolBar enable draw toolbar.
virtual void updateGroups() Q_DECL_OVERRIDE
triggers the update of the groups
void ToolSelectArc() const
void handlePointAlongCurveTool(bool checked)
handlePointAlongCurveTool handler for point along curve tool.
void showPieceMode(bool checked)
showPieceMode show Piece scene.
QDoubleSpinBox * zoomScaleSpinBox
void handlePatternPiecesMenu()
void Clear()
Clear reset to default window.
QComboBox * SetGradationList(QLabel *label, const QStringList &list)
void GlobalchangeDraftBlock(const QString &patternPiece)
qint32 currentBlockIndex
mode stores current draw mode.
std::shared_ptr< VLockGuard< char > > lock
void handlePointAlongSplineTool(bool checked)
handlePointAlongSplineTool handler for point along spline tool.
void ToolSelectSpline() const
bool MaybeSave()
MaybeSave The function is called to save pending changes.
void UpdateSizesList(const QStringList &list)
void handlePatternPieceTool(bool checked)
handlePatternPieceTool handler for pattern piece tool.
bool mChanges
mChanges true if measurement file was changed.
qint32 currentToolBoxIndex
currentBlockIndex current selected draft block.
void SetEnableWidgets(bool enable)
SetEnableWidgets enable action button.
virtual void zoomToSelected() Q_DECL_OVERRIDE
void EnableArcHover(bool enable) const
void ApplyDialog(VMainGraphicsScene *scene)
ApplyDialog handle apply in dialog.
void EnableNodePointSelection(bool enable) const
QString GetMeasurementFileName()
void handleAnchorPointTool(bool checked)
void handleOperationsMenu()
void handleCurveIntersectAxisTool(bool checked)
void UpdateRecentFileActions()
QPointer< QToolButton > infoToolButton
void MinimumScrollBar()
MinimumScrollBar set scroll bar to minimum.
void handlePointFromCircleAndTangentTool(bool checked)
QComboBox * draftBlockComboBox
QLabel * draftBlockLabel
draftBlockComboBox stores names of draft blocks.
void ClosedDialog(int result)
ClosedDialog handle close dialog.
void DoExport(const VCommandLinePtr &expParams)
void EnableNodePointHover(bool enable) const
QSharedPointer< DialogTool > dialogTool
virtual void PrepareSceneList() Q_DECL_OVERRIDE
void CancelTool()
CancelTool cancel tool.
void handleHeightTool(bool checked)
handleHeightTool handler tool height.
void EnableLabelHover(bool enable) const
QPointer< QLabel > gradationHeightsLabel
void ClosedPiecesDialogWithApply(int result)
void initPointNameToolBar()
initPointNameToolBar enable Point Name toolbar.
void handleCurveTool(bool checked)
handleCurveTool handler for curve tool.
QStringList draftPointNamesList()
draftPointNamesList gets the list of points in draft mode.
void handlePointIntersectXYTool(bool checked)
handlePointIntersectXYTool handler for pointOfIntersection tool.
bool isToolOptionsDockVisible
currentToolBoxIndex current set of tools.
void handleInsertNodesTool(bool checked)
void SetEnabledGUI(bool enabled)
void CheckRequiredMeasurements(const VMeasurements *m)
The VMainGraphicsScene class main scene.
std::shared_ptr< VCommandLine > VCommandLinePtr