Mercurial > projects > doodle
diff doodle/fig/diagram_elements.d @ 58:c63719604adb
Beginnings of creating a rectangle...
author | "David Bryant <bagnose@gmail.com>" |
---|---|
date | Mon, 09 Aug 2010 21:43:24 +0930 |
parents | 30ecedfe2ce2 |
children | 43cc2135ced0 |
line wrap: on
line diff
--- a/doodle/fig/diagram_elements.d Sun Aug 08 22:01:54 2010 +0930 +++ b/doodle/fig/diagram_elements.d Mon Aug 09 21:43:24 2010 +0930 @@ -5,16 +5,21 @@ import doodle.cairo.routines; } +interface IDiagram { + void add(DiagramElement element); +} + abstract class DiagramElement { Rectangle bounds() const; void draw(in Rectangle damage, scope Context cr) const; private { - GraphElement _container; + //GraphElement _container; // FIXME use an interface to the container } } +/* abstract class SemanticModelBridge { }; @@ -26,35 +31,46 @@ } } -final class GraphConnector { +class GraphConnector { } -final class GraphNode : GraphElement { +class GraphNode : GraphElement { } -final class GraphEdge : GraphElement { +class GraphEdge : GraphElement { private { GraphConnector[2] _anchors; } } +*/ abstract class LeafElement : DiagramElement { } -final class TextElement : LeafElement { +/* +class TextElement : LeafElement { } +*/ abstract class GraphicPrimitive : LeafElement { } -final class PolylinePrimitive : GraphicPrimitive { +/* +class PolylinePrimitive : GraphicPrimitive { private { Point[] _waypoints; } } +*/ -final class RectanglePrimitive : GraphicPrimitive { +class RectanglePrimitive : GraphicPrimitive { override void draw(in Rectangle damage, scope Context cr) const { rectangle(cr, bounds); } + + override Rectangle bounds() const { return _bounds; } + + private { + Rectangle _bounds; + } }