Otawa  0.10
AbstractDrawer.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  * AbstractDrawer class interface
4  *
5  * This file is part of OTAWA
6  * Copyright (c) 2007, IRIT UPS.
7  *
8  * OTAWA is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * OTAWA is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with OTAWA; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 #ifndef OTAWA_DISPLAY_ABSTRACT_DRAWER_H
23 #define OTAWA_DISPLAY_ABSTRACT_DRAWER_H
24 
25 #include <elm/io.h>
26 #include <elm/genstruct/FragTable.h>
27 #include <otawa/display/Driver.h>
28 
29 namespace otawa { namespace display {
30 
31 using namespace elm;
32 using namespace elm::genstruct;
33 
34 // AbstractDrawer class
36 public:
37  class Edge;
38 
39  // Vertex class
40  class Vertex {
41  public:
42  Vertex(AbstractDrawer& drawer);
43  virtual ~Vertex(void) { }
45  virtual void configure(Output& out, ShapeStyle& shape);
46 
47  private:
48  friend class Edge;
49  friend class AbstractDrawer;
50  void setup(void);
52  };
53 
54  // Edge class
55  class Edge {
56  public:
57  Edge(AbstractDrawer& drawer, Vertex *source, Vertex *sink);
58  virtual ~Edge(void) { }
61  virtual void configure(Output& label, TextStyle& text, LineStyle& line);
62 
63  private:
64  friend class AbstractDrawer;
65  void setup(void);
67  };
68 
69  // Methods
70  AbstractDrawer(void);
71  AbstractDrawer(Driver& driver);
72  virtual ~AbstractDrawer(void) { }
73  void draw(void);
74  virtual void configure(Output& caption, TextStyle& text, FillStyle& fill);
75 
76  // Configuration
81 
83 
86 
87 private:
91 };
92 
93 } } // otawa::display
94 
95 #endif /* OTAWA_DISPLAY_ABSTRACT_DRAWER_H */
dtd::RefAttr< BasicBlock * > source("source", dtd::STRICT|dtd::REQUIRED)
TextStyle page_text
Definition: AbstractDrawer.h:80
ShapeStyle default_vertex
Definition: AbstractDrawer.h:82
An edge in a AbstractDrawer.
Definition: AbstractDrawer.h:55
TextStyle text
Style of the text publicly accessible for customization.
Definition: AbstractDrawer.h:59
virtual ~Edge(void)
Definition: AbstractDrawer.h:58
virtual ~AbstractDrawer(void)
Definition: AbstractDrawer.h:72
display::Edge * edge
Definition: AbstractDrawer.h:66
LineStyle line
Style of the line publicly accessible for customization.
Definition: AbstractDrawer.h:60
kind_t
Definition: Driver.h:33
kind_t kind
Definition: AbstractDrawer.h:77
The style of a filled area.
Definition: display.h:83
virtual ~Vertex(void)
Definition: AbstractDrawer.h:43
FragTable< Vertex * > vertices
Definition: AbstractDrawer.h:89
A driver provides facilities to display a graph.
Definition: Driver.h:47
FillStyle page_fill
Definition: AbstractDrawer.h:79
Description of the style of text.
Definition: display.h:48
This class represents vertices in the AbstractDrawer.
Definition: AbstractDrawer.h:40
Shape style.
Definition: display.h:98
FragTable< Edge * > edges
Definition: AbstractDrawer.h:90
ShapeStyle shape
Shape of the vertex publicly accessible for customization.
Definition: AbstractDrawer.h:44
LineStyle default_edge_line
Definition: AbstractDrawer.h:84
sys::SystemOutStream & out
Definition: Graph.h:60
Provides facilities to draw a graph.
Definition: AbstractDrawer.h:35
Graph * graph
Definition: AbstractDrawer.h:88
TextStyle default_edge_text
Definition: AbstractDrawer.h:85
Node * node
Definition: AbstractDrawer.h:51
A graph provides facilities to display a graph.
Definition: Graph.h:76
String path
Definition: AbstractDrawer.h:78
Definition: display.h:65
Definition: Graph.h:50