lemon/bits/clearable_graph_extender.h
author alpar
Mon, 30 Jan 2006 09:37:41 +0000
changeset 1930 92b70deed0c5
parent 1909 2d806130e700
child 1956 a055123339d5
permissions -rw-r--r--
Solve bug #23: Floating versus Integer Coordinates

- BoundingBox values rounds to integer
- The generated .eps rescales if the bounding box were too small otherwise.
klao@946
     1
// -*- c++ -*-
klao@946
     2
klao@946
     3
#ifndef LEMON_CLEARABLE_GRAPH_EXTENDER_H
klao@946
     4
#define LEMON_CLEARABLE_GRAPH_EXTENDER_H
klao@946
     5
klao@946
     6
#include <lemon/invalid.h>
klao@946
     7
klao@946
     8
klao@946
     9
namespace lemon {
klao@946
    10
klao@946
    11
  template <typename _Base> 
klao@946
    12
  class ClearableGraphExtender : public _Base {
klao@946
    13
  public:
klao@946
    14
klao@946
    15
    typedef ClearableGraphExtender Graph;
klao@946
    16
    typedef _Base Parent;
deba@980
    17
    typedef typename Parent::Node Node;
deba@980
    18
    typedef typename Parent::Edge Edge;
klao@946
    19
klao@946
    20
    void clear() {
deba@1039
    21
      Parent::getNotifier(Node()).clear();
deba@1039
    22
      Parent::getNotifier(Edge()).clear();
klao@946
    23
      Parent::clear();
klao@946
    24
    }
klao@946
    25
klao@946
    26
  };
klao@946
    27
klao@1022
    28
  template <typename _Base> 
deba@1842
    29
  class ClearableEdgeSetExtender : public _Base {
deba@1842
    30
  public:
deba@1842
    31
deba@1842
    32
    typedef ClearableEdgeSetExtender Graph;
deba@1842
    33
    typedef _Base Parent;
deba@1842
    34
    typedef typename Parent::Node Node;
deba@1842
    35
    typedef typename Parent::Edge Edge;
deba@1842
    36
deba@1842
    37
    void clear() {
deba@1842
    38
      Parent::getNotifier(Edge()).clear();
deba@1842
    39
      Parent::clear();
deba@1842
    40
    }
deba@1842
    41
deba@1842
    42
  };
deba@1842
    43
deba@1842
    44
  template <typename _Base> 
klao@1909
    45
  class ClearableUGraphExtender : public _Base {
klao@1022
    46
  public:
klao@1022
    47
klao@1909
    48
    typedef ClearableUGraphExtender Graph;
klao@1022
    49
    typedef _Base Parent;
klao@1022
    50
    typedef typename Parent::Node Node;
klao@1909
    51
    typedef typename Parent::UEdge UEdge;
klao@1022
    52
    typedef typename Parent::Edge Edge;
klao@1022
    53
klao@1022
    54
    void clear() {
deba@1039
    55
      Parent::getNotifier(Node()).clear();
klao@1909
    56
      Parent::getNotifier(UEdge()).clear();
deba@1039
    57
      Parent::getNotifier(Edge()).clear();
klao@1022
    58
      Parent::clear();
klao@1022
    59
    }
deba@1842
    60
  };
deba@1842
    61
deba@1842
    62
  template <typename _Base> 
klao@1909
    63
  class ClearableUEdgeSetExtender : public _Base {
deba@1842
    64
  public:
deba@1842
    65
klao@1909
    66
    typedef ClearableUEdgeSetExtender Graph;
deba@1842
    67
    typedef _Base Parent;
deba@1842
    68
    typedef typename Parent::Node Node;
klao@1909
    69
    typedef typename Parent::UEdge UEdge;
deba@1842
    70
    typedef typename Parent::Edge Edge;
deba@1842
    71
deba@1842
    72
    void clear() {
klao@1909
    73
      Parent::getNotifier(UEdge()).clear();
deba@1842
    74
      Parent::getNotifier(Edge()).clear();
deba@1842
    75
      Parent::clear();
deba@1842
    76
    }
klao@1022
    77
klao@1022
    78
  };
klao@1022
    79
deba@1820
    80
deba@1820
    81
  template <typename _Base>
deba@1910
    82
  class ClearableBpUGraphExtender : public _Base {
deba@1820
    83
  public:
deba@1820
    84
deba@1820
    85
    typedef _Base Parent;
deba@1910
    86
    typedef ClearableBpUGraphExtender Graph;
deba@1820
    87
deba@1820
    88
    typedef typename Parent::Node Node;
deba@1910
    89
    typedef typename Parent::BNode BNode;
deba@1910
    90
    typedef typename Parent::ANode ANode;
deba@1820
    91
    typedef typename Parent::Edge Edge;
klao@1909
    92
    typedef typename Parent::UEdge UEdge;
deba@1820
    93
deba@1820
    94
    void clear() {
deba@1820
    95
      Parent::getNotifier(Edge()).clear();
klao@1909
    96
      Parent::getNotifier(UEdge()).clear();
deba@1820
    97
      Parent::getNotifier(Node()).clear();
deba@1910
    98
      Parent::getNotifier(BNode()).clear();
deba@1910
    99
      Parent::getNotifier(ANode()).clear();
deba@1820
   100
      Parent::clear();
deba@1820
   101
    }
deba@1820
   102
deba@1820
   103
  };
deba@1820
   104
klao@946
   105
}
klao@946
   106
klao@946
   107
#endif