42#ifndef OPENSWMMVIS_UI_DIALOGS_PATTERNEDITORDIALOG_H
43#define OPENSWMMVIS_UI_DIALOGS_PATTERNEDITORDIALOG_H
55class QSortFilterProxyModel;
58class QStandardItemModel;
77class InteractiveChartView;
78class PatternEditChartView;
79class PatternFactorTableModel;
80class ChartAxisFormatController;
96 QUndoStack *undoStack,
97 QWidget *
parent =
nullptr);
106 QUndoStack *undoStack,
107 QWidget *
parent =
nullptr);
121 QUndoStack *undoStack,
122 const QString &initialName,
123 QWidget *
parent =
nullptr);
133 QListView *
listView() const noexcept {
return m_listView; }
139 QLineEdit *
searchEdit() const noexcept {
return m_searchEdit; }
194 void onListSelectionChanged_();
195 void onListContextMenu_(
const QPoint &
pos);
196 void onNormalizeClicked_();
197 void onNewClicked_();
198 void onRenameClicked_();
199 void onDeleteClicked_();
200 void onDuplicateClicked_();
201 void onCancelCreateClicked_();
202 void onSearchTextChanged_(
const QString &
text);
203 void onCopyChartClicked_();
204 void onExportChartClicked_();
205 void onShowPlotStyleMenu_(
const QPoint &globalPos);
209 const QString &prev,
const QString &now);
210 void onProviderFactorChanged_();
211 void onProviderFactorsChanged_();
212 void onProviderTypeChanged_();
213 void onMutationRejected_(
const QString &reason);
214 void onCreateNewNameChanged_(
const QString &
text);
215 void onCreateNewSubmit_();
216 void onListItemRenamed_(QStandardItem *item);
220 void buildCreateCard_();
221 void rebuildListModel_();
224 void refreshChart_();
225 void updateStatusBar_();
226 void saveDialogSettings_()
const;
227 void restoreDialogSettings_();
229 QPointer<openswmmvis::pattern::PatternRegistry> m_registry;
230 QUndoStack *m_undoStack =
nullptr;
231 QPointer<openswmmvis::pattern::PatternProvider> m_current;
234 QSplitter *m_splitter =
nullptr;
235 QListView *m_listView =
nullptr;
236 QStandardItemModel *m_listModel =
nullptr;
237 QSortFilterProxyModel *m_listProxy =
nullptr;
238 QLineEdit *m_searchEdit =
nullptr;
240 QLabel *m_typeLabel =
nullptr;
241 QTableView *m_table =
nullptr;
243 QPushButton *m_normalizeBtn =
nullptr;
244 QDoubleSpinBox *m_normalizeTargetSpin =
nullptr;
245 QStatusBar *m_status =
nullptr;
246 QLabel *m_sumLabel =
nullptr;
249 QChart *m_chart =
nullptr;
251 QLineSeries *m_lineSeries =
nullptr;
252 QScatterSeries *m_scatterSeries =
nullptr;
253 QCategoryAxis *m_xAxis =
nullptr;
254 QValueAxis *m_yAxis =
nullptr;
256 bool m_smoothPreview =
false;
257 bool m_markersOn =
true;
261 QFrame *m_createCard =
nullptr;
262 QLineEdit *m_nameEdit =
nullptr;
263 QLabel *m_nameValidationLabel =
nullptr;
264 QComboBox *m_typeCombo =
nullptr;
265 QPushButton *m_createBtn =
nullptr;
266 QPushButton *m_cancelCreateBtn =
nullptr;
269 QPushButton *m_newBtn =
nullptr;
270 QPushButton *m_renameBtn =
nullptr;
271 QPushButton *m_duplicateBtn =
nullptr;
272 QPushButton *m_deleteBtn =
nullptr;
275 bool m_suppressListItemRename =
false;
277 bool m_suppressTableSelectionSync =
false;
278 bool m_suppressChartSelectionSync =
false;
Definition patternprovider.h:49
Definition patternregistry.h:34
Definition patterneditchartview.h:50
Definition patterneditordialog.h:83
QStandardItemModel * patternListModel() const noexcept
The source (unfiltered) list model. Tests cast to QStandardItemModel to inspect row count and item te...
Definition patterneditordialog.h:144
QTableView * factorTable() const noexcept
Definition patterneditordialog.h:134
bool isStepLinePreview() const noexcept
True iff the preview is drawn as a step line. False = smooth segments between adjacent slot values.
Definition patterneditordialog.h:179
PatternFactorTableModel * tableModel() const noexcept
Definition patterneditordialog.h:136
int pendingType() const
CreateNew-mode: type currently selected in the create-card combo.
Definition patterneditordialog.cpp:1104
QLineSeries * previewLineSeries() const noexcept
Definition patterneditordialog.h:137
QString pendingName() const
CreateNew-mode: name in the create-card. Empty in Edit mode.
Definition patterneditordialog.cpp:1099
bool arePreviewMarkersVisible() const noexcept
True iff slot-centre markers are drawn over the step line.
Definition patterneditordialog.h:185
bool renameCurrent(const QString &newName)
Rename the currently selected pattern. Returns false if no selection or the new name collides.
Definition patterneditordialog.cpp:915
bool isCreateEnabled() const
True iff Create button is enabled.
Definition patterneditordialog.cpp:1109
void submitCreateNew()
Programmatically click Create.
Definition patterneditordialog.cpp:1114
void setStepLinePreview(bool stepLine)
Toggle the preview between step-line and smooth-line.
Definition patterneditordialog.cpp:1080
Mode
Dialog mode. Edit opens directly bound to a provider; CreateNew shows a name + type prompt up front a...
Definition patterneditordialog.h:89
openswmmvis::pattern::PatternProvider * currentProvider() const noexcept
Currently-bound provider (or nullptr in CreateNew before submit).
Definition patterneditordialog.cpp:181
Mode mode() const noexcept
Current mode.
Definition patterneditordialog.h:126
static QString pickPattern(openswmmvis::pattern::PatternRegistry *registry, QUndoStack *undoStack, const QString &initialName, QWidget *parent=nullptr)
Modal pick / create / edit entry point for callers that round-trip a pattern selection inline (e....
Definition patterneditordialog.cpp:155
QLineEdit * searchEdit() const noexcept
Definition patterneditordialog.h:139
void invokeNormalize()
Programmatically click Normalize (test hook).
Definition patterneditordialog.cpp:784
PatternEditChartView * chartView() const noexcept
Definition patterneditordialog.h:135
void setPreviewMarkersVisible(bool visible)
Toggle slot-centre markers on/off.
Definition patterneditordialog.cpp:1088
QScatterSeries * previewMarkerSeries() const noexcept
Definition patterneditordialog.h:138
void closeEvent(QCloseEvent *e) override
Definition patterneditordialog.cpp:1163
void invokeNew()
Reveal the create-card (mirrors the "+ New" button).
Definition patterneditordialog.cpp:874
void deleteCurrentSilently()
Delete the currently selected pattern from the registry. Bypasses the confirmation dialog (test hook ...
Definition patterneditordialog.cpp:935
void openForPattern(const QString &name)
Bring the dialog forward and select name in the list (no-op if absent). Convenience for the Object Br...
Definition patterneditordialog.cpp:145
static PatternEditorDialog * createNew(openswmmvis::pattern::PatternRegistry *registry, QUndoStack *undoStack, QWidget *parent=nullptr)
Slice BM.0-Add-New factory: same dialog, started in CreateNew mode. Caller owns the returned dialog (...
Definition patterneditordialog.cpp:133
~PatternEditorDialog() override
openswmmvis::pattern::PatternProvider * duplicateCurrent(const QString &newName)
Clone the currently selected pattern under newName. Returns the new provider (also bound in the dialo...
Definition patterneditordialog.cpp:990
QListView * listView() const noexcept
Definition patterneditordialog.h:133
Definition patternfactortablemodel.h:34
int e
Definition inpmeshreader.cpp:41
ArrowPlacement p
Definition linesymbollayer.cpp:27
Definition patternprovider.h:36
Definition openswmmvislayer.h:43
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
int pos
Definition queryparser.cpp:36
QString text
Definition queryparser.cpp:35
QString name
Definition sectionmodelbuilders.cpp:474