Boost logo

Boost-Commit :

From: JakeVoytko_at_[hidden]
Date: 2007-07-30 23:57:25


Author: jakevoytko
Date: 2007-07-30 23:57:24 EDT (Mon, 30 Jul 2007)
New Revision: 7605
URL: http://svn.boost.org/trac/boost/changeset/7605

Log:
Helped make _area_fill_color and _bezier_on play nice
Text files modified:
   sandbox/SOC/2007/visualization/boost/svg_plot/detail/svg_tag.hpp | 12 +++++++++---
   sandbox/SOC/2007/visualization/boost/svg_plot/svg_2d_plot.hpp | 28 ++++++++++++++++++----------
   sandbox/SOC/2007/visualization/boost/svg_plot/svg_test.cpp | 6 +++---
   3 files changed, 30 insertions(+), 16 deletions(-)

Modified: sandbox/SOC/2007/visualization/boost/svg_plot/detail/svg_tag.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/detail/svg_tag.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/detail/svg_tag.hpp 2007-07-30 23:57:24 EDT (Mon, 30 Jul 2007)
@@ -500,13 +500,14 @@
 private:
     ptr_vector<path_point> path;
 public:
-
+ bool _fill;
+
     path_element(const path_element& rhs)//:path(rhs.path.release())
     {
         path = (const_cast<path_element&>(rhs)).path.release();
     }
 
- path_element() { }
+ path_element(): _fill(true) { }
 
     path_element& m(double x, double y)
     {
@@ -624,7 +625,12 @@
         
         style_info.write(o_str);
 
- o_str<<"fill = \"none\" />";
+ if(!_fill)
+ {
+ o_str << "fill = \"none\"";
+ }
+
+ o_str<<"/>";
     }
 };
 

Modified: sandbox/SOC/2007/visualization/boost/svg_plot/svg_2d_plot.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/svg_2d_plot.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/svg_2d_plot.hpp 2007-07-30 23:57:24 EDT (Mon, 30 Jul 2007)
@@ -59,8 +59,8 @@
 BOOST_PARAMETER_NAME(size)
 #endif
 
-BOOST_PARAMETER_NAME(line_on)
 BOOST_PARAMETER_NAME(bezier_on)
+BOOST_PARAMETER_NAME(line_on)
 BOOST_PARAMETER_NAME(line_color)
 BOOST_PARAMETER_NAME(area_fill_color)
 
@@ -71,7 +71,7 @@
 
     double i;
 
- double start(double _i)
+ double start(double _i)
     {
         i = _i;
     }
@@ -83,9 +83,9 @@
     }
 
     template <class T>
- std::pair<double, double> operator()(T val) const
+ std::pair<double, double> operator()(T a)
     {
- return std::pair<double, double>(i, (double)val);
+ return std::pair<double, double>(i++, (double)a);
     }
 };
 
@@ -460,6 +460,16 @@
         std::pair<double, double> n_minus_2, n_minus_1, n;
         std::pair<double, double> fwd_vtr, back_vtr;
 
+ if(series.line_style.area_fill == blank)
+ {
+ path._fill = false;
+ }
+
+ else
+ {
+ path.style().fill_color(series.line_style.area_fill);
+ }
+
         if(series.series.size() > 2)
         {
             std::multimap<double,double>::const_iterator iter = series.series.begin();
@@ -905,21 +915,18 @@
         (size, (int), 10)
         (line_on, (bool), true)
         (bezier_on, (bool), false)
- (in_out(x_functor), *, boost_default_2d_convert())
+ (x_functor, *, boost_default_2d_convert())
     )
 )
 {
     // This line has the error in GCC. Also, operator() in boost_default_2d_convert
     // has been changed so that the value of i is not updated. I would like
     // the start to be set, as well as i to update in operator().
- x_functor.start(1.);
+ // x_functor.start(1.);
 
     plot_line_style line_style(line_color, line_on, bezier_on);
 
- if(area_fill_color != blank)
- {
- line_style.area_fill=area_fill_color;
- }
+ line_style.area_fill=area_fill_color;
 
     series.push_back(
         svg_2d_plot_series(
@@ -936,6 +943,7 @@
 # pragma warning(pop)
 #endif
 
+
 }
 }
 

Modified: sandbox/SOC/2007/visualization/boost/svg_plot/svg_test.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/svg_test.cpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/svg_test.cpp 2007-07-30 23:57:24 EDT (Mon, 30 Jul 2007)
@@ -82,15 +82,15 @@
            .x_label_on(true)
            .x_label("sqrt(x)");
 
- my_2d_plot.plot(data1, "sqrt(x)", _bezier_on = true, _size = 5);
+ //my_2d_plot.plot(data1, "sqrt(x)", _bezier_on = true, _size = 5);
 
     my_2d_plot.plot(data2, "Not sqrt(x)",
+ _bezier_on = true,
         _size = 6,
         _point_style = square,
         _stroke_color = hotpink,
         _line_color = black,
- _fill_color = yellow,
- _bezier_on = true);
+ _fill_color = yellow);
     
 // my_2d_plot.plot(data3, "1D Plot", _bezier_on = true, _size = 5);
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk