Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51736 - in sandbox/SOC/2007/visualization: boost/svg_plot boost/svg_plot/detail libs/svg_plot/doc
From: pbristow_at_[hidden]
Date: 2009-03-12 13:53:34


Author: pbristow
Date: 2009-03-12 13:53:32 EDT (Thu, 12 Mar 2009)
New Revision: 51736
URL: http://svn.boost.org/trac/boost/changeset/51736

Log:
Added draw_note, but need to change order of parameters?
Text files modified:
   sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp | 32 +++++++++++++++++++++++++++++++-
   sandbox/SOC/2007/visualization/boost/svg_plot/svg_2d_plot.hpp | 7 +++++--
   sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp | 4 ++--
   sandbox/SOC/2007/visualization/libs/svg_plot/doc/Jamfile.v2 | 11 +++++++++--
   sandbox/SOC/2007/visualization/libs/svg_plot/doc/svg_plot.qbk | 5 -----
   5 files changed, 47 insertions(+), 12 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-03-12 13:53:32 EDT (Thu, 12 Mar 2009)
@@ -559,6 +559,7 @@
           derived().image.g(PLOT_TITLE).push_back(new text_element(derived().title_info_));
         } // void draw_title()
 
+
         void size_legend_box()
         { //! Calculate how big the legend box needs to be.
           if(derived().legend_on_ == false)
@@ -1759,6 +1760,7 @@
           svg_color limit_color();
           Derived& limit_fill_color(const svg_color&);
           svg_color limit_fill_color();
+ Derived& draw_note(double x, double y, std::string note, text_style& tsty = no_style, align_style al = center_align, rotate_style rot = horizontal, const svg_color& = black);
 
           //// Stylesheet.
           // Removed for now to avoid compile warning in spirit.
@@ -3754,7 +3756,35 @@
           return derived().image.g(detail::PLOT_LIMIT_POINTS).style().fill_color();
         }
 
- // image.g(PLOT_LIMIT_POINTS).style().stroke_color(lightslategray).fill_color(antiquewhite);
+ template <class Derived>
+ Derived& axis_plot_frame<Derived>::draw_note(double x, double y, std::string note, text_style& tsty/* = no_style*/, align_style al/* = center_align*/, rotate_style rot /*= horizontal*/, const svg_color& col)
+ { /*! \brief Annotate plot with a text string (perhaps including Unicode), putting note at SVG Coordinates X, Y.
+ \details Defaults color black, rotation horizontal and align = center_align
+ Using center_align is recommended as it will ensure that will center correctly
+ (even if original string is made much longer because it contains Unicode,
+ for example Greek or math symbols, taking about 6 characters per symbol)
+ because the render engine does the centering.
+ */
+
+ // g_element* g_ptr = &(derived().image.g(detail::PLOT_NOTES));
+ g_element* g = &(derived()).image.g(); // New group
+ g->style().fill_color(col);
+ g->push_back(new text_element(x, y, note, tsty, al, rot));
+
+ //g_ptr->style().fill_color(red);
+ //g_ptr->push_back(new text_element(x, y, note, tsty, al, rot));
+ //derived().image.g(detail::PLOT_NOTES).text(x, y,
+ //gptr.text(x, y,
+ // note, // string
+ // tsty, // no_style,
+ // al, //center_align,
+ // rot); // horizontal);
+
+ // No checks on X or Y - leave to SVG to not draw outside image.
+ // Could warn if X and/or Y outside - but even if OK, then text could still stray outside image.
+ return derived();
+ } // void draw_note()
+
 
       } // detail
     } // svg

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-03-12 13:53:32 EDT (Thu, 12 Mar 2009)
@@ -320,8 +320,8 @@
 
   // end svg_2d_plot_series Member Functions Definitions.
 
