Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55069 - in sandbox/SOC/2007/visualization/boost/svg_plot: . detail
From: pbristow_at_[hidden]
Date: 2009-07-21 12:52:38


Author: pbristow
Date: 2009-07-21 12:52:37 EDT (Tue, 21 Jul 2009)
New Revision: 55069
URL: http://svn.boost.org/trac/boost/changeset/55069

Log:
several names changes, but fails to compile because of trouble with text_style in settings fonts family for ticks values.
Text files modified:
   sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp | 74 +++++++++++++++++++++++++++++----------
   sandbox/SOC/2007/visualization/boost/svg_plot/detail/svg_style_detail.hpp | 10 ++--
   sandbox/SOC/2007/visualization/boost/svg_plot/show_1d_settings.hpp | 2
   sandbox/SOC/2007/visualization/boost/svg_plot/show_2d_settings.hpp | 17 +++++---
   sandbox/SOC/2007/visualization/boost/svg_plot/svg_2d_plot.hpp | 56 +++++++++++++++--------------
   sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp | 6 ++-
   6 files changed, 103 insertions(+), 62 deletions(-)

Modified: sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp 2009-07-21 12:52:37 EDT (Tue, 21 Jul 2009)
@@ -410,7 +410,7 @@
               { // External to plot window style bottom or top.
                 // Always want all values including "0", if labeling external to plot window.
                 // x_ticks_.ticks_on_window_or_axis_ == true != 0
- derived().image.g(detail::PLOT_X_TICK_VALUE_LABELS).text(
+ derived().image.g(detail::PLOT_X_TICKS_VALUES).text(
                   x,
                   y,
                   label.str(), derived().x_value_label_style_, alignment, derived().x_ticks_.label_rotation_);
@@ -419,7 +419,7 @@
               {
                 if ((value != 0) && derived().x_axis_.axis_line_on_)
                 { // Avoid a "0" below the X-axis if it would be cut through by any internal vertical Y-axis line.
- derived().image.g(detail::PLOT_X_TICK_VALUE_LABELS).text(
+ derived().image.g(detail::PLOT_X_TICKS_VALUES).text(
                     x,
                     y,
                     label.str(),
@@ -1493,7 +1493,7 @@
             derived().image.g(PLOT_X_MINOR_TICKS).clear();
             derived().image.g(PLOT_X_MAJOR_TICKS).clear();
             derived().image.g(PLOT_X_LABEL).clear();
- derived().image.g(PLOT_X_TICK_VALUE_LABELS).clear();
+ derived().image.g(PLOT_X_TICKS_VALUES).clear();
           }
 
           void clear_y_axis()
@@ -1648,14 +1648,18 @@
           const std::string& x_label_font_family();
           Derived& x_axis_label_color(const svg_color& col);
           svg_color x_axis_label_color();
- // X-axis label values style.
- Derived& x_axis_values_color(const svg_color& col);
- svg_color x_axis_values_color();
-
- Derived& x_axis_values_precision(int p);
- int x_axis_values_precision();
- Derived& x_axis_values_ioflags(std::ios_base::fmtflags f);
- std::ios_base::fmtflags x_axis_values_ioflags();
+ // X-axis ticks values label style.
+ Derived& x_ticks_values_color(const svg_color& col);
+ svg_color x_ticks_values_color();
+ Derived& x_ticks_values_precision(int p);
+ int x_ticks_values_precision();
+ Derived& x_ticks_values_ioflags(std::ios_base::fmtflags f);
+ std::ios_base::fmtflags x_ticks_values_ioflags();
+
+ Derived& x_ticks_values_font_family(const std::string& family);
+ const std::string& x_ticks_values_font_family();
+ Derived& x_ticks_values_font_size(unsigned int i);
+ unsigned int x_ticks_values_font_size();
 
           Derived& x_ticks_on_window_or_axis(int cmd);
           int x_ticks_on_window_or_axis();
@@ -2702,10 +2706,10 @@
 
           // X-axis tick label style.
           template <class Derived>
- Derived& axis_plot_frame<Derived>::x_axis_values_color(const svg_color& col)
+ Derived& axis_plot_frame<Derived>::x_ticks_values_color(const svg_color& col)
           { //! Set X axis tick value label color.
             // Set BOTH stroke and fill to the same color.
- derived().image.g(detail::PLOT_X_TICK_VALUE_LABELS).style().fill_color(col);
+ derived().image.g(detail::PLOT_X_TICKS_VALUES).style().fill_color(col);
             //derived().image.g(detail::PLOT_X_TICK_VALUE_LABELS).style().stroke_color(col);
             // Setting the stroke color produces fuzzy characters :-(
             //derived().x_ticks_.color_ = col;
@@ -2713,29 +2717,29 @@
           }
 
           template <class Derived>
- svg_color axis_plot_frame<Derived>::x_axis_values_color()
- { //! \return X axis tick value label color.
+ svg_color axis_plot_frame<Derived>::x_ticks_values_color()
+ { //! \return X-axis ticks value label color.
             // But only return the fill color.
- return derived().image.g(detail::PLOT_X_TICK_VALUE_LABELS).style().fill_color();
+ return derived().image.g(detail::PLOT_X_TICKS_VALUES).style().fill_color();
             //return x_ticks_.color_ ;
           }
 
           // ticks_labels_style x_ticks
           template <class Derived>
- Derived& axis_plot_frame<Derived>::x_axis_values_precision(int p)
+ Derived& axis_plot_frame<Derived>::x_ticks_values_precision(int p)
           { //! Set iostream decimal digits precision of data point X values near data points markers.
             derived().x_ticks_.value_precision_ = p;
             return derived();
           }
 
           template <class Derived>
- int axis_plot_frame<Derived>::x_axis_values_precision()
+ int axis_plot_frame<Derived>::x_ticks_values_precision()
           { //! \return iostream decimal digits precision of data point X values near data points markers.
             return derived().x_ticks_.value_precision_;
           }
 
           template <class Derived>
- Derived& axis_plot_frame<Derived>::x_axis_values_ioflags(std::ios_base::fmtflags f)
+ Derived& axis_plot_frame<Derived>::x_ticks_values_ioflags(std::ios_base::fmtflags f)
           { //! Set iostream format flags of data point X values near data points markers.
             //! Useful to set hexadecimal, fixed and scientific, (std::ios::scientific).
             derived().x_ticks_.value_ioflags_ = f;
@@ -2743,7 +2747,7 @@
           }
 
           template <class Derived>
- std::ios_base::fmtflags axis_plot_frame<Derived>::x_axis_values_ioflags()
+ std::ios_base::fmtflags axis_plot_frame<Derived>::x_ticks_values_ioflags()
           { //! \return iostream format flags of data point X values near data points markers.
             //! Might be used to set hexadecimal, fixed and scientific, (std::ios::scientific).
             return derived().x_ticks_.value_ioflags_;
@@ -2751,6 +2755,36 @@
 
 
 
+ template <class Derived>
+ Derived& axis_plot_frame<Derived>::x_ticks_values_font_size(unsigned int i)
+ { //! Set X tick value label font size (svg units, default pixels).
+ derived().x_ticks_.value_label_style_.font_size(i);
+ return derived();
+ }
+
+ template <class Derived>
+ unsigned int axis_plot_frame<Derived>::x_ticks_values_font_size()
+ { //! \return X tick value label font size (svg units, default pixels).
+ return derived().x_ticks_.value_label_style_.font_size();
+ }
+
+ template <class Derived>
+ Derived& axis_plot_frame<Derived>::x_ticks_values_font_family(const std::string& family)
+ { //! Set X tick value label font family.
+
+
+ derived().x_ticks_.value_label_style_.font_family(family);
+ return derived();
+ }
+
+ template <class Derived>
+ const std::string& axis_plot_frame<Derived>::x_ticks_values_font_family()
+ { //! \return X tick value label font family.
+ return derived().x_ticks_.value_label_style_.font_family();
+ }
+
+
+
 
           template <class Derived>
           Derived& axis_plot_frame<Derived>::x_ticks_on_window_or_axis(int cmd)

Modified: sandbox/SOC/2007/visualization/boost/svg_plot/detail/svg_style_detail.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/detail/svg_style_detail.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/detail/svg_style_detail.hpp 2009-07-21 12:52:37 EDT (Tue, 21 Jul 2009)
@@ -1,7 +1,7 @@
 /*! \file svg_style_detail.hpp
     \brief Plot document structure whose order controls the painting order,
     later layers overwriting earlier layers.
-
+ \date Jul 2009
     \author Jacob Voytko and Paul A. Bristow
 */
 
@@ -48,8 +48,8 @@
     PLOT_X_MINOR_TICKS, //! X minor ticks
     PLOT_Y_MAJOR_TICKS, //! Y major ticks.
     PLOT_X_MAJOR_TICKS, //! X major ticks.
- PLOT_X_TICK_VALUE_LABELS, //! X-axis tick values labels, for example 10, 20, 30 ...
- PLOT_Y_TICK_VALUE_LABELS, //! Y-axis tick values labels, for example 1, 2, 3 ...
+ PLOT_X_TICKS_VALUES, //! X-axis tick values labels, for example 10, 20, 30 ...
+ PLOT_Y_TICKS_VALUES, //! Y-axis tick values labels, for example 1, 2, 3 ...
     PLOT_Y_LABEL, //! Y axis text labels "length (cm)".
     PLOT_X_LABEL, //! X axis text labels "height (m)".
     PLOT_DATA_LINES, //! Lines joining data points.
@@ -83,8 +83,8 @@
     "xMinorTicks",
     "yMajorTicks",
     "xMajorTicks",
- "xTicksValueLabels", //! X-axis tick values labels, for example 10, 20, 30 ...
- "yTicksValueLabels", //! Y-axis tick values labels, for example 1, 2, 3 ...
+ "xTicksValues", //! X-axis tick values labels, for example 10, 20, 30 ...
+ "yTicksValues", //! Y-axis tick values labels, for example 1, 2, 3 ...
     "yLabel",
     "xLabel", // axis text labels "length (cm)"
     "plotLines", // normal data point markers.

Modified: sandbox/SOC/2007/visualization/boost/svg_plot/show_1d_settings.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/show_1d_settings.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/show_1d_settings.hpp 2009-07-21 12:52:37 EDT (Tue, 21 Jul 2009)
@@ -262,7 +262,7 @@
   cout << "x_axis_on " << plot.x_axis_on() << endl;
   cout << "x_axis_color() " << plot.x_axis_color() << endl;
   cout << "x_axis_label_color " << plot.x_axis_label_color() << endl;
- cout << "x_axis_value_color " << plot.x_axis_value_color() << endl;
+ cout << "x_values_color " << plot.x_values_color() << endl;
   cout << "x_axis_width " << plot.x_axis_width() << endl;
   cout << "x_label_on " << plot.x_label_on() << endl;
   cout << "x_label " << plot.x_label() << endl;

Modified: sandbox/SOC/2007/visualization/boost/svg_plot/show_2d_settings.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/show_2d_settings.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/show_2d_settings.hpp 2009-07-21 12:52:37 EDT (Tue, 21 Jul 2009)
@@ -193,13 +193,16 @@
   cout << "x_values_on " << plot.x_values_on() << endl;
   cout << "x_values_font_size " << plot.x_values_font_size() << endl;
   cout << "x_values_font_family " << plot.x_values_font_family() << endl;
-
- cout << "x_value_precision " << plot.x_value_precision() << endl;
- cout << "x_value_ioflags " << hex << plot.x_value_ioflags() << dec << ' ';
+ cout << "x_values_precision " << plot.x_values_precision() << endl;
+ cout << "x_values_ioflags " << hex << plot.x_values_ioflags() << dec << ' ';
   outFmtFlags(plot.x_value_ioflags(), cout, ".\n");
- cout << "y_value_precision " << plot.y_value_precision() << endl;
- cout << "y_value_ioflags " << hex << plot.y_value_ioflags() << dec << ' ';
- outFmtFlags(plot.y_value_ioflags(), cout, ".\n");
+ cout << "y_values_precision " << plot.y_values_precision() << endl;
+ cout << "y_values_font_size() " << plot.y_value_precision() << endl; // duplicate????
+ cout << "y_values_ioflags " << hex << plot.y_values_ioflags() << dec << ' ';
+ outFmtFlags(plot.y_values_ioflags(), cout, ".\n");
+ cout << "y_values_color " << plot.y_values_color() << endl;
+ cout << "y_values_font_family() " << plot.y_values_font_family() << endl;
+ cout << "y_values_font_size() " << plot.y_values_font_size() << endl;
 
   cout << "x_max " << plot.x_max() << endl;
   cout << "x_min " << plot.x_min() << endl;
@@ -210,7 +213,7 @@
   cout << "x_axis_on " << plot.x_axis_on() << endl;
   cout << "x_axis_color() " << plot.x_axis_color() << endl;
   cout << "x_axis_label_color " << plot.x_axis_label_color() << endl;
- cout << "x_axis_value_color " << plot.x_axis_value_color() << endl;
+ cout << "x_values_color " << plot.x_values_color() << endl;
   cout << "x_axis_width " << plot.x_axis_width() << endl;
   cout << "x_label_on " << plot.x_label_on() << endl;
   cout << "x_label " << plot.x_label() << endl;

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 2009-07-21 12:52:37 EDT (Tue, 21 Jul 2009)
@@ -1263,7 +1263,7 @@
           { // External to plot window style left or right.
             // Always want all values including "0", if labeling external to plot window.
             // y_ticks_.ticks_on_window_or_axis_ == true != 0
- image.g(detail::PLOT_Y_TICK_VALUE_LABELS).text(
+ image.g(detail::PLOT_Y_TICKS_VALUES).text(
               x,
               y,
               label.str(), y_value_label_style_, alignment, y_ticks_.label_rotation_);
@@ -1272,7 +1272,7 @@
           { // ! y_ticks_.y_ticks_on_plot_window_ == 0 'Internal' - value labels either side of vertical Y-axis.
             if ((value != 0) && y_axis_.axis_line_on_)
             { // Avoid a zero ON the Y-axis if it would be cut through by any horizontal X-axis line.
- image.g(detail::PLOT_Y_TICK_VALUE_LABELS).text(
+ image.g(detail::PLOT_Y_TICKS_VALUES).text(
                 x,
                 y,
                 label.str(),
@@ -1979,14 +1979,14 @@
       svg_2d_plot& y_label_font_family(const std::string& family);
       const std::string& y_label_font_family();
 
- svg_2d_plot& y_axis_values_color(const svg_color& col);
- svg_color y_axis_values_color();
+ svg_2d_plot& y_ticks_values_color(const svg_color& col);
+ svg_color y_ticks_values_color();
 
- svg_2d_plot& y_axis_values_precision(int p);
- int y_axis_values_precision();
+ svg_2d_plot& y_ticks_values_precision(int p);
+ int y_ticks_values_precision();
 
- svg_2d_plot& y_axis_values_ioflags(std::ios_base::fmtflags f);
- std::ios_base::fmtflags y_axis_values_ioflags();
+ svg_2d_plot& y_ticks_values_ioflags(std::ios_base::fmtflags f);
+ std::ios_base::fmtflags y_ticks_values_ioflags();
 
       svg_2d_plot& y_values_font_size(unsigned int i);
       unsigned int y_values_font_size();
@@ -2152,14 +2152,15 @@
 
       svg_2d_plot& svg_2d_plot::y_axis_label_color(const svg_color& col)
       { //! Set stroke color.
- image.g(detail::PLOT_Y_TICK_VALUE_LABELS).style().stroke_color(col);
+ // Setting the stroke color produces fuzzy characters :-(
+ image.g(detail::PLOT_Y_LABEL).style().fill_color(col);
         return *this; //! \return reference to svg_2d_plot to make chainable.
       }
 
       svg_color svg_2d_plot::y_axis_label_color()
       { //! \return the y axis label stroke color.
         // y_label_info_.style().stroke_color();
- return image.g(detail::PLOT_Y_TICK_VALUE_LABELS).style().stroke_color();
+ return image.g(detail::PLOT_Y_LABEL).style().fill_color();
       }
 
       svg_2d_plot& svg_2d_plot::y_label_units_on(bool b)
@@ -2176,14 +2177,14 @@
 
       svg_2d_plot& svg_2d_plot::y_axis_value_color(const svg_color& col)
       { //! Set color of Y axis value labels.
- image.g(detail::PLOT_Y_TICK_VALUE_LABELS).style().stroke_color(col);
+ image.g(detail::PLOT_Y_TICKS_VALUES).style().stroke_color(col);
         return *this; //! \return reference to svg_2d_plot to make chainable.
       }
 
       svg_color svg_2d_plot::y_axis_value_color()
       { //! \return color of Y-axis tick value labels.
         // Only return the stroke color.
- return image.g(detail::PLOT_Y_TICK_VALUE_LABELS).style().stroke_color();
+ return image.g(detail::PLOT_Y_TICKS_VALUES).style().stroke_color();
       }
 
       svg_2d_plot& svg_2d_plot::y_label_width(double width)
@@ -2713,45 +2714,46 @@
 
       // Y-axis tick value labels style.
 
- svg_2d_plot& svg_2d_plot::y_axis_values_color(const svg_color& col)
+ svg_2d_plot& svg_2d_plot::y_ticks_values_color(const svg_color& col)
       { //! Set color for Y_axis tick values.
         // Function could set both fill (middle) and stroke (outside),
         // but just setting fill if simplest,
         // but does not allow separate inside & outside colors.
         y_ticks_.values_color_ = col;
- //image.g(detail::PLOT_Y_POINT_VALUES).style().fill_color(col);
+ image.g(detail::PLOT_Y_TICKS_VALUES).style().fill_color(col);
+ // Setting stroke seems to produce fuzzy letters.
         //svg_2d_plot().image.g(PLOT_Y_POINT_VALUES).style().stroke_color(col);
         return *this; //! \return reference to svg_2d_plot to make chainable.
       }
 
- svg_color svg_2d_plot::y_axis_values_color()
- { //! \return color for Y-axis tick values.
- // Function could get either fill and stroke,
- // return svg_2d_plot().image.g(PLOT_Y_POINT_VALUES).style().stroke_color();
- // return image.g(detail::PLOT_Y_POINT_VALUES).style().fill_color();
+ svg_color svg_2d_plot::y_ticks_values_color()
+ { //! \return color for Y-axis ticks values.
+ // Function could greturn either fill and stroke,
+ // image.g(detail::PLOT_Y_TICKS_VALUES).style().fill_color();
         return y_ticks_.values_color_;
       }
 
- svg_2d_plot& svg_2d_plot::y_axis_values_precision(int p)
- { //! Set iostream decimal digits precision of data point Y values near data points markers.
+ // Y values
+ svg_2d_plot& svg_2d_plot::y_ticks_values_precision(int p)
+ { //! Set iostream decimal digits precision of ticks Y values.
          y_ticks_.value_precision_ = p;
          return *this;
       }
 
- int svg_2d_plot::y_axis_values_precision()
- { //! \return iostream decimal digits precision of data point Y values near data points markers.
+ int svg_2d_plot::y_ticks_values_precision()
+ { //! \return iostream decimal digits precision of ticks Y values..
         return y_ticks_.value_precision_;
       }
 
- svg_2d_plot& svg_2d_plot::y_axis_values_ioflags(std::ios_base::fmtflags f)
- { //! Set iostream format flags of data point Y values near data points markers.
+ svg_2d_plot& svg_2d_plot::y_ticks_values_ioflags(std::ios_base::fmtflags f)
+ { //! Set iostream format flags of ticks Y values.
         //! Useful to set hexadecimal, fixed and scientific, (std::ios::scientific).
         y_ticks_.value_ioflags_ = f;
         return *this;
       }
 
- std::ios_base::fmtflags svg_2d_plot::y_axis_values_ioflags()
- { //! \return iostream format flags of data point X values near data points markers.
+ std::ios_base::fmtflags svg_2d_plot::y_ticks_values_ioflags()
+ { //! \return iostream format flags of ticks Y values.
         //! Might be used to set hexadecimal, fixed and scientific, (std::ios::scientific).
         return y_ticks_.value_ioflags_;
       }

Modified: sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp 2009-07-21 12:52:37 EDT (Tue, 21 Jul 2009)
@@ -304,7 +304,8 @@
   friend bool operator== (const text_style&, const text_style&);
   friend bool operator!= (const text_style&, const text_style&);
 
-private:
+//protected:
+public:
   int font_size_; //!< Font size (SVG units, default pixels).
   std::string font_family_; //!< Font family, examples: "Arial", "Times New Roman", "Verdana", "Lucida Sans Unicode".
   std::string weight_; //!< Font style, examples: "bold", "normal".
@@ -1112,6 +1113,7 @@
     bool major_grid_on_; //!< Draw X grid at major ticks.
     bool minor_grid_on_; //!< Draw X grid at minor ticks.
     svg_color values_color_; //!< Color of tick values labels.
+ // (just fill_color for now (stroke makes characters fuzzy.)
     int value_precision_; //!< Precision for tick value labels, usually 3 will suffice.
     std::ios_base::fmtflags value_ioflags_; //!< IO formatting flags for the axis default std::ios::dec.
     bool strip_e0s_; //!< If redundant zero, + and e are to be stripped.
@@ -1123,7 +1125,7 @@
     // For X-axis -1 = bottom, 0 = false, +1 = top. Default -1 below bottom of plot window.
     const text_style& value_label_style_; //!< text style (font, size...) for value labels.
 
- ticks_labels_style( //! Constructor, providng defaults values for all member data.
+ ticks_labels_style( //! Constructor, providing defaults values for all member data.
       dim d = X,
       const text_style& style = no_style, // Default style.
       double max = 10., double min = -10.,


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