21 #ifndef Tulip_PlanarConMap_H
22 #define Tulip_PlanarConMap_H
25 #include <tulip/tuliphash.h>
27 #include <tulip/Face.h>
28 #include <tulip/GraphDecorator.h>
44 class TLP_SCOPE PlanarConMap :
public GraphDecorator {
47 friend class FaceIteratorTest;
48 friend class PlanarConMapTest;
50 friend class FaceIterator;
51 friend class FaceAdjIterator;
52 friend class NodeFaceIterator;
53 friend class EdgeFaceIterator;
55 friend TLP_SCOPE PlanarConMap *computePlanarConMap(Graph *graph);
61 PlanarConMap(Graph *s);
67 void clear()
override;
87 edge addEdgeMap(
const node v,
const node w, Face f,
const edge e1,
const edge e2,
88 Face new_face = Face());
96 Face splitFace(Face,
const node,
const node, node = node());
102 Face splitFace(Face,
const edge);
108 void mergeFaces(Face f, Face g);
115 Iterator<Face> *getFaces();
117 Iterator<Face> *getFacesAdj(
const node);
119 Iterator<node> *getFaceNodes(
const Face);
121 Iterator<edge> *getFaceEdges(
const Face);
127 edge succCycleEdge(
const edge,
const node)
const;
129 edge predCycleEdge(
const edge,
const node)
const;
131 node succCycleNode(
const node,
const node)
const;
133 node predCycleNode(
const node,
const node)
const;
136 unsigned int nbFaces();
138 unsigned int nbFacesNodes(
const Face);
140 unsigned int nbFacesEdges(
const Face);
143 bool containNode(
const Face,
const node);
145 bool containEdge(
const Face,
const edge);
150 Face getFaceContaining(
const node,
const node);
152 Face sameFace(
const node,
const node);
164 void delEdgeMap(edge, Face = Face());
166 typedef tlp_hash_map<Face, std::vector<edge>> faceMap;
167 typedef faceMap::value_type faceMapEntry;
168 typedef tlp_hash_map<edge, std::vector<Face>> edgeMap;
169 typedef edgeMap::value_type edgeMapEntry;
170 typedef tlp_hash_map<node, std::vector<Face>> nodeMap;
171 typedef nodeMap::value_type nodeMapEntry;
177 mutable std::vector<Face> faces;
184 TLP_SCOPE PlanarConMap *computePlanarConMap(Graph *graph);
188 TLP_SCOPE std::ostream &
operator<<(std::ostream &, tlp::PlanarConMap *);
std::ostream & operator<<(std::ostream &os, const Array< T, N > &array)
operator << stream operator to easily print an array, or save it to a file.