Home | Documentation | Download | Platforms | Projects | Mailing Lists | Version History

- Main Page
- Classes
- Files
- Related Pages

# embedding.h

    00001 //==========================================================================
    00002 //
    00003 //   embedding.h
    00004 //
    00005 //==========================================================================
    00006 // $Id: embedding.h,v 1.20 2003/06/11 11:28:21 raitner Exp $
    00007
    00008 #ifndef __EMBEDDING__H
    00009 #define __EMBEDDING__H
    00010
    00011 #include <GTL/GTL.h>
    00012 #include <GTL/graph.h>
    00013 #include <GTL/st_number.h>
    00014 #include <GTL/symlist.h>
    00015
    00016 __GTL_BEGIN_NAMESPACE
    00017
    00028 class GTL_EXTERN planar_embedding
    00029 {
    00030 public:
    00034     typedef symlist<edge> adj_list;
    00035
    00039     typedef symlist<edge>::iterator iterator;
    00040 private:
    00047     planar_embedding() : G(0)
    00048     {
    00049     }
    00050 public:
    00057     planar_embedding(const planar_embedding& em);
    00058
    00063     virtual ~planar_embedding()
    00064     {
    00065     }
    00066
    00076     planar_embedding& operator=(const planar_embedding& em);
    00077 private:
    00084     void init(graph& G);
    00085
    00092     void turn(node n);
    00093
    00103     iterator push_back(node n, edge e);
    00104
    00114     iterator push_front(node n, edge e);
    00115
    00122     void insert_selfloop (edge e);
    00123
    00133     iterator& pos (node, edge);
    00134 public:
    00143     adj_list& adjacency(node n)
    00144     {
    00145         return adj[n];
    00146     }
    00147
    00156     const adj_list& adjacency(node n) const
    00157     {
    00158         return adj[n];
    00159     }
    00160
    00169     iterator adj_edges_begin(node n)
    00170     {
    00171         return adj[n].begin();
    00172     }
    00173
    00182     iterator adj_edges_end(node n)
    00183     {
    00184         return adj[n].end();
    00185     }
    00186
    00197     edge cyclic_next(node n, edge e);
    00198
    00209     edge cyclic_prev(node n, edge e);
    00210
    00211
    00220     void write_st(ostream& os, st_number& st);
    00221
    00229     list<edge>& selfloops()
    00230     {
    00231         return self;
    00232     }
    00233
    00241     const list<edge>& selfloops() const
    00242     {
    00243         return self;
    00244     }
    00245
    00256     list<edge>& multiple_edges()
    00257     {
    00258         return multi;
    00259     }
    00260
    00271     const list<edge>& multiple_edges() const
    00272     {
    00273         return multi;
    00274     }
    00275
    00286     bool check();
    00287
    00291     friend class planarity;
    00292
    00296     friend class pq_tree;
    00297
    00301     GTL_EXTERN friend ostream& operator<< (ostream&, planar_embedding&);
    00302 private:
    00307     graph* G;
    00308
    00313     node_map<adj_list> adj;
    00314
    00319     edge_map<adj_list::iterator> s_pos;
    00320
    00325     edge_map<adj_list::iterator> t_pos;
    00326
    00331     list<edge> self;
    00332
    00337     list<edge> multi;
    00338 };
    00339
    00340
    00341 // class face
    00342 // {
    00343 // public:
    00344 //     face (planar_embedding& em, node n, edge e) : embed (em),
    00345 //      start (n), first (e) { }
    00346 //     virtual ~face () { }
    00347
    00348 // private:
    00349 //     planar_embedding& embed;
    00350 //     node start;
    00351 //     edge first;
    00352
    00353 //     friend class planar_embedding;
    00354 // };
    00355
    00356 // struct _face_iterator
    00357 // {
    00358
    00359
    00360 //     face& _face;
    00361 // };
    00362
    00363 __GTL_END_NAMESPACE
    00364
    00365 #endif
    00366
    00367 //--------------------------------------------------------------------------
    00368 //   end of file
    00369 //--------------------------------------------------------------------------

University of Passau - FMI - Theoretical Computer Science

Design © 2002, 2003 Marcus Raitner, University of Passau