API — ICoreSDK/ICoreStudio/StudioObjects/Chart
The public contract of 11 header(s) under src/ICoreSDK/ICoreStudio/StudioObjects/Chart — 10 class/struct definition(s), 128 declaration(s). Each section shows the header's banner and its public (and protected-virtual) surface exactly as the file writes it.
| Header | Defines | Declarations | Bases |
|---|---|---|---|
ICoreChart.h | ICoreChart | 63 | public ICoreChartBase |
ICoreChartAxisLabel.h | ICoreChartAxisLabel | 5 | public ICoreGraphicsBoxedText |
ICoreChartLinePath.h | ICoreChartLinePath | 14 | public ICoreChartLinePathBase |
ICoreChartLinePathRef.h | ICoreChartLinePathRef | 11 | — |
ICoreChartRightPanel.h | ICoreChartRightPanel | 12 | public ICoreWidget |
ICoreChartRightPanelPropertiesPanel.h | ICoreChartRightPanelPropertiesPanel | 7 | public ICoreWidget |
ICoreChartToolBar.h | ICoreChartToolBar | 3 | public ICoreToolBar |
ICoreChartView.h | ICoreChartView | 3 | public ICoreGraphicsView |
ICoreChartZoomRect.h | — | 0 | — |
ICoreSinkChartBridge.h | ICoreSinkChartBridge | 10 | — |
ICoreSinkRecordingBridge.h | ICoreSinkRecordingBridge | 0 | — |
ICoreChart.h#
src/ICoreSDK/ICoreStudio/StudioObjects/Chart/ICoreChart.h
ICoreChart#
ICoreChart.h:37 · class · bases public ICoreChartBase · pImpl · nested SubChartOf · 63 declaration(s)
A plot, and - when it is not itself a sub chart - the window around it.
class ICoreChart : public ICoreChartBase {
public:
explicit ICoreChart(ICoreBlock* parentBlock = nullptr);
// ---- Sub charts
ICoreChart* addSubChart();
void removeAllSubCharts();
[[nodiscard]] std::vector<ICoreChart*> getSubCharts() const;
[[nodiscard]] bool isSubChart() const;
// The chart that owns the window. Returns this when there is no host.
[[nodiscard]] ICoreChart* getHostChart();
[[nodiscard]] const ICoreChart* getHostChart() const;
// Host first, then every sub chart in stacking order. Always non-empty.
[[nodiscard]] std::vector<ICoreChart*> getChartStack();
// Splits the viewport height evenly over the stack. Driven by the view.
void layoutChartsInScene(double viewportWidth, double viewportHeight);
void showInWindow();
void hideWindow() const;
void triggerZoom(const double &delta);
void resetZoomAndPan();
void resetZoomAndPanAllCharts();
void plot(const ICoreMatrix& matrix);
void clearAndPlot(const ICoreMatrix& matrix);
// --- Chart Export ---
bool exportAsImage(const ICoreString& filePath) const; // png/jpg (auto by extension)
bool exportAsPDF(const ICoreString& filePath);
bool exportAsSVG(const ICoreString& filePath);
// --- Data Export --- (covers every sub chart in the window)
bool exportDataCSV(const ICoreString& filePath);
void enableFlushingTimer();
void disableFlushingTimer();
ICoreChartLinePath* createNewLinePath();
void clearAllLinePaths();
[[nodiscard]] ICoreChartLinePath* getLinePathByIndex(const int& index) const;
// Tops the chart up to the given number of line paths, creating the missing
// ones. Restoring state needs it: styles are captured per path, but the
// paths themselves are only created when the model runs, so they have to be
// put back before a style has anything to be applied to.
void ensureLinePathCount(int requiredCount);
void ensureSubChartCount(int requiredCount);
void updateAllChildrenPositions() const;
void getState(ICoreCanvasObjectState* stateToPopulate) const;
void updateToState(const std::unordered_map<std::string, std::string>& desiredProperties);
void loadSerializedPathStyles(const std::unordered_map<std::string, std::string> &allPaths);
void cacheDrawnPathStyles(const bool &clearOldCachedStyles);
std::unordered_map<std::string, std::string> popOldestPathStyle();
void setWidth(double newWidth);
void setHeight(double newHeight);
// Swaps a linear axis for a base-10 logarithmic one (the toolkit cannot
// convert one in place, so the axis is replaced and the series reattached).
// No-ops if the axis is already logarithmic, or if any plotted value on
// that axis is <= 0 -- reported through ICoreRunDiagnosis rather than
// silently. Call after plot(), which is what establishes the range being
// carried over. The chart toolbar's "Set log ruler" menu entries call these
// across the whole chart stack; a caller building a plot that is
// conventionally logarithmic (a Bode magnitude, say) can call them directly
// instead.
void setLogarithmicX();
void setLogarithmicY();
void setAxisLabelText_X(const std::string& newText) const;
void setAxisLabelText_Y(const std::string& newText) const;
void setAxisFont_X(const ICoreFont& newFont) const;
void setAxisFont_Y(const ICoreFont& newFont) const;
[[nodiscard]] std::vector<ICoreChartLinePath*> getAllLinePaths() const;
[[nodiscard]] ICoreChartRightPanel* getRightSidePanel() const;
[[nodiscard]] ICoreChartAxisLabel* getXAxisLabel() const;
[[nodiscard]] ICoreChartAxisLabel* getYAxisLabel() const;
// Deliberately hides the base's axis builder. The toolkit's version
// destroys the existing axes and builds new ones carrying its own built-in
// light theme, so tick labels come back near-black whatever theme is
// active. Every axis a chart ever gets is born here or in
// setLogarithmicX/Y(), and painting them in this one place is what keeps a
// caller from having to remember to.
void createDefaultAxes();
void setInfiniteStreaming(const bool& newInfiniteStreaming);
bool isInfiniteStreaming() const;
void setMovingWindowWidth(const int& newMovingWindowWidth);
int getBufferWidth() const;
ICoreBlock *getParentBlock() const;
ICoreGraphicsView* getView() const;
ICoreWidget* getRootWidget() const;
void resetToInitialState();
void kill();
void setAlive();
bool isAlive() const;
~ICoreChart() override;
protected:
bool wheelScrolled(const ICoreWheelEvent& event) override;
bool mousePressed(const ICoreMouseEvent& event) override;
bool mouseMoved(const ICoreMouseEvent& event) override;
bool mouseReleased(const ICoreMouseEvent& event) override;
bool mouseDoubleClicked(const ICoreMouseEvent& event) override;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
ICoreChartAxisLabel.h#
src/ICoreSDK/ICoreStudio/StudioObjects/Chart/ICoreChartAxisLabel.h
Q_OBJECT removed (P2.10b-5): this class declares no signal, slot, Q_PROPERTY or Q_INVOKABLE of its own, and nothing qobject_casts to it, holds a QPointer to it, animates it by name or reaches its metaObject(). It therefore had a meta-object nobody consulted -- and it could not keep one past P2.10b-6, when the base stops being a QObject.
ICoreChartAxisLabel#
ICoreChartAxisLabel.h:10 · class · bases public ICoreGraphicsBoxedText · pImpl · 5 declaration(s)
class ICoreChartAxisLabel : public ICoreGraphicsBoxedText {
public:
explicit ICoreChartAxisLabel(ICoreChart* parent);
void autoUpdateSize();
~ICoreChartAxisLabel() override;
protected:
// ⚠ focusLost, NOT focusLosing, and the difference is load-bearing.
// autoUpdateSize() measures the CURRENT text, so it has to run AFTER
// the toolkit base has committed the edit -- which is exactly what the
// old body did by calling its parent first. focusLosing would size the
// label against the pre-edit text.
void focusLost(const ICoreFocusEvent& event) override;
// ⚠ keyPressHandled, NOT keyPressed -- same reason as focusLost above.
// autoUpdateSize() measures the current text, so it must run after the
// toolkit has inserted the character; the old override got that by
// calling its parent first. Sizing before the insert lags the label one
// keystroke behind, visibly, while typing.
void keyPressHandled(const ICoreKeyEvent& event) override;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
ICoreChartLinePath.h#
src/ICoreSDK/ICoreStudio/StudioObjects/Chart/ICoreChartLinePath.h
How the path's points are drawn. Scatter suits data that is a set of points rather than a signal -- a pole-zero map, say -- where connecting consecutive entries with a line would draw a shape that means nothing.
The shapes themselves live on the wrapper base; this alias is what call sites already spell (ICoreChartLinePath::MarkerShape::Cross) and keeps them unchanged.
ICoreChartLinePath#
ICoreChartLinePath.h:10 · class · final · bases public ICoreChartLinePathBase · pImpl · 14 declaration(s)
class ICoreChartLinePath final : public ICoreChartLinePathBase {
public:
// How the path's points are drawn. Scatter suits data that is a set of
// points rather than a signal -- a pole-zero map, say -- where connecting
// consecutive entries with a line would draw a shape that means nothing.
//
// The shapes themselves live on the wrapper base; this alias is what call
// sites already spell (ICoreChartLinePath::MarkerShape::Cross) and keeps
// them unchanged.
using MarkerShape = ICoreChartMarkerShape;
explicit ICoreChartLinePath(ICoreChart* parentChart);
ICoreRect getPathBounds() const;
void pushPoint(const double& x, const double& y);
void updateMovingWindow();
void flushEntireDataVectorToSeries();
std::unordered_map<std::string, std::string> captureStyle(const std::string& prefix) const;
void applyStyle(const std::unordered_map<std::string, std::string> &desiredState);
void setPathName(const ICoreString &name);
void setPathColor(const ICoreColor &color);
// Point labels are text drawn onto the plot, so their color has to follow
// the theme or they vanish into a dark plot area. But it is also a
// user-settable, saved property, and a theme switch must not overwrite a
// color someone picked. These two are the split: anything that represents
// a choice — the properties panel, a restored state — goes through
// setPointLabelsColorCustom(), which latches the path out of theming;
// applyThemeToPointLabels() then only touches paths still on the default.
void setPointLabelsColorCustom(const ICoreColor& color);
void applyThemeToPointLabels();
// Draws each point as a marker of the given shape and size (in pixels).
// `keepConnectingLine` false -- the default -- hides the line so the result
// is a pure scatter; true overlays markers on a normal line plot.
void setScatterStyle(const MarkerShape& shape, const ICoreColor& color,
const double& markerSizePx = 11.0,
const bool& keepConnectingLine = false);
// True once setScatterStyle() has been applied.
[[nodiscard]] bool isScatter() const;
// Declared here and DEFINED in the .cpp -- unique_ptr<Impl> needs Impl
// complete to destroy it, and it is incomplete in this header.
~ICoreChartLinePath() override;
protected:
void pointClicked(const ICorePoint& point) override;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
ICoreChartLinePathRef.h#
src/ICoreSDK/ICoreStudio/StudioObjects/Chart/ICoreChartLinePathRef.h
ICoreChartLinePathRef#
ICoreChartLinePathRef.h:43 · class · pImpl · 11 declaration(s)
A weak, self-nulling handle to one ICoreChartLinePath.
class ICoreChartLinePathRef {
public:
ICoreChartLinePathRef();
// Implicit on purpose: binding a handle reads `map.insert(name, path)` with
// a plain ICoreChartLinePath* on the right, exactly as it did when the map
// held the guarded pointer directly.
ICoreChartLinePathRef(ICoreChartLinePath* path);
~ICoreChartLinePathRef();
// This is a VALUE -- ICoreRecipeInterpreter keeps a whole map of them, so it
// is copied and rehashed. The residue below deletes the implicit copy, so
// all four are written by hand in the .cpp; the moves are noexcept, or a
// growing container silently goes back to copying.
ICoreChartLinePathRef(const ICoreChartLinePathRef& other);
ICoreChartLinePathRef& operator=(const ICoreChartLinePathRef& other);
ICoreChartLinePathRef(ICoreChartLinePathRef&& other) noexcept;
ICoreChartLinePathRef& operator=(ICoreChartLinePathRef&& other) noexcept;
// The live path, or nullptr if it has been destroyed since it was bound.
ICoreChartLinePath* get() const;
// True while the path is still alive.
explicit operator bool() const;
bool operator==(const ICoreChartLinePathRef& other) const;
bool operator!=(const ICoreChartLinePathRef& other) const;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
ICoreChartRightPanel.h#
src/ICoreSDK/ICoreStudio/StudioObjects/Chart/ICoreChartRightPanel.h
---- Collapsing. The state is held rather than read back off the widget: the tool bar asks for it while the chart window is still being assembled, and until a widget has a shown parent Qt reports it as hidden either way.
ICoreChartRightPanel#
ICoreChartRightPanel.h:18 · class · final · bases public ICoreWidget · pImpl · 12 declaration(s)
class ICoreChartRightPanel final : public ICoreWidget {
public:
explicit ICoreChartRightPanel(ICoreChart* parentChart);
void addPath(ICoreChartLinePath *newPath);
void selectPath(ICoreChartLinePath *path);
void refreshPathEntry(const ICoreChartLinePath *path);
void populatePropertiesPanelWithLinePath(ICoreChartLinePath *path);
void showPropertiesForCurrentSelection();
void clearAllPaths();
void resetPropertiesMap();
ICoreLineEdit* getBufferSizeTextBox() const;
// ---- Collapsing. The state is held rather than read back off the widget:
// the tool bar asks for it while the chart window is still being assembled,
// and until a widget has a shown parent Qt reports it as hidden either way.
void setPanelShown(bool shown);
[[nodiscard]] bool isPanelShown() const;
~ICoreChartRightPanel() override;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
ICoreChartRightPanelPropertiesPanel.h#
src/ICoreSDK/ICoreStudio/StudioObjects/Chart/ICoreChartRightPanelPropertiesPanel.h
Takes the wrapper interface rather than QWidget*, so an already-converted wrapper (ICoreSlider) can be handed over alongside the unconverted ones.
ICoreChartRightPanelPropertiesPanel#
ICoreChartRightPanelPropertiesPanel.h:14 · class · final · bases public ICoreWidget · pImpl · 7 declaration(s)
class ICoreChartRightPanelPropertiesPanel final : public ICoreWidget {
public:
explicit ICoreChartRightPanelPropertiesPanel(ICoreWidget* parent, ICoreChartLinePath* path);
void addPropertyEntry_MajorSplit() const;
void addPropertyEntry_ToggleButton(const std::string &title, ICoreToggleButton *interfaceUI) const;
void addPropertyEntry_LineEdit(const std::string &title, ICoreLineEdit *interfaceUI) const;
// Takes the wrapper interface rather than QWidget*, so an already-converted
// wrapper (ICoreSlider) can be handed over alongside the unconverted ones.
void addPropertyEntry_Widget(const std::string &title, ICoreNativeWidget *interfaceUI) const;
~ICoreChartRightPanelPropertiesPanel() override;
protected:
// Does nothing -- enforces a fully transparent panel.
void paintContent(ICorePainter&) override;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
ICoreChartToolBar.h#
src/ICoreSDK/ICoreStudio/StudioObjects/Chart/ICoreChartToolBar.h
ICoreChartToolBar#
ICoreChartToolBar.h:14 · class · final · bases public ICoreToolBar · pImpl · 3 declaration(s)
class ICoreChartToolBar final : public ICoreToolBar {
public:
explicit ICoreChartToolBar(ICoreChart* parentChart);
void addSplitter() const;
~ICoreChartToolBar() override;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
ICoreChartView.h#
src/ICoreSDK/ICoreStudio/StudioObjects/Chart/ICoreChartView.h
ICoreGraphicsView's hook, not resizeEvent: this class only ever read viewport()->rect(), which is exactly what the hook is handed.
ICoreChartView#
ICoreChartView.h:12 · class · final · bases public ICoreGraphicsView · pImpl · 3 declaration(s)
class ICoreChartView final : public ICoreGraphicsView {
public:
explicit ICoreChartView(ICoreGraphicsScene* scene, ICoreChart* chart);
protected:
// ICoreGraphicsView's hook, not resizeEvent: this class only ever read
// viewport()->rect(), which is exactly what the hook is handed.
void resized(const ICoreRect& viewportBounds) override;
public:
// Declared here and DEFINED in the .cpp: unique_ptr<Impl> needs Impl
// complete to destroy it, and it is incomplete in this header.
~ICoreChartView() override;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
ICoreChartZoomRect.h#
src/ICoreSDK/ICoreStudio/StudioObjects/Chart/ICoreChartZoomRect.h
⚠ NARROWED, and the old note is kept here because the reason it stopped being true is reusable. It read: "ICoreAnyGraphicsItem, not ICoreGraphicsItem: the only caller parents this to an ICoreChart, which derives from the toolkit's chart and so has no ICoreGraphicsItem subobject to point at. There is no cast that makes the narrow type true."
Correct at the time. P2.2 then gave ICoreChartBase
public ICoreNativeItem-- two lines, added for an unrelated reason -- and the chart gained exactly the subobject this parameter needed. The lesson is that "not migrated yet" parameters unblock themselves as the seam spreads; re-check them rather than treating the note as permanent.
Declares no class of its own — see the file.
ICoreSinkChartBridge.h#
src/ICoreSDK/ICoreStudio/StudioObjects/Chart/SinkBlocksBridge/ICoreSinkChartBridge.h
ICoreSinkChartBridge#
ICoreSinkChartBridge.h:49 · class · final · pImpl · 10 declaration(s)
The one seam between a charting sink block and the chart it draws on.
class ICoreSinkChartBridge final {
public:
// `ownerBlock` is the sink block itself -- the chart is looked up through it
// on each call rather than cached, because setScopeBlock() may not have
// attached one yet when the block's constructor builds this bridge.
explicit ICoreSinkChartBridge(ICoreBlock* ownerBlock);
// Declared here, DEFINED in the .cpp: the four sink blocks hold this BY
// VALUE, so their translation units destroy it and would otherwise need
// Impl complete.
~ICoreSinkChartBridge();
// False when the block has no chart attached. Every method below is a no-op
// in that case, so a caller only needs this when it wants to skip work of
// its own (Record, which records into variables whether or not it plots).
[[nodiscard]] bool hasChart() const;
// Rolling window instead of the whole history, for a run with no end.
// Applied directly rather than posted: it sets a plain flag the chart reads,
// which is what the blocks already did.
void setInfiniteStreaming(const bool& newInfiniteStreaming) const;
// ---- Run setup. Called in this order from loadBlockConfig().
void clearTraces() const;
void addTrace(const std::string& traceName) const;
// createDefaultAxes() must run AFTER the traces exist -- the axes are built
// from the paths -- which is why this is a separate call and not folded into
// addTrace(). It also starts the flushing timer for the run.
void finishTraces(const std::string& xAxisLabel) const;
void finishTraces(const std::string& xAxisLabel, const std::string& yAxisLabel) const;
// ---- Per sample. `traceIndex` is the position the trace was added in.
// Out-of-range indices are dropped by the chart, not by the caller.
void pushPoint(const int& traceIndex, const double& x, const double& y) const;
// ---- End of run: flush every buffered point into its series and stop the
// flushing timer.
void finishRun() const;
private:
class Impl; // the two-line residue; state lives here
std::unique_ptr<Impl> impl;
};
ICoreSinkRecordingBridge.h#
src/ICoreSDK/ICoreStudio/StudioObjects/Chart/SinkBlocksBridge/ICoreSinkRecordingBridge.h
ICoreSinkRecordingBridge#
ICoreSinkRecordingBridge.h:27 · class · final · 0 declaration(s)
The seam between a recording sink block and the variables space.
class ICoreSinkRecordingBridge final {
public:
// Declares `names[k]` = `channels[k]` in the global variables space, on the
// GUI thread. Pairs are taken up to the shorter of the two vectors.
//
// `blockLabel` prefixes the diagnosis logged when there is no variables
// space to record into -- "Record" or "Signal Recorder" -- so the message
// still names the block once the call is one frame deeper than it was.
static void declareTimeSeries(std::vector<std::string> names,
std::vector<ICoreTimeSeries> channels,
const std::string& blockLabel);
};
};