52 /// \endcode |
52 /// \endcode |
53 /// |
53 /// |
54 /// The \c writeNodeMap() function declares a \c NodeMap writing |
54 /// The \c writeNodeMap() function declares a \c NodeMap writing |
55 /// command in the \c GraphWriter. You should give as parameter |
55 /// command in the \c GraphWriter. You should give as parameter |
56 /// the name of the map and the map object. The NodeMap writing |
56 /// the name of the map and the map object. The NodeMap writing |
57 /// command with name "id" should write a unique map because it |
57 /// command with name "label" should write a unique map because it |
58 /// is regarded as ID map (such a map is essential if the graph has edges). |
58 /// is regarded as label map (such a map is essential if the graph has edges). |
59 /// |
59 /// |
60 /// \code |
60 /// \code |
61 /// IdMap<ListGraph, Node> nodeIdMap; |
61 /// IdMap<ListGraph, Node> nodeLabelMap; |
62 /// writer.writeNodeMap("id", nodeIdMap); |
62 /// writer.writeNodeMap("label", nodeLabelMap); |
63 /// |
63 /// |
64 /// writer.writeNodeMap("coords", coords); |
64 /// writer.writeNodeMap("coords", coords); |
65 /// writer.writeNodeMap("color", colorMap); |
65 /// writer.writeNodeMap("color", colorMap); |
66 /// \endcode |
66 /// \endcode |
67 /// |
67 /// |
251 /// Executes the writing commands. |
251 /// Executes the writing commands. |
252 void run() { |
252 void run() { |
253 writer->run(); |
253 writer->run(); |
254 } |
254 } |
255 |
255 |
256 /// \brief Write the id of the given node. |
256 /// \brief Write the label of the given node. |
257 /// |
257 /// |
258 /// It writes the id of the given node. If there was written an "id" |
258 /// It writes the label of the given node. If there was written an "label" |
259 /// named node map then it will write the map value belonging to the node. |
259 /// named node map then it will write the map value belonging to the node. |
260 void writeId(std::ostream& os, const Node& item) const { |
260 void writeLabel(std::ostream& os, const Node& item) const { |
261 nodeset_writer.writeId(os, item); |
261 nodeset_writer.writeLabel(os, item); |
262 } |
262 } |
263 |
263 |
264 /// \brief Write the id of the given edge. |
264 /// \brief Write the label of the given edge. |
265 /// |
265 /// |
266 /// It writes the id of the given edge. If there was written an "id" |
266 /// It writes the label of the given edge. If there was written an "label" |
267 /// named edge map then it will write the map value belonging to the edge. |
267 /// named edge map then it will write the map value belonging to the edge. |
268 void writeId(std::ostream& os, const Edge& item) const { |
268 void writeLabel(std::ostream& os, const Edge& item) const { |
269 edgeset_writer.writeId(os, item); |
269 edgeset_writer.writeLabel(os, item); |
270 } |
270 } |
271 |
271 |
272 private: |
272 private: |
273 |
273 |
274 LemonWriter* writer; |
274 LemonWriter* writer; |
325 /// \endcode |
325 /// \endcode |
326 /// |
326 /// |
327 /// The \c writeNodeMap() function declares a \c NodeMap writing |
327 /// The \c writeNodeMap() function declares a \c NodeMap writing |
328 /// command in the \c UndirGraphWriter. You should give as parameter |
328 /// command in the \c UndirGraphWriter. You should give as parameter |
329 /// the name of the map and the map object. The NodeMap writing |
329 /// the name of the map and the map object. The NodeMap writing |
330 /// command with name "id" should write a unique map because it |
330 /// command with name "label" should write a unique map because it |
331 /// is regarded as ID map. |
331 /// is regarded as label map. |
332 /// |
332 /// |
333 /// \code |
333 /// \code |
334 /// IdMap<UndirListGraph, Node> nodeIdMap; |
334 /// IdMap<UndirListGraph, Node> nodeLabelMap; |
335 /// writer.writeNodeMap("id", nodeIdMap); |
335 /// writer.writeNodeMap("label", nodeLabelMap); |
336 /// |
336 /// |
337 /// writer.writeNodeMap("coords", coords); |
337 /// writer.writeNodeMap("coords", coords); |
338 /// writer.writeNodeMap("color", colorMap); |
338 /// writer.writeNodeMap("color", colorMap); |
339 /// \endcode |
339 /// \endcode |
340 /// |
340 /// |
559 /// Executes the writing commands. |
559 /// Executes the writing commands. |
560 void run() { |
560 void run() { |
561 writer->run(); |
561 writer->run(); |
562 } |
562 } |
563 |
563 |
564 /// \brief Write the id of the given node. |
564 /// \brief Write the label of the given node. |
565 /// |
565 /// |
566 /// It writes the id of the given node. If there was written an "id" |
566 /// It writes the label of the given node. If there was written an "label" |
567 /// named node map then it will write the map value belonging to the node. |
567 /// named node map then it will write the map value belonging to the node. |
568 void writeId(std::ostream& os, const Node& item) const { |
568 void writeLabel(std::ostream& os, const Node& item) const { |
569 nodeset_writer.writeId(os, item); |
569 nodeset_writer.writeLabel(os, item); |
570 } |
570 } |
571 |
571 |
572 /// \brief Write the id of the given edge. |
572 /// \brief Write the label of the given edge. |
573 /// |
573 /// |
574 /// It writes the id of the given edge. If there was written an "id" |
574 /// It writes the label of the given edge. If there was written an "label" |
575 /// named edge map then it will write the map value belonging to the edge. |
575 /// named edge map then it will write the map value belonging to the edge. |
576 void writeId(std::ostream& os, const Edge& item) const { |
576 void writeLabel(std::ostream& os, const Edge& item) const { |
577 undir_edgeset_writer.writeId(os, item); |
577 undir_edgeset_writer.writeLabel(os, item); |
578 } |
578 } |
579 |
579 |
580 /// \brief Write the id of the given undirected edge. |
580 /// \brief Write the label of the given undirected edge. |
581 /// |
581 /// |
582 /// It writes the id of the given undirected edge. If there was written |
582 /// It writes the label of the given undirected edge. If there was written |
583 /// an "id" named edge map then it will write the map value belonging to |
583 /// an "label" named edge map then it will write the map value belonging to |
584 /// the edge. |
584 /// the edge. |
585 void writeId(std::ostream& os, const UndirEdge& item) const { |
585 void writeLabel(std::ostream& os, const UndirEdge& item) const { |
586 undir_edgeset_writer.writeId(os, item); |
586 undir_edgeset_writer.writeLabel(os, item); |
587 } |
587 } |
588 |
588 |
589 |
589 |
590 private: |
590 private: |
591 |
591 |