28class QXmlStreamReader;
29class QXmlStreamAttributes;
74 void load(
const QString &fileName,
const QString &codecName,
const int &defNodeSize,
75 const QString &defNodeColor,
const QString &defNodeShape,
const QString &defNodeNumberColor,
76 const int &defNodeNumberSize,
const QString &defNodeLabelColor,
const int &defNodeLabelSize ,
77 const QString &defEdgeColor,
const int &canvasWidth,
const int &canvasHeight,
const int &format,
78 const QString &delim=QString(),
const int &sm_mode=1,
const bool &sm_has_labels=
false);
85 bool parseAsDL(
const QByteArray &rawData);
90 bool readDLKeywords(QStringList &strList,
int &N,
int &NM,
int &NR,
int &NC,
bool &fullmatrixFormat,
bool &edgelist1Format);
93 QString &shape, QString &color, QString &fontName,
112 const int &newNodes=1);
121 const QString &color,
122 const QString &numColor,
124 const QString &label,
125 const QString &lColor,
128 const QString &shape,
129 const QString &iconPath=QString(),
130 const bool &signalMW=
false);
133 const QString &label,
134 const bool &signalMW=
false
141 const bool &signalMW=
false);
143 const QString &fileName,
144 const QString &netName,
148 const qint64 &elapsedTime,
149 const QString &message=QString());
The CompareActors class Implements a min-priority queue Used while parsing weighted edge lists.
Definition parser.h:48
bool operator()(Actor &t1, Actor &t2)
Definition parser.h:50
Defines a class for network file loading and parsing.
Definition parser.h:68
void removeDummyNode(int)
QString initNodeCustomIcon
Definition parser.h:175
void readGraphMLElementNodeGraphics(QXmlStreamReader &)
Reads node graphics data and properties: label, color, shape, size, coordinates, etc.
Definition parser.cpp:2740
int totalNodes
Definition parser.h:185
bool parseAsAdjacency(const QByteArray &rawData, const QString &delimiter=",", const bool &sm_has_labels=false)
Definition parser.cpp:1625
bool missingNode
Definition parser.h:190
QString initEdgeLabel
Definition parser.h:177
void createRandomNodes(const int &fixedNum=1, const QString &label=QString(), const int &newNodes=1)
Signals to create either a single new node (numbered fixedNum) or multiple new nodes (numbered from 1...
Definition parser.cpp:277
qreal bez_p1_y
Definition parser.h:189
void signalCreateNodeAtPosRandomWithLabel(const int &num, const QString &label, const bool &signalMW=false)
QHash< QString, QString > edgesMissingNodesHash
Definition parser.h:168
QString initNodeNumberColor
Definition parser.h:176
Parser()
Definition parser.cpp:39
int nodeSize
Definition parser.h:187
void signalCreateNode(const int &num, const int &size, const QString &color, const QString &numColor, const int &numSize, const QString &label, const QString &lColor, const int &lSize, const QPointF &p, const QString &shape, const QString &iconPath=QString(), const bool &signalMW=false)
QHash< QString, QString > keyName
Definition parser.h:167
QString networkName
Definition parser.h:174
bool parseAsTwoModeSociomatrix(const QByteArray &rawData)
Parses the data as two-mode sociomatrix formatted network.
Definition parser.cpp:1896
void signalCreateEdge(const int &source, const int &target, const qreal &weight, const QString &color, const int &edgeDirType, const bool &arrows, const bool &bezier, const QString &edgeLabel=QString(), const bool &signalMW=false)
void signalCreateNodeAtPosRandom(const bool &signalMW=false)
bool containsReservedKeywords(const QString &str) const
Definition parser.cpp:1875
bool createEdgesForRow(const QStringList ¤tRow, int rowIndex)
Definition parser.cpp:1837
bool fileLoaded
Definition parser.h:190
qreal edgeWeight
Definition parser.h:188
bool fileContainsLinkLabels
Definition parser.h:194
int initNodeNumberSize
Definition parser.h:186
QString initNodeShape
Definition parser.h:175
void readGraphMLElementNode(QXmlStreamReader &)
Reads basic node attributes and sets the nodeNumber.
Definition parser.cpp:2397
QString key_type
Definition parser.h:182
bool parseAsDL(const QByteArray &rawData)
Parses the data as DL-formatted (UCINET)
Definition parser.cpp:301
int gwHeight
Definition parser.h:184
bool bezier
Definition parser.h:191
void load(const QString &fileName, const QString &codecName, const int &defNodeSize, const QString &defNodeColor, const QString &defNodeShape, const QString &defNodeNumberColor, const int &defNodeNumberSize, const QString &defNodeLabelColor, const int &defNodeLabelSize, const QString &defEdgeColor, const int &canvasWidth, const int &canvasHeight, const int &format, const QString &delim=QString(), const int &sm_mode=1, const bool &sm_has_labels=false)
Loads the data of the given network file, and calls the relevant method to parse it.
Definition parser.cpp:90
QString edge_weight
Definition parser.h:183
~Parser()
Definition parser.cpp:46
bool parseAsGML(const QByteArray &rawData)
Parses the data as GML formatted network.
Definition parser.cpp:2985
QString initNodeColor
Definition parser.h:175
QMultiMap< int, int > firstModeMultiMap
Definition parser.h:170
int gwWidth
Definition parser.h:184
qreal bez_p1_x
Definition parser.h:189
int fileFormat
Definition parser.h:185
bool parseAsEdgeListWeighted(const QByteArray &rawData, const QString &delimiter)
Parses the data as weighted edgelist formatted network.
Definition parser.cpp:3849
double randY
Definition parser.h:195
bool readDLKeywords(QStringList &strList, int &N, int &NM, int &NR, int &NC, bool &fullmatrixFormat, bool &edgelist1Format)
Definition parser.cpp:922
qreal initEdgeWeight
Definition parser.h:188
QString initEdgeColor
Definition parser.h:177
void readGraphMLElementGraph(QXmlStreamReader &)
Reads a graph definition.
Definition parser.cpp:2249
QString key_name
Definition parser.h:182
void createMissingNodeEdges()
Creates any missing node edges.
Definition parser.cpp:2926
bool validateAndInitialize(const QByteArray &rawData, const QString &delimiter, const bool &sm_has_labels, QStringList &nodeLabels)
Definition parser.cpp:1670
bool fileContainsNodeCoords
Definition parser.h:193
QMultiMap< int, int > secondModeMultiMap
Definition parser.h:170
QHash< QString, int > nodeHash
Definition parser.h:166
int edgeDirType
Definition parser.h:185
QHash< QString, QString > keyDefaultValue
Definition parser.h:167
QString edge_source
Definition parser.h:183
void readGraphMLElementDefaultValue(QXmlStreamReader &)
Reads default key values.
Definition parser.cpp:2328
QString fileDirPath
Definition parser.h:172
QString errorMessage
Definition parser.h:178
QString nodeIconPath
Definition parser.h:180
QString key_value
Definition parser.h:182
QString edgeLabel
Definition parser.h:179
int target
Definition parser.h:187
void createNodeWithDefaults(int nodeIndex, const QString &label)
Definition parser.cpp:1819
int initNodeLabelSize
Definition parser.h:186
QString node_id
Definition parser.h:183
QString nodeNumberColor
Definition parser.h:181
int source
Definition parser.h:187
bool conv_OK
Definition parser.h:191
int totalLinks
Definition parser.h:185
QString edgeColor
Definition parser.h:179
QXmlStreamReader * xml
Definition parser.h:171
qreal arrowSize
Definition parser.h:188
QString edge_id
Definition parser.h:183
void signalFileLoaded(const int &fileType, const QString &fileName, const QString &netName, const int &totalNodes, const int &totalLinks, const int &edgeDirType, const qint64 &elapsedTime, const QString &message=QString())
QString delimiter
Definition parser.h:177
void endGraphMLElementNode(QXmlStreamReader &)
Signals to create a new node.
Definition parser.cpp:2435
bool bool_key
Definition parser.h:192
QString key_what
Definition parser.h:182
void signalAddNewRelation(const QString &relName, const bool &changeRelation=false)
bool fileContainsNodeColors
Definition parser.h:192
qreal bez_p2_y
Definition parser.h:189
void readGraphMLElementEdgeGraphics(QXmlStreamReader &)
Reads edge graphics data and properties: path, linestyle,width, arrows, etc.
Definition parser.cpp:2817
bool readGraphML(QXmlStreamReader &)
Checks the xml token name and calls the appropriate function.
Definition parser.cpp:2151
QStringList edgeMissingNodesList
Definition parser.h:169
int nodeLabelSize
Definition parser.h:187
void readGraphMLElementData(QXmlStreamReader &)
Reads data for edges and nodes.
Definition parser.cpp:2585
QString m_textCodecName
Definition parser.h:173
bool doParseAdjacency(QTextStream &ts, const QString &delimiter, const QStringList &nodeLabels)
Definition parser.cpp:1757
QString edge_directed
Definition parser.h:183
int nodeNumberSize
Definition parser.h:186
QString initNodeLabelColor
Definition parser.h:176
void signalSetRelation(int, const bool &updateUI=true)
int two_sm_mode
Definition parser.h:185
bool parseAsEdgeListSimple(const QByteArray &rawData, const QString &delimiter)
Parses the data as simple edgelist formatted.
Definition parser.cpp:4157
QString nodeLabel
Definition parser.h:179
void readGraphMLElementEdge(QXmlStreamAttributes &)
Reads basic edge creation properties.
Definition parser.cpp:2491
bool bool_node
Definition parser.h:192
bool fileContainsLinkColors
Definition parser.h:193
bool parseAsDot(const QByteArray &rawData)
Parses the data as dot (Graphviz) formatted network.
Definition parser.cpp:3306
bool isComment(QString str)
Helper. Checks if the string parameter is a comment (starts with a known char, i.e #).
Definition parser.cpp:4460
QString key_id
Definition parser.h:182
void readGraphMLElementUnknown(QXmlStreamReader &)
Trivial call for unknown elements.
Definition parser.cpp:2916
QStringList edgeMissingNodesListData
Definition parser.h:169
void readDotProperties(QString str, qreal &, QString &label, QString &shape, QString &color, QString &fontName, QString &fontColor)
Reads the properties of a dot element.
Definition parser.cpp:3719
bool bool_edge
Definition parser.h:192
QHash< QString, QString > keyType
Definition parser.h:167
QString nodeLabelColor
Definition parser.h:181
bool arrows
Definition parser.h:191
qreal bez_p2_x
Definition parser.h:189
QString edgeType
Definition parser.h:179
int initNodeSize
Definition parser.h:186
void resetCounters()
Definition parser.cpp:1739
bool parseAsGraphML(const QByteArray &rawData)
Parses the data as GraphML (not GML) formatted network.
Definition parser.cpp:2009
void readGraphMLElementKey(QXmlStreamAttributes &)
Reads a key definition.
Definition parser.cpp:2293
bool parseAsPajek(const QByteArray &rawData)
Parses the data as Pajek-formatted.
Definition parser.cpp:1038
QHash< QString, QString > keyFor
Definition parser.h:167
QStringList relationsList
Definition parser.h:169
void endGraphMLElementEdge(QXmlStreamReader &)
Signals for a new edge to be created/added.
Definition parser.cpp:2562
double randX
Definition parser.h:195
QString nodeShape
Definition parser.h:179
QString nodeColor
Definition parser.h:179
QString edge_target
Definition parser.h:183
The Actor struct Used while parsing edge lists.
Definition parser.h:37
QString key
Definition parser.h:38
int value
Definition parser.h:39