21 #ifndef Tulip_PlanarConMap_H 22 #define Tulip_PlanarConMap_H 25 #include <unordered_map> 27 #include <tulip/Face.h> 28 #include <tulip/GraphDecorator.h> 46 class TLP_SCOPE PlanarConMap :
public GraphDecorator {
49 friend class FaceIteratorTest;
50 friend class PlanarConMapTest;
52 friend class FaceIterator;
53 friend class FaceAdjIterator;
54 friend class NodeFaceIterator;
55 friend class EdgeFaceIterator;
57 friend TLP_SCOPE PlanarConMap *computePlanarConMap(Graph *graph);
63 PlanarConMap(Graph *s);
69 void clear()
override;
89 edge addEdgeMap(
const node v,
const node w, Face f,
const edge e1,
const edge e2,
90 Face new_face = Face());
98 Face splitFace(Face,
const node,
const node, node = node());
104 Face splitFace(Face,
const edge);
110 void mergeFaces(Face f, Face g);
117 Iterator<Face> *getFaces();
119 Iterator<Face> *getFacesAdj(
const node);
121 Iterator<node> *getFaceNodes(
const Face);
123 Iterator<edge> *getFaceEdges(
const Face);
129 edge succCycleEdge(
const edge,
const node)
const;
131 edge predCycleEdge(
const edge,
const node)
const;
133 node succCycleNode(
const node,
const node)
const;
135 node predCycleNode(
const node,
const node)
const;
138 unsigned int nbFaces();
140 unsigned int nbFacesNodes(
const Face);
142 unsigned int nbFacesEdges(
const Face);
145 bool containNode(
const Face,
const node);
147 bool containEdge(
const Face,
const edge);
152 Face getFaceContaining(
const node,
const node);
154 Face sameFace(
const node,
const node);
166 void delEdgeMap(edge, Face = Face());
168 typedef std::unordered_map<Face, std::vector<edge>> faceMap;
169 typedef faceMap::value_type faceMapEntry;
170 typedef std::unordered_map<edge, std::vector<Face>> edgeMap;
171 typedef edgeMap::value_type edgeMapEntry;
172 typedef std::unordered_map<node, std::vector<Face>> nodeMap;
173 typedef nodeMap::value_type nodeMapEntry;
179 mutable std::vector<Face> faces;
186 TLP_SCOPE PlanarConMap *computePlanarConMap(Graph *graph);
190 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.