diff --git a/share/magics/styles/ecmwf/test/styles.json b/share/magics/styles/ecmwf/test/styles.json new file mode 100644 index 00000000..1bd2ebcb --- /dev/null +++ b/share/magics/styles/ecmwf/test/styles.json @@ -0,0 +1,6 @@ +{ + "red_lines" : { + "contour" : "on", + "contour_line_colour" : "red" + } +} diff --git a/src/attributes/EpsPlumeAttributes.cc b/src/attributes/EpsPlumeAttributes.cc index 427498ac..bb6f02b2 100644 --- a/src/attributes/EpsPlumeAttributes.cc +++ b/src/attributes/EpsPlumeAttributes.cc @@ -27,6 +27,7 @@ using namespace magics; EpsPlumeAttributes::EpsPlumeAttributes(): method_(ParameterManager::getString("eps_plume_method")), legend_(ParameterManager::getBool("eps_plume_legend")), + legend_grey_style_(ParameterManager::getBool("eps_plume_legend_grey_style")), line_(ParameterManager::getBool("eps_plume_members")), line_thickness_(ParameterManager::getInt("eps_plume_line_thickness")), forecast_(ParameterManager::getBool("eps_plume_forecast")), @@ -79,6 +80,7 @@ void EpsPlumeAttributes::set(const std::map& params) setAttribute(prefix, "eps_plume_method", method_, params); setAttribute(prefix, "eps_plume_legend", legend_, params); + setAttribute(prefix, "eps_plume_legend_grey_style", legend_grey_style_, params); setAttribute(prefix, "eps_plume_members", line_, params); setAttribute(prefix, "eps_plume_line_thickness", line_thickness_, params); setAttribute(prefix, "eps_plume_forecast", forecast_, params); @@ -118,6 +120,7 @@ void EpsPlumeAttributes::copy(const EpsPlumeAttributes& other) { method_ = other.method_; legend_ = other.legend_; + legend_grey_style_ = other.legend_grey_style_; line_ = other.line_; line_thickness_ = other.line_thickness_; forecast_ = other.forecast_; @@ -189,6 +192,7 @@ void EpsPlumeAttributes::print(ostream& out) const out << "Attributes["; out << " method = " << method_; out << " legend = " << legend_; + out << " legend_grey_style = " << legend_grey_style_; out << " line = " << line_; out << " line_thickness = " << line_thickness_; out << " forecast = " << forecast_; @@ -231,6 +235,8 @@ void EpsPlumeAttributes::toxml(ostream& out) const niceprint(out,method_); out << ", \"eps_plume_legend\":"; niceprint(out,legend_); + out << ", \"eps_plume_legend_grey_style\":"; + niceprint(out,legend_grey_style_); out << ", \"eps_plume_members\":"; niceprint(out,line_); out << ", \"eps_plume_line_thickness\":"; @@ -298,6 +304,7 @@ void EpsPlumeAttributes::toxml(ostream& out) const static MagicsParameter eps_plume_method("eps_plume_method", "time_serie"); static MagicsParameter eps_plume_legend("eps_plume_legend", "on"); +static MagicsParameter eps_plume_legend_grey_style("eps_plume_legend_grey_style", "on"); static MagicsParameter eps_plume_members("eps_plume_members", "on"); static MagicsParameter eps_plume_line_thickness("eps_plume_line_thickness", 1); static MagicsParameter eps_plume_forecast("eps_plume_forecast", "on"); diff --git a/src/attributes/EpsPlumeAttributes.h b/src/attributes/EpsPlumeAttributes.h index 5cd62468..f237745d 100644 --- a/src/attributes/EpsPlumeAttributes.h +++ b/src/attributes/EpsPlumeAttributes.h @@ -53,6 +53,7 @@ class EpsPlumeAttributes string tag_; string method_; bool legend_; + bool legend_grey_style_; bool line_; int line_thickness_; bool forecast_; diff --git a/src/params/EpsPlume.xml b/src/params/EpsPlume.xml index 26ce9811..75856735 100644 --- a/src/params/EpsPlume.xml +++ b/src/params/EpsPlume.xml @@ -31,6 +31,14 @@ does it submit to any jurisdiction. visible='false'> ignore legend + + if On ( default) the legend will use a grey scale ootherwise it will use user defined colour + ::reverse_iterator point = shading[top].rbegin(); point != shading[top].rend(); ++point) line->push_back(*point); - double grey = ((col.red() + col.blue() + col.green()) / 3.); - - col.setColour(grey, grey, grey); + if ( legend_grey_style_ ) { + double grey = ((col.red() + col.blue() + col.green()) / 3.); + col.setColour(grey, grey, grey); + } ++colour; shading_legend_.push_back(col);