From 6197b0dc80c4f87000d26213293fe2cb72fbe081 Mon Sep 17 00:00:00 2001 From: Tim Moore Date: Tue, 1 Dec 2009 19:05:09 +0100 Subject: Refactor drawing of different styles of graph into classes * grapher/GraphStyle.cxx: New file * grapher/GraphStyle.hxx: New file * grapher/Graph(draw): Move much drawing code to GraphStyle::draw --- grapher/StapParser.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'grapher/StapParser.cxx') diff --git a/grapher/StapParser.cxx b/grapher/StapParser.cxx index ddc14b2d..af5f2d7d 100644 --- a/grapher/StapParser.cxx +++ b/grapher/StapParser.cxx @@ -102,7 +102,7 @@ vector commaSplit(const boost::sub_range& range) std::tr1::shared_ptr > dataSet(new GraphData); if (style == "dot") - dataSet->style = GraphDataBase::DOT; + dataSet->style = &GraphStyleDot::instance; dataSet->color[0] = (hexColor >> 16) / 255.0; dataSet->color[1] = ((hexColor >> 8) & 0xff) / 255.0; dataSet->color[2] = (hexColor & 0xff) / 255.0; @@ -114,7 +114,7 @@ vector commaSplit(const boost::sub_range& range) { std::tr1::shared_ptr > dataSet(new GraphData); - dataSet->style = GraphDataBase::EVENT; + dataSet->style = &GraphStyleEvent::instance; dataSet->color[0] = (hexColor >> 16) / 255.0; dataSet->color[1] = ((hexColor >> 8) & 0xff) / 255.0; dataSet->color[2] = (hexColor & 0xff) / 255.0; -- cgit