Engauge Digitizer 2
Loading...
Searching...
No Matches
Public Member Functions | List of all members
CmdFactory Class Reference

Factory for CmdAbstractBase objects. More...

#include <CmdFactory.h>

Collaboration diagram for CmdFactory:
Collaboration graph

Public Member Functions

 CmdFactory ()
 Single constructor.
 
CmdAbstractcreateCmd (MainWindow &mainWindow, Document &document, QXmlStreamReader &reader)
 Factory method. Input is the xml node from an error report file.
 

Detailed Description

Factory for CmdAbstractBase objects.

Definition at line 16 of file CmdFactory.h.

Constructor & Destructor Documentation

◆ CmdFactory()

CmdFactory::CmdFactory ( )

Single constructor.

Definition at line 38 of file CmdFactory.cpp.

39{
40}

Member Function Documentation

◆ createCmd()

CmdAbstract * CmdFactory::createCmd ( MainWindow & mainWindow,
Document & document,
QXmlStreamReader & reader )

Factory method. Input is the xml node from an error report file.

Definition at line 42 of file CmdFactory.cpp.

45{
46 CmdAbstract *cmd = nullptr;
47
49 if (!attributes.hasAttribute(DOCUMENT_SERIALIZE_CMD_TYPE) ||
51
52 // Invalid xml
53 ENGAUGE_ASSERT(false);
54
55 }
56
57 // Get common attributes
59 QString cmdDescription = attributes.value(DOCUMENT_SERIALIZE_CMD_DESCRIPTION).toString();
60
62 cmd = new CmdAddPointAxis (mainWindow,
63 document,
64 cmdDescription,
65 reader);
67 cmd = new CmdAddPointGraph (mainWindow,
68 document,
69 cmdDescription,
70 reader);
72 cmd = new CmdAddPointsGraph (mainWindow,
73 document,
74 cmdDescription,
75 reader);
77 cmd = new CmdCopy (mainWindow,
78 document,
79 cmdDescription,
80 reader);
81 } else if (cmdType == DOCUMENT_SERIALIZE_CMD_CUT) {
82 cmd = new CmdCut (mainWindow,
83 document,
84 cmdDescription,
85 reader);
87 cmd = new CmdDelete (mainWindow,
88 document,
89 cmdDescription,
90 reader);
92 cmd = new CmdEditPointAxis (mainWindow,
93 document,
94 cmdDescription,
95 reader);
97 cmd = new CmdEditPointGraph (mainWindow,
98 document,
99 cmdDescription,
100 reader);
102 cmd = new CmdMoveBy (mainWindow,
103 document,
104 cmdDescription,
105 reader);
107 cmd = new CmdRedoForTest (mainWindow,
108 document,
109 cmdDescription,
110 reader);
112 cmd = new CmdSelectCoordSystem (mainWindow,
113 document,
114 cmdDescription,
115 reader);
117 cmd = new CmdSettingsAxesChecker (mainWindow,
118 document,
119 cmdDescription,
120 reader);
122 cmd = new CmdSettingsColorFilter (mainWindow,
123 document,
124 cmdDescription,
125 reader);
127 cmd = new CmdSettingsCoords (mainWindow,
128 document,
129 cmdDescription,
130 reader);
132 cmd = new CmdSettingsCurveList (mainWindow,
133 document,
134 cmdDescription,
135 reader);
137 cmd = new CmdSettingsCurveProperties (mainWindow,
138 document,
139 cmdDescription,
140 reader);
142 cmd = new CmdSettingsDigitizeCurve (mainWindow,
143 document,
144 cmdDescription,
145 reader);
147 cmd = new CmdSettingsExportFormat (mainWindow,
148 document,
149 cmdDescription,
150 reader);
152 cmd = new CmdSettingsGeneral (mainWindow,
153 document,
154 cmdDescription,
155 reader);
157 cmd = new CmdSettingsGridRemoval (mainWindow,
158 document,
159 cmdDescription,
160 reader);
162 cmd = new CmdSettingsPointMatch (mainWindow,
163 document,
164 cmdDescription,
165 reader);
167 cmd = new CmdSettingsSegments (mainWindow,
168 document,
169 cmdDescription,
170 reader);
172 cmd = new CmdUndoForTest (mainWindow,
173 document,
174 cmdDescription,
175 reader);
176 } else {
177
178 // Invalid xml
179 ENGAUGE_ASSERT (false);
180
181 }
182
183 return cmd;
184}
const int INNER_RADIUS_MIN
const QString DOCUMENT_SERIALIZE_CMD_ADD_POINT_AXIS
const QString DOCUMENT_SERIALIZE_CMD_MOVE_BY
const QString DOCUMENT_SERIALIZE_CMD_REDO_FOR_TEST
const QString DOCUMENT_SERIALIZE_CMD_SETTINGS_CURVE_LIST
const QString DOCUMENT_SERIALIZE_CMD_SETTINGS_CURVE_PROPERTIES
const QString DOCUMENT_SERIALIZE_CMD_SETTINGS_GRID_REMOVAL
const QString DOCUMENT_SERIALIZE_CMD_ADD_POINTS_GRAPH
const QString DOCUMENT_SERIALIZE_CMD_ADD_POINT_GRAPH
const QString DOCUMENT_SERIALIZE_CMD_SETTINGS_SEGMENTS
const QString DOCUMENT_SERIALIZE_CMD_SETTINGS_POINT_MATCH
const QString DOCUMENT_SERIALIZE_CMD_SETTINGS_COLOR_FILTER
const QString DOCUMENT_SERIALIZE_CMD_UNDO_FOR_TEST
const QString DOCUMENT_SERIALIZE_CMD_TYPE
const QString DOCUMENT_SERIALIZE_CMD_SETTINGS_GENERAL
const QString DOCUMENT_SERIALIZE_CMD_CUT
const QString DOCUMENT_SERIALIZE_CMD_SETTINGS_DIGITIZE_CURVE
const QString DOCUMENT_SERIALIZE_CMD_DELETE
const QString DOCUMENT_SERIALIZE_CMD_EDIT_POINT_AXIS
const QString DOCUMENT_SERIALIZE_CMD_EDIT_POINT_GRAPH
const QString DOCUMENT_SERIALIZE_CMD_SETTINGS_COORDS
const QString DOCUMENT_SERIALIZE_CMD_SETTINGS_AXES_CHECKER
const QString DOCUMENT_SERIALIZE_CMD_DESCRIPTION
const QString DOCUMENT_SERIALIZE_CMD_SETTINGS_EXPORT
const QString DOCUMENT_SERIALIZE_CMD_COPY
const QString DOCUMENT_SERIALIZE_CMD_SELECT_COORD_SYSTEM
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS) define ENGAUGE...
Wrapper around QUndoCommand. This simplifies the more complicated feature set of QUndoCommand.
Definition CmdAbstract.h:20
Command for adding one axis point.
Command for adding one graph point.
Command for adding one or more graph points. This is for Segment Fill mode.
Command for moving all selected Points by a specified translation.
Definition CmdCopy.h:19
Command for cutting all selected Points.
Definition CmdCut.h:19
Command for deleting all selected Points.
Definition CmdDelete.h:19
Command for editing the graph coordinates one axis point.
Command for editing the graph coordinates of one or more graph points.
Command for moving all selected Points by a specified translation.
Definition CmdMoveBy.h:19
Command for performing Redo during testing.
Command for changing the currently selected CoordSystem.
Command for DlgSettingsAxesChecker.
Command for DlgSettingsColorFilter.
Command for DlgSettingsCoords.
Command for DlgSettingsCurveList.
Command for DlgSettingsCurveProperties.
Command for DlgSettingsDigitizeCurve.
Command for DlgSettingsExportFormat.
Command for DlgSettingsGeneral.
Command for DlgSettingsGridRemoval.
Command for DlgSettingsPointMatch.
Command for DlgSettingsSegments.
Command for performing Undo during testing.

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