- class svg_2d_plot : public detail::axis_plot_frame<svg_2d_plot>
- { /*! \class boost::svg::svg_2d_plot
+ class svg_2d_plot : public detail::axis_plot_frame<svg_2d_plot>
+ { /*! \class boost::svg::svg_2d_plot
     \brief Provides svg_2d_plot data and functions to create plots.
        Very many functions allow very fine control of the
        appearance and layout of plots, data markers and lines.
@@ -449,6 +449,7 @@
       int y_auto_ticks_; //!< Number of ticks (calculated by Y autoscale).
 
       std::vector<svg_2d_plot_series> serieses_; //!< Store of several series of data points for transformation.
+ std::vector<text_element> notes_; //!< Store of text for annotation.
 
       std::string plot_window_clip_; /*!< = "clip_plot_window" id for clippath
         http://www.w3.org/TR/SVG/masking.html#ClipPathElement 14.1 Introduction clipping paths,\n
@@ -564,6 +565,8 @@
         image.g(PLOT_X_AXIS).style().stroke_color(black).stroke_width(x_axis_.width());
         image.g(PLOT_Y_AXIS).style().stroke_color(black).stroke_width(y_axis_.width());
 
+ //image.g(detail::PLOT_NOTES).style().fill_color(black);
+
         // Note that widths are stored in member data *and* copied here.
         // Not sure if this is wise but ...
 

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-03-12 13:53:32 EDT (Thu, 12 Mar 2009)
@@ -306,8 +306,8 @@
 private:
   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 weight, examples: normal | bold | italic | oblique.
- std::string style_; //!< Font style, examples: "bold", "normal".
+ std::string weight_; //!< Font style, examples: "bold", "normal".
+ std::string style_; //!< Font weight, examples: normal | bold | italic | oblique.
   std::string stretch_; //!< Font stretch, examples: normal | wider | narrower.
   std::string decoration_; //!< Font decoration, examples: "underline" | "overline" | "line-through".
 

Modified: sandbox/SOC/2007/visualization/libs/svg_plot/doc/Jamfile.v2
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/doc/Jamfile.v2 (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/doc/Jamfile.v2 2009-03-12 13:53:32 EDT (Thu, 12 Mar 2009)
@@ -35,19 +35,26 @@
     [ glob ../../../boost/svg_plot/*.hpp ]
     [ glob ../../../boost/svg_plot/detail/*.hpp ]
   :
+ <doxygen:param>TAB_SIZE=2
     <doxygen:param>EXTRACT_ALL=YES
     <doxygen:param>HIDE_UNDOC_MEMBERS=NO
- <doxygen:param>INLINE_INHERITED_MEMB=YES
+ <doxygen:param>INLINE_INHERITED_MEMB=YES # Show all inherited members of a class in the documentation of that class as if those members were ordinary class members.
     <doxygen:param>SORT_MEMBER_DOCS=YES
     <doxygen:param>EXTRACT_PRIVATE=YES
     <doxygen:param>ENABLE_PREPROCESSING=YES
     <doxygen:param>MACRO_EXPANSION=YES
     <doxygen:param>EXPAND_ONLY_PREDEF=YES
     <doxygen:param>SEARCH_INCLUDES=YES
- <doxygen:param>SHOW_INCLUDE_FILES=NO
+ <doxygen:param>SHOW_INCLUDE_FILES=NO # List of the files that are included by a file in the documentation of that file.
+ <doxygen:param>REPEAT_BRIEF=YES # Prepend the brief description of a member or function before the detailed description
+ <doxygen:param>BRIEF_MEMBER_DESC=YES # Include brief member descriptions after the members that are listed in the file and class
+ <doxygen:param> MULTILINE_CPP_IS_BRIEF = YES # Treat a multi-line C++ special comment block (i.e. a block of //! or /// comments) as a brief description.
+ # May be best to always use \brief and \details to avoid ambiguity?
     <doxygen:param>INCLUDE_PATH=$(BOOST_ROOT)
+ <doxygen:param>WARN_LOGFILE=../../../libs/svg_plot/doc/doxywarnings.log
 ;
     #<doxygen:param>"PREDEFINED=\"BOOST_DEDUCED_TYPENAME=typename\" "
+# See Doxygen configuration for detailed explanation of these options
 
 # import boostbook : boostbook ;
 

Modified: sandbox/SOC/2007/visualization/libs/svg_plot/doc/svg_plot.qbk
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/doc/svg_plot.qbk (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/doc/svg_plot.qbk 2009-03-12 13:53:32 EDT (Thu, 12 Mar 2009)
@@ -23,8 +23,6 @@
 [def __docbook__ [@http://www.docbook.org/ DocBook]]
 [def __Boost_Assign [@$(BOOST_ROOT)/libs/assign/doc/index.html Boost.Assign]]
 
-[/def __Boost_Assign [@http://www.boost.org/doc/libs/1_38_0/libs/assign/doc/index.html Boost.Assign]]
-
 [/ Links ]
 [/ By Eric's convention prefix *and* suffix _ means a defined value. But Use JM and SW double underscore prefix convention.]
 [def __boost [@http://www.boost.org Boost]]
@@ -40,9 +38,6 @@
 
 [def __todo [link plotting_graphs_in_svg_format.todo TODO]]
 [def __rationale [link plotting_graphs_in_svg_format.implementation rationale and implementation]]
-
-[/ I expect this to be [link svg_plot.todo]
-
 [def __caution Boost.Plot is not (yet) an official Boost library, but remains a library under construction,
      the code is functional, but interfaces, library structure, and function and distribution names
      may still be changed without notice.]


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