|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r52011 - in sandbox/SOC/2007/visualization/boost/svg_plot: . detail
From: pbristow_at_[hidden]
Date: 2009-03-27 08:57:34
Author: pbristow
Date: 2009-03-27 08:57:32 EDT (Fri, 27 Mar 2009)
New Revision: 52011
URL: http://svn.boost.org/trac/boost/changeset/52011
Log:
Yet more doc correctins and updates.
Text files modified:
sandbox/SOC/2007/visualization/boost/svg_plot/detail/FP_compare.hpp | 40 ++++------
sandbox/SOC/2007/visualization/boost/svg_plot/detail/functors.hpp | 34 +++++----
sandbox/SOC/2007/visualization/boost/svg_plot/detail/svg_tag.hpp | 59 ++++++++-------
sandbox/SOC/2007/visualization/boost/svg_plot/svg.hpp | 2
sandbox/SOC/2007/visualization/boost/svg_plot/svg_1d_plot.hpp | 141 +++++++++++++++++++--------------------
sandbox/SOC/2007/visualization/boost/svg_plot/svg_2d_plot.hpp | 89 ++++++++++++------------
sandbox/SOC/2007/visualization/boost/svg_plot/svg_boxplot.hpp | 91 +++++++++++++------------
sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp | 83 +++++++++++-----------
sandbox/SOC/2007/visualization/boost/svg_plot/uncertain.hpp | 20 +++--
9 files changed, 281 insertions(+), 278 deletions(-)
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/detail/FP_compare.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/detail/FP_compare.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/detail/FP_compare.hpp 2009-03-27 08:57:32 EDT (Fri, 27 Mar 2009)
@@ -2,7 +2,7 @@
\brief Two types of floating-point comparison "Very close" and "Close enough" to a chosen tolerance.
\details
Derived from Boost.Test Copyright Gennadiy Rozental 2001-2007.
- See http://www.boost.org/libs/test for the library home page.
+ See http://www.boost.org/libs/test for the Boost.Test library home page.
Deliberately removed any treatment of percent to avoid further potential confusion!
\date Mar 2009
\author Paul A. Bristow
@@ -17,8 +17,8 @@
#ifndef BOOST_FLOATING_POINT_COMPARISON_HPP
#define BOOST_FLOATING_POINT_COMPARISON_HPP
-#include <boost/limits.hpp> // for std::numeric_limits
-#include <boost/math/tools/precision.hpp> // for max_value, min_value & epsilon for floating_point type;
+#include <boost/limits.hpp> // using std::numeric_limits
+#include <boost/math/tools/precision.hpp> // using max_value, min_value & epsilon for floating_point type.
//namespace boost
//{
@@ -26,10 +26,10 @@
// {
// Check two floating-point values are close within a chosen tolerance.
-template<typename FPT> class close_to;
+template<typename FPT> class close_to; // Default = double.
// Check floating-point value is smaller than a chosen small value.
-template<typename FPT> class smallest;
+template<typename FPT> class smallest; // Default = double.
enum floating_point_comparison_type
{ /*! \enum floating_point_comparison_type
@@ -58,11 +58,11 @@
// CNRS Ecole normale superieure, 1 Feb 2008, http://arxiv.org/abs/cs/0701192v4
// submitted to ACM TOPLAS.
-// FPT is Floating-Point Type: float, double, long double, or User-Defined like NTL quad_float or RR.
+// \tparam FPT is Floating-Point Type: float, double, long double, or User-Defined like NTL quad_float or RR.
// from boost/math/tools/precision.hpp
-template <class T> T max_value(T);
-template <class T> T min_value(T);
-template <class T> T epsilon(T);
+template <class FPT> FPT max_value(FPT); //!< maximum value for floating-point type T.
+template <class FPT> FPT min_value(FPT); //!< minimum value for floating-point type T.
+template <class FPT> FPT epsilon(FPT); //!< epsilon for type T (about 1e-16 for double)
template<typename FPT> FPT
fpt_abs(FPT arg)
@@ -86,8 +86,7 @@
return f1 / f2;
} // safe_fpt_division(FPT f1, FPT f2)
-
-template<typename FPT = double>
+template<typename FPT = double> //! \tparam FPT floating-point type.
class close_to
{ /*!
\class close_to
@@ -100,10 +99,10 @@
*/
public:
- // One constructor for fraction tolerance only. (By design, percent is NOT implemented ).
+ //! Constructor for close_to from tolerance and strength. (By design, percent is NOT implemented).
template<typename FPT>
- explicit close_to(FPT tolerance,
- floating_point_comparison_type fpc_type = FPC_STRONG)
+ explicit close_to(FPT tolerance, //!< Fractional tolerance.
+ floating_point_comparison_type fpc_type = FPC_STRONG) //!< strong requires closeness relative to both values.
:
fraction_tolerance_(tolerance),
strong_or_weak_(fpc_type)
@@ -113,7 +112,6 @@
BOOST_ASSERT(tolerance >= static_cast<FPT>(0));
}
- //template<typename FPT>
close_to()
:
fraction_tolerance_(2 * boost::math::tools::epsilon<FPT>()),
@@ -138,14 +136,13 @@
: ((d1 <= fraction_tolerance_) || (d2 <= fraction_tolerance_)); // Weak.
}
- template<typename FPT>
FPT size()
- { //! Get the chosen tolerance, as a fraction.
+ { //! \return the chosen tolerance, as a \b fraction (not a percentage).
return fraction_tolerance_;
}
floating_point_comparison_type strength()
- { //! Get strength of comparison, Knuth's "Very close" (equation 1), the default, or "Close enough" (equation 2).
+ { //! \return strength of comparison, Knuth's "Very close" (equation 1), the default, or "Close enough" (equation 2).
return strong_or_weak_;
}
@@ -155,7 +152,7 @@
}; // class close_to
-template<typename FPT = double>
+template<typename FPT = double> //! \tparam FPT floating-point type.
class smallest
{ /*! \class smallest
\brief Check floating-point value is smaller than a chosen small value,
@@ -198,7 +195,6 @@
*/
}
- template<typename FPT>
bool operator()(FPT fp_value, FPT s)
{ //! True if value is smaller than a smallest value s.
if (fpt_abs(fp_value) == static_cast<FPT>(0))
@@ -210,7 +206,6 @@
return fpt_abs(fp_value) < fpt_abs(s);
} // bool operator()
- template<typename FPT>
bool operator()(FPT fp_value)
{ //! True if value is smaller than chosen smallest value.
if (fpt_abs(fp_value) == static_cast<FPT>(0))
@@ -221,9 +216,8 @@
return fpt_abs(fp_value) < fpt_abs(smallest_);
} // bool operator()
- template<typename FPT>
FPT size()
- { //! Get chosen smallest value that will be counted as effectively zero.
+ { //! \return chosen smallest value that will be counted as effectively zero.
return smallest_;
}
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/detail/functors.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/detail/functors.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/detail/functors.hpp 2009-03-27 08:57:32 EDT (Fri, 27 Mar 2009)
@@ -39,10 +39,10 @@
\brief This functor allows any 1D data convertible to doubles to be plotted.
*/
public:
- typedef double result_type;
+ typedef double result_type; //!< result type is double.
template <class T>
- double operator()(T val) const
+ double operator()(T val) const //! Convert a single data value to double.
{
return (double)val;
}
@@ -53,22 +53,22 @@
\brief This functor allows any 2 D data convertible to type std::pair<double, double> to be plotted.
*/
public:
- typedef std::pair<double, double> result_type;
- double i;
-
- void start(double i)
+ typedef std::pair<double, double> result_type; //!< result type is a pair (X and Y) of doubles.
+ double i; //!< Start value.
+ void start(double i) //!< Set a start value.
{
- i = i;
+ i = i;
}
+ //!< Convert a pair of X and Y double type values to a pair of doubles.
template <class T, class U>
std::pair<double, double> operator()(const std::pair<T, U>& a) const
- {
+ { //! Assumes that a conversion from double yields just the value component of the uncertain value.
return std::pair<double, double>((double)(a.first), (double)(a.second));
}
template <class T>
- std::pair<double, double> operator()(T a)
+ std::pair<double, double> operator()(T a) //!< Convert a pair of X and Y values to a pair of doubles.
{
return std::pair<double, double>(i++, (double)a);
}
@@ -79,13 +79,14 @@
\brief This functor allows any 2D data convertible to type std::pair<unc, unc> to be plotted.
*/
public:
- typedef std::pair<unc, unc> result_type;
- unc i;
- void start(unc i)
+ typedef std::pair<unc, unc> result_type; //!< result type is pair of uncertain values.
+ unc i; //!< Start uncertain value.
+ void start(unc i) //!< Set a start value.
{
i = i;
}
+ //!< Convert a pair of X and Y uncertain type values to a pair of doubles.
template <class T, class U>
std::pair<unc, unc> operator()(const std::pair<T, U>& a) const
{
@@ -106,15 +107,16 @@
uncertainty, degrees of freedom information, and type are set too.
*/
public:
-
- typedef unc result_type;
+ typedef unc result_type; //!< result type is an uncertain floating-point type.
template <class T>
- unc operator()(T val) const
+ unc operator()(T val) const /*!< Convert to uncertain type, providing defaults for uncertainty,
+ degrees of freedom information, and type meaning undefined.
+ \return uncertain.*/
{
return (unc)val;
// warning C4244: 'argument' : conversion from 'long double' to 'double', possible loss of data.
- // because unc only holds double precision.
+ // because unc only holds double precision. Suppressed by pragma for MSVC above. Need similar for other compilers.
}
}; // class default_1d_convert
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 2009-03-27 08:57:32 EDT (Fri, 27 Mar 2009)
@@ -110,9 +110,10 @@
{ // Example: clip-path="url(#plot_window)"
s_out << " clip-path=\"url(#" << clip_name_ << ")\""; // Prefix with space.
}
+ // should transform be here allow translate and rotate?
/*! \details
- \verbatim
Classes inherited from svg_element add other references, 5.3.1, like color, fill, stroke, gradients...
+ \verbatim
Example id: <g id="yMinorGrid" ></g>
Example class: <g class="grid_style"></g>
Example URI: fill="url(#Gradient01) // local URL
@@ -439,7 +440,7 @@
)
: x(x), y(y), radius(radius),
svg_element(style_info, id_name, class_name, clip_name)
- { // Define all private data.
+ { //! Constructor defines all private data.
}
void write(std::ostream& rhs)
@@ -454,10 +455,6 @@
}
}; // class circle_element
-
- // -----------------------------------------------------------------
- // Represents a single ellipse.
- // -----------------------------------------------------------------
class ellipse_element : public svg_element
{ /*! \class boost::svg::ellipse_element
\brief Ellipse from center coordinate, and radius.
@@ -465,16 +462,19 @@
Represents a single ellipse.
http://www.w3.org/TR/SVG/shapes.html#EllipseElement
9.4 The 'ellipse' element.
+ Default is 'horizontal' but can be rotated.
*/
private:
- double cx; // coordinate x of center of ellipse, default 0
- double cy; // coordinate y, default 0
- double rx; // radius x
- double ry; // radius x
+ double cx_; //!< coordinate x of center of ellipse, default 0.
+ double cy_; //!< coordinate y, default 0.
+ double rx_; //!< radius x.
+ double ry_; //!< radius y.
+ double rotate_; //! rotation in degrees from horizontal (default 0.).
+ // Only hacked in - should be in attributes?
public:
ellipse_element(double cx, double cy, double rx = 4, double ry = 8)
- : cx(cx), cy(cy), rx(rx), ry(ry)
- { //! Define all private data (default radii).
+ : cx_(cx), cy_(cy), rx_(rx), ry_(ry), rotate_(0.)
+ { //!< Constructor defines all private data (with default radii).
}
ellipse_element(double cx, double cy, double rx, double ry,
@@ -482,32 +482,35 @@
const std::string& id_name="",
const std::string& class_name="",
const std::string& clip_name="")
- : cx(cx), cy(cy), rx(rx), ry(ry),
+ : cx_(cx), cy_(cy), rx_(rx), ry_(ry), rotate_(0.),
svg_element(style_info, id_name, class_name, clip_name)
- { // Define all private data.
+ { //!< Constructor defines all private data.
}
-
+ // Constructor that also includes style, id, class and clip.
ellipse_element(double cx, double cy,
- const svg_style& style_info,
- const std::string& id_name="",
- const std::string& class_name="",
- const std::string& clip_name="")
- : cx(cx), cy(cy), rx(4), ry(8), // 4 and 8 are the same defaults used above.
+ const svg_style& style_info, //! Colors & widths.
+ const std::string& id_name = "",
+ const std::string& class_name = "",
+ const std::string& clip_name = "")
+ : cx_(cx), cy_(cy), rx_(4), ry_(8), // 4 and 8 are the same defaults used above.
+ rotate_(0.),
svg_element(style_info, id_name, class_name, clip_name)
{ // Define all private data.
}
- void write(std::ostream& rhs)
+ void write(std::ostream& os)
{ /*!
- \verbatim
Output SVG XML for ellipse.
- Example: <ellipse rx="250" ry="100" fill="red" />
- \endverbatim
+ Example: \<ellipse rx="250" ry="100" fill="red" /\>
*/
- rhs << "<ellipse";
- write_attributes(rhs);
- rhs << " cx=\"" << cx << "\" cy=\"" << cy << "\""
- << " rx=\"" << rx << "\" ry=\"" << ry << "\"/>";
+ os << "<ellipse";
+ write_attributes(os);
+ if(rotate_ != 0)
+ { // Should this be in atttributes?
+ os << " transform= \"" << " rotate=(" << rotate_ << ")\"";
+ }
+ os << " cx=\"" << cx_ << "\" cy=\"" << cy_ << "\""
+ << " rx=\"" << rx_ << "\" ry=\"" << ry_ << "\"/>";
}
}; // class ellipse_element
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/svg.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/svg.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/svg.hpp 2009-03-27 08:57:32 EDT (Fri, 27 Mar 2009)
@@ -234,7 +234,7 @@
unsigned int y_size_; //!< SVG image Y-axis size (in SVG units (default pixels).
g_element document; //!< group_element to hold all elements of the svg document.
- std::vector<clip_path_element> clip_paths;
+ std::vector<clip_path_element> clip_paths; //!< Points on clip path (used for plot window).
std::string title_document_; //!< SVG document title (for header as \verbatim <title> ... <\title> \endverbatim).
std::string image_desc_; //!< SVG image description (for header as \verbatim <desc> ... <\desc> \endverbatim).
std::string holder_copyright_; //!< SVG info on holder of copyright (probably == author, but could be institution).
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/svg_1d_plot.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/svg_1d_plot.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/svg_1d_plot.hpp 2009-03-27 08:57:32 EDT (Fri, 27 Mar 2009)
@@ -249,8 +249,8 @@
\brief Hold all data about a plot, and functions to get and set.
\details All data about a plot, and functions to get and set appearance.
axis_plot_frame.hpp contains functions common to 1 and 2-D.
- See also svg_2d_plot.hpp for 2-D version.
- */
+ See also svg_2d_plot.hpp for 2-D version.
+ */
friend void show_1d_plot_settings(svg_1d_plot&);
//friend void show_2d_plot_settings(svg_1d_plot&); // Surely not needed?
@@ -259,70 +259,70 @@
protected:
// Member data names conventionally end with _.
// for example: border_margin_,
- // and set & get accessor functions are named without _ suffix,
+ // and set & get accessor functions are named *without* _ suffix,
// for example: border_margin() & border_margin(int).
- double x_scale_; //! scale used for transform from Cartesian to SVG coordinates.
- double x_shift_; //! shift from SVG origin is top left, Cartesian is bottom right.
- double y_scale_; //! scale used for transform from Cartesian to SVG coordinates.
- double y_shift_; //! shift from SVG origin is top left, Cartesian is bottom right.
-
- svg image; // Stored so as to avoid rewriting style information constantly.
-
- double text_margin_; //! Marginal space around text items like title,
-
- text_style a_style_; //! Default text style that contains font size & type etc.
- text_style title_style_;
- text_style legend_style_;
- text_style x_axis_label_style_;
- text_style y_axis_label_style_; //! Not used for 1D but needed by axis_plot_frame.hpp.
- text_style x_value_label_style_;
- text_style y_value_label_style_; //! Not used for 1D but needed by axis_plot_frame.hpp.
- text_style point_symbols_style_; //! Used for data point marking.
- text_style value_style_; //! Used for data point value label.
+ double x_scale_; //!< scale used for transform from Cartesian to SVG coordinates.
+ double x_shift_; //!< shift from SVG origin is top left, Cartesian is bottom right.
+ double y_scale_; //!< scale used for transform from Cartesian to SVG coordinates.
+ double y_shift_; //!< shift from SVG origin is top left, Cartesian is bottom right.
+
+ svg image; //!< Stored so as to avoid rewriting style information constantly.
+
+ double text_margin_; //!< Marginal space around text items like title,
+
+ text_style a_style_; //!< Default text style that contains font size & type etc.
+ text_style title_style_; //!< style (font etc) of title.
+ text_style legend_style_; //!< style (font etc of legend.
+ text_style x_axis_label_style_; //!< style of X axis label.
+ text_style y_axis_label_style_; //!< Not used for 1D but needed by axis_plot_frame.hpp.
+ text_style x_value_label_style_; //!< style of X value label.
+ text_style y_value_label_style_; //!< Not used for 1D but needed by axis_plot_frame.hpp.
+ text_style point_symbols_style_; //!< Used for data point marking.
+ text_style value_style_; //!< Used for data point value label.
- value_style x_values_style_; //! Used for data point value marking.
+ value_style x_values_style_; //!< Used for data point value marking.
//rotate_style x_value_label_rotation_; // Direction point value labels written.
//int x_value_precision_;
//std::ios_base::fmtflags x_value_ioflags_;
- text_element title_info_; //! Title of whole plot.
- text_element legend_header_; //! legend box header or title (if any).
- text_element x_label_info_; //! X-axis label, Example: "length of widget"
- text_element x_label_value_; // For example: "1.2" or "1.2e1"
- text_element x_units_info_; // For example, to display, "length (meter)"
+ text_element title_info_; //!< Title of whole plot.
+ text_element legend_header_; //!< legend box header or title (if any).
+ text_element x_label_info_; //!< X-axis label, Example: "length of widget"
+ text_element x_label_value_; //!< For example: "1.2" or "1.2e1"
+ text_element x_units_info_; //!< For example, to display, "length (meter)"
// No Y-axis info for 1D.
// Note that text_elements hold font_size, bold, italic...
// Border information for the plot window (not the full image size).
- box_style image_border_; // rectangular border of all image width, color...
- box_style plot_window_border_; // rectangular border of plot window width, color...
- box_style legend_box_; // rectangular box of legend width, color...
-
- double plot_left_; // calculate_plot_window() sets these values.
- double plot_top_;
- double plot_right_;
- double plot_bottom_;
+ box_style image_border_; //!< rectangular border of all image width, color...
+ box_style plot_window_border_; //!< rectangular border of plot window width, color...
+ box_style legend_box_; //!< rectangular box of legend width, color...
+
+ double plot_left_; //!< svg left of plot window (calculate_plot_window() sets these values).
+ double plot_top_; //!< svg top of plot window (calculate_plot_window() sets these values).
+ double plot_right_; //!< svg right of plot window (calculate_plot_window() sets these values).
+ double plot_bottom_; //!< svg bottom of plot window (calculate_plot_window() sets these values).
// enum legend_places{ nowhere, inside...}
- legend_places legend_place_; // Place for any legend box.
- double legend_width_; // Width of legend box (pixels).
- double legend_height_; // Height of legend box (in pixels).
- // Size of legend box is controlled by its contents,
- // but helpful to store computed coordinates.
- double legend_left_; // Left of legend box.
- double legend_top_; // Top of legend box.
+ legend_places legend_place_; //!< Place for any legend box.
+ double legend_width_; //!< Width of legend box (pixels).
+ double legend_height_; //!< Height of legend box (in pixels).
+ //!< Size of legend box is controlled by its contents,
+ //!< but helpful to store computed coordinates.
+ double legend_left_; //!< Left of legend box.
+ double legend_top_; //!< Top of legend box.
// Both optionally set by legend_top_left.
- double legend_right_; // SVG Coordinates of right of legend box,
- double legend_bottom_; // bottom of legend box.
- size_t legend_longest_; // longest (both header & data) string in legend box,
+ double legend_right_; //!< SVG Coordinates of right of legend box,
+ double legend_bottom_; //!< bottom of legend box.
+ size_t legend_longest_; //!< longest (both header & data) string in legend box,
- axis_line_style x_axis_;
- axis_line_style y_axis_;
+ axis_line_style x_axis_; //!< style of X axis line.
+ axis_line_style y_axis_; //!< style of Y axis line.
- ticks_labels_style x_ticks_;
- ticks_labels_style y_ticks_; // Added to permit shared code!
+ ticks_labels_style x_ticks_; //!< style of X axis tick value labels.
+ ticks_labels_style y_ticks_; //!< style of Y axis tick value labels. ( Meaningless of 1D but added to permit shared code!)
bool title_on_; //!< If true include a title for the whole plot.
bool legend_on_; //!< If true include a legend box.
@@ -343,24 +343,23 @@
int x_steps_; //!< If autoscaled, set any prescaling to decimal 1, 2, 5, 10 etc.
// Values calculated by scale_axis, and is used only if x_autoscale == true.
- double x_auto_min_value_;
- double x_auto_max_value_;
- double x_auto_tick_interval_; // tick major interval.
- int x_auto_ticks_; // Number of ticks.
+ double x_auto_min_value_; //!< X minimum value calculated by autoscaling.
+ double x_auto_max_value_;//!< X maximum value calculated by autoscaling.
+ double x_auto_tick_interval_; //!< X axis tick major interval.
+ int x_auto_ticks_; //!< Number of X axis ticks.
// Similar y_auto value for 2-D
- bool y_autoscale_; // Stays false for 1-D plot.
+ bool y_autoscale_; //!< Always false for 1-D plot because Y axis is not autoscaled.
+
+ 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, which uses any combination of 'path', 'text' and basic shapes
+ //!< to serve as the outline where everything on the "inside" of the outline
+ //!< is allowed to show through but everything on the outside is masked out.
+ //!< So the plot_window_clip_ limits display to a plot_window rectangle.
- 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, which uses any combination of 'path', 'text' and basic shapes
- // to serve as the outline where everything on the "inside" of the outline
- // is allowed to show through but everything on the outside is masked out.
- // So the plot_window_clip_ limits display to a plot_window rectangle.
-
- // Storing the (perhaps several) series of data points for transformation.
- std::vector<svg_1d_plot_series> serieses_;
- // These are sorted into two vectors for normal and abnormal (max, inf and NaN).
+ std::vector<svg_1d_plot_series> serieses_; //!< The (perhaps several) series of data points for transformation.
+ //!< These are sorted into two vectors for normal and abnormal (max, inf and NaN).
public:
svg_1d_plot()
@@ -548,7 +547,7 @@
// one would have to *not* do this,
// but to make sure they are both assigned correctly).
- if(plot_window_on_) //
+ if(plot_window_on_) //
{
// Calculate the number of chars of the longest value label.
x_ticks_.longest_label(); // Updates label_max_length_
@@ -629,8 +628,8 @@
} // void calculate_transform()
void draw_axes()
- { // Add information to the plot image for X axis lines.
- // For 1-D, there is, of course, only the horizontal X-axis!
+ { //! Add information to the plot image for X axis lines.
+ //! (For 1-D, there is, of course, only the horizontal X-axis!)
double x(0.);
double y1(0.);
double y2(image.y_size());
@@ -700,7 +699,7 @@
{ // Draw jth point for ith serieses.
unc ux = serieses_[i].series_[j];
double x = ux.value();
- // TODO symbols are offset downwards because
+ // TODO symbols are offset downwards because
// the origin of the point is the top left of the glyph.
// Need to offset by the height and width of the font size?
transform_x(x);
@@ -735,11 +734,11 @@
transform_x(x);
// If include zero, OK, else plot on left or right as appropriate.
if (x < plot_left_)
- {
+ {
x = plot_left_;
}
else if (x > plot_right_)
- {
+ {
x = plot_right_;
}
//else X axis includes zero, so x is OK.
@@ -785,7 +784,7 @@
svg_1d_plot_series& plot(const T& begin, const T& end, const std::string& title = "", U functor = double_1d_convert);
template <class T, class U>
svg_1d_plot_series& plot(const T& container, const std::string& title = "", U functor = double_1d_convert);
-}; // class svg_1d_plot
+}; // class svg_1d_plot
// svg_1d_plot Member functions definitions.
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-27 08:57:32 EDT (Fri, 27 Mar 2009)
@@ -83,10 +83,12 @@
bar_style bar_style_; //!< Style of bar used in histograms.
histogram_style histogram_style_; //!< Style of histogram.
- // Constructor.
- template <class T> // T an STL container: for example: multimap.
- svg_2d_plot_series(T begin, T end, // Container of data series.
- std::string title = ""); // Title of data series.
+ //! Constructor for a data series to plot.
+ template <class T> //! \tparam T an STL container: for example: multimap.
+ svg_2d_plot_series(
+ T begin, //! starting iterator into container of data series begin() to start at the beginning.
+ T end, //! ending iterator into container of data series, end() to finish with the last item.
+ std::string title = ""); // !Title of data series.
// Function declarations only - definitions may be in .ipp file).
// Set functions for the plot series.
@@ -300,7 +302,7 @@
}
svg_2d_plot_series& svg_2d_plot_series::histogram(histogram_option opt_)
- { /*!
+ { /*!
\param opt_ no_histogram = 0,
\param opt_ bar = +1 // Stick or column line (stroke width) vertical to X-axis.
*/
@@ -310,7 +312,7 @@
int svg_2d_plot_series::values_count()
{ //! \return number of normal values in a data series.
- return series_.size();
+ return series_.size();
}
int svg_2d_plot_series::limits_count()
@@ -346,9 +348,9 @@
// for example: border_margin() & border_margin(int).
double x_scale_; //!< scale factor used by transform() to go from Cartesian to SVG coordinates.
- double x_shift_; //!< shift factor used by transform() to go from Cartesian to SVG coordinates.
+ double x_shift_; //!< shift factor used by transform() to go from Cartesian to SVG coordinates.
double y_scale_; //!< scale factor used by transform() to go from Cartesian to SVG coordinates.
- double y_shift_; //!< shift factor used by transform() to go from Cartesian to SVG coordinates.
+ double y_shift_; //!< shift factor used by transform() to go from Cartesian to SVG coordinates.
svg image; //!< Stored so as to avoid rewriting style information constantly.
@@ -477,7 +479,7 @@
.plot_background_color(svg_color(white)) // Just the plot window
.plot_border_color(svg_color(green)) // The border rectangle color.
.plot_border_width(1) // Thin border (SVG units, default pixels).
- .title_color(red) // Title of whole image.
+ .title_color(red) // Title of whole image.
;
\endcode
*/
@@ -504,7 +506,7 @@
y_ticks_(Y, y_value_label_style_),
y_label_info_(0, 0, "", y_axis_label_style_, center_align, upward),
y_units_info_(0, 0, "", y_axis_label_style_, center_align, upward),
- y_label_value_(0, 0, "", y_value_label_style_, center_align, upward), //
+ y_label_value_(0, 0, "", y_value_label_style_, center_align, upward), //
text_margin_(2.), // for axis label text, as a multiplier of the font size.
image_border_(yellow, white, 2, 10, true, true), // margin should be about axis label font size.
plot_window_border_(lightslategray, svg_color(255, 255, 255), 2, 3, true, false),
@@ -1542,7 +1544,7 @@
//double vy = y; // Note the true Y value.
transform_point(x, y); // Note x and y are now SVG coordinates.
if((x > plot_left_) && (x < plot_right_) && (y > plot_top_) && (y < plot_bottom_))
- { // Is inside plot window, so draw a point.
+ { // Is inside plot window, so draw a point.
draw_plot_point(x, y, g_ptr, serieses_[i].point_style_, ux, uy); // Add the unc to allow access to uncertainty.
// TODO might refactor so that only pass ux, and uy.
g_element& g_ptr_vx = image.g(detail::PLOT_X_POINT_VALUES).g();
@@ -1582,11 +1584,11 @@
transform_x(x);
// If include zero, OK, else plot on left or right as appropriate.
if (x < plot_left_)
- {
+ {
x = plot_left_;
}
else if (x > plot_right_)
- {
+ {
x = plot_right_;
}
//else X axis includes zero, so x is OK.
@@ -1614,7 +1616,7 @@
y = plot_top_;
}
else if (y > plot_bottom_)
- {
+ {
y = plot_bottom_;
}
//else y axis includes zero, so y is OK.
@@ -2030,7 +2032,7 @@
}
bool svg_2d_plot::y_label_on()
- {
+ { //! \return true if Y label is on.
return y_axis_.label_on_;
}
@@ -2128,32 +2130,31 @@
}
svg_2d_plot& svg_2d_plot::y_axis_color(const svg_color& col)
- { //! Set Y axis linecolor.
- // set only stroke color.
+ { //! Set Y axis linecolor. (set only stroke color).
image.g(detail::PLOT_Y_AXIS).style().stroke_color(col);
return *this; //! \return reference to svg_2d_plot to make chainable.
}
svg_color svg_2d_plot::y_axis_color()
- { // return the stroke color.
+ { //! \return the stroke color.
return image.g(detail::PLOT_Y_AXIS).style().stroke_color();
}
svg_2d_plot& svg_2d_plot::y_axis_label_color(const svg_color& col)
- { // Set stroke color.
+ { //! Set stroke color.
image.g(detail::PLOT_VALUE_LABELS).style().stroke_color(col);
return *this; //! \return reference to svg_2d_plot to make chainable.
}
svg_color svg_2d_plot::y_axis_label_color()
- { // But only return the stroke color.
- //return y_label_info_.style().stroke_color();
+ { //! \return the y axis label stroke color.
+ // y_label_info_.style().stroke_color();
return image.g(detail::PLOT_VALUE_LABELS).style().stroke_color();
}
svg_2d_plot& svg_2d_plot::y_label_units_on(bool b)
{ //! Set true to add units text to the Y axis label.
- //! \see
+ //! \see
y_axis_.label_units_on_ = b;
return *this; //! \return reference to svg_2d_plot to make chainable.
}
@@ -2383,7 +2384,7 @@
}
svg_2d_plot& svg_2d_plot::y_decor(const std::string& pre, const std::string& sep, const std::string& suf)
- { //! Set prefix, separator and suffix for
+ { //! Set prefix, separator and suffix for
//! Note if you want a space, you must use a Unicode space "\ ",
//! for example, ",\ " rather than ", ".
y_values_style_.prefix_ = pre;
@@ -2442,7 +2443,7 @@
}
template <class T> // T an STL container: array, vector ...
- svg_2d_plot& svg_2d_plot::y_autoscale(const T& container)
+ svg_2d_plot& svg_2d_plot::y_autoscale(const T& container)
{ //! Whole data series to use to calculate autoscaled values.
scale_axis(container.begin(), container.end(), // All the container.
&y_auto_min_value_, &y_auto_max_value_, &y_auto_tick_interval_, &y_auto_ticks_,
@@ -2565,7 +2566,7 @@
}
svg_2d_plot& svg_2d_plot::x_major_labels_side(int side)
- { /*! Side for major ticks label values:
+ { /*! Side for major ticks label values:
\param side -1 labels downward.
\param side 0 no labels.
\param side +1 labels upward.
@@ -2580,7 +2581,7 @@
}
svg_2d_plot& svg_2d_plot::y_ticks_on_window_or_axis(int cmd)
- { /*! Set Y ticks on window or axis
+ { /*! Set Y ticks on window or axis
\arg cmd -1 left of plot window,
\arg cmd 0 on Y axis.
\arg cmd +1 right of plot window.
@@ -2694,7 +2695,7 @@
x_axis_label_style_.font_family(family);
return *this; //! \return reference to svg_2d_plot to make chainable.
}
-
+
const std::string& svg_2d_plot::y_label_font_family()
{ //! \return the font family for label on Y axis.
return y_axis_label_style_.font_family();
@@ -2707,7 +2708,7 @@
}
unsigned int svg_2d_plot::y_values_font_size()
- {//! \return font size for Y axis values.
+ {//! \return font size for Y axis values.
return y_values_style_.values_text_style_.font_size();
}
@@ -2773,21 +2774,21 @@
return y_values_style_.value_ioflags_;
}
- svg_2d_plot& svg_2d_plot::write(const std::string& file)
- { //! Write the plot image to a named file (default suffix .svg).
- std::string filename(file); // Copy to avoid problem with const if try to append.
- if (filename.find(".svg") == std::string::npos)
- { // No file type suffix, so provide the default .svg.
- filename.append(".svg");
- }
- std::ofstream fout(filename.c_str());
- if(fout.fail())
- {
- throw std::runtime_error("Unable to open " + filename);
- }
- write(fout); // Using the ostream version.
- return *this; //! \return reference to svg_2d_plot to make chainable.
- } // write(file)
+ svg_2d_plot& svg_2d_plot::write(const std::string& file)
+ { //! Write the plot image to a named file (default suffix .svg).
+ std::string filename(file); // Copy to avoid problem with const if try to append.
+ if (filename.find(".svg") == std::string::npos)
+ { // No file type suffix, so provide the default .svg.
+ filename.append(".svg");
+ }
+ std::ofstream fout(filename.c_str());
+ if(fout.fail())
+ {
+ throw std::runtime_error("Unable to open " + filename);
+ }
+ write(fout); // Using the ostream version.
+ return *this; //! \return reference to svg_2d_plot to make chainable.
+ } // write(file)
template <class T> //! \tparam T Type of data in series (must be convertible to unc double).
svg_2d_plot_series& svg_2d_plot::plot(const T& container, const std::string& title)
@@ -2826,7 +2827,7 @@
{ /*! Add a data series to the plot (by default, converting automatically to unc doubles).\n
This version permits part of the container to be used, a partial range, using iterators begin to end.\n
For example:
- \code
+ \code
my_2d_plot.plot(my_data.begin(), my_data.end(), "My container");
\endcode
\code
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/svg_boxplot.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/svg_boxplot.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/svg_boxplot.hpp 2009-03-27 08:57:32 EDT (Fri, 27 Mar 2009)
@@ -94,9 +94,10 @@
class svg_boxplot_series
{ /*! \class boost::svg::svg_boxplot_series
- \brief Information about a data series to be boxplotted.
+ \brief Information about a data series to be box plotted.
\details A Box Plot that can contain several boxplot data series.
- median, whiskers and outliers are computed for each series.
+ Median, whiskers and outliers are computed for each series.
+ \see http://en.wikipedia.org/wiki/Boxplot
*/
public: // TODO private?
std::vector<double> series_; //!< Data series for the boxplot.
@@ -110,29 +111,29 @@
std::vector<double> extreme_outliers_; //!< Any data values that are judged extreme outliers.
// std::string title_;
- text_style series_style_;
- text_element series_info_;
- double text_margin_;
+ text_style series_style_; //!< Style (font etc) for text.
+ text_element series_info_; //!< information about the data series.
+ double text_margin_; //!< Margin (SVG units, default pixels) around text items.
// svg_style(stroke, fill, width)
- double box_width_;
- svg_style box_style_;
- svg_style median_style_;
- svg_style axis_style_;
-
- double whisker_length_;
- svg_style min_whisker_style_;
- svg_style max_whisker_style_;
- value_style values_style_;
+ double box_width_; //!< Width of boxplot box.
+ svg_style box_style_; //!< line widths and colors of box.
+ svg_style median_style_; //!< line widths and colors of median marker.
+ svg_style axis_style_;//!< line widths and colors of X and Y axes.
+
+ double whisker_length_; //!< Length of boxplot 'whisker'.
+ svg_style min_whisker_style_; //!< Color and width etc of boxplot minimum 'whisker'.
+ svg_style max_whisker_style_; //!< Color and width etc of boxplot minimum 'whisker'.
+ value_style values_style_; //!< Style for data value labels.
- plot_point_style mild_outlier_;
- plot_point_style ext_outlier_;
+ plot_point_style mild_outlier_; //!< Style (shape, color...) for marking 'mild' outliers.
+ plot_point_style ext_outlier_; //!< Style (shape, color...) for marking 'extreme' outliers.
- bool outlier_values_on_;
- bool extreme_outlier_values_on_;
+ bool outlier_values_on_; //!< True if mild outliers are to have their values labelled.
+ bool extreme_outlier_values_on_; //!< True if extreme outliers are to have their values labelled.
- template <class T> // \tparam T is STL data container type.
- svg_boxplot_series( // Constructor.
+ template <class T> // \tparam T is STL data container type, typically double or uncertain .
+ svg_boxplot_series( //! Constructor, providing default values for all data members.
T begin, //!< Data container interator begin.
T end, //!< Data container interator end.
const std::string& title, // Data series title.
@@ -149,7 +150,7 @@
value_style vs, //!< Style for optional display of data point values.
text_style ss //!< series style (font etc) for box labels.
)
- // All other parameters can also be added using chainable functions.
+ //! All other parameters can also be added using chainable functions.
: //
box_width_(bw), // svg_boxplot::box_width()),
box_style_(bs), // green, azure, 1), // stroke, fill, width, 1, true, true, margin, border_on, fill_on
@@ -255,7 +256,7 @@
svg_boxplot_series& title(const std::string& t); //! Set title for data series.
const std::string title(); //! \return title for boxplot.
svg_boxplot_series& whisker_length(double l); //! Set length of whisker line.
- double whisker_length(); //! \return length of whisker line.
+ double whisker_length(); //! \return length of whisker line.
svg_boxplot_series& box_width(double l); //! Set width of box.
double box_width(); //! \return width of box.
svg_boxplot_series& min_whisker_color(const svg_color& col); //! Color of boxplot whisker.
@@ -332,7 +333,7 @@
{ //! Set minimum and maximum whisker length.
// Applies to BOTH min and max whisker.
whisker_length_ = width;
- return *this; // Chainable.
+ return *this; //! \return reference to svg_boxplot_series to make chainable.
}
double svg_boxplot_series::whisker_length()
@@ -420,7 +421,7 @@
}
svg_boxplot_series& svg_boxplot_series::outlier_style(plot_point_style& os)
- { //! Set entire outlier style.
+ { //! Set entire outlier style.
mild_outlier_ = os;
return *this; //! \return reference to svg_boxplot_series to make chainable.
}
@@ -645,7 +646,7 @@
double y_axis_position_; //! < Intersection of Y axis, or not.
// Plot window (calculate_plot_window() sets these values).
- double plot_left_;
+ double plot_left_;
double plot_top_;
double plot_right_;
double plot_bottom_;
@@ -1168,7 +1169,7 @@
/*! \verbatim
Assumes align = center_align.
Note: center_align will ensure that will center correctly
- even if original string is long because contains Unicode like
+ even if original string is long because contains Unicode like
because the browser render engine does the centering.
\endverbatim
*/
@@ -1839,7 +1840,7 @@
// svg_boxplot& load_stylesheet(const std::string& file); // Removed pending reimplementation of stylesheets.
- // Declarations of user boxplot functions.
+ // Declarations of user svg_boxplot functions.
svg_boxplot& write(const std::string& file); //! Write SVG boxplot to file.
svg_boxplot& write(std::ostream& s_out); //! Write SVG boxplot to ostream.
@@ -1900,12 +1901,12 @@
std::string x_label_text();
std::string y_label_text();
- // Member Functions to control all box and whisker settings.
+ // svg_boxplot Member Functions to control all box and whisker settings.
svg_boxplot& whisker_length(double width);
- double whisker_length();
- svg_boxplot& box_width(double width); // Width of the box, not the border.
- double box_width(); // Width of the box, not the border.
+ double whisker_length(); //!
+ svg_boxplot& box_width(double width); //! Width of the actual box (not the border).
+ double box_width(); //! \return Width of the box (not the border).
svg_boxplot& x_axis_position(int pos); // Position of the horizontal X-axis line (on the border).
double x_axis_position(); // Position of the horizontal X-axis line (on the border).
svg_boxplot& y_axis_position(int pos); // Position of the vertical Y-axis line (on the border).
@@ -1923,35 +1924,35 @@
svg_boxplot& axis_width(double l); // Width of vertical whisker axis line in box.
double axis_width(); // Width of vertical whisker axis line in box.
- plot_point_style& outlier_style();
+ plot_point_style& outlier_style(); //
svg_boxplot& outlier_style(plot_point_style& os);
- svg_boxplot& outlier_color(const svg_color& color); // Color of outlier marker.
- svg_color outlier_color(); // Color of outlier marker.
- svg_boxplot& outlier_fill(const svg_color& color); // Fill color of outlier marker.
- svg_color outlier_fill(); // Fill color of outlier marker.
+ svg_boxplot& outlier_color(const svg_color& color); //! Set Color of outlier marker.
+ svg_color outlier_color(); //! \return Color of outlier marker.
+ svg_boxplot& outlier_fill(const svg_color& color); //! Set Fill color of outlier marker.
+ svg_color outlier_fill(); //! \return Fill color of outlier marker.
svg_boxplot& extreme_outlier_color(const svg_color& color); // Color of extreme outlier marker.
- svg_color extreme_outlier_color(); // Color of extreme outlier marker.
+ svg_color extreme_outlier_color(); //! \return Color of extreme outlier marker.
svg_boxplot& extreme_outlier_fill(const svg_color& color); // Fill color of extreme outlier marker.
- svg_color extreme_outlier_fill(); // Fill color of extreme outlier marker.
+ svg_color extreme_outlier_fill(); //! \return Fill color of extreme outlier marker.
svg_boxplot& outlier_shape(point_shape shape); // Shape of outlier marker.
- point_shape outlier_shape(); // Shape of outlier marker.
+ point_shape outlier_shape(); //! \return Shape of outlier marker.
- svg_boxplot& outlier_size(int size); // Size of outlier marker.
+ svg_boxplot& outlier_size(int size); //! Set size of outlier marker.
int outlier_size(); // Size of outlier marker.
- svg_boxplot& extreme_outlier_shape(point_shape shape); // Shape of extreme outlier marker.
- point_shape extreme_outlier_shape(); // Shape of extreme outlier marker.
+ svg_boxplot& extreme_outlier_shape(point_shape shape); //! Shape of extreme outlier marker.
+ point_shape extreme_outlier_shape(); //! \return Shape of extreme outlier marker.
svg_boxplot& extreme_outlier_size(int size); // Size of extreme outlier marker.
- int extreme_outlier_size(); // Size of extreme outlier marker.
+ int extreme_outlier_size(); //! \return Size of extreme outlier marker.
svg_boxplot& quartile_definition(int def); // H&F quartile definition.
int quartile_definition(); // H&F quartile definition.
- bool y_autoscale(); // If to use y_autoscaled values.
- svg_boxplot& y_autoscale(bool b); // If to use y_autoscaled values.
+ bool y_autoscale(); //! \return If to use y_autoscaled values.
+ svg_boxplot& y_autoscale(bool b); //! \return If to use y_autoscaled values.
svg_boxplot& y_autoscale(double first, double second);// Autoscale using two doubles.
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-27 08:57:32 EDT (Fri, 27 Mar 2009)
@@ -344,7 +344,7 @@
// class text_style function *Definitions*.
- text_style::text_style(//! Default constructor only sets font size = 20, and leaves other font details as SVG defaults.
+ text_style::text_style( //!< Default constructor only sets font size = 20, and leaves other font details as SVG defaults.
int size,
const std::string& font, //!< Default for browser is sans with Firefox & IE but serif with Opera.
const std::string& style, //!< font-style: normal
@@ -419,23 +419,23 @@
}
text_style& text_style::font_weight(const std::string& s)
- { // svg font-weight: normal | bold | bolder | lighter | 100 | 200 .. 900
- // Examples: "bold", "normal"
- // http://www.croczilla.com/~alex/conformance_suite/svg/text-fonts-02-t.svg
- // tests conformance. Only two weights are supported by Firefox, Opera, Inkscape
+ { //! svg font-weight: normal | bold | bolder | lighter | 100 | 200 .. 900
+ //! Examples: "bold", "normal"
+ //! http://www.croczilla.com/~alex/conformance_suite/svg/text-fonts-02-t.svg
+ //! tests conformance. Only two weights, "bold", "normal", are supported by Firefox, Opera, Inkscape.
weight_ = s;
return *this;
//! \return reference to text_style to make chainable.
}
const std::string& text_style::font_stretch() const
- {
+ { //! \return font stretch, for example: normal | wider | narrower .
return stretch_;
}
text_style& text_style::font_stretch(const std::string& s)
- { // Examples: "wider" but implementation?
- // font-stretch: normal | wider | narrower ...
+ { //! Examples: "wider" but implementation by browsers varies.
+ //! font-stretch: normal | wider | narrower ...
stretch_ = s;
return *this; //! \return reference to text_style to make chainable.
}
@@ -483,7 +483,7 @@
} // operator!=
bool operator==(const text_style& lhs, const text_style& rhs)
- { //! Compare two text_style for equality
+ { //! Compare two text_style for equality
//! Note operator== and operator << both needed to use Boost.text.
//! (But can be avoided with a macro define).
return (lhs.font_size_ == rhs.font_size_)
@@ -495,7 +495,7 @@
} // bool operator==(const text_style& lhs, const text_style& rhs)
bool operator!= (const text_style& lhs, const text_style& rhs)
- { //! Compare two text_style for equality.
+ { //! Compare two text_style for equality.
//! Note operator== and operator << both needed to use Boost.Test.
//! (But can be avoided with a macro define).
return (lhs.font_size_ != rhs.font_size_)
@@ -570,9 +570,9 @@
}; // class value_style
// class value_style Member Functions definitions.
-// Constructor.
-value_style::value_style() //! Data point value label style (provides default color and font).
+ //!< Constructor Data point value label style (provides default color and font).
+ value_style::value_style()
:
value_label_rotation_(horizontal), //!< Label orientation, default horizontal.
value_precision_(4), //!< Reduced from default of 6 which is usually too long.
@@ -594,7 +594,7 @@
text_style ts, const svg_color& scol = black, svg_color fcol = black, bool pm = false, bool df = false,
// Separators [,] provide, for example: [1.23+-0.01 (3), 4.56 +-0.2 (10)]
// default color black.
- std::string pre = "", // "[",
+ std::string pre = "", // "[",
std::string sep = "", // ,\ ", // If put ", " the trailing space seems to be ignored, so add Unicode explicit space.
std::string suf = "") // "]")
:
@@ -675,7 +675,7 @@
//// to avoid writing over the point marker.
//text_style value_style_; // Size, font, color etc of the value.
- plot_point_style( //! Constructor with all defaults.
+ plot_point_style( //!< Constructor with all defaults.
const svg_color& stroke = black, const svg_color& fill = blank,
int size = 10, point_shape shape = round, const std::string& symbols = "X");
@@ -696,7 +696,7 @@
// class plot_point_style function Definitions.
// Constructor.
- plot_point_style::plot_point_style( //! Constructor with all defaults (see declaration).
+ plot_point_style::plot_point_style( //!< Constructor set defaults for data members. (see declaration).
const svg_color& stroke, const svg_color& fill,
int size, point_shape shape, const std::string& symbols)
:
@@ -720,7 +720,7 @@
}
int plot_point_style::size()
- { //! Get size of shape or symbol used to mark data value plot point(s).
+ { //! \return size of shape or symbol used to mark data value plot point(s).
return size_;
}
@@ -759,14 +759,14 @@
}
plot_point_style& plot_point_style::symbols(const std::string s)
- { // Override default symbol "X" - only effective if .shape(symbol) used.
+ { //! Override default symbol "X" - only effective if .shape(symbol) used.
symbols_ = s;
return *this; //! \return plot_point_style& to make chainable.
}
std::string& plot_point_style::symbols()
- {
+ { //! \return plot point marking symbol (only effective if .shape(symbol) used).
return symbols_;
}
@@ -777,7 +777,7 @@
}
text_style& plot_point_style::style() const
- { // To allow control of symbol font, size, decoration etc.
+ { //! \return text_style& To allow control of symbol font, size, decoration etc.
return const_cast<text_style&>(symbols_style_);
}
@@ -793,7 +793,7 @@
<< p.symbols_ << ", "
<< p.symbols_style_ << ", "
<< p.show_x_value_ << ", "
- << p.show_y_value_
+ << p.show_y_value_
// << ", symbols style: " << p.symbols_style_ // TODO check this works and alter example.
<< ")";
/*! \details Example: plot_point_style p; cout << p << endl;
@@ -803,7 +803,7 @@
} // std::ostream& operator<<
//! plot_point_style that uses all the defaults.
-plot_point_style default_plot_point_style();
+plot_point_style default_plot_point_style();
class plot_line_style
{ //! \class boost::svg::plot_line_style Style of line joining data series values.
@@ -860,7 +860,7 @@
}
svg_color& plot_line_style::color()
- { //! \return color of line(s) joining data points.
+ { //! \return color of line(s) joining data points.
return stroke_color_;
}
@@ -876,23 +876,23 @@
}
bool plot_line_style::line_on() const
- { // True if line(s) will join data points.
+ { //! \return True if line(s) will join data points.
return line_on_;
}
plot_line_style& plot_line_style::line_on(bool is)
- { // Set true if line(s) are to join data points.
+ { //! Set true if line(s) are to join data points.
line_on_ = is;
return *this; //! \return plot_line_style& to make chainable.
}
bool plot_line_style::bezier_on() const
- { // Get true if bezier curved line(s) are to join data points.
+ { //! \return true if bezier curved line(s) are to join data points.
return bezier_on_;
}
plot_line_style& plot_line_style::bezier_on(bool is)
- { // Set true if bezier curved line(s) are to join data points.
+ { //! Set true if bezier curved line(s) are to join data points.
bezier_on_ = is;
return *this; //! \return plot_line_style& to make chainable.
}
@@ -943,7 +943,7 @@
bool axis_line_on_; //!< Draw an X horizontal or Y vertical axis line.
double axis_; //!< Depending on value of dim, either X-axis (y = 0) transformed into SVG Y coordinates or Y-axis (x = 0) transformed into SVG X coordinates (-1 if not calculated yet).
// Used in axis_plot_frame.hpp
- axis_line_style( //!< class axis_line_style default constructor, sets all member data items.
+ axis_line_style( //!< class axis_line_style default constructor, sets default values for all member data items.
dim d = X,
double min = -10.,
double max = +10., // Defaults.
@@ -971,9 +971,9 @@
bool axis_line_on() const;
}; // class axis_line_style
-// class axis_line_style Member Functions Definitions:
+ // class axis_line_style Member Functions Definitions:
// Default constructor.
- axis_line_style::axis_line_style( // Sets all member data items with defaults for all.
+ axis_line_style::axis_line_style( //!< Sets all member data items with defaults for all.
dim d, //!< Dimension (zero if boxplot)
double min, //!< Minimum of axis line.
double max, //!< Maximum of axis line.
@@ -1088,7 +1088,7 @@
double minor_interval_; //!< Interval (Cartesian units) between minor ticks.
// No set function because x_num_minor_ticks_ used to determine this instead,
// but one could calculate x_minor_interval_.
- unsigned int num_minor_ticks_; //! number of minor ticks, eg 4 gives major 0, minor 1,2,3,4, major 5 (All units in svg units, default pixels).
+ unsigned int num_minor_ticks_; //!< number of minor ticks, eg 4 gives major 0, minor 1,2,3,4, major 5 (All units in svg units, default pixels).
svg_color major_tick_color_; //!< Color (stroke) of tick lines.
double major_tick_width_; //!< Width of major tick lines.
double major_tick_length_;//!< Length of major tick lines.
@@ -1122,7 +1122,8 @@
// 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(dim d = X,
+ ticks_labels_style( //! Constructor, providng defaults values for all member data.
+ dim d = X,
const text_style& style = no_style,
double max = 10., double min = -10.,
double major_interval = 2.,
@@ -1278,12 +1279,12 @@
}
int major_value_labels_side() const
- { // Get side for tick value labels: left (<0), none (==0) or right (>0).
+ { //! \return side for tick value labels: left (<0), none (==0) or right (>0).
return major_value_labels_side_;
}
ticks_labels_style& major_value_labels_side(int is)
- { // Set side for tick value labels: left (<0), none (==0) or right (>0).
+ { //! Set side for tick value labels: left (<0), none (==0) or right (>0).
major_value_labels_side_ = is;
return *this; //! \return ticks_labels_style& to make chainable.
}
@@ -1436,12 +1437,12 @@
\brief Histogram options.
*/
public:
- histogram_option histogram_option_; //! default bar, no_histogram or column.
+ histogram_option histogram_option_; //!< default bar, no_histogram or column.
- histogram_style(histogram_option opt = no_histogram);
+ histogram_style(histogram_option opt = no_histogram); //!< Set any histogram option.
- histogram_style& histogram(histogram_option opt);
- double histogram();
+ histogram_style& histogram(histogram_option opt); //!< Set any histogram option.
+ double histogram(); //!
}; // class histogram_style
@@ -1451,8 +1452,8 @@
histogram_style::histogram_style(histogram_option opt)
:
histogram_option_(opt)
-{ // Default for all private data.
- // Line width and area-fill are taken from the plot_line_style style.
+{ //! Constructor providing defaults for all private data.
+ //! Line width and area-fill are taken from the plot_line_style style.
}
// Member Functions Definitions.
@@ -1464,7 +1465,7 @@
}
double histogram_style::histogram()
-{ //
+{ // \return Histogram option.
return histogram_option_;
}
// End class histogram_style Definitions.
@@ -1480,7 +1481,7 @@
double width_; //!< Width of bar, not enclosing line width.
bar_option bar_option_; //!< stick or bar.
bar_style(const svg_color& col = black, const svg_color& acol = true, double width = 2, bar_option opt = no_bar); //!< Construct with defaults for all member variables.
- bar_style& width(double w); //!<
+ bar_style& width(double w); //!<
double width();
bar_style& color(const svg_color& f);
svg_color& color();
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/uncertain.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/uncertain.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/uncertain.hpp 2009-03-27 08:57:32 EDT (Fri, 27 Mar 2009)
@@ -8,8 +8,9 @@
This is a simple model of uncertainties, designed to
accompany an article published in C/C++ Users Journal March 1996.
A fuller collection of even fancier classes also given in UReal.h.
- And also based on a extended version including uncertainty as standard deviation & its uncertainty
+ And also based on a extended version including uncertainty as standard deviation & its uncertainty
as degrees of freedom, and other information about the value added Paul A Bristow from 31 Mar 98.
+ \see http://en.wikipedia.org/wiki/Plus-minus_sign
\author Paul A. Bristow
\date Mar 2009
@@ -40,16 +41,17 @@
static const double plusminus = 2.; //!< Number of standard deviations used for plusminus text display.\n
// template <bool correlated = false>
-class unc
-{ /*! \brief Class for storing an observed or measured value together with information
- about its uncertainty (previously called 'error' or 'plusminus') represented
- nominally one standard deviation (but displayed as a multiple, usually two standard deviations).
+/*! \brief Uncertain class for storing an observed or measured value together with information
+ about its uncertainty (previously called 'error' or 'plusminus', but now deprecated) represented
+ nominally one standard deviation (but displayed as a multiple, usually two standard deviations).
\details This version assumes uncorrelated uncertainties (by far the most common case).
\see http://www.measurementuncertainty.org/ \n
International Vocabulary of Basic and General Terms in Metrology; ISO/TAG 4 1994\n
ISO, Guide to the expression of uncertainty in measurement, ISO, Geneva, 1993.\n
Eurochem, Quantifying uncertainty in analytical measurements.
*/
+class unc
+{
public:
unc(); // Default constructor.
unc(double v, float u, short unsigned df, short unsigned ty);
@@ -76,7 +78,7 @@
double value_; //!< Most likely value, typically the mean.
float uncertainty_; //!< Estimate of uncertainty, typically one standard deviation.
//! Negative values mean that uncertainty is not defined.
- //!
+ //!
short unsigned deg_free_; /*!< Degrees of freedom, usually = number of observations -1;
so for 2 observations, 1 degree of freedom.
Range from 0 (1 observation) to 65534 = (std::numeric_limits<unsigned short int>::max)() - 1\n
@@ -123,7 +125,7 @@
value_ = u.value_;
uncertainty_ = u.uncertainty_;
deg_free_ = u.deg_free_;
- types_ = u.types_ ;
+ types_ = u.types_ ;
return *this; //! to make chainable.
}
@@ -184,7 +186,7 @@
//! hexadecimal F1, or
// os << " ±"
//! Unicode space plusminus glyph, or\n
- //! os << " +or-" << u.uncertainty_;
+ //! os << " +or-" << u.uncertainty_;
//! Plain ANSI 7 bit code chars.
<< u.uncertainty_ * plusminus; // Typically two standard deviation.
};
@@ -265,7 +267,7 @@
double vp1 = up.first.value();
double vp2 = up.second.value();
std::pair<double, double> minmax = std::make_pair(up.first.value(), up.second.value());
- return minmax;
+ return minmax;
}
template <class T>
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