|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r81343 - in sandbox/SOC/2007/visualization: boost/svg_plot boost/svg_plot/detail libs/svg_plot/example
From: pbristow_at_[hidden]
Date: 2012-11-14 11:41:26
Author: pbristow
Date: 2012-11-14 11:41:25 EST (Wed, 14 Nov 2012)
New Revision: 81343
URL: http://svn.boost.org/trac/boost/changeset/81343
Log:
Working NetBeans on windows
Text files modified:
sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp | 11 --
sandbox/SOC/2007/visualization/boost/svg_plot/svg_1d_plot.hpp | 4
sandbox/SOC/2007/visualization/boost/svg_plot/svg_style.hpp | 10 -
sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_1d_uncertainty.cpp | 164 +++++++++++++++++++++------------------
sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_2d_uncertainty.cpp | 42 +++++-----
5 files changed, 118 insertions(+), 113 deletions(-)
Modified: sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp
==============================================================================
--- sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp (original)
+++ sandbox/SOC/2007/visualization/boost/svg_plot/detail/axis_plot_frame.hpp 2012-11-14 11:41:25 EST (Wed, 14 Nov 2012)
@@ -583,16 +583,7 @@
Derived& three_sd_color(const svg_color&); //!< Set the color for three standard deviation (~99% confidence) ellipse fill.
svg_color three_sd_color(); //!< \return Color for three standard deviation (~99% confidence) ellipse fill.
- //// Stylesheet.
- // Removed for now to avoid compile warning in Spirit.
-
- //Derived& load_stylesheet(const std::string& file)
- //{
- // derived().image_.load_stylesheet(file);
- // return derived();
- //}
-
- //// Image info (& identical const version).
+ // Image info (& identical const version).
//svg& get_svg()
//{
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 2012-11-14 11:41:25 EST (Wed, 14 Nov 2012)
@@ -267,7 +267,7 @@
public:
- svg_1d_plot::svg_1d_plot(); //! Constructor of a 1-D plot.
+ svg_1d_plot(); //! Constructor of a 1-D plot.
void set_ids(); //! Set the XML ids for various layers of the plot.
void calculate_plot_window(); //! Calculate the position of the plot window.
void calculate_transform(); //! Calculate transform form euclidian to svg coordinate.
@@ -290,7 +290,7 @@
svg_1d_plot_series& plot(const T& container, const std::string& title = "");
template <typename T>
svg_1d_plot_series& plot(const T& begin, const T& end, const std::string& title = "");
-
+
template <typename T, typename U>
svg_1d_plot_series& plot(const T& container, const std::string& title = "", U functor = boost::svg::detail::double_1d_convert());
template <typename T, typename U>
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-11-14 11:41:25 EST (Wed, 14 Nov 2012)
@@ -304,9 +304,7 @@
friend bool operator== (const text_style&, const text_style&);
friend bool operator!= (const text_style&, const text_style&);
- public: // temporary for experimental gil
-
-//private:
+ public: // Or private?
int font_size_; //!< Font size (SVG units, default pixels).
std::string font_family_; //!< Font family, examples: "Arial", "Times New Roman", "Verdana", "Lucida Sans Unicode".
std::string weight_; //!< Font style, examples: "bold", "normal".
@@ -325,8 +323,8 @@
text_style& font_size(unsigned int i);
text_style& font_family(const std::string& s);
- text_style& font_style(const std::string& s);
text_style& font_weight(const std::string& s);
+ text_style& font_style(const std::string& s);
text_style& font_stretch(const std::string& s);
text_style& font_decoration(const std::string& s);
// text_style& font_variant(const std::string& s); // Not implemented,
@@ -351,8 +349,8 @@
text_style::text_style( //!< Constructor to allow all text style (font etc) to be set.
int size, //!< Font size.
const std::string& font, //!< Default for browser is sans with Firefox & IE but serif with Opera.
- const std::string& style, //!< font-style: normal
const std::string& weight, //!< font weight "normal"
+ const std::string& style, //!< font-style: normal
const std::string& stretch, //!< font-stretch: normal
const std::string& decoration) //!< No decoration.
: // Constructor.
@@ -1215,7 +1213,7 @@
//! For X-axis -1 = bottom, 0 = false = on Y-axis, +1 = top. Default -1 below bottom of plot window.
//! 0 = false puts the ticks and their labels on the X or Y axis line which may be in the middle of the plot.
//! For 1D the default overrides the constructor default of -1 below, to tick and value label the X-axis.
- //! For 2D the default is left at -1, to use bottom and left of plot window to ticka nd value label X and Y-axis.
+ //! For 2D the default is left at -1, to use bottom and left of plot window to tick and value label X and Y-axis.
text_style value_label_style_; //!< text style (font, size...) for value labels.
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-11-14 11:41:25 EST (Wed, 14 Nov 2012)
@@ -26,18 +26,18 @@
*/
#include <boost/quan/unc.hpp>
//#include <boost/quan/unc_init.hpp>
- // using boost::quan::unc; // Holds value and uncertainty formation.
+// using boost::quan::unc; // Holds value and uncertainty formation.
#include <boost/svg_plot/detail/functors.hpp>
// using boost::svg::detail::unc_1d_convert;
#include <boost/svg_plot/svg_1d_plot.hpp>
- using namespace boost::svg;
+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;
- // using std::endl;
+// using std::cout;
+// using std::endl;
#include <vector>
// using std::vector;
#include <iterator>
@@ -50,55 +50,55 @@
{
//[demo_1d_uncertainty_2
-/*`STL vector is used as the container for our two data series,
-and values are inserted using push_back. Since this is a 1-D plot
-the order of data values is not important.
-*/
- setUncDefaults(std::cout);
- typedef unc<false> uncun; // Uncertain Uncorrelated (the normal case).
- float NaN = std::numeric_limits<float>::quiet_NaN();
+ /*`STL vector is used as the container for our two data series,
+ and values are inserted using push_back. Since this is a 1-D plot
+ the order of data values is not important.
+ */
+ setUncDefaults(std::cout);
+ typedef unc<false> uncun; // Uncertain Uncorrelated (the normal case).
+ float NaN = std::numeric_limits<float>::quiet_NaN();
std::vector<uncun> A_times;
- A_times.push_back(unc<false>(3.1, 0.02F, 8));
- A_times.push_back(uncun(4.2, 0.01F, 14, 0U));
+ A_times.push_back(unc<false>(3.1, 0.02F, 8));
+ A_times.push_back(uncun(4.2, 0.01F, 14, 0U));
- short unsigned int t = UNC_KNOWN | UNC_EXPLICIT| DEG_FREE_EXACT | DEG_FREE_KNOWN;
+ short unsigned int t = UNC_KNOWN | UNC_EXPLICIT| DEG_FREE_EXACT | DEG_FREE_KNOWN;
- std::vector<unc<false> > B_times;
- B_times.push_back(uncun(2.1, 0.001F, 30, t)); // Value, uncertainty, degrees of freedom and type known.
- // (But use of type is not yet implemented.)
- B_times.push_back(unc<>(5.1, 0.025F, 20, 0U)); // Value, uncertainty, and degrees of freedom known - the usual case.
- B_times.push_back(uncun(7.8, 0.0025F, 1, 0U)); // Value and uncertainty known, but not degrees of freedom.
- B_times.push_back(uncun(3.4, 0.03F, 1, 0U)); // Value and uncertainty known, but not degrees of freedom.
- //B_times.push_back(uncun(6.9, 0.0F, 0, 0U)); // Only value known - no information available about uncertainty but treated as exact.
- B_times.push_back(uncun(5.9, NaN, 1, 0U)); // Only value known - uncertainty explicit NaN meaning no information available about uncertainty.
- // So in both cases show all possibly significant digits (usually 15).
- // This is ugly on a graph, so best to be explicit about uncertainty.
-
- std::vector<unc<false> > C_times;
- C_times.push_back(uncun(2.6, 0.1F, 5, 0U));
- C_times.push_back(uncun(5.4, 0.2F, 11, 0U));
-
- /*`Echo the values input: */
- std::copy(A_times.begin(), A_times.end(), std::ostream_iterator<uncun>(std::cout, " "));
- std::cout << std::endl;
- std::copy(B_times.begin(), B_times.end(), std::ostream_iterator<uncun>(std::cout, " "));
- std::cout << std::endl;
- /*`The constructor initializes a new 1D plot, called `my_plot`,
- and also sets all the very many defaults for axes, width, colors, etc.
-*/
- svg_1d_plot my_plot;
-/*`A few (member) functions that are set (using concatenation or chaining) should be fairly self-explanatory:
+ std::vector<unc<false> > B_times;
+ B_times.push_back(uncun(2.1, 0.001F, 30, t)); // Value, uncertainty, degrees of freedom and type known.
+ // (But use of type is not yet implemented.)
+ B_times.push_back(unc<>(5.1, 0.025F, 20, 0U)); // Value, uncertainty, and degrees of freedom known - the usual case.
+ B_times.push_back(uncun(7.8, 0.0025F, 1, 0U)); // Value and uncertainty known, but not degrees of freedom.
+ B_times.push_back(uncun(3.4, 0.03F, 1, 0U)); // Value and uncertainty known, but not degrees of freedom.
+ //B_times.push_back(uncun(6.9, 0.0F, 0, 0U)); // Only value known - no information available about uncertainty but treated as exact.
+ B_times.push_back(uncun(5.9, NaN, 1, 0U)); // Only value known - uncertainty explicit NaN meaning no information available about uncertainty.
+ // So in both cases show all possibly significant digits (usually 15).
+ // This is ugly on a graph, so best to be explicit about uncertainty.
+
+ std::vector<unc<false> > C_times;
+ C_times.push_back(uncun(2.6, 0.1F, 5, 0U));
+ C_times.push_back(uncun(5.4, 0.2F, 11, 0U));
+
+ /*`Echo the values input: */
+ std::copy(A_times.begin(), A_times.end(), std::ostream_iterator<uncun>(std::cout, " "));
+ std::cout << std::endl;
+ std::copy(B_times.begin(), B_times.end(), std::ostream_iterator<uncun>(std::cout, " "));
+ std::cout << std::endl;
+ /*`The constructor initializes a new 1D plot, called `my_plot`,
+ and also sets all the very many defaults for axes, width, colors, etc.
+ */
+ svg_1d_plot my_plot;
+ /*`A few (member) functions that are set (using concatenation or chaining) should be fairly self-explanatory:
+
+ * .title() provides a title at the top for the whole plot,
+ * .`legend_on(true)` will mean that titles of data series and markers will display in the legend box.
+ * .`x_range(-1, 11)` sets the axis limits from -1 to +11 (instead of the default -10 to +10).
+ * .`background_border_color(blue)` sets just one of the very many other options.
+ */
+ my_plot.autoscale_check_limits(false); // Default is true.
+ my_plot.autoscale_plusminus(2); // default is 3.
+ my_plot.confidence(0.01); // Change alpha from default 0.05 == 95% to 0.01 == 99%.
-* .title() provides a title at the top for the whole plot,
-* .`legend_on(true)` will mean that titles of data series and markers will display in the legend box.
-* .`x_range(-1, 11)` sets the axis limits from -1 to +11 (instead of the default -10 to +10).
-* .`background_border_color(blue)` sets just one of the very many other options.
-*/
- my_plot.autoscale_check_limits(false); // Default is true.
- my_plot.autoscale_plusminus(2); // default is 3.
- my_plot.confidence(0.01); // Change alpha from default 0.05 == 95% to 0.01 == 99%.
-
- my_plot
+ my_plot
.image_x_size(600)
.image_y_size(300)
.plot_window_on(true)
@@ -122,35 +122,35 @@
.x_df_color(green)
.x_autoscale(B_times) // Note that this might not be right scaling for A_times and/or C_times.
;
-/*`
-Then we add our data series,
-and add optional data series titles
-(very helpful if we want them to show on the legend).
-
-The A_times mark data points with a red border circle with a green fill,
-The B_times use a blue vertical line,
-while C_times use an ellipse whose width (x radius) is from the uncertainty,
-1st standard deviation shows as ellipse in magenta, and 2nd as yellow.
-All the data points are also labelled with their value,
-and uncertainty and degrees of freedom if known.
-*/
- my_plot.plot(A_times, "A").shape(circlet).size(10).stroke_color(red).fill_color(green);
- my_plot.plot(B_times, "B").shape(vertical_line).stroke_color(blue);
- my_plot.plot(C_times, "C").shape(unc_ellipse).fill_color(lightyellow).stroke_color(magenta);
-/*`
-Finally, we can write the SVG to a file of our choice.
-*/
- std::string svg_file = (my_plot.legend_on() == true) ?
- "./demo_1d_uncertainty_legend.svg" : "./demo_1d_uncertainty.svg";
+ /*`
+ Then we add our data series,
+ and add optional data series titles
+ (very helpful if we want them to show on the legend).
+
+ The A_times mark data points with a red border circle with a green fill,
+ The B_times use a blue vertical line,
+ while C_times use an ellipse whose width (x radius) is from the uncertainty,
+ 1st standard deviation shows as ellipse in magenta, and 2nd as yellow.
+ All the data points are also labeled with their value,
+ and uncertainty and degrees of freedom if known.
+ */
+ my_plot.plot(A_times, "A").shape(circlet).size(10).stroke_color(red).fill_color(green);
+ my_plot.plot(B_times, "B").shape(vertical_line).stroke_color(blue);
+ my_plot.plot(C_times, "C").shape(unc_ellipse).fill_color(lightyellow).stroke_color(magenta);
+ /*`
+ Finally, we can write the SVG to a file of our choice.
+ */
+ std::string svg_file = (my_plot.legend_on() == true) ?
+ "./demo_1d_uncertainty_legend.svg" : "./demo_1d_uncertainty.svg";
- my_plot.write(svg_file);
+ my_plot.write(svg_file);
- std::cout <<"Plot written to file " << svg_file << std::endl;
- show_1d_plot_settings(my_plot);
+ std::cout <<"Plot written to file " << svg_file << std::endl;
+ show_1d_plot_settings(my_plot);
//] [/demo_1d_uncertainty_2]
- return 0;
+ return 0;
} // int main()
/*
@@ -181,3 +181,19 @@
*/
+
+/* Output Netbeans 4.7.2
+ *
+ 3.10 4.200
+2.1000 5.10 7.800 3.40 5.900
+Plot written to file ./demo_1d_uncertainty.svg
+
+
+axes_on false
+background_border_width 1
+background_border_color RGB(0,0,255)
+background_color RGB(255,255,255)
+...
+ *
+ *
+ */
Modified: sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_2d_uncertainty.cpp
==============================================================================
--- sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_2d_uncertainty.cpp (original)
+++ sandbox/SOC/2007/visualization/libs/svg_plot/example/demo_2d_uncertainty.cpp 2012-11-14 11:41:25 EST (Wed, 14 Nov 2012)
@@ -2,7 +2,7 @@
\brief Demonstration of some 2D plot features.
\details including showing values with uncertainty information as 'plus minus' and degrees of freedom estimates.
\author Jacob Voytko and Paul A. Bristow
- \date Mar 2009
+ \date Mar 2009, 2012
*/
// Copyright Jacob Voytko 2007
@@ -112,7 +112,7 @@
pair<double, double> double_pair; // double X and Y
double_pair = make_pair(double(-2.234), double(-8.76));
cout << "make_pair(double(-2.234), double(-8.76)) = " << double_pair << endl;
-
+
uncun u1(1.23, 0.56F, 7); // For an X value.
cout << "u1 = " << u1 << endl; // u1 = 1.23+-0.056 (7)
uncun u2(3.45, 0.67F, 9); // For a Y value.
@@ -123,7 +123,7 @@
data1.insert(mp1); // u1, u2 = 1.23+-0.056 (7), 2.345+-0.067 (9)
data1.insert(make_pair(uncun(4.1, 0.4F, 7), uncun(3.1, 0.3F, 18))); //
data1.insert(make_pair(uncun(-2.234, 0.03F, 7), uncun(-8.76, 0.9F, 9)));
-
+
/*
`Make very sure you don't forget either uncun(...) like this
`data1.insert(make_pair((-2.234, 0.12F, 7),(-8.76, 0.56F, 9)));`
@@ -239,10 +239,10 @@
-2.23, -8.8
1.2, 3.5
4.10, 3.100
-
+
No limits checks: x_min = -2.234, x_max = 4.1, y_min = -8.76, y_max = 3.45
-
-
+
+
axes_on true
background_border_width 2
background_border_color RGB(255,255,0)
@@ -250,13 +250,13 @@
image_border_margin() 3
image_border_width() 2
coord_precision 3
- copyright_date
- copyright_holder
- description
+ copyright_date
+ copyright_holder
+ description
document_title ""
x_size 500
image y_size 400
- image_filename
+ image_filename
legend_on false
legend_place 2
legend_top_left -1, -1, legend_bottom_right -1, -1
@@ -265,7 +265,7 @@
legend_color blank
legend_title ""
legend_title_font_size 14
- legend_font_weight
+ legend_font_weight
legend_width 0
legend_lines true
limit points stroke color RGB(119,136,153)
@@ -289,13 +289,13 @@
title ""
title_color blank
title_font_alignment 2
- title_font_decoration
+ title_font_decoration
title_font_family Verdana
title_font_rotation 0
title_font_size 18
- title_font_stretch
- title_font_style
- title_font_weight
+ title_font_stretch
+ title_font_style
+ title_font_weight
x_values_on false
x_values_font_size 16
x_values_font_family Times New Roman
@@ -323,7 +323,7 @@
x_label_color blank
x_label_font_family Verdana
x_label_font_size 14
- x_label_units
+ x_label_units
x_label_units_on false
x_major_labels_side left
x_major_label_rotation 0
@@ -353,9 +353,9 @@
x_plusminus_color RGB(0,255,255)
x_df_on true
x_df_color RGB(255,0,255)
- x_prefix
- x_separator
- x_suffix
+ x_prefix
+ x_separator
+ x_suffix
xy_values_on true
y_label_on "true"
y_label_axis distance (km)
@@ -370,7 +370,7 @@
y_label_font_family Verdana
y_label_font_size 14
y_label_on true
- y_label_units
+ y_label_units
y_label_units_on false
y_label_width 0
y_major_grid_on false
@@ -390,7 +390,7 @@
y_minor_tick_length 2
y_minor_tick_width 1
y_range() -10, 5
- y_num_minor_ticks
+ y_num_minor_ticks
y_ticks_left_on true
y_ticks_right_on false
y_ticks_on_window_or_axis left
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