33 #ifdef OGDF_INCLUDE_CGAL
46 class OGDFFaceWrapper {
50 std::shared_ptr<CombinatorialEmbedding> m_ce;
51 std::vector<unsigned int> is_on_flag;
52 std::vector<Node> nodes;
54 OGDFFaceWrapper() : m_ce(new CombinatorialEmbedding()) { }
56 CombinatorialEmbedding& get_combinatorial_embedding() {
return *m_ce; }
58 void set_face(
adjEntry external_entry) {
59 set_face(get_combinatorial_embedding().leftFace(external_entry));
62 void set_face(
face _face) {
63 is_on_flag.assign(m_ce->getGraph().maxNodeIndex() + 1,
false);
67 for_all_nodes([&](
const Node v) {
68 is_on_flag[v->index()] = c++;
73 face ogdf_face() {
return m_face; }
75 adjEntry first_adj() {
return m_face->firstAdj(); }
77 std::vector<Node>::iterator
begin() {
return nodes.begin(); }
79 std::vector<Node>::const_iterator
begin()
const {
return nodes.cbegin(); }
81 std::vector<Node>::iterator
end() {
return nodes.end(); }
83 std::vector<Node>::const_iterator
end()
const {
return nodes.cend(); }
85 template<
typename Handler>
86 void for_all_nodes(Handler&& handler)
const {
87 adjEntry current = m_face->firstAdj();
89 handler(current->theNode());
90 current = current->faceCycleSucc();
92 }
while (current != m_face->firstAdj());
95 bool has_on(Node v)
const {
return is_on_flag[v->index()]; }
97 unsigned int ordering_number(Node v)
const {
return is_on_flag[v->index()]; }
99 size_t number_of_nodes()
const {
return nodes.size(); }