|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r81707 - in sandbox/SOC/2007: quan/boost/quan/impl visualization/boost/svg_plot visualization/boost/svg_plot/detail visualization/libs/svg_plot/example visualization/libs/svg_plot/test
From: pbristow_at_[hidden]
Date: 2012-12-04 13:11:53
Author: pbristow
Date: 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
New Revision: 81707
URL: http://svn.boost.org/trac/boost/changeset/81707
Log:
OK for gcc, Clang and VS 2010
Binary files modified:
sandbox/SOC/2007/visualization/libs/svg_plot/example/1d_simple_style.svg
Text files modified:
sandbox/SOC/2007/quan/boost/quan/impl/xiostream.ipp | 3 +
sandbox/SOC/2007/visualization/boost/svg_plot/detail/functors.hpp | 18 +++++-----
sandbox/SOC/2007/visualization/boost/svg_plot/detail/svg_tag.hpp | 71 +++++++++++++++++++++------------------
sandbox/SOC/2007/visualization/boost/svg_plot/svg.hpp | 6 +-
sandbox/SOC/2007/visualization/boost/svg_plot/svg_boxplot.hpp | 8 ++--
sandbox/SOC/2007/visualization/boost/svg_plot/svg_fwd.hpp | 5 +-
sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp | 54 +++++++++++++++---------------
sandbox/SOC/2007/visualization/libs/svg_plot/example/1d_full_layout.cpp | 1
sandbox/SOC/2007/visualization/libs/svg_plot/example/Jamfile.v2 | 69 ++++++++++++++++++++++++++------------
sandbox/SOC/2007/visualization/libs/svg_plot/example/auto_1d_plot.cpp | 2
sandbox/SOC/2007/visualization/libs/svg_plot/example/container_minmax.cpp | 4 +-
sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_autoscaling.cpp | 2
sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_axis_scaling.cpp | 2
sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_heat_flow_data.cpp | 8 ++--
sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_plot.cpp | 2
sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_uncertainty.cpp | 15 ++++---
sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_svg.cpp | 61 ++++++++++++++++++++++-----------
sandbox/SOC/2007/visualization/libs/svg_plot/test/1d_color_consistency.cpp | 30 ++++++++--------
18 files changed, 207 insertions(+), 154 deletions(-)
Modified: sandbox/SOC/2007/quan/boost/quan/impl/xiostream.ipp
==============================================================================
--- sandbox/SOC/2007/quan/boost/quan/impl/xiostream.ipp (original)
+++ sandbox/SOC/2007/quan/boost/quan/impl/xiostream.ipp 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
@@ -164,6 +164,7 @@
return os;
}
+/*
// Manipulator to set specified base and to show base letter O or X uppercase.
// Usage: out << setupperbase(16) ...
setupperbase::setupperbase(int b) : base(b)
@@ -182,7 +183,7 @@
);
return os;
} // std::ostream& operator<< (std::ostream& os, const setupperbase& s)
-
+*/
void outIOstates(std::ios_base::iostate rdState, std::ostream& os, const char* term)
{ // Usages:
// Default logs cout iostate to cerr, for example "IOstate: good", or "IOstate: fail"
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 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
@@ -111,11 +111,11 @@
public:
typedef std::pair<double, double> result_type; //!< result type is a pair (X and Y) of doubles.
- double i; //!< Start value.
+ double i; //!< Current value, 1st set by start(double i0).
- void start(double i)
+ void start(double i0)
{ //! Set a start value.
- i = i;
+ i = i0;
}
//! Convert a pair of X and Y (whose types can be converted to double values) to a pair of doubles.
@@ -143,11 +143,11 @@
public:
typedef std::pair<unc<correlated>, unc<correlated> > result_type; //!< result type is pair of uncertain values.
- unc<correlated> i; //!< Start uncertain value.
+ unc<correlated> i; //!< Current uncertaint value, 1st set by start(double i0).
- void start(unc<correlated> i)
+ void start(unc<correlated> i0)
{ //!< Set a start value.
- i = i;
+ i = i0;
}
//!< \tparam T type convertible to double.
@@ -176,11 +176,11 @@
typedef std::pair<Meas, unc<correlated> > result_type;
//!< result type is pair of uncertain values.
- Meas i; //!< Start Meas (uncun + datetime etc) value.
+ Meas i; //!< Current Meas (uncun + datetime etc) value.
- void start(Meas i)
+ void start(Meas i0)
{ //!< Set a start value.
- i = i;
+ i = i0;
}
//!< \tparam T type convertible to double.
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 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
@@ -5,11 +5,12 @@
svg_tag.hpp defines all classes that can occur in the SVG parse tree.
\author Jacob Voytko and Paul A. Bristow
- \date Mar 2009
*/
+// svg_tag.hpp
+
// Copyright Jacob Voytko 2007, 2008
-// Copyright Paul A Bristow 2007, 2008, 2009
+// Copyright Paul A Bristow 2007, 2008, 2009, 2012
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0.
@@ -234,7 +235,7 @@
/details Straight line from SVG location (x1, y1) to (x2, y2).
*/
- public: //temporary for experimental gil
+ public:
// private:
double x1_; //!< Line from (x1_, x2_) to (y1_, y2_)
double x2_; //!< Line from (x1_, x2_) to (y1_, y2_)
@@ -243,7 +244,7 @@
public:
line_element(double x1, double y1, double x2, double y2)
- : x1_(x1), y1_(y1), x2_(x2), y2_(y2)
+ : x1_(x1), x2_(x2), y1_(y1), y2_(y2)
{ //! Constructor assigning all line_element private data.
}
@@ -254,7 +255,7 @@
const std::string& id_name = "",
const std::string& class_name = "",
const std::string& clip_name = "")
- : x1_(x1), y1_(y1), x2_(x2), y2_(y2),
+ : x1_(x1), x2_(x2), y1_(y1), y2_(y2),
svg_element(style_info, id_name, class_name, clip_name)
{ //! Constructor assigning all line_element private data,
//! and also inherited svg_element data.
@@ -278,12 +279,12 @@
*/
public: //temporary for experimental gil
// private:
- double x1_; //!< Quadratic curved line from (x1_, y1_) control point (x2_, y2_) to (y3_, y3_)
- double x2_; //!< Quadratic curved line from (x1_, y1_) control point (x2_, y2_) to (y3_, y3_)
- double y1_; //!< Quadratic curved line from (x1_, y1_) control point (x2_, y2_) to (y3_, y3_)
- double y2_; //!< Quadratic curved line from (x1_, y1_) control point (x2_, y2_) to (y3_, y3_)
- double x3_; //!< Quadratic curved line from (x1_, y1_) control point (x2_, y2_) to (y3_, y3_)
- double y3_; //!< Quadratic curved line from (x1_, y1_) control point (x2_, y2_) to (y3_, y3_)
+ double x1_; //!< Quadratic curved line from (x1_, y1_) control point (x2_, y2_) to (y3_, y3_).
+ double x2_; //!< Quadratic curved line from (x1_, y1_) control point (x2_, y2_) to (y3_, y3_).
+ double y1_; //!< Quadratic curved line from (x1_, y1_) control point (x2_, y2_) to (y3_, y3_).
+ double y2_; //!< Quadratic curved line from (x1_, y1_) control point (x2_, y2_) to (y3_, y3_).
+ double x3_; //!< Quadratic curved line from (x1_, y1_) control point (x2_, y2_) to (y3_, y3_).
+ double y3_; //!< Quadratic curved line from (x1_, y1_) control point (x2_, y2_) to (y3_, y3_).
public:
// bool fill; now inherited from parent svg class.
@@ -300,7 +301,7 @@
const std::string& id_name="",
const std::string& class_name="",
const std::string& clip_name = "")
- : x1_(x1), y1_(y1), x2_(x2), y2_(y2), x3_(x3), y3_(y3),
+ : x1_(x1),x2_(x2), y1_(y1), y2_(y2), x3_(x3), y3_(y3),
svg_element(style_info, id_name, class_name, clip_name)
{ //!< Quadratic curved line constructor, including svg_element info.
}
@@ -357,8 +358,9 @@
const std::string& id_name,
const std::string& class_name,
const std::string& clip_name)
- : x_(x), y_(y), width_(w), height_(h),
- svg_element(style_info, id_name, class_name, clip_name)
+ :
+ svg_element(style_info, id_name, class_name, clip_name),
+ x_(x), y_(y), width_(w), height_(h)
{ //! Constructor defines all private data (inherites info from svg_element).
}
@@ -452,8 +454,9 @@
const std::string& class_name="",
const std::string& clip_name=""
)
- : x(x), y(y), radius(radius),
- svg_element(style_info, id_name, class_name, clip_name)
+ :
+ x(x), y(y),
+ svg_element(style_info, id_name, class_name, clip_name), radius(radius)
{ //! Constructor defines all private data.
}
@@ -502,8 +505,9 @@
const std::string& id_name="", //!< ID of group, for example: PLOT_X_TICKS_VALUES.
const std::string& class_name="", //!< Name of SVG class, for example: "grid_style".
const std::string& clip_name="") //!< name of clip path.
- : cx_(cx), cy_(cy), rx_(rx), ry_(ry), rotate_(0.),
- svg_element(style_info, id_name, class_name, clip_name)
+ :
+ svg_element(style_info, id_name, class_name, clip_name),
+ cx_(cx), cy_(cy), rx_(rx), ry_(ry), rotate_(0.)
{ //!< Constructor sets ellipse and its style (defaults define all private data).
}
ellipse_element(
@@ -514,8 +518,9 @@
const std::string& class_name = "", //!< Name of SVG class."grid_style"
const std::string& clip_name = "") //!< name of clip path.
: cx_(cx), cy_(cy), rx_(4), ry_(8), // 4 and 8 are the same defaults used above.
- rotate_(0.), // Horizontal.
- svg_element(style_info, id_name, class_name, clip_name)
+
+ svg_element(style_info, id_name, class_name, clip_name),
+ rotate_(0.) // Horizontal.
{ //!< Constructor that also includes style, id, class and clip.
}
@@ -606,10 +611,10 @@
public:
tspan_element(const std::string& text, //!< Text string to display.
const text_style& style = no_style) //!< Text style (font).
- :
- x_(0), y_(0), dx_(0), dy_(0), rotate_(0), text_length_(0),
+ :
use_x_(false), use_y_(false), use_text_length_(false),
- style_(style), text_parent(text)
+ text_parent(text), style_(style),
+ x_(0), y_(0), dx_(0), dy_(0), rotate_(0), text_length_(0)
{ //! Construct tspan element (with all defaults except text string).
}
@@ -893,10 +898,11 @@
tspan_element::tspan_element(const tspan_element& rhs)
:
- x_(rhs.x_), y_(rhs.y_), dx_(rhs.dx_), dy_(rhs.dy_), rotate_(rhs.rotate_),
text_length_(rhs.text_length_), use_x_(rhs.use_x_), use_y_(rhs.use_y_),
- use_text_length_(rhs.use_text_length_), style_(rhs.style_),
- text_parent(rhs)
+ use_text_length_(rhs.use_text_length_),
+ text_parent(rhs), style_(rhs.style_),
+ x_(rhs.x_), y_(rhs.y_), dx_(rhs.dx_), dy_(rhs.dy_), rotate_(rhs.rotate_)
+
{ // Separately defined constructor.
} // tspan_element::tspan_element
@@ -1238,7 +1244,8 @@
} // void write(std::ostream& o_str)
m_path(double x, double y, bool relative = false)
- : x(x), y(y), path_point(relative)
+ : path_point(relative),
+ x(x), y(y)
{ //! Construct a move to
}
}; // struct m_path
@@ -1284,7 +1291,7 @@
}
l_path(double x, double y, bool relative = false)
- : x(x), y(y), path_point(relative)
+ : x(x), path_point(relative), y(y)
{ //! Constructor defines all member variables.
}
}; // struct l_path
@@ -1309,7 +1316,7 @@
}
h_path(double x, bool relative = false)
- : x(x), path_point(relative)
+ : path_point(relative), x(x)
{ //!< Constructor defines all member variables.
}
}; // struct h_path
@@ -1334,7 +1341,7 @@
}
v_path(double y, bool relative = false)
- : y(y), path_point(relative)
+ : path_point(relative), y(y)
{ //!< Constructor (defines all member variables).
}
}; // struct v_path
@@ -1368,7 +1375,7 @@
c_path(double x1, double y1, double x2, double y2,
double x, double y, bool relative = false)
- : x1(x1), y1(y1), x2(x2), y2(y2), x(x), y(y), path_point(relative)
+ : path_point(relative), x1(x1), y1(y1), x2(x2), y2(y2), x(x), y(y)
{ //!< Constructor defines all member variables.
}
}; // struct c_path
@@ -1397,7 +1404,7 @@
}
q_path(double x1, double y1, double x, double y, bool relative = false)
- : x1(x1), y1(y1), x(x), y(y), path_point(relative)
+ : path_point(relative), x1(x1), y1(y1), x(x), y(y)
{ //! Constructor quadratic Bezier curve.
}
}; //struct q_path
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 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
@@ -391,17 +391,17 @@
y_size_(400), //!< Y-axis of the whole SVG image (default SVG units, default pixels).
title_document_(""), //!< This is a SVG document title, not a plot title.
image_desc_(""), //!< Information about the SVG image, for example, the program that created it.
- author_(""), //!< Author of image (defaults to the copyright holder).
holder_copyright_(""), //!< Name of copyright holder.
date_copyright_(""), //!< Date of copyright claim.
+ author_(""), //!< Author of image (defaults to the copyright holder).
css_(""), //!< Stylesheet filename.
filename_(""), //!< Name of file to which SVG XML has been written is embedded in the file as an XML comment (if written only to an ostream, filename will not appear in comment).
- is_license_(false), //!< If true, license text is written as comment in SVG XML. (Default is no license).
is_boost_license_(false), //!< If true, Boost license text is written as comment in SVG XML. (Default is no license). Suggested strings for license permission are "permits", "requires", or "prohibits", or "".
+ is_license_(false), //!< If true, license text is written as comment in SVG XML. (Default is no license).
reproduction_("permits"), //!< Default license permits reproduction.
- distribution_("permits"), //!< Default license permits distribution.
attribution_("requires"), //!< Default license requires attribution.
commercialuse_("permits"), //<! Default license permits commerical use.
+ distribution_("permits"), //!< Default license permits distribution.
derivative_works_("permits"), //!< Default license permits derivative works.
coord_precision_(3) //!< 3 decimal digits precision is enough for 1 in 1000 resolution: suits small image use. Higher precision (4, 5 or 6) will be needed for larger images, but increase the SVG XML file size, especially if there are very many data values.
{ // Default constructor.
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 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
@@ -633,7 +633,7 @@
*/
class svg_boxplot : public detail::axis_plot_frame<svg_boxplot>
{
- friend svg_boxplot_series;
+ friend class svg_boxplot_series;
friend class detail::axis_plot_frame<svg_boxplot>;
// axis_plot_frame.hpp contains functions common to 1 and 2-D, and boxplot.
@@ -1091,7 +1091,7 @@
// and x_axis_ is svg coordinate of Y-axis (usually y = 0).
// If not fix axis to bottom (or top) of the plot window.
if ((x_axis_position_ == bottom) // All Y values definitely > zero.
- )// && !(x_ticks_.ticks_on_window_or_on_axis_ < 0) ) // & not already at bottom.
+ && !(x_ticks_.ticks_on_window_or_on_axis_ < 0) ) // & not already at bottom.
{ // y_min_ > 0 so X-axis will not intersect Y-axis, so use plot window.
x_axis_.axis_ = plot_bottom_; // Put X-axis on bottom.
}
@@ -1112,14 +1112,14 @@
// and y_axis_ is svg coordinate of X-axis (usually x = 0).
// Instead fix axis to left (or right) of the plot window.
if ((y_axis_position_ == left) // All X values definitely > zero.
- //&& !(y_ticks_.ticks_on_window_or_on_axis_ < 0) // & not already at left.
+ && !(y_ticks_.ticks_on_window_or_on_axis_ < 0) // & not already at left.
)
{ // Y-axis will not intersect X -axis, so put Y-axis line on plot window.
y_axis_.axis_ = plot_left_; // Y-axis to left,
//plot_left_ += 2 * y_label_info_.font_size(); // with a space.
}
else if ((y_axis_position_ == right) // All X values definitely < zero.
- //&& !(y_ticks_.ticks_on_window_or_on_axis_ > 0) // & not already at right.
+ && !(y_ticks_.ticks_on_window_or_on_axis_ > 0) // & not already at right.
)
{
y_axis_.axis_ = plot_right_; // Y-axis to right of plot window,
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/svg_fwd.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/svg_fwd.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/svg_fwd.hpp 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
@@ -7,7 +7,7 @@
*/
// Copyright Jacob Voytko 2007
-// Copyright Paul A. Bristow 2007, 2008
+// Copyright Paul A. Bristow 2007, 2008, 2012
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0.
@@ -52,7 +52,8 @@
// \detail\svg_style.hpp
using boost::svg::detail::plot_doc_structure;
-enum plot_doc_structure;
+
+// enum plot_doc_structure; // ISO C++ forbids forward references to 'enum' types
// svg.hpp
// Chainable set and get member functions for:
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 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
@@ -356,8 +356,8 @@
: // Constructor.
font_size_(size),
font_family_(font),
- style_(style),
weight_(weight),
+ style_(style),
stretch_(stretch),
decoration_(decoration)
{ // text_style default constructor, defines defaults for all private members.
@@ -1171,8 +1171,8 @@
dim dim_; //!< X, Y, or None.
double min_; //!< Minimum x value (Cartesian units).
double max_; //!< Maximum x value (Cartesian units).
- double major_interval_; //!< Stride or interval between major x ticks (Cartesian units).
double minor_interval_; //!< Interval (Cartesian units) between minor ticks.
+ double major_interval_; //!< Stride or interval between major x ticks (Cartesian units).
// 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).
@@ -1217,26 +1217,25 @@
text_style value_label_style_; //!< text style (font, size...) for value labels.
//! Constructor setting several parameters, but providing default values for all member data.
- ticks_labels_style(
- dim d = X, //!< X or Y axis (-1 if not assigned yet).
- const text_style& style = no_style, //!< Default text font style.
- double max = 10., //!< Maximum x value (Cartesian units).
- double min = -10., //!< Minimum x value (Cartesian units).
- double major_interval = 2., //!< Interval between major ticks.
- unsigned int num_minor_ticks = 4) //!< Number of minor ticks between major ticks.
- : // Constructor.
- dim_(d),
- value_label_style_(style),
- max_(max), min_(min),
- major_interval_(major_interval),
- num_minor_ticks_(num_minor_ticks),
- // Other data can be changed by set functions.
-
+ ticks_labels_style(
+ dim d = X, //!< X or Y axis (-1 if not assigned yet).
+ const text_style& style = no_style, //!< Default text font style.
+ double max = 10., //!< Maximum x value (Cartesian units).
+ double min = -10., //!< Minimum x value (Cartesian units).
+ double major_interval = 2., //!< Interval between major ticks.
+ unsigned int num_minor_ticks = 4) //!< Number of minor ticks between major ticks.
+ : // Constructor.
// Initialize all private data.
+ // Other data can be changed by set functions.
+ dim_(d), // 1 or 2 D
+ min_(min),
+ max_(max),
+ minor_interval_(0), //!< Calculated from x & y_num_minor_ticks_
+ major_interval_(major_interval),
+ num_minor_ticks_(num_minor_ticks),
// These are the plot defaults.
// major_interval_(2.), // x stride between major ticks & value label.
// num_minor_ticks_(4), // suits: major 0, minor 2, 4, 6, 8, major 10
- minor_interval_(0), //!< Calculated from x & y_num_minor_ticks_
// but given a value here for safety.
major_tick_color_(black), // line stroke color.
major_tick_width_(2),
@@ -1245,8 +1244,8 @@
minor_tick_width_(1),
minor_tick_length_(2),
major_grid_color_(svg_color(200, 220, 255)),
- minor_grid_color_(svg_color(200, 220, 255)),
major_grid_width_(1.), // pixels.
+ minor_grid_color_(svg_color(200, 220, 255)),
minor_grid_width_(0.5), // pixels.
up_ticks_on_(false), // Draw ticks up from horizontal X-axis line.
@@ -1269,10 +1268,11 @@
label_max_length_(0.), // length (estimated in SVG units) of longest label on axis.
label_max_space_(0.), // Space (estimated in SVG units) of longest label on axis
// adjusted for rotation.
- ticks_on_window_or_on_axis_(-1) // Value labels & ticks on the plot window,
+ ticks_on_window_or_on_axis_(-1), // Value labels & ticks on the plot window,
// rather than on X or Y-axis.
// Default -1 means left or bottom of plot window.
- {
+ value_label_style_(style)
+ {
if(max_ <= min_)
{ // max_ <= min_.
throw std::runtime_error("Axis ticks & labels range: max <= min!");
@@ -1719,8 +1719,8 @@
If possible use an actual length, but probably platform and/or browser-dependent,
else use average char width,
and deal with Unicode, for example Ω = greek omega,
- counting each symbol(s) embedded between & amd ; as one character,
- and ignore embedded xml like <sub> (not implemented by browsers yet).
+ counting each symbol(s) embedded between & and ; as one character,
+ and ignore embedded xml like <sub> (not implemented by all browsers yet).
\endverbatim
\return length of string in SVG units depending on text_style (font size etc).
*/
@@ -1733,19 +1733,19 @@
{ // Start of Unicode 'escape sequence'
in_esc = true;
while ((*i != ';')
- && (i != s.end())) // In case mistakenly not terminated.
+ && (i != s.end())) // In case mistakenly not null terminated.
{
- i++; // Only count Unicode string as 1 character wide.
+ i++; // Only count a Unicode string like Ω as 1 character (omega) wide.
}
in_esc = false;
}
if (*i == '<')
- {
+ { // Embedded xml like <sub> or <super>.
in_esc = true;
while ((*i != '>')
&& (i != s.end())) // In case mistakenly not terminated.
{
- i++; // Only count <...>; as NO character wide.
+ // i++; // Only count <...>; as NO characters wide.
}
d--;
in_esc = false;
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/1d_full_layout.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/1d_full_layout.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/1d_full_layout.cpp 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
@@ -2,7 +2,6 @@
\brief Example of 1 D plot of 3 different STL container types using several layout features.
\details creates file 1d_complex.svg
\author Jacob Voytko
- \date 2007
*/
// Copyright Jacob Voytko 2007
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/1d_simple_style.svg
==============================================================================
Binary files. No diff available.
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/Jamfile.v2
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/Jamfile.v2 (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/Jamfile.v2 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
@@ -2,38 +2,64 @@
# Runs SVG Plot examples
-# Copyright 2009 Paul A. Bristow.
+# Copyright 2009, 2012 Paul A. Bristow.
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-# bring in the rules for testing
+# Bring in the rules for testing.
import testing ;
+import path ;
+import modules ;
+import os ;
+
+if [ os.name ] = NT
+{
+
+}
+
+echo "Building SVGplot examples." ;
+
project
- : requirements
+ : requirements
+ <define>BOOST_ALL_NO_LIB # Avoid using 'libboost_math_c99-vc100-mt-gd-1_53.lib'.
+ # GCC
+ <toolset>gcc:<cxxflags>-w # Inhibit all warning messages.
<toolset>gcc:<cxxflags>-Wno-missing-braces
- <toolset>darwin:<cxxflags>-Wno-missing-braces
- <toolset>acc:<cxxflags>+W2068,2461,2236,4070
- <toolset>intel:<cxxflags>-Qwd264,239
+ #<toolset>gcc:<cxxflags>-std=c++0x
+ # Darwin
+ #<toolset>darwin:<cxxflags>-Wno-missing-braces
+ #<toolset>acc:<cxxflags>+W2068,2461,2236,4070
+ #<toolset>intel:<cxxflags>-Qwd264,239
+ # Clang
+ <toolset>clang:<cxxflags>-w # Inhibit all warning messages.
+ <toolset>clang:<cxxflags>-fpermissive
+ #<toolset>clang:<cxxflags>-Wno-reorder
+ #<toolset>clang:<cxxflags>-Wno-unused-variable
+ #<toolset>clang:<link>static
+ # MSVC
+ #<toolset>msvc:<link>static
<toolset>msvc:<warnings>all
- <toolset>msvc:<asynch-exceptions>on
- <toolset>msvc:<cxxflags>/wd4800 # forcing value to bool 'true' or 'false'
+ #<toolset>msvc:<asynch-exceptions>on
+ <toolset>msvc:<cxxflags>/wd4800 # Forcing value to bool 'true' or 'false'
<toolset>msvc:<cxxflags>/wd4996 # Deprecated.
- <toolset>msvc:<cxxflags>/wd4512 # assignment operator could not be generated.
- <toolset>msvc:<cxxflags>/wd4610
- <toolset>msvc:<cxxflags>/wd4510
- <toolset>msvc:<cxxflags>/wd4127
- <toolset>msvc:<cxxflags>/wd4701
- <toolset>msvc:<cxxflags>/wd4127 # expression is constant.
- <toolset>msvc:<cxxflags>/wd4305
- <toolset>msvc:<cxxflags>/wd4503 # decorated name length exceeded, name was truncated.
- <toolset>msvc:<cxxflags>/wd4180 # qualifier applied to function type has no meaning; ignored.
- <include>../../..
- <include>$(boost_root)
+ <toolset>msvc:<cxxflags>/wd4512 # Assignment operator could not be generated.
+ #<toolset>msvc:<cxxflags>/wd4610 #
+ #<toolset>msvc:<cxxflags>/wd4510 #
+ #<toolset>msvc:<cxxflags>/wd4701 #
+ <toolset>msvc:<cxxflags>/wd4127 # Expression is constant.
+ #<toolset>msvc:<cxxflags>/wd4305 #
+ #<toolset>msvc:<cxxflags>/wd4503 # Decorated name length exceeded, name was truncated.
+ #<toolset>msvc:<cxxflags>/wd4180 # Qualifier applied to function type has no meaning; ignored.
+
+ <include>../../../ # boost-sandbox/SOC/2007/visualization
+ <include>../../../../../../../ # boost-trunk
+ <include>../../../..//quan/ # boost-sandbox/SOC/2007/quan
;
+
-run 1d_full_layout.cpp ;
+run 1d_full_layout.cpp ;
run 1d_simple_style.cpp ;
run 1d_x_external.cpp ;
run 1d_x_grid.cpp ;
@@ -83,7 +109,7 @@
run svg_colors.cpp ;
run svg_test.cpp ;
run svg_test_boxplot.cpp ;
-run demo_fp_compare.cpp ; #
+#run demo_fp_compare.cpp ; #
#run test_1d_color_consistency.cpp ;
#run test_legend_place.cpp ;
@@ -94,7 +120,6 @@
#run test_sci.cpp ;
#run test_unc.cpp ;
#run test_unc_pair.cpp ;
-
#run default_1d_plot.cpp ;
#run default_2d_plot.cpp ;
#run test_axis_scaling.cpp ;
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/auto_1d_plot.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/auto_1d_plot.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/auto_1d_plot.cpp 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
@@ -32,7 +32,7 @@
#include <boost/svg_plot/show_1d_settings.hpp>
// Only needed for showing which settings in use.
- void boost::svg::show_1d_plot_settings(svg_1d_plot&);
+// void boost::svg::show_1d_plot_settings(svg_1d_plot&);
// (Also provides operator<< for std::pair).
#include <boost/algorithm/minmax.hpp>
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/container_minmax.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/container_minmax.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/container_minmax.cpp 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
@@ -171,7 +171,7 @@
template <class T> // T an STL container: for example: array<float>, vector<double> ...
pair<double, double> s(const T& container) // Data series to plot.
{
- pair<T::const_iterator, typename T::const_iterator> result = boost::minmax_element(container.begin(), container.end());
+ pair<typename T::const_iterator, typename T::const_iterator> result = boost::minmax_element(container.begin(), container.end());
cout << "minmax_elements " << *result.first << ' ' << *result.second << endl;
std::pair<double, double > minmax; // Convert type of container T to double.
minmax.first = *result.first;
@@ -179,7 +179,7 @@
return minmax; // pair<double, double>
} // template <class T> int s T an STL container: array, vector ...
-template <class T> // T an STL container: array, vector ...
+template <typename T> // T an STL container: array, vector ...
std::pair<double, double> scale(const T& container) // Container Data series
{
//typedef typename <const T& >::const_iterator container_iterator;
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_autoscaling.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_autoscaling.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_autoscaling.cpp 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
@@ -32,7 +32,7 @@
#include <boost/svg_plot/show_1d_settings.hpp>
// Only needed for showing which settings in use.
- void boost::svg::show_1d_plot_settings(svg_1d_plot&);
+// void boost::svg::show_1d_plot_settings(svg_1d_plot&);
// (Also provides operator<< for std::pair).
#include <boost/algorithm/minmax.hpp>
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_axis_scaling.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_axis_scaling.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_axis_scaling.cpp 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
@@ -40,7 +40,7 @@
#include <boost/svg_plot/show_1d_settings.hpp>
// Only needed for showing which settings in use.
- void boost::svg::show_1d_plot_settings(svg_1d_plot&);
+// void boost::svg::show_1d_plot_settings(svg_1d_plot&);
// (Also provides operator<< for std::pair).
#include <boost/algorithm/minmax.hpp>
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_heat_flow_data.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_heat_flow_data.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_heat_flow_data.cpp 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
@@ -9,11 +9,11 @@
This data was used in an example in the Boost.Math Library.
\author Paul A Bristow
- \date Mar 2009
-
*/
-// Copyright Paul A Bristow 2008
+// demo_1d_heat_flow_data.cpp
+
+// Copyright Paul A Bristow 2008, 2012
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0.
@@ -45,7 +45,7 @@
using boost::svg::svg_boxplot;
#include <boost/svg_plot/show_1d_settings.hpp>
- void boost::svg::show_1d_plot_settings(svg_1d_plot&);
+// void boost::svg::show_1d_plot_settings(svg_1d_plot&);
#include <iostream> // for debugging.
using std::cout;
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_plot.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_plot.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_plot.cpp 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
@@ -33,7 +33,7 @@
using boost::svg::svg_1d_plot;
#include <boost/svg_plot/show_1d_settings.hpp>
- void boost::svg::show_1d_plot_settings(svg_1d_plot&);
+// void boost::svg::show_1d_plot_settings(svg_1d_plot&);
#include <boost/svg_plot/svg_fwd.hpp> // forward declarations.
// for testing its correctness.
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_uncertainty.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_uncertainty.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_uncertainty.cpp 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
@@ -1,12 +1,13 @@
-/*! \file demo_1d_uncertainty.cpp
+/*! \file
\brief Simple plot of uncertainty of 1D data.
\details An example to demonstrate simple 1D plot using two vectors,
including showing values with uncertainty information as
"plus minus" and degrees of freedom estimates.
- \author Paul A. Bristow cpp
- \date Mar 2009
+ \author Paul A. Bristow
*/
+// demo_1d_uncertainty.cpp
+
// Copyright Paul A Bristow 2009, 2012
// Use, modification and distribution are subject to the
@@ -25,7 +26,7 @@
/*`First we need a few includes to use Boost.Plot:
*/
#include <boost/quan/unc.hpp>
-//#include <boost/quan/unc_init.hpp>
+
// using boost::quan::unc; // Holds value and uncertainty formation.
#include <boost/svg_plot/detail/functors.hpp>
// using boost::svg::detail::unc_1d_convert;
@@ -33,7 +34,7 @@
using namespace boost::svg;
#include <boost/svg_plot/show_1d_settings.hpp>
-void boost::svg::show_1d_plot_settings(svg_1d_plot&);
+//void boost::svg::show_1d_plot_settings(svg_1d_plot&);
#include <iostream>
// using std::cout;
@@ -161,8 +162,8 @@
Linking...
Embedding manifest...
Autorun j:\Cpp\SVG\debug\demo_1d_uncertainty.exe
-3.1�0.02 (8) 4.2�0.01 (14)
-2.1�0.001 (30) 7.8�0.0025 (21) 3.4�0.03 6.9
+3.1?0.02 (8) 4.2?0.01 (14)
+2.1?0.001 (30) 7.8?0.0025 (21) 3.4?0.03 6.9
Build Time 0:03
//] [/demo_1d_uncertainty_output]
*/
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_svg.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_svg.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_svg.cpp 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
@@ -8,7 +8,7 @@
\author Paul A. Bristow
\date 20 Feb 2009
*/
-// Copyright Paul A Bristow 2007
+// Copyright Paul A Bristow 2007, 2012
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0.
@@ -26,48 +26,49 @@
#endif
#include <boost/svg_plot/svg.hpp>
- using boost::svg::svg;
- using boost::svg::g_element;
- using boost::svg::rect_element;
+ //using boost::svg::svg;
+ //using boost::svg::g_element;
+ //using boost::svg::rect_element;
#include <boost/svg_plot/svg_fwd.hpp>
-
- using namespace boost::svg;
- // Is most convenient because otherwise all the colors used must be specified thus:
- using boost::svg::black;
- using boost::svg::white;
- using boost::svg::red;
- using boost::svg::blue;
+ //using namespace boost::svg;
+ //// Is most convenient because otherwise all the colors used must be specified thus:
+ //using boost::svg::black;
+ //using boost::svg::white;
+ //using boost::svg::red;
+ //using boost::svg::blue;
// ... which may get tedious!
#include <iostream>
- using std::cout;
- using std::endl;
- using std::boolalpha;
+ //using std::cout;
+ //using std::endl;
+ //using std::boolalpha;
#include <vector>
using std::vector;
#include <string>
- using std::string;
+// using std::string;
#include <boost/array.hpp>
- using boost::array;
+// using boost::array;
+
+using namespace boost::svg;
-void symb(array<const poly_path_point, 6> shape, const poly_path_point position, const poly_path_point size, g_element& g)
+void symb(boost::array<const poly_path_point, 6> shape, const poly_path_point position, const poly_path_point size, g_element& g)
{
- vector<poly_path_point> shaped;
- for(array<const poly_path_point, 6>::iterator i = shape.begin(); i != shape.end(); ++i)
+ std::vector<poly_path_point> shaped;
+ for(boost::array<const poly_path_point, 6>::iterator i = shape.begin(); i != shape.end(); ++i)
{
poly_path_point p = (*i);
p.x *= size.x;
p.y *= size.y;
p.x += position.x;
p.y += position.y;
- std::cout << p << endl;
+ std::cout << p << std::endl;
shaped.push_back(p);
}
- cout << endl;
+ std::cout << std::endl;
// Can't return ref to shape because goes out of scope :-(
g.push_back(new polygon_element(shaped, true) );
return; // reference to g_element just added.
@@ -75,6 +76,24 @@
int main()
{
+ using std::cout;
+ using std::endl;
+ using std::boolalpha;
+
+ // Is most convenient because otherwise all the colors used must be specified thus:
+ using boost::svg::black;
+ using boost::svg::white;
+ using boost::svg::red;
+ using boost::svg::blue;
+ // ... which may get tedious!
+
+ using boost::svg::svg;
+ using boost::svg::g_element;
+ using boost::svg::rect_element;
+
+ using boost::array;
+
+
svg my_svg;
cout << "Initial my_svg.document_size() " << my_svg.document_size() << endl; // == 0
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/test/1d_color_consistency.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/test/1d_color_consistency.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/test/1d_color_consistency.cpp 2012-12-04 13:11:50 EST (Tue, 04 Dec 2012)
@@ -16,10 +16,10 @@
#if defined (_MSC_VER)
# pragma warning(disable : 4267) // '=' : conversion from 'size_t' to 'unsigned int'
// in spirit
-# pragma warning(disable : 4310) // cast truncates constant value
-# pragma warning(disable : 4512) // assignment operator could not be generated
-# pragma warning(disable : 4702) // unreachable code
-# pragma warning(disable : 4701) // potentially uninitialized local variable 'old_iph' used
+# pragma warning(disable : 4310) // Cast truncates constant value.
+# pragma warning(disable : 4512) // Assignment operator could not be generated.
+# pragma warning(disable : 4702) // Unreachable code.
+# pragma warning(disable : 4701) // Potentially uninitialized local variable 'old_iph' used.
# pragma warning(disable : 4996) // Deprecated.
#endif
@@ -125,17 +125,17 @@
// Test the svg_element class.
- svg_1d_plot my_plot;
- // Check the default image sizes:
- BOOST_CHECK_EQUAL(my_plot.x_size(), 500U);
- BOOST_CHECK_EQUAL(my_plot.y_size(), 200U);
-
- my_plot.size(200U, 100U);
- BOOST_CHECK_EQUAL(my_plot.x_size(), 200U);
- my_plot.size(500U, 100U); // update x
- BOOST_CHECK_EQUAL(my_plot.x_size(), 500U); // & check
- my_plot.size(500U, 300U); // update y
- BOOST_CHECK_EQUAL(my_plot.y_size(), 300U); // & check
+ //svg_1d_plot my_plot;
+ //// Check the default image sizes:
+ //BOOST_CHECK_EQUAL(my_plot.x_size(), 500U);
+ //BOOST_CHECK_EQUAL(my_plot.y_size(), 200U);
+
+ //my_plot.size(200U, 100U);
+ //BOOST_CHECK_EQUAL(my_plot.x_size(), 200U);
+ //my_plot.size(500U, 100U); // update x
+ //BOOST_CHECK_EQUAL(my_plot.x_size(), 500U); // & check
+ //my_plot.size(500U, 300U); // update y
+ //BOOST_CHECK_EQUAL(my_plot.y_size(), 300U); // & check
// // cout << my_plot.x_size() << endl; // 500
//BOOST_CHECK_EQUAL(my_plot.x_size(), 500U);
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