| Wireshark 4.7.3 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
sequence_diagram.h
Go to the documentation of this file.
1
9
10#ifndef SEQUENCE_DIAGRAM_H
11#define SEQUENCE_DIAGRAM_H
12
13#include <config.h>
14
15#include <epan/address.h>
16
17#include <QObject>
18#include <QMultiMap>
19#include <ui/qt/widgets/qcustomplot.h>
20
21 struct _seq_analysis_info;
22 struct _seq_analysis_item;
23
24// Some of this is probably unnecessary
29 class WSCPSeqData
30{
31 public:
33 WSCPSeqData();
34
40 WSCPSeqData(double key, _seq_analysis_item *value);
41
42 double key;
43 struct _seq_analysis_item *value;
44};
45
46
48 typedef QMultiMap<double, WSCPSeqData> WSCPSeqDataMap;
49
50
56 class SequenceDiagram : public QCPAbstractPlottable
57{
58 Q_OBJECT
59
60 public:
67 explicit SequenceDiagram(QCPAxis *keyAxis, QCPAxis *valueAxis, QCPAxis *commentAxis);
68
72 virtual ~SequenceDiagram();
73
74 // ── Getters ──────────────────────────────────────────────────────────
75
81 int adjacentPacket(bool next);
82
87 double selectedKey() { return selected_key_; }
88
89 // ── Setters ──────────────────────────────────────────────────────────
90
96 void setData(struct _seq_analysis_info *sainfo);
97
98 // ── Queries ──────────────────────────────────────────────────────────
99
106 struct _seq_analysis_item *itemForPosY(int ypos);
107
113 bool inComment(QPoint pos) const;
114
120 QString elidedComment(const QString &text) const;
121
122 // ── Reimplemented virtual methods ─────────────────────────────────────
123
127 virtual void clearData() { data_->clear(); }
128
137 virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details = 0) const Q_DECL_OVERRIDE;
138
139public slots:
145 void setSelectedPacket(int selected_packet);
146
147protected:
153 virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE;
154
160 virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const Q_DECL_OVERRIDE;
161
168 virtual QCPRange getKeyRange(bool &validRange, QCP::SignDomain inSignDomain = QCP::sdBoth) const Q_DECL_OVERRIDE;
169
177 virtual QCPRange getValueRange(bool &validRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange = QCPRange()) const Q_DECL_OVERRIDE;
178
179private:
180 QCPAxis *key_axis_;
181 QCPAxis *value_axis_;
182 QCPAxis *comment_axis_;
183 WSCPSeqDataMap *data_;
184 struct _seq_analysis_info *sainfo_;
185 uint32_t selected_packet_;
186 double selected_key_;
187};
188
189#endif // SEQUENCE_DIAGRAM_H
address.h
SequenceDiagram::~SequenceDiagram
virtual ~SequenceDiagram()
Destroys the SequenceDiagram and frees the internal data map.
Definition sequence_diagram.cpp:106
SequenceDiagram::setData
void setData(struct _seq_analysis_info *sainfo)
Replaces the diagram's data with the contents of sainfo and triggers a replot.
Definition sequence_diagram.cpp:157
SequenceDiagram::SequenceDiagram
SequenceDiagram(QCPAxis *keyAxis, QCPAxis *valueAxis, QCPAxis *commentAxis)
Constructs a SequenceDiagram plottable with three axes.
Definition sequence_diagram.cpp:45
SequenceDiagram::itemForPosY
struct _seq_analysis_item * itemForPosY(int ypos)
Returns the sequence analysis item rendered at the given vertical pixel position in the plot.
Definition sequence_diagram.cpp:216
SequenceDiagram::clearData
virtual void clearData()
Removes all data points from the internal data map.
Definition sequence_diagram.h:127
SequenceDiagram::inComment
bool inComment(QPoint pos) const
Returns whether pos falls within a comment text region.
Definition sequence_diagram.cpp:226
SequenceDiagram::drawLegendIcon
virtual void drawLegendIcon(QCPPainter *painter, const QRectF &rect) const Q_DECL_OVERRIDE
Draws a small representative icon for the legend entry.
Definition sequence_diagram.cpp:381
SequenceDiagram::getKeyRange
virtual QCPRange getKeyRange(bool &validRange, QCP::SignDomain inSignDomain=QCP::sdBoth) const Q_DECL_OVERRIDE
Returns the key-axis range spanned by the data.
Definition sequence_diagram.cpp:385
SequenceDiagram::adjacentPacket
int adjacentPacket(bool next)
Returns the frame number of the packet adjacent to the current selection.
Definition sequence_diagram.cpp:111
SequenceDiagram::setSelectedPacket
void setSelectedPacket(int selected_packet)
Selects the data point corresponding to selected_packet and updates selected_key_ and selected_packet...
Definition sequence_diagram.cpp:205
SequenceDiagram::draw
virtual void draw(QCPPainter *painter) Q_DECL_OVERRIDE
Draws all sequence diagram arrows, participant labels, and comment text onto painter.
Definition sequence_diagram.cpp:251
SequenceDiagram::elidedComment
QString elidedComment(const QString &text) const
Returns text elided to fit within the comment axis width.
Definition sequence_diagram.cpp:234
SequenceDiagram::selectTest
virtual double selectTest(const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
Returns the distance from pos to the nearest data point for hit-testing and selection purposes.
Definition sequence_diagram.cpp:240
SequenceDiagram::getValueRange
virtual QCPRange getValueRange(bool &validRange, QCP::SignDomain inSignDomain=QCP::sdBoth, const QCPRange &inKeyRange=QCPRange()) const Q_DECL_OVERRIDE
Returns the value-axis range spanned by the data.
Definition sequence_diagram.cpp:407
SequenceDiagram::selectedKey
double selectedKey()
Returns the plot key coordinate of the currently selected data point.
Definition sequence_diagram.h:87
WSCPSeqData::value
struct _seq_analysis_item * value
Definition sequence_diagram.h:43
WSCPSeqData::key
double key
Definition sequence_diagram.h:42
WSCPSeqData::WSCPSeqData
WSCPSeqData()
Constructs a default WSCPSeqData with a zero key and null value.
Definition sequence_diagram.cpp:33
WSCPSeqDataMap
QMultiMap< double, WSCPSeqData > WSCPSeqDataMap
Multi-map keyed by plot coordinate, storing WSCPSeqData entries for the sequence diagram.
Definition sequence_diagram.h:48
_seq_analysis_info
Definition sequence_analysis.h:79
_seq_analysis_item
Represents a single event or message arrow in a sequence / flow graph analysis.
Definition sequence_analysis.h:52