diff --git a/CMakeLists.txt b/CMakeLists.txt index ab110b0c..395d9591 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,10 +15,7 @@ cmake_minimum_required( VERSION 3.12 FATAL_ERROR ) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../ecbuild/cmake") find_package( ecbuild 3.4 REQUIRED ) - -# In prepaation for hotfix of 4.14.0 -project( magics LANGUAGES CXX ) - +project( magics VERSION 4.15.0 LANGUAGES CXX ) # make sure that the header files are installed into include/magics # note that this needs to be done before ecbuild_declare_project() 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/ColourTechniqueAttributes.cc b/src/attributes/ColourTechniqueAttributes.cc index 77857f21..2af62957 100644 --- a/src/attributes/ColourTechniqueAttributes.cc +++ b/src/attributes/ColourTechniqueAttributes.cc @@ -24,9 +24,7 @@ using namespace magics; -ColourTechniqueAttributes::ColourTechniqueAttributes(): - oob_min_colour_(ParameterManager::getString("contour_out_of_bound_min_colour")), - oob_max_colour_(ParameterManager::getString("contour_out_of_bound_max_colour")) +ColourTechniqueAttributes::ColourTechniqueAttributes() { @@ -45,16 +43,12 @@ void ColourTechniqueAttributes::set(const std::map& params) int i = 0; prefix[i++] = ""; - setAttribute(prefix, "contour_out_of_bound_min_colour", oob_min_colour_, params); - setAttribute(prefix, "contour_out_of_bound_max_colour", oob_max_colour_, params); } void ColourTechniqueAttributes::copy(const ColourTechniqueAttributes& other) { - oob_min_colour_ = other.oob_min_colour_; - oob_max_colour_ = other.oob_max_colour_; } @@ -93,8 +87,6 @@ void ColourTechniqueAttributes::set(const XmlNode& node) void ColourTechniqueAttributes::print(ostream& out) const { out << "Attributes["; - out << " oob_min_colour = " << oob_min_colour_; - out << " oob_max_colour = " << oob_max_colour_; out << "]" << "\n"; } @@ -102,12 +94,6 @@ void ColourTechniqueAttributes::print(ostream& out) const void ColourTechniqueAttributes::toxml(ostream& out) const { out << "\"\""; - out << ", \"contour_out_of_bound_min_colour\":"; - niceprint(out,oob_min_colour_); - out << ", \"contour_out_of_bound_max_colour\":"; - niceprint(out,oob_max_colour_); } -static MagicsParameter contour_out_of_bound_min_colour("contour_out_of_bound_min_colour", "automatic"); -static MagicsParameter contour_out_of_bound_max_colour("contour_out_of_bound_max_colour", "automatic"); diff --git a/src/attributes/ColourTechniqueAttributes.h b/src/attributes/ColourTechniqueAttributes.h index f4d01134..532f28a5 100644 --- a/src/attributes/ColourTechniqueAttributes.h +++ b/src/attributes/ColourTechniqueAttributes.h @@ -50,8 +50,6 @@ class ColourTechniqueAttributes virtual void toxml(std::ostream& out) const; // -- members: string tag_; - string oob_min_colour_; - string oob_max_colour_; private: diff --git a/src/attributes/ColourTechniqueWrapper.cc b/src/attributes/ColourTechniqueWrapper.cc index 740661f9..e615ccae 100644 --- a/src/attributes/ColourTechniqueWrapper.cc +++ b/src/attributes/ColourTechniqueWrapper.cc @@ -55,14 +55,6 @@ void ColourTechniqueWrapper::set(const MagRequest& request) - if (request.countValues("CONTOUR_OUT_OF_BOUND_MIN_COLOUR") ) { - string oob_min_colour_value = request("CONTOUR_OUT_OF_BOUND_MIN_COLOUR"); - colourtechnique_->oob_min_colour_ = oob_min_colour_value; - } - if (request.countValues("CONTOUR_OUT_OF_BOUND_MAX_COLOUR") ) { - string oob_max_colour_value = request("CONTOUR_OUT_OF_BOUND_MAX_COLOUR"); - colourtechnique_->oob_max_colour_ = oob_max_colour_value; - } } diff --git a/src/attributes/EpsPlumeAttributes.cc b/src/attributes/EpsPlumeAttributes.cc index d7c2162a..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")), @@ -35,6 +36,11 @@ EpsPlumeAttributes::EpsPlumeAttributes(): control_line_thickness_(ParameterManager::getInt("eps_plume_control_line_thickness")), median_(ParameterManager::getBool("eps_plume_median")), median_line_thickness_(ParameterManager::getInt("eps_plume_median_line_thickness")), + percentiles_(ParameterManager::getBool("eps_plume_percentiles")), + percentiles_list_(ParameterManager::getDoubleArray("eps_plume_percentiles_list")), + percentiles_line_colour_list_(ParameterManager::getStringArray("eps_plume_percentiles_line_colour_list")), + percentiles_line_style_list_(ParameterManager::getStringArray("eps_plume_percentiles_line_style_list")), + percentiles_line_thickness_list_(ParameterManager::getIntArray("eps_plume_percentiles_line_thickness_list")), shading_(ParameterManager::getBool("eps_plume_shading")), shading_levels_(ParameterManager::getDoubleArray("eps_plume_shading_level_list")), shading_colours_(ParameterManager::getStringArray("eps_plume_shading_colour_list")), @@ -74,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); @@ -82,6 +89,11 @@ void EpsPlumeAttributes::set(const std::map& params) setAttribute(prefix, "eps_plume_control_line_thickness", control_line_thickness_, params); setAttribute(prefix, "eps_plume_median", median_, params); setAttribute(prefix, "eps_plume_median_line_thickness", median_line_thickness_, params); + setAttribute(prefix, "eps_plume_percentiles", percentiles_, params); + setAttribute(prefix, "eps_plume_percentiles_list", percentiles_list_, params); + setAttribute(prefix, "eps_plume_percentiles_line_colour_list", percentiles_line_colour_list_, params); + setAttribute(prefix, "eps_plume_percentiles_line_style_list", percentiles_line_style_list_, params); + setAttribute(prefix, "eps_plume_percentiles_line_thickness_list", percentiles_line_thickness_list_, params); setAttribute(prefix, "eps_plume_shading", shading_, params); setAttribute(prefix, "eps_plume_shading_level_list", shading_levels_, params); setAttribute(prefix, "eps_plume_shading_colour_list", shading_colours_, params); @@ -108,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_; @@ -116,6 +129,11 @@ void EpsPlumeAttributes::copy(const EpsPlumeAttributes& other) control_line_thickness_ = other.control_line_thickness_; median_ = other.median_; median_line_thickness_ = other.median_line_thickness_; + percentiles_ = other.percentiles_; + percentiles_list_ = other.percentiles_list_; + percentiles_line_colour_list_ = other.percentiles_line_colour_list_; + percentiles_line_style_list_ = other.percentiles_line_style_list_; + percentiles_line_thickness_list_ = other.percentiles_line_thickness_list_; shading_ = other.shading_; shading_levels_ = other.shading_levels_; shading_colours_ = other.shading_colours_; @@ -174,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_; @@ -182,6 +201,11 @@ void EpsPlumeAttributes::print(ostream& out) const out << " control_line_thickness = " << control_line_thickness_; out << " median = " << median_; out << " median_line_thickness = " << median_line_thickness_; + out << " percentiles = " << percentiles_; + out << " percentiles_list = " << percentiles_list_; + out << " percentiles_line_colour_list = " << percentiles_line_colour_list_; + out << " percentiles_line_style_list = " << percentiles_line_style_list_; + out << " percentiles_line_thickness_list = " << percentiles_line_thickness_list_; out << " shading = " << shading_; out << " shading_levels = " << shading_levels_; out << " shading_colours = " << shading_colours_; @@ -211,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\":"; @@ -227,6 +253,16 @@ void EpsPlumeAttributes::toxml(ostream& out) const niceprint(out,median_); out << ", \"eps_plume_median_line_thickness\":"; niceprint(out,median_line_thickness_); + out << ", \"eps_plume_percentiles\":"; + niceprint(out,percentiles_); + out << ", \"eps_plume_percentiles_list\":"; + niceprint(out,percentiles_list_); + out << ", \"eps_plume_percentiles_line_colour_list\":"; + niceprint(out,percentiles_line_colour_list_); + out << ", \"eps_plume_percentiles_line_style_list\":"; + niceprint(out,percentiles_line_style_list_); + out << ", \"eps_plume_percentiles_line_thickness_list\":"; + niceprint(out,percentiles_line_thickness_list_); out << ", \"eps_plume_shading\":"; niceprint(out,shading_); out << ", \"eps_plume_shading_level_list\":"; @@ -268,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"); @@ -276,6 +313,11 @@ static MagicsParameter eps_plume_control("eps_plume_control", "on"); static MagicsParameter eps_plume_control_line_thickness("eps_plume_control_line_thickness", 5); static MagicsParameter eps_plume_median("eps_plume_median", "off"); static MagicsParameter eps_plume_median_line_thickness("eps_plume_median_line_thickness", 5); +static MagicsParameter eps_plume_percentiles("eps_plume_percentiles", "off"); +static MagicsParameter eps_plume_percentiles_list("eps_plume_percentiles_list", floatarray()); +static MagicsParameter eps_plume_percentiles_line_colour_list("eps_plume_percentiles_line_colour_list", stringarray()); +static MagicsParameter eps_plume_percentiles_line_style_list("eps_plume_percentiles_line_style_list", stringarray()); +static MagicsParameter eps_plume_percentiles_line_thickness_list("eps_plume_percentiles_line_thickness_list", intarray()); static MagicsParameter eps_plume_shading("eps_plume_shading", "off"); static MagicsParameter eps_plume_shading_level_list("eps_plume_shading_level_list", floatarray()); static MagicsParameter eps_plume_shading_colour_list("eps_plume_shading_colour_list", stringarray()); diff --git a/src/attributes/EpsPlumeAttributes.h b/src/attributes/EpsPlumeAttributes.h index 6c9010a7..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_; @@ -61,6 +62,11 @@ class EpsPlumeAttributes int control_line_thickness_; bool median_; int median_line_thickness_; + bool percentiles_; + doublearray percentiles_list_; + stringarray percentiles_line_colour_list_; + stringarray percentiles_line_style_list_; + intarray percentiles_line_thickness_list_; bool shading_; doublearray shading_levels_; stringarray shading_colours_; diff --git a/src/attributes/EpsPlumeWrapper.cc b/src/attributes/EpsPlumeWrapper.cc index 15ff0739..4d388e37 100644 --- a/src/attributes/EpsPlumeWrapper.cc +++ b/src/attributes/EpsPlumeWrapper.cc @@ -64,6 +64,12 @@ void EpsPlumeWrapper::set(const MagRequest& request) epsplume_->legend_ = MagTranslator()(legend_value); + } + if (request.countValues("EPS_PLUME_LEGEND_GREY_STYLE") ) { + string legend_grey_style_value = request("EPS_PLUME_LEGEND_GREY_STYLE"); + + epsplume_->legend_grey_style_ = MagTranslator()(legend_grey_style_value); + } if (request.countValues("EPS_PLUME_MEMBERS") ) { string line_value = request("EPS_PLUME_MEMBERS"); @@ -105,6 +111,32 @@ void EpsPlumeWrapper::set(const MagRequest& request) int median_line_thickness_value = request("EPS_PLUME_MEDIAN_LINE_THICKNESS"); epsplume_->median_line_thickness_ = median_line_thickness_value; } + if (request.countValues("EPS_PLUME_PERCENTILES") ) { + string percentiles_value = request("EPS_PLUME_PERCENTILES"); + + epsplume_->percentiles_ = MagTranslator()(percentiles_value); + + } + doublearray percentiles_list_value; + for (int i = 0; i < request.countValues("EPS_PLUME_PERCENTILES_LIST"); i++) + percentiles_list_value.push_back((double)request("EPS_PLUME_PERCENTILES_LIST", i)); + if ( !percentiles_list_value.empty() ) + epsplume_->percentiles_list_ = percentiles_list_value; + stringarray percentiles_line_colour_list_value; + for (int i = 0; i < request.countValues("EPS_PLUME_PERCENTILES_LINE_COLOUR_LIST"); i++) + percentiles_line_colour_list_value.push_back((string)request("EPS_PLUME_PERCENTILES_LINE_COLOUR_LIST", i)); + if ( !percentiles_line_colour_list_value.empty() ) + epsplume_->percentiles_line_colour_list_ = percentiles_line_colour_list_value; + stringarray percentiles_line_style_list_value; + for (int i = 0; i < request.countValues("EPS_PLUME_PERCENTILES_LINE_STYLE_LIST"); i++) + percentiles_line_style_list_value.push_back((string)request("EPS_PLUME_PERCENTILES_LINE_STYLE_LIST", i)); + if ( !percentiles_line_style_list_value.empty() ) + epsplume_->percentiles_line_style_list_ = percentiles_line_style_list_value; + intarray percentiles_line_thickness_list_value; + for (int i = 0; i < request.countValues("EPS_PLUME_PERCENTILES_LINE_THICKNESS_LIST"); i++) + percentiles_line_thickness_list_value.push_back((int)request("EPS_PLUME_PERCENTILES_LINE_THICKNESS_LIST", i)); + if ( !percentiles_line_thickness_list_value.empty() ) + epsplume_->percentiles_line_thickness_list_ = percentiles_line_thickness_list_value; if (request.countValues("EPS_PLUME_SHADING") ) { string shading_value = request("EPS_PLUME_SHADING"); diff --git a/src/attributes/GeoJSonAttributes.cc b/src/attributes/GeoJSonAttributes.cc index 2c3672dd..ab58f95b 100644 --- a/src/attributes/GeoJSonAttributes.cc +++ b/src/attributes/GeoJSonAttributes.cc @@ -30,7 +30,7 @@ GeoJSonAttributes::GeoJSonAttributes(): input_(ParameterManager::getString("geojson_input")), binning_resolution_(ParameterManager::getDouble("geojson_binning_grid_resolution")), value_(ParameterManager::getString("geojson_value_property")) - + { } @@ -54,7 +54,6 @@ void GeoJSonAttributes::set(const std::map& params) setAttribute(prefix, "geojson_binning_grid_resolution", binning_resolution_, params); setAttribute(prefix, "geojson_value_property", value_, params); - cout << value_ << endl; } diff --git a/src/attributes/GribDecoderAttributes.cc b/src/attributes/GribDecoderAttributes.cc index 8c44856a..23385a67 100644 --- a/src/attributes/GribDecoderAttributes.cc +++ b/src/attributes/GribDecoderAttributes.cc @@ -41,13 +41,9 @@ GribDecoderAttributes::GribDecoderAttributes(): expver_(ParameterManager::getBool("grib_text_experiment")), units_(ParameterManager::getBool("grib_text_units")), field_position_(ParameterManager::getInt("grib_field_position")), - large_field_position_(ParameterManager::getULong("grib_field_large_position")), position_1_(ParameterManager::getInt("grib_wind_position_1")), position_2_(ParameterManager::getInt("grib_wind_position_2")), colour_position_(ParameterManager::getInt("grib_wind_position_colour")), - large_position_1_(ParameterManager::getULong("grib_wind_large_position_1")), - large_position_2_(ParameterManager::getULong("grib_wind_large_position_2")), - large_colour_position_(ParameterManager::getULong("grib_wind_large_position_colour")), missing_value_(ParameterManager::getDouble("grib_missing_value_indicator")), wind_style_(ParameterManager::getBool("grib_wind_style")) , @@ -87,13 +83,9 @@ void GribDecoderAttributes::set(const std::map& params) setAttribute(prefix, "grib_text_experiment", expver_, params); setAttribute(prefix, "grib_text_units", units_, params); setAttribute(prefix, "grib_field_position", field_position_, params); - setAttribute(prefix, "grib_field_large_position", large_field_position_, params); setAttribute(prefix, "grib_wind_position_1", position_1_, params); setAttribute(prefix, "grib_wind_position_2", position_2_, params); setAttribute(prefix, "grib_wind_position_colour", colour_position_, params); - setAttribute(prefix, "grib_wind_large_position_1", large_position_1_, params); - setAttribute(prefix, "grib_wind_large_position_2", large_position_2_, params); - setAttribute(prefix, "grib_wind_large_position_colour", large_colour_position_, params); setAttribute(prefix, "grib_missing_value_indicator", missing_value_, params); setAttribute(prefix, "grib_wind_style", wind_style_, params); @@ -120,13 +112,9 @@ void GribDecoderAttributes::copy(const GribDecoderAttributes& other) expver_ = other.expver_; units_ = other.units_; field_position_ = other.field_position_; - large_field_position_ = other.large_field_position_; position_1_ = other.position_1_; position_2_ = other.position_2_; colour_position_ = other.colour_position_; - large_position_1_ = other.large_position_1_; - large_position_2_ = other.large_position_2_; - large_colour_position_ = other.large_colour_position_; missing_value_ = other.missing_value_; wind_style_ = other.wind_style_; address_mode_ = unique_ptr(other.address_mode_->clone()); @@ -193,13 +181,9 @@ void GribDecoderAttributes::print(ostream& out) const out << " expver = " << expver_; out << " units = " << units_; out << " field_position = " << field_position_; - out << " large_field_position = " << large_field_position_; out << " position_1 = " << position_1_; out << " position_2 = " << position_2_; out << " colour_position = " << colour_position_; - out << " large_position_1 = " << large_position_1_; - out << " large_position_2 = " << large_position_2_; - out << " large_colour_position = " << large_colour_position_; out << " missing_value = " << missing_value_; out << " wind_style = " << wind_style_; out << " address_mode = " << *address_mode_; @@ -243,20 +227,12 @@ void GribDecoderAttributes::toxml(ostream& out) const niceprint(out,units_); out << ", \"grib_field_position\":"; niceprint(out,field_position_); - out << ", \"grib_field_large_position\":"; - niceprint(out,large_field_position_); out << ", \"grib_wind_position_1\":"; niceprint(out,position_1_); out << ", \"grib_wind_position_2\":"; niceprint(out,position_2_); out << ", \"grib_wind_position_colour\":"; niceprint(out,colour_position_); - out << ", \"grib_wind_large_position_1\":"; - niceprint(out,large_position_1_); - out << ", \"grib_wind_large_position_2\":"; - niceprint(out,large_position_2_); - out << ", \"grib_wind_large_position_colour\":"; - niceprint(out,large_colour_position_); out << ", \"grib_missing_value_indicator\":"; niceprint(out,missing_value_); out << ", \"grib_wind_style\":"; @@ -284,13 +260,9 @@ static MagicsParameter grib_interpolation_method_missing_fill_count("grib_i static MagicsParameter grib_text_experiment("grib_text_experiment", "off"); static MagicsParameter grib_text_units("grib_text_units", "off"); static MagicsParameter grib_field_position("grib_field_position", 1); -static MagicsParameter grib_field_large_position("grib_field_large_position", 0); static MagicsParameter grib_wind_position_1("grib_wind_position_1", 1); static MagicsParameter grib_wind_position_2("grib_wind_position_2", -1); static MagicsParameter grib_wind_position_colour("grib_wind_position_colour", -1); -static MagicsParameter grib_wind_large_position_1("grib_wind_large_position_1", 0); -static MagicsParameter grib_wind_large_position_2("grib_wind_large_position_2", 0); -static MagicsParameter grib_wind_large_position_colour("grib_wind_large_position_colour", 0); static MagicsParameter grib_missing_value_indicator("grib_missing_value_indicator", -1.5e+21); static MagicsParameter grib_wind_style("grib_wind_style", "off"); static MagicsParameter grib_file_address_mode("grib_file_address_mode", "record"); diff --git a/src/attributes/GribDecoderAttributes.h b/src/attributes/GribDecoderAttributes.h index 090aa4ba..e096edea 100644 --- a/src/attributes/GribDecoderAttributes.h +++ b/src/attributes/GribDecoderAttributes.h @@ -68,13 +68,9 @@ class GribDecoderAttributes bool expver_; bool units_; int field_position_; - unsigned long long large_field_position_; int position_1_; int position_2_; int colour_position_; - unsigned long long large_position_1_; - unsigned long long large_position_2_; - unsigned long long large_colour_position_; double missing_value_; bool wind_style_; unique_ptr address_mode_; diff --git a/src/attributes/GribDecoderWrapper.cc b/src/attributes/GribDecoderWrapper.cc index 50e0c340..008b6cf5 100644 --- a/src/attributes/GribDecoderWrapper.cc +++ b/src/attributes/GribDecoderWrapper.cc @@ -129,10 +129,6 @@ void GribDecoderWrapper::set(const MagRequest& request) int field_position_value = request("GRIB_FIELD_POSITION"); gribdecoder_->field_position_ = field_position_value; } - if (request.countValues("GRIB_FIELD_LARGE_POSITION") ) { - // unsigned long long large_field_position_value = request("GRIB_FIELD_LARGE_POSITION"); - // gribdecoder_->large_field_position_ = large_field_position_value; - } if (request.countValues("GRIB_WIND_POSITION_1") ) { int position_1_value = request("GRIB_WIND_POSITION_1"); gribdecoder_->position_1_ = position_1_value; @@ -145,18 +141,6 @@ void GribDecoderWrapper::set(const MagRequest& request) int colour_position_value = request("GRIB_WIND_POSITION_COLOUR"); gribdecoder_->colour_position_ = colour_position_value; } - if (request.countValues("GRIB_WIND_LARGE_POSITION_1") ) { - // unsigned long long large_position_1_value = request("GRIB_WIND_LARGE_POSITION_1"); - // gribdecoder_->large_position_1_ = large_position_1_value; - } - if (request.countValues("GRIB_WIND_LARGE_POSITION_2") ) { - // unsigned long long large_position_2_value = request("GRIB_WIND_LARGE_POSITION_2"); - // gribdecoder_->large_position_2_ = large_position_2_value; - } - if (request.countValues("GRIB_WIND_LARGE_POSITION_COLOUR") ) { - // unsigned long long large_colour_position_value = request("GRIB_WIND_LARGE_POSITION_COLOUR"); - // gribdecoder_->large_colour_position_ = large_colour_position_value; - } if (request.countValues("GRIB_MISSING_VALUE_INDICATOR") ) { double missing_value_value = request("GRIB_MISSING_VALUE_INDICATOR"); gribdecoder_->missing_value_ = missing_value_value; diff --git a/src/attributes/MagicsSettingsWrapper.cc b/src/attributes/MagicsSettingsWrapper.cc index 15b36bf1..830af363 100644 --- a/src/attributes/MagicsSettingsWrapper.cc +++ b/src/attributes/MagicsSettingsWrapper.cc @@ -24,13 +24,15 @@ #include "MagicsParameter.h" #include "Factory.h" #include "MagTranslator.h" -#include "MagicsSettings.h" +#include "MagicsGlobal.h" using namespace magics; + MagicsSettingsWrapper::MagicsSettingsWrapper(): magicssettings_(new MagicsSettings()) + { @@ -55,15 +57,21 @@ void MagicsSettingsWrapper::set(const MagRequest& request) if (request.countValues("MAGICS_SILENT") ) { string silent_value = request("MAGICS_SILENT"); + magicssettings_->silent_ = MagTranslator()(silent_value); + } if (request.countValues("MAGICS_BACKWARD_COMPATIBILITY") ) { string compatibility_value = request("MAGICS_BACKWARD_COMPATIBILITY"); + magicssettings_->compatibility_ = MagTranslator()(compatibility_value); + } if (request.countValues("MAGICS_STRICT_MODE") ) { string strict_value = request("MAGICS_STRICT_MODE"); + magicssettings_->strict_ = MagTranslator()(strict_value); + } diff --git a/src/attributes/NoBoxPlotAttributes.cc b/src/attributes/NoBoxPlotAttributes.cc new file mode 100644 index 00000000..a6d8d0c2 --- /dev/null +++ b/src/attributes/NoBoxPlotAttributes.cc @@ -0,0 +1,99 @@ + +/****************************** LICENSE ******************************* + + * (C) Copyright 1996-2017 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \\file NoBoxPlotAttributes.h + \\brief Definition of NoBoxPlot Attributes class. + + This file is automatically generated. + Do Not Edit! +*/ + +#include "NoBoxPlotAttributes.h" +#include "MagicsParameter.h" +#include "ParameterSettings.h" + +using namespace magics; + +NoBoxPlotAttributes::NoBoxPlotAttributes() + + +{ +} + + +NoBoxPlotAttributes::~NoBoxPlotAttributes() +{ + +} + + +void NoBoxPlotAttributes::set(const std::map& params) +{ + vector prefix(1); + int i = 0; + prefix[i++] = "boxplot"; + + + +} + +void NoBoxPlotAttributes::copy(const NoBoxPlotAttributes& other) +{ + +} + + +bool NoBoxPlotAttributes::accept(const string& node) +{ + + if ( magCompare(node, "boxplot") ) + return true; + + return false; +} + +void NoBoxPlotAttributes::set(const XmlNode& node) +{ + bool apply = false; + + if ( this->accept(node.name()) == false ) + return; + + if ( magCompare(node.name(), "boxplot") ) + apply = true; + + + if ( apply ) + set(node.attributes()); + else { + + } + for (auto &elt : node.elements()) + { + + } +} + +void NoBoxPlotAttributes::print(ostream& out) const +{ + out << "Attributes["; + + out << "]" << "\n"; +} + +void NoBoxPlotAttributes::toxml(ostream& out) const +{ + out << "\"boxplot\""; + +} + diff --git a/src/attributes/NoBoxPlotAttributes.h b/src/attributes/NoBoxPlotAttributes.h new file mode 100644 index 00000000..018ed893 --- /dev/null +++ b/src/attributes/NoBoxPlotAttributes.h @@ -0,0 +1,63 @@ + +/******************************* LICENSE ******************************* + + * (C) Copyright 1996-2016 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \fileNoBoxPlotAttributes.h + \brief Definition of NoBoxPlot Attributes class. + + This file is automatically generated. + Do Not Edit! + + Generated: +*/ + + +#ifndef NoBoxPlotAttributes_H +#define NoBoxPlotAttributes_H + +#include "magics.h" +namespace magics { + +class XmlNode; +class NoBoxPlotAttributes +{ +public: +// -- constructor + NoBoxPlotAttributes(); + +// -- destructor + virtual ~NoBoxPlotAttributes(); + + virtual void set(const std::map&); + virtual void set(const XmlNode&); + virtual void copy(const NoBoxPlotAttributes&); + virtual bool accept(const std::string&); + + void setTag(const std::string& tag) { tag_ = tag; } + +public: + // -- method + virtual void print(std::ostream&) const; + virtual void toxml(std::ostream& out) const; + // -- members: + string tag_; + + +private: + friend ostream& operator<<(ostream& s,const NoBoxPlotAttributes& p) + { p.print(s); return s; } +}; + +} // namespace magics + +#endif + diff --git a/src/attributes/NoBoxPlotBoxAttributes.cc b/src/attributes/NoBoxPlotBoxAttributes.cc new file mode 100644 index 00000000..c215ddd1 --- /dev/null +++ b/src/attributes/NoBoxPlotBoxAttributes.cc @@ -0,0 +1,99 @@ + +/****************************** LICENSE ******************************* + + * (C) Copyright 1996-2017 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \\file NoBoxPlotBoxAttributes.h + \\brief Definition of NoBoxPlotBox Attributes class. + + This file is automatically generated. + Do Not Edit! +*/ + +#include "NoBoxPlotBoxAttributes.h" +#include "MagicsParameter.h" +#include "ParameterSettings.h" + +using namespace magics; + +NoBoxPlotBoxAttributes::NoBoxPlotBoxAttributes() + + +{ +} + + +NoBoxPlotBoxAttributes::~NoBoxPlotBoxAttributes() +{ + +} + + +void NoBoxPlotBoxAttributes::set(const std::map& params) +{ + vector prefix(1); + int i = 0; + prefix[i++] = "boxplot"; + + + +} + +void NoBoxPlotBoxAttributes::copy(const NoBoxPlotBoxAttributes& other) +{ + +} + + +bool NoBoxPlotBoxAttributes::accept(const string& node) +{ + + if ( magCompare(node, "boxplot") ) + return true; + + return false; +} + +void NoBoxPlotBoxAttributes::set(const XmlNode& node) +{ + bool apply = false; + + if ( this->accept(node.name()) == false ) + return; + + if ( magCompare(node.name(), "boxplot") ) + apply = true; + + + if ( apply ) + set(node.attributes()); + else { + + } + for (auto &elt : node.elements()) + { + + } +} + +void NoBoxPlotBoxAttributes::print(ostream& out) const +{ + out << "Attributes["; + + out << "]" << "\n"; +} + +void NoBoxPlotBoxAttributes::toxml(ostream& out) const +{ + out << "\"boxplot\""; + +} + diff --git a/src/attributes/NoBoxPlotBoxAttributes.h b/src/attributes/NoBoxPlotBoxAttributes.h new file mode 100644 index 00000000..ddb17710 --- /dev/null +++ b/src/attributes/NoBoxPlotBoxAttributes.h @@ -0,0 +1,63 @@ + +/******************************* LICENSE ******************************* + + * (C) Copyright 1996-2016 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \fileNoBoxPlotBoxAttributes.h + \brief Definition of NoBoxPlotBox Attributes class. + + This file is automatically generated. + Do Not Edit! + + Generated: +*/ + + +#ifndef NoBoxPlotBoxAttributes_H +#define NoBoxPlotBoxAttributes_H + +#include "magics.h" +namespace magics { + +class XmlNode; +class NoBoxPlotBoxAttributes +{ +public: +// -- constructor + NoBoxPlotBoxAttributes(); + +// -- destructor + virtual ~NoBoxPlotBoxAttributes(); + + virtual void set(const std::map&); + virtual void set(const XmlNode&); + virtual void copy(const NoBoxPlotBoxAttributes&); + virtual bool accept(const std::string&); + + void setTag(const std::string& tag) { tag_ = tag; } + +public: + // -- method + virtual void print(std::ostream&) const; + virtual void toxml(std::ostream& out) const; + // -- members: + string tag_; + + +private: + friend ostream& operator<<(ostream& s,const NoBoxPlotBoxAttributes& p) + { p.print(s); return s; } +}; + +} // namespace magics + +#endif + diff --git a/src/attributes/NoBoxPlotBoxBorderAttributes.cc b/src/attributes/NoBoxPlotBoxBorderAttributes.cc new file mode 100644 index 00000000..fdfea170 --- /dev/null +++ b/src/attributes/NoBoxPlotBoxBorderAttributes.cc @@ -0,0 +1,100 @@ + +/****************************** LICENSE ******************************* + + * (C) Copyright 1996-2017 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \\file NoBoxPlotBoxBorderAttributes.h + \\brief Definition of NoBoxPlotBoxBorder Attributes class. + + This file is automatically generated. + Do Not Edit! +*/ + +#include "NoBoxPlotBoxBorderAttributes.h" +#include "MagicsParameter.h" +#include "ParameterSettings.h" + +using namespace magics; + +NoBoxPlotBoxBorderAttributes::NoBoxPlotBoxBorderAttributes() + + +{ +} + + +NoBoxPlotBoxBorderAttributes::~NoBoxPlotBoxBorderAttributes() +{ + +} + + +void NoBoxPlotBoxBorderAttributes::set(const std::map& params) +{ + vector prefix(2); + int i = 0; + prefix[i++] = "boxplot"; + prefix[i++] = "boxplot_median"; + + + +} + +void NoBoxPlotBoxBorderAttributes::copy(const NoBoxPlotBoxBorderAttributes& other) +{ + +} + + +bool NoBoxPlotBoxBorderAttributes::accept(const string& node) +{ + + if ( magCompare(node, "median") ) + return true; + + return false; +} + +void NoBoxPlotBoxBorderAttributes::set(const XmlNode& node) +{ + bool apply = false; + + if ( this->accept(node.name()) == false ) + return; + + if ( magCompare(node.name(), "median") ) + apply = true; + + + if ( apply ) + set(node.attributes()); + else { + + } + for (auto &elt : node.elements()) + { + + } +} + +void NoBoxPlotBoxBorderAttributes::print(ostream& out) const +{ + out << "Attributes["; + + out << "]" << "\n"; +} + +void NoBoxPlotBoxBorderAttributes::toxml(ostream& out) const +{ + out << "\"median\""; + +} + diff --git a/src/attributes/NoBoxPlotBoxBorderAttributes.h b/src/attributes/NoBoxPlotBoxBorderAttributes.h new file mode 100644 index 00000000..cd9e9104 --- /dev/null +++ b/src/attributes/NoBoxPlotBoxBorderAttributes.h @@ -0,0 +1,63 @@ + +/******************************* LICENSE ******************************* + + * (C) Copyright 1996-2016 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \fileNoBoxPlotBoxBorderAttributes.h + \brief Definition of NoBoxPlotBoxBorder Attributes class. + + This file is automatically generated. + Do Not Edit! + + Generated: +*/ + + +#ifndef NoBoxPlotBoxBorderAttributes_H +#define NoBoxPlotBoxBorderAttributes_H + +#include "magics.h" +namespace magics { + +class XmlNode; +class NoBoxPlotBoxBorderAttributes +{ +public: +// -- constructor + NoBoxPlotBoxBorderAttributes(); + +// -- destructor + virtual ~NoBoxPlotBoxBorderAttributes(); + + virtual void set(const std::map&); + virtual void set(const XmlNode&); + virtual void copy(const NoBoxPlotBoxBorderAttributes&); + virtual bool accept(const std::string&); + + void setTag(const std::string& tag) { tag_ = tag; } + +public: + // -- method + virtual void print(std::ostream&) const; + virtual void toxml(std::ostream& out) const; + // -- members: + string tag_; + + +private: + friend ostream& operator<<(ostream& s,const NoBoxPlotBoxBorderAttributes& p) + { p.print(s); return s; } +}; + +} // namespace magics + +#endif + diff --git a/src/attributes/NoBoxPlotBoxBorderWrapper.cc b/src/attributes/NoBoxPlotBoxBorderWrapper.cc new file mode 100644 index 00000000..14fb00eb --- /dev/null +++ b/src/attributes/NoBoxPlotBoxBorderWrapper.cc @@ -0,0 +1,67 @@ + +/****************************** LICENSE ******************************* + + * (C) Copyright 1996-2017 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \\file NoBoxPlotBoxBorderAttributes.h + \\brief Definition of NoBoxPlotBoxBorder Attributes class. + + This file is automatically generated. + Do Not Edit! + +*/ + +#include "MagRequest.h" +#include "NoBoxPlotBoxBorderWrapper.h" +#include "MagicsParameter.h" +#include "Factory.h" +#include "MagTranslator.h" +#include "MagicsGlobal.h" + +using namespace magics; + + + +NoBoxPlotBoxBorderWrapper::NoBoxPlotBoxBorderWrapper(): noboxplotboxborder_(new NoBoxPlotBoxBorder()) + + +{ + + + + +} +NoBoxPlotBoxBorderWrapper::NoBoxPlotBoxBorderWrapper(NoBoxPlotBoxBorder* noboxplotboxborder): noboxplotboxborder_(noboxplotboxborder) +{ + + +} + +NoBoxPlotBoxBorderWrapper::~NoBoxPlotBoxBorderWrapper() +{ + +} + +void NoBoxPlotBoxBorderWrapper::set(const MagRequest& request) +{ + + + + + +} + +void NoBoxPlotBoxBorderWrapper::print(ostream& out) const +{ + out << "NoBoxPlotBoxBorderWrapper[]"; +} + + diff --git a/src/attributes/NoBoxPlotBoxBorderWrapper.h b/src/attributes/NoBoxPlotBoxBorderWrapper.h new file mode 100644 index 00000000..bde7f82f --- /dev/null +++ b/src/attributes/NoBoxPlotBoxBorderWrapper.h @@ -0,0 +1,91 @@ + +/******************************* LICENSE ******************************* + + * (C) Copyright 1996-2016 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \fileNoBoxPlotBoxBorderAttributes.h + \brief Definition of NoBoxPlotBoxBorder Attributes class. + + This file is automatically generated. + Do Not Edit! + + Generated: +*/ + + +#ifndef NoBoxPlotBoxBorderWrapper_H +#define NoBoxPlotBoxBorderWrapper_H + +#include "magics.h" +#include "ParameterManager.h" +#include "Factory.h" + + + +#include "BoxPlotItem.h" + + + + + + + + + + +namespace magics { + +class MagRequest; + + + +class NoBoxPlotBoxBorderWrapper + +{ +public: +// -- constructor + NoBoxPlotBoxBorderWrapper(); + NoBoxPlotBoxBorderWrapper(NoBoxPlotBoxBorder*); +// -- destructor + virtual ~NoBoxPlotBoxBorderWrapper(); + virtual void set(const MagRequest&); + + NoBoxPlotBoxBorder* me() { return noboxplotboxborder_; } + + virtual NoBoxPlotBoxBorder* object() { return noboxplotboxborder_; } + + + virtual void object(NoBoxPlotBoxBorder* o) { + // Remember to delete the previous object + noboxplotboxborder_ = o; + + + } + + + +protected: + NoBoxPlotBoxBorder* noboxplotboxborder_; + + +// -- method + virtual void print(ostream&) const; + + +private: + string tag_; + friend ostream& operator<<(ostream& s,const NoBoxPlotBoxBorderWrapper& p) + { p.print(s); return s; } +}; + +} // namespace magics + +#endif \ No newline at end of file diff --git a/src/attributes/NoBoxPlotBoxWrapper.cc b/src/attributes/NoBoxPlotBoxWrapper.cc new file mode 100644 index 00000000..5458c600 --- /dev/null +++ b/src/attributes/NoBoxPlotBoxWrapper.cc @@ -0,0 +1,67 @@ + +/****************************** LICENSE ******************************* + + * (C) Copyright 1996-2017 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \\file NoBoxPlotBoxAttributes.h + \\brief Definition of NoBoxPlotBox Attributes class. + + This file is automatically generated. + Do Not Edit! + +*/ + +#include "MagRequest.h" +#include "NoBoxPlotBoxWrapper.h" +#include "MagicsParameter.h" +#include "Factory.h" +#include "MagTranslator.h" +#include "MagicsGlobal.h" + +using namespace magics; + + + +NoBoxPlotBoxWrapper::NoBoxPlotBoxWrapper(): noboxplotbox_(new NoBoxPlotBox()) + + +{ + + + + +} +NoBoxPlotBoxWrapper::NoBoxPlotBoxWrapper(NoBoxPlotBox* noboxplotbox): noboxplotbox_(noboxplotbox) +{ + + +} + +NoBoxPlotBoxWrapper::~NoBoxPlotBoxWrapper() +{ + +} + +void NoBoxPlotBoxWrapper::set(const MagRequest& request) +{ + + + + + +} + +void NoBoxPlotBoxWrapper::print(ostream& out) const +{ + out << "NoBoxPlotBoxWrapper[]"; +} + + diff --git a/src/attributes/NoBoxPlotBoxWrapper.h b/src/attributes/NoBoxPlotBoxWrapper.h new file mode 100644 index 00000000..7d573a44 --- /dev/null +++ b/src/attributes/NoBoxPlotBoxWrapper.h @@ -0,0 +1,91 @@ + +/******************************* LICENSE ******************************* + + * (C) Copyright 1996-2016 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \fileNoBoxPlotBoxAttributes.h + \brief Definition of NoBoxPlotBox Attributes class. + + This file is automatically generated. + Do Not Edit! + + Generated: +*/ + + +#ifndef NoBoxPlotBoxWrapper_H +#define NoBoxPlotBoxWrapper_H + +#include "magics.h" +#include "ParameterManager.h" +#include "Factory.h" + + + +#include "BoxPlotItem.h" + + + + + + + + + + +namespace magics { + +class MagRequest; + + + +class NoBoxPlotBoxWrapper + +{ +public: +// -- constructor + NoBoxPlotBoxWrapper(); + NoBoxPlotBoxWrapper(NoBoxPlotBox*); +// -- destructor + virtual ~NoBoxPlotBoxWrapper(); + virtual void set(const MagRequest&); + + NoBoxPlotBox* me() { return noboxplotbox_; } + + virtual NoBoxPlotBox* object() { return noboxplotbox_; } + + + virtual void object(NoBoxPlotBox* o) { + // Remember to delete the previous object + noboxplotbox_ = o; + + + } + + + +protected: + NoBoxPlotBox* noboxplotbox_; + + +// -- method + virtual void print(ostream&) const; + + +private: + string tag_; + friend ostream& operator<<(ostream& s,const NoBoxPlotBoxWrapper& p) + { p.print(s); return s; } +}; + +} // namespace magics + +#endif \ No newline at end of file diff --git a/src/attributes/NoBoxPlotMedianAttributes.cc b/src/attributes/NoBoxPlotMedianAttributes.cc new file mode 100644 index 00000000..50dcf6f0 --- /dev/null +++ b/src/attributes/NoBoxPlotMedianAttributes.cc @@ -0,0 +1,100 @@ + +/****************************** LICENSE ******************************* + + * (C) Copyright 1996-2017 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \\file NoBoxPlotMedianAttributes.h + \\brief Definition of NoBoxPlotMedian Attributes class. + + This file is automatically generated. + Do Not Edit! +*/ + +#include "NoBoxPlotMedianAttributes.h" +#include "MagicsParameter.h" +#include "ParameterSettings.h" + +using namespace magics; + +NoBoxPlotMedianAttributes::NoBoxPlotMedianAttributes() + + +{ +} + + +NoBoxPlotMedianAttributes::~NoBoxPlotMedianAttributes() +{ + +} + + +void NoBoxPlotMedianAttributes::set(const std::map& params) +{ + vector prefix(2); + int i = 0; + prefix[i++] = "boxplot"; + prefix[i++] = "boxplot_median"; + + + +} + +void NoBoxPlotMedianAttributes::copy(const NoBoxPlotMedianAttributes& other) +{ + +} + + +bool NoBoxPlotMedianAttributes::accept(const string& node) +{ + + if ( magCompare(node, "median") ) + return true; + + return false; +} + +void NoBoxPlotMedianAttributes::set(const XmlNode& node) +{ + bool apply = false; + + if ( this->accept(node.name()) == false ) + return; + + if ( magCompare(node.name(), "median") ) + apply = true; + + + if ( apply ) + set(node.attributes()); + else { + + } + for (auto &elt : node.elements()) + { + + } +} + +void NoBoxPlotMedianAttributes::print(ostream& out) const +{ + out << "Attributes["; + + out << "]" << "\n"; +} + +void NoBoxPlotMedianAttributes::toxml(ostream& out) const +{ + out << "\"median\""; + +} + diff --git a/src/attributes/NoBoxPlotMedianAttributes.h b/src/attributes/NoBoxPlotMedianAttributes.h new file mode 100644 index 00000000..3a6b29a1 --- /dev/null +++ b/src/attributes/NoBoxPlotMedianAttributes.h @@ -0,0 +1,63 @@ + +/******************************* LICENSE ******************************* + + * (C) Copyright 1996-2016 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \fileNoBoxPlotMedianAttributes.h + \brief Definition of NoBoxPlotMedian Attributes class. + + This file is automatically generated. + Do Not Edit! + + Generated: +*/ + + +#ifndef NoBoxPlotMedianAttributes_H +#define NoBoxPlotMedianAttributes_H + +#include "magics.h" +namespace magics { + +class XmlNode; +class NoBoxPlotMedianAttributes +{ +public: +// -- constructor + NoBoxPlotMedianAttributes(); + +// -- destructor + virtual ~NoBoxPlotMedianAttributes(); + + virtual void set(const std::map&); + virtual void set(const XmlNode&); + virtual void copy(const NoBoxPlotMedianAttributes&); + virtual bool accept(const std::string&); + + void setTag(const std::string& tag) { tag_ = tag; } + +public: + // -- method + virtual void print(std::ostream&) const; + virtual void toxml(std::ostream& out) const; + // -- members: + string tag_; + + +private: + friend ostream& operator<<(ostream& s,const NoBoxPlotMedianAttributes& p) + { p.print(s); return s; } +}; + +} // namespace magics + +#endif + diff --git a/src/attributes/NoBoxPlotMedianWrapper.cc b/src/attributes/NoBoxPlotMedianWrapper.cc new file mode 100644 index 00000000..b3011118 --- /dev/null +++ b/src/attributes/NoBoxPlotMedianWrapper.cc @@ -0,0 +1,67 @@ + +/****************************** LICENSE ******************************* + + * (C) Copyright 1996-2017 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \\file NoBoxPlotMedianAttributes.h + \\brief Definition of NoBoxPlotMedian Attributes class. + + This file is automatically generated. + Do Not Edit! + +*/ + +#include "MagRequest.h" +#include "NoBoxPlotMedianWrapper.h" +#include "MagicsParameter.h" +#include "Factory.h" +#include "MagTranslator.h" +#include "MagicsGlobal.h" + +using namespace magics; + + + +NoBoxPlotMedianWrapper::NoBoxPlotMedianWrapper(): noboxplotmedian_(new NoBoxPlotMedian()) + + +{ + + + + +} +NoBoxPlotMedianWrapper::NoBoxPlotMedianWrapper(NoBoxPlotMedian* noboxplotmedian): noboxplotmedian_(noboxplotmedian) +{ + + +} + +NoBoxPlotMedianWrapper::~NoBoxPlotMedianWrapper() +{ + +} + +void NoBoxPlotMedianWrapper::set(const MagRequest& request) +{ + + + + + +} + +void NoBoxPlotMedianWrapper::print(ostream& out) const +{ + out << "NoBoxPlotMedianWrapper[]"; +} + + diff --git a/src/attributes/NoBoxPlotMedianWrapper.h b/src/attributes/NoBoxPlotMedianWrapper.h new file mode 100644 index 00000000..97b82f4b --- /dev/null +++ b/src/attributes/NoBoxPlotMedianWrapper.h @@ -0,0 +1,91 @@ + +/******************************* LICENSE ******************************* + + * (C) Copyright 1996-2016 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \fileNoBoxPlotMedianAttributes.h + \brief Definition of NoBoxPlotMedian Attributes class. + + This file is automatically generated. + Do Not Edit! + + Generated: +*/ + + +#ifndef NoBoxPlotMedianWrapper_H +#define NoBoxPlotMedianWrapper_H + +#include "magics.h" +#include "ParameterManager.h" +#include "Factory.h" + + + +#include "BoxPlotItem.h" + + + + + + + + + + +namespace magics { + +class MagRequest; + + + +class NoBoxPlotMedianWrapper + +{ +public: +// -- constructor + NoBoxPlotMedianWrapper(); + NoBoxPlotMedianWrapper(NoBoxPlotMedian*); +// -- destructor + virtual ~NoBoxPlotMedianWrapper(); + virtual void set(const MagRequest&); + + NoBoxPlotMedian* me() { return noboxplotmedian_; } + + virtual NoBoxPlotMedian* object() { return noboxplotmedian_; } + + + virtual void object(NoBoxPlotMedian* o) { + // Remember to delete the previous object + noboxplotmedian_ = o; + + + } + + + +protected: + NoBoxPlotMedian* noboxplotmedian_; + + +// -- method + virtual void print(ostream&) const; + + +private: + string tag_; + friend ostream& operator<<(ostream& s,const NoBoxPlotMedianWrapper& p) + { p.print(s); return s; } +}; + +} // namespace magics + +#endif \ No newline at end of file diff --git a/src/attributes/NoBoxPlotWhiskerAttributes.cc b/src/attributes/NoBoxPlotWhiskerAttributes.cc new file mode 100644 index 00000000..dc6d49cb --- /dev/null +++ b/src/attributes/NoBoxPlotWhiskerAttributes.cc @@ -0,0 +1,99 @@ + +/****************************** LICENSE ******************************* + + * (C) Copyright 1996-2017 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \\file NoBoxPlotWhiskerAttributes.h + \\brief Definition of NoBoxPlotWhisker Attributes class. + + This file is automatically generated. + Do Not Edit! +*/ + +#include "NoBoxPlotWhiskerAttributes.h" +#include "MagicsParameter.h" +#include "ParameterSettings.h" + +using namespace magics; + +NoBoxPlotWhiskerAttributes::NoBoxPlotWhiskerAttributes() + + +{ +} + + +NoBoxPlotWhiskerAttributes::~NoBoxPlotWhiskerAttributes() +{ + +} + + +void NoBoxPlotWhiskerAttributes::set(const std::map& params) +{ + vector prefix(1); + int i = 0; + prefix[i++] = "boxplot"; + + + +} + +void NoBoxPlotWhiskerAttributes::copy(const NoBoxPlotWhiskerAttributes& other) +{ + +} + + +bool NoBoxPlotWhiskerAttributes::accept(const string& node) +{ + + if ( magCompare(node, "boxplot") ) + return true; + + return false; +} + +void NoBoxPlotWhiskerAttributes::set(const XmlNode& node) +{ + bool apply = false; + + if ( this->accept(node.name()) == false ) + return; + + if ( magCompare(node.name(), "boxplot") ) + apply = true; + + + if ( apply ) + set(node.attributes()); + else { + + } + for (auto &elt : node.elements()) + { + + } +} + +void NoBoxPlotWhiskerAttributes::print(ostream& out) const +{ + out << "Attributes["; + + out << "]" << "\n"; +} + +void NoBoxPlotWhiskerAttributes::toxml(ostream& out) const +{ + out << "\"boxplot\""; + +} + diff --git a/src/attributes/NoBoxPlotWhiskerAttributes.h b/src/attributes/NoBoxPlotWhiskerAttributes.h new file mode 100644 index 00000000..6beadab7 --- /dev/null +++ b/src/attributes/NoBoxPlotWhiskerAttributes.h @@ -0,0 +1,63 @@ + +/******************************* LICENSE ******************************* + + * (C) Copyright 1996-2016 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \fileNoBoxPlotWhiskerAttributes.h + \brief Definition of NoBoxPlotWhisker Attributes class. + + This file is automatically generated. + Do Not Edit! + + Generated: +*/ + + +#ifndef NoBoxPlotWhiskerAttributes_H +#define NoBoxPlotWhiskerAttributes_H + +#include "magics.h" +namespace magics { + +class XmlNode; +class NoBoxPlotWhiskerAttributes +{ +public: +// -- constructor + NoBoxPlotWhiskerAttributes(); + +// -- destructor + virtual ~NoBoxPlotWhiskerAttributes(); + + virtual void set(const std::map&); + virtual void set(const XmlNode&); + virtual void copy(const NoBoxPlotWhiskerAttributes&); + virtual bool accept(const std::string&); + + void setTag(const std::string& tag) { tag_ = tag; } + +public: + // -- method + virtual void print(std::ostream&) const; + virtual void toxml(std::ostream& out) const; + // -- members: + string tag_; + + +private: + friend ostream& operator<<(ostream& s,const NoBoxPlotWhiskerAttributes& p) + { p.print(s); return s; } +}; + +} // namespace magics + +#endif + diff --git a/src/attributes/NoBoxPlotWhiskerWrapper.cc b/src/attributes/NoBoxPlotWhiskerWrapper.cc new file mode 100644 index 00000000..8bd638cb --- /dev/null +++ b/src/attributes/NoBoxPlotWhiskerWrapper.cc @@ -0,0 +1,67 @@ + +/****************************** LICENSE ******************************* + + * (C) Copyright 1996-2017 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \\file NoBoxPlotWhiskerAttributes.h + \\brief Definition of NoBoxPlotWhisker Attributes class. + + This file is automatically generated. + Do Not Edit! + +*/ + +#include "MagRequest.h" +#include "NoBoxPlotWhiskerWrapper.h" +#include "MagicsParameter.h" +#include "Factory.h" +#include "MagTranslator.h" +#include "MagicsGlobal.h" + +using namespace magics; + + + +NoBoxPlotWhiskerWrapper::NoBoxPlotWhiskerWrapper(): noboxplotwhisker_(new NoBoxPlotWhisker()) + + +{ + + + + +} +NoBoxPlotWhiskerWrapper::NoBoxPlotWhiskerWrapper(NoBoxPlotWhisker* noboxplotwhisker): noboxplotwhisker_(noboxplotwhisker) +{ + + +} + +NoBoxPlotWhiskerWrapper::~NoBoxPlotWhiskerWrapper() +{ + +} + +void NoBoxPlotWhiskerWrapper::set(const MagRequest& request) +{ + + + + + +} + +void NoBoxPlotWhiskerWrapper::print(ostream& out) const +{ + out << "NoBoxPlotWhiskerWrapper[]"; +} + + diff --git a/src/attributes/NoBoxPlotWhiskerWrapper.h b/src/attributes/NoBoxPlotWhiskerWrapper.h new file mode 100644 index 00000000..7258f3f1 --- /dev/null +++ b/src/attributes/NoBoxPlotWhiskerWrapper.h @@ -0,0 +1,91 @@ + +/******************************* LICENSE ******************************* + + * (C) Copyright 1996-2016 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \fileNoBoxPlotWhiskerAttributes.h + \brief Definition of NoBoxPlotWhisker Attributes class. + + This file is automatically generated. + Do Not Edit! + + Generated: +*/ + + +#ifndef NoBoxPlotWhiskerWrapper_H +#define NoBoxPlotWhiskerWrapper_H + +#include "magics.h" +#include "ParameterManager.h" +#include "Factory.h" + + + +#include "BoxPlotItem.h" + + + + + + + + + + +namespace magics { + +class MagRequest; + + + +class NoBoxPlotWhiskerWrapper + +{ +public: +// -- constructor + NoBoxPlotWhiskerWrapper(); + NoBoxPlotWhiskerWrapper(NoBoxPlotWhisker*); +// -- destructor + virtual ~NoBoxPlotWhiskerWrapper(); + virtual void set(const MagRequest&); + + NoBoxPlotWhisker* me() { return noboxplotwhisker_; } + + virtual NoBoxPlotWhisker* object() { return noboxplotwhisker_; } + + + virtual void object(NoBoxPlotWhisker* o) { + // Remember to delete the previous object + noboxplotwhisker_ = o; + + + } + + + +protected: + NoBoxPlotWhisker* noboxplotwhisker_; + + +// -- method + virtual void print(ostream&) const; + + +private: + string tag_; + friend ostream& operator<<(ostream& s,const NoBoxPlotWhiskerWrapper& p) + { p.print(s); return s; } +}; + +} // namespace magics + +#endif \ No newline at end of file diff --git a/src/attributes/NoBoxPlotWrapper.cc b/src/attributes/NoBoxPlotWrapper.cc new file mode 100644 index 00000000..5b48f7a6 --- /dev/null +++ b/src/attributes/NoBoxPlotWrapper.cc @@ -0,0 +1,67 @@ + +/****************************** LICENSE ******************************* + + * (C) Copyright 1996-2017 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \\file NoBoxPlotAttributes.h + \\brief Definition of NoBoxPlot Attributes class. + + This file is automatically generated. + Do Not Edit! + +*/ + +#include "MagRequest.h" +#include "NoBoxPlotWrapper.h" +#include "MagicsParameter.h" +#include "Factory.h" +#include "MagTranslator.h" +#include "MagicsGlobal.h" + +using namespace magics; + + + +NoBoxPlotWrapper::NoBoxPlotWrapper(): noboxplot_(new NoBoxPlot()) + + +{ + + + + +} +NoBoxPlotWrapper::NoBoxPlotWrapper(NoBoxPlot* noboxplot): noboxplot_(noboxplot) +{ + + +} + +NoBoxPlotWrapper::~NoBoxPlotWrapper() +{ + +} + +void NoBoxPlotWrapper::set(const MagRequest& request) +{ + + + + + +} + +void NoBoxPlotWrapper::print(ostream& out) const +{ + out << "NoBoxPlotWrapper[]"; +} + + diff --git a/src/attributes/NoBoxPlotWrapper.h b/src/attributes/NoBoxPlotWrapper.h new file mode 100644 index 00000000..d634b754 --- /dev/null +++ b/src/attributes/NoBoxPlotWrapper.h @@ -0,0 +1,91 @@ + +/******************************* LICENSE ******************************* + + * (C) Copyright 1996-2016 ECMWF. + * + * This software is licensed under the terms of the Apache Licence Version 2.0 + * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. + * In applying this licence, ECMWF does not waive the privileges and immunities + * granted to it by virtue of its status as an intergovernmental organisation nor + * does it submit to any jurisdiction. + + ******************************* LICENSE *******************************/ + +/*! \fileNoBoxPlotAttributes.h + \brief Definition of NoBoxPlot Attributes class. + + This file is automatically generated. + Do Not Edit! + + Generated: +*/ + + +#ifndef NoBoxPlotWrapper_H +#define NoBoxPlotWrapper_H + +#include "magics.h" +#include "ParameterManager.h" +#include "Factory.h" + + + +#include "BoxPlotItem.h" + + + + + + + + + + +namespace magics { + +class MagRequest; + + + +class NoBoxPlotWrapper + +{ +public: +// -- constructor + NoBoxPlotWrapper(); + NoBoxPlotWrapper(NoBoxPlot*); +// -- destructor + virtual ~NoBoxPlotWrapper(); + virtual void set(const MagRequest&); + + NoBoxPlot* me() { return noboxplot_; } + + virtual NoBoxPlot* object() { return noboxplot_; } + + + virtual void object(NoBoxPlot* o) { + // Remember to delete the previous object + noboxplot_ = o; + + + } + + + +protected: + NoBoxPlot* noboxplot_; + + +// -- method + virtual void print(ostream&) const; + + +private: + string tag_; + friend ostream& operator<<(ostream& s,const NoBoxPlotWrapper& p) + { p.print(s); return s; } +}; + +} // namespace magics + +#endif \ No newline at end of file diff --git a/src/attributes/SymbolPlottingAttributes.cc b/src/attributes/SymbolPlottingAttributes.cc index 2d1fbd6d..217725b3 100644 --- a/src/attributes/SymbolPlottingAttributes.cc +++ b/src/attributes/SymbolPlottingAttributes.cc @@ -36,7 +36,17 @@ SymbolPlottingAttributes::SymbolPlottingAttributes(): connect_(ParameterManager::getBool("symbol_connect_line")), automatic_connect_colour_(ParameterManager::getBool("symbol_connect_automatic_line_colour")), connect_thickness_(ParameterManager::getInt("symbol_connect_line_thickness")), - legend_only_(ParameterManager::getBool("symbol_legend_only")) + legend_only_(ParameterManager::getBool("symbol_legend_only")), + property_hue_name_(ParameterManager::getString("symbol_property_hue_name")), + property_hue_list_(ParameterManager::getDoubleArray("symbol_property_hue_list")), + property_hue_values_list_(ParameterManager::getDoubleArray("symbol_property_hue_values_list")), + property_lightness_name_(ParameterManager::getString("symbol_property_lightness_name")), + property_lightness_list_(ParameterManager::getDoubleArray("symbol_property_lightness_list")), + property_lightness_values_list_(ParameterManager::getDoubleArray("symbol_property_lightness_values_list")), + property_saturation_value_(ParameterManager::getDouble("symbol_property_saturation_value")), + property_height_name_(ParameterManager::getString("symbol_property_height_name")), + property_height_scaling_factor_(ParameterManager::getDouble("symbol_property_height_scaling_factor")), + marker_(ParameterManager::getInt("symbol_marker_index")) , mode_(MagTranslator().magics("symbol_table_mode")), outline_colour_(MagTranslator().magics("symbol_outline_colour")), @@ -72,6 +82,16 @@ void SymbolPlottingAttributes::set(const std::map& params) setAttribute(prefix, "symbol_connect_automatic_line_colour", automatic_connect_colour_, params); setAttribute(prefix, "symbol_connect_line_thickness", connect_thickness_, params); setAttribute(prefix, "symbol_legend_only", legend_only_, params); + setAttribute(prefix, "symbol_property_hue_name", property_hue_name_, params); + setAttribute(prefix, "symbol_property_hue_list", property_hue_list_, params); + setAttribute(prefix, "symbol_property_hue_values_list", property_hue_values_list_, params); + setAttribute(prefix, "symbol_property_lightness_name", property_lightness_name_, params); + setAttribute(prefix, "symbol_property_lightness_list", property_lightness_list_, params); + setAttribute(prefix, "symbol_property_lightness_values_list", property_lightness_values_list_, params); + setAttribute(prefix, "symbol_property_saturation_value", property_saturation_value_, params); + setAttribute(prefix, "symbol_property_height_name", property_height_name_, params); + setAttribute(prefix, "symbol_property_height_scaling_factor", property_height_scaling_factor_, params); + setAttribute(prefix, "symbol_marker_index", marker_, params); setMember(prefix, "symbol_table_mode", mode_, params); setMember(prefix, "symbol_outline_colour", outline_colour_, params); @@ -95,6 +115,16 @@ void SymbolPlottingAttributes::copy(const SymbolPlottingAttributes& other) automatic_connect_colour_ = other.automatic_connect_colour_; connect_thickness_ = other.connect_thickness_; legend_only_ = other.legend_only_; + property_hue_name_ = other.property_hue_name_; + property_hue_list_ = other.property_hue_list_; + property_hue_values_list_ = other.property_hue_values_list_; + property_lightness_name_ = other.property_lightness_name_; + property_lightness_list_ = other.property_lightness_list_; + property_lightness_values_list_ = other.property_lightness_values_list_; + property_saturation_value_ = other.property_saturation_value_; + property_height_name_ = other.property_height_name_; + property_height_scaling_factor_ = other.property_height_scaling_factor_; + marker_ = other.marker_; mode_ = unique_ptr(other.mode_->clone()); outline_colour_ = unique_ptr(other.outline_colour_->clone()); outline_style_ = other.outline_style_; @@ -154,6 +184,16 @@ void SymbolPlottingAttributes::print(ostream& out) const out << " automatic_connect_colour = " << automatic_connect_colour_; out << " connect_thickness = " << connect_thickness_; out << " legend_only = " << legend_only_; + out << " property_hue_name = " << property_hue_name_; + out << " property_hue_list = " << property_hue_list_; + out << " property_hue_values_list = " << property_hue_values_list_; + out << " property_lightness_name = " << property_lightness_name_; + out << " property_lightness_list = " << property_lightness_list_; + out << " property_lightness_values_list = " << property_lightness_values_list_; + out << " property_saturation_value = " << property_saturation_value_; + out << " property_height_name = " << property_height_name_; + out << " property_height_scaling_factor = " << property_height_scaling_factor_; + out << " marker = " << marker_; out << " mode = " << *mode_; out << " outline_colour = " << *outline_colour_; out << " outline_style = " << outline_style_; @@ -190,6 +230,26 @@ void SymbolPlottingAttributes::toxml(ostream& out) const niceprint(out,connect_thickness_); out << ", \"symbol_legend_only\":"; niceprint(out,legend_only_); + out << ", \"symbol_property_hue_name\":"; + niceprint(out,property_hue_name_); + out << ", \"symbol_property_hue_list\":"; + niceprint(out,property_hue_list_); + out << ", \"symbol_property_hue_values_list\":"; + niceprint(out,property_hue_values_list_); + out << ", \"symbol_property_lightness_name\":"; + niceprint(out,property_lightness_name_); + out << ", \"symbol_property_lightness_list\":"; + niceprint(out,property_lightness_list_); + out << ", \"symbol_property_lightness_values_list\":"; + niceprint(out,property_lightness_values_list_); + out << ", \"symbol_property_saturation_value\":"; + niceprint(out,property_saturation_value_); + out << ", \"symbol_property_height_name\":"; + niceprint(out,property_height_name_); + out << ", \"symbol_property_height_scaling_factor\":"; + niceprint(out,property_height_scaling_factor_); + out << ", \"symbol_marker_index\":"; + niceprint(out,marker_); out << ", \"symbol_table_mode\":"; mode_->toxml(out); out << ", \"symbol_outline_colour\":"; @@ -215,6 +275,16 @@ static MagicsParameter symbol_connect_line("symbol_connect_line", "off") static MagicsParameter symbol_connect_automatic_line_colour("symbol_connect_automatic_line_colour", "on"); static MagicsParameter symbol_connect_line_thickness("symbol_connect_line_thickness", 1); static MagicsParameter symbol_legend_only("symbol_legend_only", "off"); +static MagicsParameter symbol_property_hue_name("symbol_property_hue_name", "colour"); +static MagicsParameter symbol_property_hue_list("symbol_property_hue_list", floatarray()); +static MagicsParameter symbol_property_hue_values_list("symbol_property_hue_values_list", floatarray()); +static MagicsParameter symbol_property_lightness_name("symbol_property_lightness_name", "colour"); +static MagicsParameter symbol_property_lightness_list("symbol_property_lightness_list", floatarray()); +static MagicsParameter symbol_property_lightness_values_list("symbol_property_lightness_values_list", floatarray()); +static MagicsParameter symbol_property_saturation_value("symbol_property_saturation_value", 1); +static MagicsParameter symbol_property_height_name("symbol_property_height_name", "colour"); +static MagicsParameter symbol_property_height_scaling_factor("symbol_property_height_scaling_factor", 1); +static MagicsParameter symbol_marker_index("symbol_marker_index", 1); static MagicsParameter symbol_table_mode("symbol_table_mode", "OFF"); static MagicsParameter symbol_outline_colour("symbol_outline_colour", "black"); static MagicsParameter symbol_outline_style("symbol_outline_style", "solid"); diff --git a/src/attributes/SymbolPlottingAttributes.h b/src/attributes/SymbolPlottingAttributes.h index ea7239de..2d46d6ff 100644 --- a/src/attributes/SymbolPlottingAttributes.h +++ b/src/attributes/SymbolPlottingAttributes.h @@ -64,6 +64,16 @@ class SymbolPlottingAttributes bool automatic_connect_colour_; int connect_thickness_; bool legend_only_; + string property_hue_name_; + doublearray property_hue_list_; + doublearray property_hue_values_list_; + string property_lightness_name_; + doublearray property_lightness_list_; + doublearray property_lightness_values_list_; + double property_saturation_value_; + string property_height_name_; + double property_height_scaling_factor_; + int marker_; unique_ptr mode_; unique_ptr outline_colour_; LineStyle outline_style_; diff --git a/src/attributes/SymbolPlottingWrapper.cc b/src/attributes/SymbolPlottingWrapper.cc index f643d742..f57fd136 100644 --- a/src/attributes/SymbolPlottingWrapper.cc +++ b/src/attributes/SymbolPlottingWrapper.cc @@ -115,6 +115,50 @@ void SymbolPlottingWrapper::set(const MagRequest& request) symbolplotting_->legend_only_ = MagTranslator()(legend_only_value); } + if (request.countValues("SYMBOL_PROPERTY_HUE_NAME") ) { + string property_hue_name_value = request("SYMBOL_PROPERTY_HUE_NAME"); + symbolplotting_->property_hue_name_ = property_hue_name_value; + } + doublearray property_hue_list_value; + for (int i = 0; i < request.countValues("SYMBOL_PROPERTY_HUE_LIST"); i++) + property_hue_list_value.push_back((double)request("SYMBOL_PROPERTY_HUE_LIST", i)); + if ( !property_hue_list_value.empty() ) + symbolplotting_->property_hue_list_ = property_hue_list_value; + doublearray property_hue_values_list_value; + for (int i = 0; i < request.countValues("SYMBOL_PROPERTY_HUE_VALUES_LIST"); i++) + property_hue_values_list_value.push_back((double)request("SYMBOL_PROPERTY_HUE_VALUES_LIST", i)); + if ( !property_hue_values_list_value.empty() ) + symbolplotting_->property_hue_values_list_ = property_hue_values_list_value; + if (request.countValues("SYMBOL_PROPERTY_LIGHTNESS_NAME") ) { + string property_lightness_name_value = request("SYMBOL_PROPERTY_LIGHTNESS_NAME"); + symbolplotting_->property_lightness_name_ = property_lightness_name_value; + } + doublearray property_lightness_list_value; + for (int i = 0; i < request.countValues("SYMBOL_PROPERTY_LIGHTNESS_LIST"); i++) + property_lightness_list_value.push_back((double)request("SYMBOL_PROPERTY_LIGHTNESS_LIST", i)); + if ( !property_lightness_list_value.empty() ) + symbolplotting_->property_lightness_list_ = property_lightness_list_value; + doublearray property_lightness_values_list_value; + for (int i = 0; i < request.countValues("SYMBOL_PROPERTY_LIGHTNESS_VALUES_LIST"); i++) + property_lightness_values_list_value.push_back((double)request("SYMBOL_PROPERTY_LIGHTNESS_VALUES_LIST", i)); + if ( !property_lightness_values_list_value.empty() ) + symbolplotting_->property_lightness_values_list_ = property_lightness_values_list_value; + if (request.countValues("SYMBOL_PROPERTY_SATURATION_VALUE") ) { + double property_saturation_value_value = request("SYMBOL_PROPERTY_SATURATION_VALUE"); + symbolplotting_->property_saturation_value_ = property_saturation_value_value; + } + if (request.countValues("SYMBOL_PROPERTY_HEIGHT_NAME") ) { + string property_height_name_value = request("SYMBOL_PROPERTY_HEIGHT_NAME"); + symbolplotting_->property_height_name_ = property_height_name_value; + } + if (request.countValues("SYMBOL_PROPERTY_HEIGHT_SCALING_FACTOR") ) { + double property_height_scaling_factor_value = request("SYMBOL_PROPERTY_HEIGHT_SCALING_FACTOR"); + symbolplotting_->property_height_scaling_factor_ = property_height_scaling_factor_value; + } + if (request.countValues("SYMBOL_MARKER_INDEX") ) { + int marker_value = request("SYMBOL_MARKER_INDEX"); + symbolplotting_->marker_ = marker_value; + } string mode_value = request.countValues("SYMBOL_TABLE_MODE") ? (string) request("SYMBOL_TABLE_MODE") : "OFF"; diff --git a/src/attributes/TileDecoderAttributes.cc b/src/attributes/TileDecoderAttributes.cc index 6bde01ae..32b32c29 100644 --- a/src/attributes/TileDecoderAttributes.cc +++ b/src/attributes/TileDecoderAttributes.cc @@ -27,6 +27,7 @@ using namespace magics; TileDecoderAttributes::TileDecoderAttributes(): file_name_(ParameterManager::getString("grib_input_file_name")), projection_(ParameterManager::getString("grib_tile_projection")), + mode_(ParameterManager::getString("grib_tile_mode")), loop_(ParameterManager::getBool("grib_loop")), z_(ParameterManager::getInt("grib_tile_z")), x_(ParameterManager::getInt("grib_tile_x")), @@ -54,6 +55,7 @@ void TileDecoderAttributes::set(const std::map& params) setAttribute(prefix, "grib_input_file_name", file_name_, params); setAttribute(prefix, "grib_tile_projection", projection_, params); + setAttribute(prefix, "grib_tile_mode", mode_, params); setAttribute(prefix, "grib_loop", loop_, params); setAttribute(prefix, "grib_tile_z", z_, params); setAttribute(prefix, "grib_tile_x", x_, params); @@ -69,6 +71,7 @@ void TileDecoderAttributes::copy(const TileDecoderAttributes& other) { file_name_ = other.file_name_; projection_ = other.projection_; + mode_ = other.mode_; loop_ = other.loop_; z_ = other.z_; x_ = other.x_; @@ -116,6 +119,7 @@ void TileDecoderAttributes::print(ostream& out) const out << "Attributes["; out << " file_name = " << file_name_; out << " projection = " << projection_; + out << " mode = " << mode_; out << " loop = " << loop_; out << " z = " << z_; out << " x = " << x_; @@ -134,6 +138,8 @@ void TileDecoderAttributes::toxml(ostream& out) const niceprint(out,file_name_); out << ", \"grib_tile_projection\":"; niceprint(out,projection_); + out << ", \"grib_tile_mode\":"; + niceprint(out,mode_); out << ", \"grib_loop\":"; niceprint(out,loop_); out << ", \"grib_tile_z\":"; @@ -153,6 +159,7 @@ void TileDecoderAttributes::toxml(ostream& out) const static MagicsParameter grib_input_file_name("grib_input_file_name", ""); static MagicsParameter grib_tile_projection("grib_tile_projection", "cylindrical"); +static MagicsParameter grib_tile_mode("grib_tile_mode", "eccharts"); static MagicsParameter grib_loop("grib_loop", "off"); static MagicsParameter grib_tile_z("grib_tile_z", 1); static MagicsParameter grib_tile_x("grib_tile_x", 0); diff --git a/src/attributes/TileDecoderAttributes.h b/src/attributes/TileDecoderAttributes.h index 659a05d7..470ea181 100644 --- a/src/attributes/TileDecoderAttributes.h +++ b/src/attributes/TileDecoderAttributes.h @@ -52,6 +52,7 @@ class TileDecoderAttributes string tag_; string file_name_; string projection_; + string mode_; bool loop_; int z_; int x_; diff --git a/src/attributes/TileDecoderWrapper.cc b/src/attributes/TileDecoderWrapper.cc index dbc9c0f4..ddbcb42a 100644 --- a/src/attributes/TileDecoderWrapper.cc +++ b/src/attributes/TileDecoderWrapper.cc @@ -63,6 +63,10 @@ void TileDecoderWrapper::set(const MagRequest& request) string projection_value = request("GRIB_TILE_PROJECTION"); tiledecoder_->projection_ = projection_value; } + if (request.countValues("GRIB_TILE_MODE") ) { + string mode_value = request("GRIB_TILE_MODE"); + tiledecoder_->mode_ = mode_value; + } if (request.countValues("GRIB_LOOP") ) { string loop_value = request("GRIB_LOOP"); diff --git a/src/basic/FortranMagics.cc b/src/basic/FortranMagics.cc index 061f418c..960b2e3a 100644 --- a/src/basic/FortranMagics.cc +++ b/src/basic/FortranMagics.cc @@ -8,7 +8,7 @@ * nor does it submit to any jurisdiction. */ -/*! \file FortranMagics.cc +/*! \file ics.cc \brief Implementation of the Template class FortranMagics. Magics Team - ECMWF 2007 @@ -103,10 +103,12 @@ void FortranMagics::reset() { gribindex_ = 0; legend_todo_ = false; + symbolinput_todo_ = false; matrixinput_todo_ = false; polyinput_todo_ = false; obsinput_todo_ = false; + obsinput_todo_ = false; while (actions_.size()) { @@ -435,7 +437,9 @@ void FortranMagics::pobs() { if (!action_ || obsinput_todo_ ) { action_ = new VisualAction(); ObsDecoder* obs = new ObsDecoder(); + cout << "OBS" << endl; if (obs->defined()) { + cout << "defined" << endl; action_->data(obs); top()->push_back(action_); @@ -446,8 +450,12 @@ void FortranMagics::pobs() { top()->push_back(action_); } } + // action_ = new VisualAction(); + // action_->data(new ObsJSon()); + // top()->push_back(action_); action_->visdef(new ObsPlotting()); + } #include "MatrixTestDecoder.h" diff --git a/src/common/ColourTableDefinitionCompute.cc b/src/common/ColourTableDefinitionCompute.cc index 8abf2042..de608024 100644 --- a/src/common/ColourTableDefinitionCompute.cc +++ b/src/common/ColourTableDefinitionCompute.cc @@ -275,10 +275,6 @@ void ColourTableDefinitionCompute::hcl(ColourTable& table, int nb) { void ColourTableDefinitionCompute::set(ColourTable& table, int nb) { prepare(); - MagLog::dev() << "ColourTableDefinitionCompute::set->min-->" << minColour_ << endl; - MagLog::dev() << "ColourTableDefinitionCompute::set->max-->" << maxColour_ << endl; - MagLog::dev() << "nb interval-->" << nb << endl; - if (nb == 1) { table.push_back(minColour_); return; @@ -292,6 +288,8 @@ void ColourTableDefinitionCompute::set(ColourTable& table, int nb) { table.push_back(maxColour_); return; } + + std::map::iterator method = methods_.find(lowerCase(method_)); if (method == methods_.end()) hsl(table, nb); @@ -393,7 +391,6 @@ void ColourTableDefinitionCompute::dynamic_normal(const stringarray& from, Colou void ColourTableDefinitionCompute::set(const stringarray& from, ColourTable& to, int nb, ColourListPolicy policy, const string& method) { - auto colour = from.begin(); if (policy == ColourListPolicy::DYNAMIC) { auto helper = dynamicMethods_.find(method); @@ -409,20 +406,18 @@ void ColourTableDefinitionCompute::set(const stringarray& from, ColourTable& to, } for (int i = 0; i < nb - 1; i++) { + to.push_back(Colour(*colour)); + colour++; + if (colour == from.end()) { if (policy == ColourListPolicy::LASTONE) { - to.push_back(Colour(from.back())); + colour--; } else { colour = from.begin(); - to.push_back(Colour(*colour)); - colour++; } } - else { - to.push_back(Colour(*colour)); - colour++; - } + } diff --git a/src/common/Transformation.cc b/src/common/Transformation.cc index 50650921..1577e8f1 100644 --- a/src/common/Transformation.cc +++ b/src/common/Transformation.cc @@ -322,6 +322,7 @@ void Transformation::operator()(const magics::Polyline& from, BasicGraphicsObjec } void Transformation::operator()(const magics::Polyline& from, vector& out) const { + if (from.empty()) return; diff --git a/src/decoders/GribDecoder.cc b/src/decoders/GribDecoder.cc index 3b454b24..72992912 100644 --- a/src/decoders/GribDecoder.cc +++ b/src/decoders/GribDecoder.cc @@ -752,7 +752,8 @@ void GribDecoder::decode2D(const Transformation&) { void GribDecoder::openField() { - current_position_ = (large_field_position_) ? large_field_position_ : field_position_; + // current_position_ = (large_field_position_) ? large_field_position_ : field_position_; + current_position_ = field_position_; current_file_name_ = file_name_; field_ = open(field_); @@ -760,12 +761,21 @@ void GribDecoder::openField() { void GribDecoder::openFirstComponent() { current_position_ = position_1_; - current_file_name_ = (first_file_name_ == "grib_input_file_name") ? file_name_ : first_file_name_; - field_ = open(field_); + + if (first_file_name_ == "grib_input_file_name") { + current_file_name_= file_name_; + } + else { + current_file_name_= first_file_name_; + } + + MagLog::debug() << "received-> " << current_position_ << " from file " << current_file_name_ < " << position_2_ << " from file " << second_file_name_ < first, last; + static vector latitudes; + netcdf.get(projection_ + "_lat", latitudes, first, last); + return true; + } + catch(...) { + return false; + } + } + + file_ = ifstream(path); if (!file_.good()) { file_.close(); @@ -149,21 +176,32 @@ void TileDecoder::customisedPoints(const Transformation& transformation, const s CustomisedPointsList& out, bool all) { string path = positions(); Timer timer("Tile", path); - #ifdef HAVE_NETCDF Netcdf netcdf(path, "index"); - map first, last; - first["x"] = tostring(x_); - first["y"] = tostring(y_); - last["x"] = tostring(x_); - last["y"] = tostring(y_); - vector bbox; vector latitudes; vector longitudes; vector values; vector index; + map first, last; + + if ( mode_ == "opencharts") { + + // netcdf.get(projection_ + "_lat", latitudes, first, last); + // netcdf.get(projection_ + "_lon", longitudes, first, last); + netcdf.get(projection_ + "_index", values, first, last); + + } + else { + first["x"] = tostring(x_); + first["y"] = tostring(y_); + last["x"] = tostring(x_); + last["y"] = tostring(y_); + netcdf.get("index", values, first, last); + } + + int error; FILE* in = fopen(file_name_.c_str(), "rb"); @@ -188,9 +226,6 @@ void TileDecoder::customisedPoints(const Transformation& transformation, const s return; } - int nbpoints = netcdf.getDimension("points"); - // netcdf.get("bounding-box", bbox, first, last); - netcdf.get("index", values, first, last); for (auto b = values.begin(); b != values.end(); ++b) { double lat = *b; @@ -200,15 +235,16 @@ void TileDecoder::customisedPoints(const Transformation& transformation, const s double i = *b; if (i != 0) { - if (lon > 180) - lon -= 360; + if ( mode_ != "opencharts") { + if (lon > 180) + lon -= 360; + } latitudes.push_back(lat); longitudes.push_back(lon); index.push_back(i); } } - { vector uc; uc.reserve(index.size()); @@ -230,6 +266,7 @@ void TileDecoder::customisedPoints(const Transformation& transformation, const s point->insert(make_pair("y_component", *vx)); out.push_back(point); point->tile(true); + ux++; vx++; lat++; @@ -244,21 +281,35 @@ void TileDecoder::customisedPoints(const Transformation& transformation, const s PointsHandler& TileDecoder::points(const Transformation& t, bool) { string path = positions_symbols(); Timer timer("Tile", path); + #ifdef HAVE_NETCDF Netcdf netcdf(path, "index"); - map first, last; - first["x"] = tostring(x_); - first["y"] = tostring(y_); - last["x"] = tostring(x_); - last["y"] = tostring(y_); - // vector bbox; - static vector latitudes; - static vector longitudes; - static vector values; + vector latitudes; + vector longitudes; + vector values; vector index; + map first, last; + + if ( mode_ == "opencharts") { + // netcdf.get(projection_ + "_lat", latitudes, first, last); + // netcdf.get(projection_ + "_lon", longitudes, first, last); + netcdf.get(projection_ + "_index", values, first, last); + + + + } + else { + first["x"] = tostring(x_); + first["y"] = tostring(y_); + last["x"] = tostring(x_); + last["y"] = tostring(y_); + netcdf.get("index", values, first, last); + } + + int error; FILE* in = fopen(file_name_.c_str(), "rb"); @@ -280,12 +331,8 @@ PointsHandler& TileDecoder::points(const Transformation& t, bool) { return *(pointsHandlers_.back()); } - + if (latitudes.size() == 0) { - int nbpoints = netcdf.getDimension("points"); - // netcdf.get("bounding-box", bbox, first, last); - netcdf.get("index", values, first, last); - for (auto b = values.begin(); b != values.end(); ++b) { double lat = *b; @@ -295,13 +342,14 @@ PointsHandler& TileDecoder::points(const Transformation& t, bool) { double i = *b; if (i != 0) { - if (lon > 180) - lon -= 360; - // transformation.fast_reproject(lon, lat); - + if ( mode_ != "opencharts") { + if (lon > 180) + lon -= 360; + } latitudes.push_back(lat); longitudes.push_back(lon); index.push_back(i); + } } } @@ -428,21 +476,19 @@ Data* TileDecoder::next() { void TileDecoder::decode() { - if (matrix_.size()) - return; + if (matrix_.size()) { + matrix_ = Matrix(); + + } string path = weights(); Timer timer("Tile", path); #ifdef HAVE_NETCDF + Netcdf netcdf(path, "index"); map first, last; - first["x"] = tostring(x_); - first["y"] = tostring(y_); - last["x"] = tostring(x_); - last["y"] = tostring(y_); - static vector bbox; static vector latitudes; static vector longitudes; @@ -450,10 +496,25 @@ void TileDecoder::decode() { static vector dindex; static vector distances; - int nblat = netcdf.getDimension("lat") - 1; - int nblon = netcdf.getDimension("lon") - 1; + if ( mode_ == "opencharts") { - if (bbox.empty()) { + netcdf.get(projection_ + "_lat", latitudes, first, last); + netcdf.get(projection_ + "_lon", longitudes, first, last); + netcdf.get(projection_ + "_index", dindex, first, last); + netcdf.get(projection_ + "_distances", distances, first, last); + } + else { + first["x"] = tostring(x_); + first["y"] = tostring(y_); + last["x"] = tostring(x_); + last["y"] = tostring(y_); + + + + int nblat = netcdf.getDimension("lat") - 1; + int nblon = netcdf.getDimension("lon") - 1; + + netcdf.get("bounding-box", bbox, first, last); int error; @@ -481,10 +542,13 @@ void TileDecoder::decode() { last["lat"] = tostring(maxy); last["lon"] = tostring(maxx); + + netcdf.get("lat", latitudes, first, last); netcdf.get("lon", longitudes, first, last); netcdf.get("index", dindex, first, last); netcdf.get("distances", distances, first, last); + } int index[4]; diff --git a/src/params/Axis.xml b/src/params/Axis.xml index 9b79fdc2..cae9bd55 100644 --- a/src/params/Axis.xml +++ b/src/params/Axis.xml @@ -94,7 +94,7 @@ does it submit to any jurisdiction. Colour of grid background diff --git a/src/params/ColourTechnique.xml b/src/params/ColourTechnique.xml index d0e22340..8826bfcc 100644 --- a/src/params/ColourTechnique.xml +++ b/src/params/ColourTechnique.xml @@ -9,23 +9,7 @@ does it submit to any jurisdiction. - - Colour to use below the out of bound minimum value - - - Colour to use below the out of bound maximum value - diff --git a/src/params/EpsPlume.xml b/src/params/EpsPlume.xml index 21946f14..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 + Line thickness of the deterministic forecast + + show teh precnetiles + + + List of the precentiles to display + + + List of colours to use to display the percentiles + + + List of line-style to use to display the percentiles + + + List of line-thickness to use to display the percentiles + The name of the input file containing the v-component of wind + The position in the input file of a field other than a wind component - used when the offset is too big - + The position in the input file of a wind component field used to colour the flag - The position in the input file of a wind component field used to colour the flag - + Turn legend on or off (ON/OFF) : New Parameter! + + values="number/text/marker/wind/property"> Defines the type of symbol plotting required @@ -251,5 +252,125 @@ does it submit to any jurisdiction. visible='off'> Inform the contour object do generate only the legend and not the plot .. [Web sdpecific] + + + With GeoSon : property name to use to set the colour + + + With GeoSon : list of colours to use + + + With GeoSon : list of heights to use + + + + With GeoSon : property name to use to set the colour + + + With GeoSon : list of colours to use + + + With GeoSon : list of heights to use + + + + With GeoSon : list of colours to use + + + + With GeoSon : property name to use to set the colour + + + With GeoSon : list of colours to use + + + With GeoSon : list of heights to use + + + + With GeoSon : list of colours to use + + + + With GeoSon : property name to use to set the colour + + + With GeoSon : property name to use to set the colour + + + + + Marker indice: An integer between 1 and 28 + + diff --git a/src/params/TileDecoder.xml b/src/params/TileDecoder.xml index e62d7643..d7ee1815 100644 --- a/src/params/TileDecoder.xml +++ b/src/params/TileDecoder.xml @@ -28,6 +28,11 @@ does it submit to any jurisdiction. default="cylindrical" from="string" name="grib_tile_projection"> + , void visit(LegendVisitor&); ListPolicy getPolicy() const { return policy_; } - bool minOutOfBound() const { return minOutOfBound_; } - bool maxOutOfBound() const { return maxOutOfBound_; } protected: //! Method to print string about this class on to a stream of type ostream (virtual). @@ -98,9 +96,7 @@ class ColourTechnique : public map, map > ranges_; double maxLevel_; - bool minOutOfBound_; - bool maxOutOfBound_; - + ListPolicy policy_; diff --git a/src/visualisers/CountSelectionType.cc b/src/visualisers/CountSelectionType.cc index 0fe91451..cb6b4aa2 100644 --- a/src/visualisers/CountSelectionType.cc +++ b/src/visualisers/CountSelectionType.cc @@ -34,59 +34,21 @@ CountSelectionType::CountSelectionType() {} #define MAXSET(v) !same(v, +1.0e+21) void CountSelectionType::calculate(double min, double max, bool shading) { - - - clear(); - - - double min_limit=min; - double max_limit=max; - - - if ( MINSET(min_) ) - min_limit = min_; - - if ( MAXSET(max_) ) - max_limit = max_; - - if ( shading && MINSET(shade_min_) ) - min_limit = shade_min_; - - if ( shading && MAXSET(shade_max_) ) - max_limit = shade_max_; - - minOutOfBond_ = oob_min_ > min_limit; - maxOutOfBond_ = oob_max_ < max_limit; - +clear(); + double maxi = (max_ > 1000000000) ? max : max_; + double mini = (min_ < -1000000000) ? min : min_; int i = 0; - if ( minOutOfBond_ || !MINSET(min_)) { - i++; - } - - if ( maxOutOfBond_ || !MAXSET(max_) ) { - i++; - } + i += (max_ > 1000000000) ? 1 : 0; + i += (min_ < -1000000000) ? 1 : 0; - // Commented for now, may have to be revisited soon. - // i += ( MINSET(min_limit) ) ? 1 : 0; - // i += ( MAXSET(max_limit) ) ? 1 : 0; - double nb = levelCount_ - 1; - if (same(max_limit, min_limit)) { - push_back(min_limit); + if (same(maxi, mini)) { + push_back(mini); return; } - - if (min_limit > max_limit) { - push_back(max_limit); - push_back(min_limit); - return; - } - - - double step = (max_limit - min_limit) / nb; + double step = (maxi - mini) / nb; double toleranceProportion = (double)tolerance_ / (double)(levelCount_ + 1 + i); // tolerance as a proportion of the number of levels @@ -94,7 +56,7 @@ void CountSelectionType::calculate(double min, double max, bool shading) { // number of levels we will not actually plot, ie the min/max contours). if (same(step, 0)) { // Only one isoline! - push_back(min_limit); + push_back(mini); return; } @@ -145,12 +107,13 @@ void CountSelectionType::calculate(double min, double max, bool shading) { inc *= istep; // convert back into proper range - double first = floor(min_limit / inc) * inc; - while (first > min_limit) + double first = floor(mini / inc) * inc; + + while (first > mini) first -= inc; - push_back(min_limit); + push_back(mini); first += inc; double epsilon = inc / 10000.0; while (same(epsilon, 0)) { @@ -159,20 +122,18 @@ void CountSelectionType::calculate(double min, double max, bool shading) { } - - for (double val = first; val < max_limit; val += inc) { + for (double val = first; val < maxi; val += inc) { // special case - if the value is close to zero then set it to precisely zero to avoid later formatting issues if (fabs(val) < epsilon) push_back(0.0); - else if (same(val, max_limit)) - push_back(max_limit); + else if (same(val, maxi)) + push_back(maxi); else push_back(val); } - if (max_limit != back()) - push_back(max_limit); - + if (maxi != back()) + push_back(maxi); int si = static_cast(size()); @@ -180,37 +141,28 @@ void CountSelectionType::calculate(double min, double max, bool shading) { // so as to ensure the correct number, even if they are not nice if (si - i < levelCount_ - tolerance_ || si - i > levelCount_ + tolerance_) { - MagLog::debug() << "Not using nice levels[" << levelCount_ << ", " << tolerance_ << "]-->" << size() << endl; + MagLog::debug() << "Not using nice levels[" << levelCount_ << ", " << tolerance_ << "]-->" << size() << endl; clear(); - step = (max_limit - min_limit) / (levelCount_ - 1); - double val = min_limit; + step = (maxi - mini) / (levelCount_ - 1); + double val = mini; while (1) { - if ( val >= min_limit && val <= max_limit ) push_back(val); - if (same(val, max_limit) || val > max_limit) + if (same(val, maxi) || val > maxi) break; val += step; } MagLog::debug() << "New size-->" << size() << endl; } - if ( minOutOfBond_ ) { - insert(begin(), std::max(min, min_)); - } + MagLog::debug() << "count=" << levelCount_ << ", tolerance=" << tolerance_ << ", result=" << size() << endl; - if ( maxOutOfBond_ ) { - push_back(std::min(max, max_)); - } - - ostringstream level; for (const_iterator l = begin(); l != end(); ++l) level << *l << " "; - MagLog::debug() << level.str() << endl; + MagLog::debug() << level.str() << endl; } - CountSelectionType::~CountSelectionType() {} /*! diff --git a/src/visualisers/EpsGraph.cc b/src/visualisers/EpsGraph.cc index 44f1c65d..1998281f 100644 --- a/src/visualisers/EpsGraph.cc +++ b/src/visualisers/EpsGraph.cc @@ -2493,6 +2493,13 @@ void EpsPlume::visit(LegendVisitor& legend) { median->setLineStyle(median_line_style_); legend.add(new LineEntry("Median", median)); } + // if (percentiles_) { + // magics::Polyline* median = new magics::Polyline(); + // median->setColour(*median_line_colour_); + // median->setThickness(median_line_thickness_); + // median->setLineStyle(median_line_style_); + // legend.add(new LineEntry("Median", median)); + // } } void EpsPlume::timeserie(Data& data, BasicGraphicsObjectContainer& visitor) { @@ -2521,11 +2528,21 @@ void EpsPlume::timeserie(Data& data, BasicGraphicsObjectContainer& visitor) { median->setColour(*median_line_colour_); median->setThickness(median_line_thickness_); median->setLineStyle(median_line_style_); + + + map> shading; + map> percentiles; + if (shading_) { for (vector::iterator level = shading_levels_.begin(); level != shading_levels_.end(); ++level) shading.insert(make_pair(*level, vector())); } + if (percentiles_) { + for (vector::iterator level = percentiles_list_.begin(); level != percentiles_list_.end(); ++level) { + percentiles.insert(make_pair(*level, vector())); + } + } for (const auto& point : points) { double x = (*point)["step"] + (*point)["shift"]; double missing = (*point)["missing"]; @@ -2565,6 +2582,11 @@ void EpsPlume::timeserie(Data& data, BasicGraphicsObjectContainer& visitor) { std::sort(members.begin(), members.end()); median->push_back(PaperPoint(x, members[m])); } + if (percentiles_) { + int m = members.size()/2; + std::sort(members.begin(), members.end()); + median->push_back(PaperPoint(x, members[m])); + } if (shading_) { for (vector::iterator level = shading_levels_.begin(); level != shading_levels_.end(); ++level) { int i = *level * (members.size()/100.); @@ -2573,7 +2595,16 @@ void EpsPlume::timeserie(Data& data, BasicGraphicsObjectContainer& visitor) { shading[*level].push_back(PaperPoint(x, members[i])); } } + if (percentiles_) { + for (vector::iterator level = percentiles_list_.begin(); level != percentiles_list_.end(); ++level) { + int i = *level * (members.size()/100.); + if (i >= members.size()) + i = members.size() - 1; + percentiles[*level].push_back(PaperPoint(x, members[i])); + } + } } + vector::iterator colour = shading_colours_.begin(); @@ -2594,9 +2625,10 @@ void EpsPlume::timeserie(Data& data, BasicGraphicsObjectContainer& visitor) { for (vector::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); @@ -2611,6 +2643,36 @@ void EpsPlume::timeserie(Data& data, BasicGraphicsObjectContainer& visitor) { transformation(*forecast, visitor); if (median_) transformation(*median, visitor); + if (percentiles_) { + if ( percentiles_line_colour_list_.empty() ) + percentiles_line_colour_list_.push_back("black"); + if ( percentiles_line_thickness_list_.empty() ) + percentiles_line_thickness_list_.push_back(2); + if ( percentiles_line_style_list_.empty() ) + percentiles_line_style_list_.push_back("solid"); + + auto percentiles_line_colour = percentiles_line_colour_list_.begin(); + auto percentiles_line_thickness = percentiles_line_thickness_list_.begin(); + auto percentiles_line_style = percentiles_line_style_list_.begin(); + + for ( auto percentile = percentiles.begin(); percentile != percentiles.end (); ++percentile ) { + magics::Polyline* line = new magics::Polyline(); + line->setColour(Colour(*percentiles_line_colour)); + line->setLineStyle(MagTranslator()(*percentiles_line_style)); + line->setThickness(*percentiles_line_thickness); + + if (++percentiles_line_colour == percentiles_line_colour_list_.end() ) --percentiles_line_colour; + if (++percentiles_line_thickness == percentiles_line_thickness_list_.end() ) --percentiles_line_thickness; + if (++percentiles_line_style == percentiles_line_style_list_.end() ) --percentiles_line_style; + + for (vector::iterator point = percentile->second.begin(); point != percentile->second.end(); ++point) + line->push_back(*point); + + transformation(*line, visitor); + } + + + } } void EpsPlume::verticalprofile(Data& data, BasicGraphicsObjectContainer& visitor) { @@ -2714,6 +2776,8 @@ void EpsPlume::background(BasicGraphicsObjectContainer& visitor) { } + double shift =(transformation.getMaxY() - transformation.getMinY())*0.02; + if ( label != background_label_list_.end() ) { Text* text = new Text(); @@ -2723,10 +2787,11 @@ void EpsPlume::background(BasicGraphicsObjectContainer& visitor) { font.colour(*background_label_font_colour_); text->setFont(font); double x = transformation.getMinX() + (transformation.getMaxX() - transformation.getMinX())*0.01; - double y = from + (to-from)*0.1; - - text->push_back(PaperPoint(x, y)); - visitor.push_back(text); + + double y = from + shift; + if ( y < transformation.getMaxY() ) + text->push_back(PaperPoint(x, y)); + visitor.push_back(text); ++label; } from = *level; @@ -2735,20 +2800,6 @@ void EpsPlume::background(BasicGraphicsObjectContainer& visitor) { } - // if ( from < transformation.getMaxY() ) { - // Polyline* area = new Polyline(); - // area->setColour(Colour(*colour)); - // area->setFilled(true); - // area->setShading(new FillShadingProperties()); - // area->setFillColour(Colour(*colour)); - // visitor.push_back(area); - // area->push_back(PaperPoint(transformation.getMinX(), from)); - // area->push_back(PaperPoint(transformation.getMinX(), transformation.getMaxY())); - // area->push_back(PaperPoint(transformation.getMaxX(), transformation.getMaxY())); - // area->push_back(PaperPoint(transformation.getMaxX(), from)); - // area->push_back(PaperPoint(transformation.getMinX(), from)); - // } - } void EpsPlume::operator()(Data& data, BasicGraphicsObjectContainer& visitor) { diff --git a/src/visualisers/IntervalSelectionType.cc b/src/visualisers/IntervalSelectionType.cc index c4e10c57..1ca7e2d0 100644 --- a/src/visualisers/IntervalSelectionType.cc +++ b/src/visualisers/IntervalSelectionType.cc @@ -40,12 +40,14 @@ void IntervalSelectionType::print(ostream& out) const { out << "]"; } + #define MINSET(v) !same(v, -1.0e+21) #define MAXSET(v) !same(v, +1.0e+21) void IntervalSelectionType::calculate(double min, double max, bool shading) { clear(); std::set levels; + double min_level=min; double max_level=max; @@ -60,26 +62,13 @@ void IntervalSelectionType::calculate(double min, double max, bool shading) { if ( shading && MAXSET(shade_max_) ) max_level = shade_max_; - - - minOutOfBond_ = oob_min_ > min_level; - maxOutOfBond_ = oob_max_ < max_level; - if ( minOutOfBond_ ) { - levels.insert(min_level); - min_level = oob_min_; - } - if ( maxOutOfBond_ ) { - levels.insert(max_level); - max_level = oob_max_; - } - levels.insert(min_level); levels.insert(max_level); - + double level = reference_; double newref; @@ -106,7 +95,7 @@ void IntervalSelectionType::calculate(double min, double max, bool shading) { push_back(*level); } out << "]" << endl; - // cout << out.str() << endl; + MagLog::dev() << out.str() << endl; } diff --git a/src/visualisers/LevelListSelectionType.cc b/src/visualisers/LevelListSelectionType.cc index 1f400d8d..3fb3d49c 100644 --- a/src/visualisers/LevelListSelectionType.cc +++ b/src/visualisers/LevelListSelectionType.cc @@ -45,47 +45,17 @@ void LevelListSelectionType::print(ostream& out) const { void LevelListSelectionType::calculate(double min, double max, bool shading) { clear(); - double min_level=list_.front(); - double max_level=list_.back(); - - - if ( MINSET(min_) ) - min_level = min_; - - if ( MAXSET(max_) ) - max_level = max_; - - if ( shading && MINSET(shade_min_) ) - min_level = shade_min_; - - if ( shading && MAXSET(shade_max_) ) - max_level = shade_max_; - - - - minOutOfBond_ = oob_min_ > min_level; - maxOutOfBond_ = oob_max_ < max_level; - - - - - if (minOutOfBond_) { - push_back(min); - push_back(oob_min_); - min_level = oob_min_; - } - - if (maxOutOfBond_) { - max_level = oob_max_; - } +// Here have to take into account contour_min/max and comtour_shade_min/max : we take the max of the min and the min of the max. + double use_min = ( shade_min_ > min_ ) ? shade_min_ : min_; + double use_max = ( shade_max_ < max_ ) ? shade_max_ : max_; doublearray::const_iterator last = list_.begin(); - double prevVal = min_; + double prevVal = use_min; for (doublearray::const_iterator val = list_.begin(); val != list_.end(); ++val) { MagLog::dev() << "LevelListSelectionType::calculate(double min, double max)--->" << *val << "\n"; - if (min_level <= *val && *val <= max_level) { + if (use_min <= *val && *val <= use_max) { if (*val < prevVal) { MagLog::error() << " level list values should increase, but " << *val << " follows " << prevVal << endl; break; @@ -95,24 +65,19 @@ void LevelListSelectionType::calculate(double min, double max, bool shading) { } ++last; } - if (maxOutOfBond_) { - push_back(oob_max_); - push_back(max); - } - // Just in case add another level to close the last interval ! if (last != list_.end()) push_back(*last); - // ostringstream print; - // print << "LevelListSelectionType::calculate-->"; - // string sep = "["; - // for (vector::const_iterator val = begin(); val != end(); ++val) { - // print << sep << *val; - // sep = ", "; - // } - // print << "]"; - // cout << print.str() << endl; + ostringstream print; + print << "LevelListSelectionType::calculate-->"; + string sep = "["; + for (vector::const_iterator val = begin(); val != end(); ++val) { + print << sep << *val; + sep = ", "; + } + print << "]"; + MagLog::dev() << print.str() << endl; } diff --git a/src/visualisers/LevelSelection.h b/src/visualisers/LevelSelection.h index 218d342b..1be70cc6 100644 --- a/src/visualisers/LevelSelection.h +++ b/src/visualisers/LevelSelection.h @@ -58,15 +58,11 @@ class LevelSelection : public LevelSelectionAttributes, public doublearray { virtual double reference(int) const; virtual void thinLevels(int frequency, vector&) const; - bool minOutOfBond() { return minOutOfBond_; } - bool maxOutOfBond() { return maxOutOfBond_; } - + protected: //! Method to print string about this class on to a stream of type ostream (virtual). virtual void print(ostream&) const override; - bool minOutOfBond_; - bool maxOutOfBond_; -; + private: //! Copy constructor - No copy allowed diff --git a/src/visualisers/PolyShadingTechnique.h b/src/visualisers/PolyShadingTechnique.h index 5724699c..07d24508 100644 --- a/src/visualisers/PolyShadingTechnique.h +++ b/src/visualisers/PolyShadingTechnique.h @@ -141,7 +141,6 @@ struct LegendEntryBuilder { box->setColour(colours_.right(min)); LegendEntry* entry = new BoxEntry(min, max, box); - entry->oob(colours_.minOutOfBound(), colours_.maxOutOfBound()); if (first_) { first_ = false; entry->first(); diff --git a/src/visualisers/SegmentJoiner.h b/src/visualisers/SegmentJoiner.h index 9e7f901a..10ff5301 100644 --- a/src/visualisers/SegmentJoiner.h +++ b/src/visualisers/SegmentJoiner.h @@ -23,6 +23,8 @@ using namespace std; +namespace magics { + struct Point { double x_; double y_; @@ -143,4 +145,6 @@ class SegmentJoiner { bool dirty_; }; +} + #endif diff --git a/src/visualisers/SymbolPlotting.cc b/src/visualisers/SymbolPlotting.cc index 834b0dd0..bd847ce8 100644 --- a/src/visualisers/SymbolPlotting.cc +++ b/src/visualisers/SymbolPlotting.cc @@ -28,6 +28,10 @@ #include "LegendVisitor.h" #include "MagicsGlobal.h" +#include "IntervalMap.h" + +#include "IntervalMap.h" + using namespace magics; @@ -116,11 +120,121 @@ struct SortHelper { } }; +void SymbolPlotting::by_property_prepare(IntervalMap& hueFinder, IntervalMap& lightnessFinder) +{ + auto value_hue = property_hue_values_list_.begin(); + auto hue = property_hue_list_.begin(); + auto value_lightness = property_lightness_values_list_.begin(); + auto lightness = property_lightness_list_.begin(); + + while (true) { + if (value_hue + 1 == property_hue_values_list_.end()) + break; + + hueFinder[Interval(*value_hue, *(value_hue+1))] = *hue; + if (hue + 1 != property_hue_list_.end()) + hue++; + ++value_hue; + } + while (true) { + if (value_lightness + 1 == property_lightness_values_list_.end()) + break; + + lightnessFinder[Interval(*value_lightness, *(value_lightness+1))] = *lightness; + if (lightness + 1 != property_lightness_list_.end()) + lightness++; + ++value_lightness; + } +} + +void SymbolPlotting::by_property(Data& data, BasicGraphicsObjectContainer& out) { + + const Transformation& transformation = out.transformation(); + + std::set needs; + + needs.insert(property_height_name_); + needs.insert(property_hue_name_); + needs.insert(property_lightness_name_); + + + if ( property_hue_list_.empty() ) + property_hue_list_.push_back(1); + if ( property_lightness_list_.empty() ) + property_lightness_list_.push_back(0.5); + + + + + IntervalMap hueFinder; + IntervalMap lightnessFinder; + + by_property_prepare(hueFinder, lightnessFinder); + + + Colour red("blue"); + + double factor = ( out.absoluteHeight()*transformation.patchDistance(1))/(transformation.getMaxPCY()-transformation.getMinPCY()) ; + + factor = magCompare(unit_method_, "geographical") ? + ( out.absoluteHeight()*transformation.patchDistance(1))/(transformation.getMaxPCY()-transformation.getMinPCY()) : 1; + + + CustomisedPointsList points; + data.customisedPoints(out.transformation(), needs, points, true); + + for (auto& point : points) { + double val = 0; + + + double hue = (*point)[property_hue_name_]; + double lightness = (*point)[property_lightness_name_]; + double height = (*point)[property_height_name_]; + + Symbol* symbol = new Symbol(); + symbol->setMarker(marker_); + + Hsl hsl(hueFinder.find(hue, 0), property_saturation_value_, lightnessFinder.find(lightness, 0.5)); + Colour colour(hsl); + symbol->setColour(colour); + + + if ( height*property_height_scaling_factor_ > 2 ) { + height = 2*factor; + MagLog::warning() << " Symbol height reset to 2 " << endl; + } + else + height = height*property_height_scaling_factor_*factor; + + symbol->setHeight(height); + + UserPoint geo = UserPoint(point->longitude(), point->latitude()); + std::stack duplicates; + transformation.wraparound(geo, duplicates); + while (duplicates.empty() == false) { + PaperPoint xy = transformation(duplicates.top()); + symbol->push_back(xy); + duplicates.pop(); + + } + out.push_back(symbol); + + } + + + +} + void SymbolPlotting::operator()(Data& data, BasicGraphicsObjectContainer& out) { mode_->parent(this); mode_->prepare(); symbols_.clear(); + + + if ( magCompare("property", type_) ) + return by_property(data, out); + vector check; check.push_back("text"); check.push_back("number"); @@ -130,19 +244,12 @@ void SymbolPlotting::operator()(Data& data, BasicGraphicsObjectContainer& out) { const Transformation& transformation = out.transformation(); - // cout << "absolut width " << out.absoluteWidth() << endl; - // cout << "absolut height " << out.absoluteHeight() << endl; - // cout << "pcminy " << transformation.getMinPCY() << endl; - // cout << "pcmaxy " << transformation.getMaxPCY() << endl; - - // cout << "unit " << unit_method_ << endl; - double factor = ( out.absoluteHeight()*transformation.patchDistance(1))/(transformation.getMaxPCY()-transformation.getMinPCY()) ; - // cout << "sacle--> " << factor << endl; - // cout << "patch--> " << transformation.patchDistance(1) << endl; + factor = magCompare(unit_method_, "geographical") ? ( out.absoluteHeight()*transformation.patchDistance(1))/(transformation.getMaxPCY()-transformation.getMinPCY()) : 1; + bool valid = false; for (vector::iterator c = check.begin(); c != check.end(); ++c) { @@ -158,7 +265,7 @@ void SymbolPlotting::operator()(Data& data, BasicGraphicsObjectContainer& out) { try { - const Transformation& transformation = out.transformation(); + // If we need to connect the symbols with a line, we need all the poinst // to enable proper clipping of the line! Othewise wee just nedde to get the point @@ -174,6 +281,7 @@ void SymbolPlotting::operator()(Data& data, BasicGraphicsObjectContainer& out) { points.setToFirst(); while (points.more()) { + PaperPoint xy = transformation(points.current()); (*this)(xy, out); points.advance(); @@ -206,11 +314,44 @@ void SymbolPlotting::operator()(Data& data, BasicGraphicsObjectContainer& out) { } } + +void SymbolPlotting::by_property_legend(Data& data, LegendVisitor& legend) { + + IntervalMap hueFinder; + IntervalMap lightnessFinder; + + by_property_prepare(hueFinder, lightnessFinder); + + + + for (IntervalMap::const_iterator hue = hueFinder.begin(); hue != hueFinder.end(); ++hue) + for (IntervalMap::const_iterator lightness = lightnessFinder.begin(); lightness != lightnessFinder.end(); ++lightness) + { + Polyline* box = new Polyline(); + double min = lightness->first.min_; + double max = lightness->first.max_; + + box->setShading(new FillShadingProperties()); + + Hsl hsl(hue->second, property_saturation_value_, lightness->second); + Colour colour(hsl); + cout << "add legend " << colour << endl; + + box->setFillColour(colour); + box->setFilled(true); + + legend.add(new BoxEntry(min, max, box)); + } +} + void SymbolPlotting::visit(Data& data, LegendVisitor& legend) { MagLog::debug() << " SymbolPlotting::visit to create a legend ... " << "\n"; if (!legend_) return; + if ( magCompare("property", type_) ) + return by_property_legend(data, legend); + (*mode_).visit(data, legend); } diff --git a/src/visualisers/SymbolPlotting.h b/src/visualisers/SymbolPlotting.h index 0005acdf..322849b1 100644 --- a/src/visualisers/SymbolPlotting.h +++ b/src/visualisers/SymbolPlotting.h @@ -44,8 +44,13 @@ class SymbolPlotting : public SymbolPlottingAttributes, public Visdef { virtual void operator()(Data&, BasicGraphicsObjectContainer&) override; + virtual void visit(Data&, LegendVisitor&) override; + void by_property(Data&, BasicGraphicsObjectContainer&); + void by_property_legend(Data&, LegendVisitor&); + void by_property_prepare(IntervalMap&, IntervalMap&); bool needLegend() override { return legend_; } + virtual void visit(Data&, HistoVisitor&) override; void operator()(const PaperPoint&, BasicGraphicsObjectContainer&) const; void getReady(const LegendVisitor& legend) override;