diff --git a/.gitignore b/.gitignore index bc46ae854..83610564a 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,6 @@ tmp.* *.ppm .env *.swp + +# mac +.DS_Store diff --git a/.vscode/settings.json b/.vscode/settings.json index 5accb52c1..f44f6e540 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -72,7 +72,23 @@ "system_error": "cpp", "tuple": "cpp", "type_traits": "cpp", - "typeinfo": "cpp" + "typeinfo": "cpp", + "__hash_table": "cpp", + "array": "cpp", + "codecvt": "cpp", + "compare": "cpp", + "concepts": "cpp", + "condition_variable": "cpp", + "numbers": "cpp", + "queue": "cpp", + "random": "cpp", + "semaphore": "cpp", + "strstream": "cpp", + "thread": "cpp", + "unordered_map": "cpp", + "memory_resource": "cpp", + "stop_token": "cpp", + "cinttypes": "cpp" }, "esbonio.server.enabled": true } diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..ba121e296 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +4.14.2 \ No newline at end of file diff --git a/docs/confluence/tojson.py b/docs/confluence/tojson.py index f48897378..d33e79423 100644 --- a/docs/confluence/tojson.py +++ b/docs/confluence/tojson.py @@ -138,6 +138,7 @@ def thickness(p, attrs): "Colour": anyset, "LineStyle": lineset, "ListPolicy": listpolicy, + "ColourListPolicy": colourpolicy, "ColourTechnique": colourtechnique, "ArrowPosition": arrowposition, "Justification": justification, diff --git a/notebook/mongo.ipynb b/notebook/mongo.ipynb index e41812430..8aa608e43 100644 --- a/notebook/mongo.ipynb +++ b/notebook/mongo.ipynb @@ -2,9 +2,9 @@ "cells": [ { "cell_type": "code", - "execution_count": 6, + "execution_count": 2, "metadata": { - "collapsed": true + "tags": [] }, "outputs": [], "source": [ @@ -13,9 +13,9 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 3, "metadata": { - "collapsed": true + "tags": [] }, "outputs": [], "source": [ @@ -25,38 +25,30 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 5, "metadata": {}, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'param2': 'val2', 'param1': 'val1'}\n" - ] + "data": { + "text/plain": [ + "{'param1': 'val1', 'param2': 'val2'}" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ "stat = { \"param1\" : \"val1\", \"param2\" : \"val2\" }\n", - "print stat " + "stat " ] }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "db = client['statistique']\n", "stats = db.stats\n", @@ -65,57 +57,41 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 7, "metadata": {}, "outputs": [ { - "data": { - "text/plain": [ - "{u'_id': ObjectId('57d86ce2049832a4a0ddd19b'),\n", - " u'param1': u'val1',\n", - " u'param2': u'val2'}" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" + "ename": "ServerSelectionTimeoutError", + "evalue": "localhost:27017: [Errno 61] Connection refused, Timeout: 30s, Topology Description: ]>", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mServerSelectionTimeoutError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m/var/folders/pj/33n_ljh12_nf6nbm78x1h5mr0000gn/T/ipykernel_9282/3649959354.py\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mx\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mstats\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfind_one\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mx\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/opt/homebrew/lib/python3.9/site-packages/pymongo/collection.py\u001b[0m in \u001b[0;36mfind_one\u001b[0;34m(self, filter, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1238\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1239\u001b[0m \u001b[0mcursor\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfind\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfilter\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1240\u001b[0;31m \u001b[0;32mfor\u001b[0m \u001b[0mresult\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcursor\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mlimit\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m-\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1241\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1242\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/opt/homebrew/lib/python3.9/site-packages/pymongo/cursor.py\u001b[0m in \u001b[0;36mnext\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1193\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__empty\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1194\u001b[0m \u001b[0;32mraise\u001b[0m \u001b[0mStopIteration\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1195\u001b[0;31m \u001b[0;32mif\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__data\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_refresh\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1196\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__data\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpopleft\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1197\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/opt/homebrew/lib/python3.9/site-packages/pymongo/cursor.py\u001b[0m in \u001b[0;36m_refresh\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1086\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1087\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__session\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1088\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__session\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__collection\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdatabase\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mclient\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_ensure_session\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1089\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1090\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__id\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;31m# Query\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/opt/homebrew/lib/python3.9/site-packages/pymongo/mongo_client.py\u001b[0m in \u001b[0;36m_ensure_session\u001b[0;34m(self, session)\u001b[0m\n\u001b[1;32m 1641\u001b[0m \u001b[0;31m# Don't make implicit sessions causally consistent. Applications\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1642\u001b[0m \u001b[0;31m# should always opt-in.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1643\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__start_session\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcausal_consistency\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1644\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mConfigurationError\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mInvalidOperation\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1645\u001b[0m \u001b[0;31m# Sessions not supported.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/opt/homebrew/lib/python3.9/site-packages/pymongo/mongo_client.py\u001b[0m in \u001b[0;36m__start_session\u001b[0;34m(self, implicit, **kwargs)\u001b[0m\n\u001b[1;32m 1592\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__start_session\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mimplicit\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1593\u001b[0m \u001b[0;31m# Raises ConfigurationError if sessions are not supported.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1594\u001b[0;31m \u001b[0mserver_session\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_get_server_session\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1595\u001b[0m \u001b[0mopts\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mclient_session\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mSessionOptions\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1596\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mclient_session\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mClientSession\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mserver_session\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mopts\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mimplicit\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/opt/homebrew/lib/python3.9/site-packages/pymongo/mongo_client.py\u001b[0m in \u001b[0;36m_get_server_session\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1627\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_get_server_session\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1628\u001b[0m \u001b[0;34m\"\"\"Internal: start or resume a _ServerSession.\"\"\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1629\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_topology\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_server_session\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1630\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1631\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_return_server_session\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mserver_session\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlock\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/opt/homebrew/lib/python3.9/site-packages/pymongo/topology.py\u001b[0m in \u001b[0;36mget_server_session\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 532\u001b[0m \u001b[0;31m# Sessions are always supported in load balanced mode.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 533\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_settings\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload_balanced\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 534\u001b[0;31m \u001b[0msession_timeout\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_check_session_support\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 535\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 536\u001b[0m \u001b[0;31m# Sessions never time out in load balanced mode.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m/opt/homebrew/lib/python3.9/site-packages/pymongo/topology.py\u001b[0m in \u001b[0;36m_check_session_support\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 518\u001b[0m )\n\u001b[1;32m 519\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_description\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mreadable_servers\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 520\u001b[0;31m self._select_servers_loop(\n\u001b[0m\u001b[1;32m 521\u001b[0m \u001b[0mreadable_server_selector\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_settings\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mserver_selection_timeout\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 522\u001b[0m )\n", + "\u001b[0;32m/opt/homebrew/lib/python3.9/site-packages/pymongo/topology.py\u001b[0m in \u001b[0;36m_select_servers_loop\u001b[0;34m(self, selector, timeout, address)\u001b[0m\n\u001b[1;32m 221\u001b[0m \u001b[0;31m# No suitable servers.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 222\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mtimeout\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;36m0\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0mnow\u001b[0m \u001b[0;34m>\u001b[0m \u001b[0mend_time\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 223\u001b[0;31m raise ServerSelectionTimeoutError(\n\u001b[0m\u001b[1;32m 224\u001b[0m \u001b[0;34m\"%s, Timeout: %ss, Topology Description: %r\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 225\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_error_message\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mselector\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdescription\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mServerSelectionTimeoutError\u001b[0m: localhost:27017: [Errno 61] Connection refused, Timeout: 30s, Topology Description: ]>" + ] } ], "source": [ - "stats.find_one()\n" + "x = stats.find_one()\n", + "x\n", + "\n" ] }, { "cell_type": "code", - "execution_count": 30, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "{'name': 'stat', 'value': 1}\n", - "{'name': 'stat', 'value': 2}\n", - "{'name': 'stat', 'value': 3}\n", - "{'name': 'stat', 'value': 4}\n", - "{'name': 'stat', 'value': 5}\n", - "{'name': 'stat', 'value': 6}\n", - "{'name': 'stat', 'value': 7}\n", - "{'name': 'stat', 'value': 8}\n", - "{'name': 'stat', 'value': 9}\n" - ] - }, - { - "data": { - "text/plain": [ - "46" - ] - }, - "execution_count": 30, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "\n", "for i in range(1, 10):\n", @@ -175,7 +151,10 @@ "cell_type": "code", "execution_count": null, "metadata": { - "collapsed": true + "collapsed": true, + "jupyter": { + "outputs_hidden": true + } }, "outputs": [], "source": [] @@ -183,23 +162,23 @@ ], "metadata": { "kernelspec": { - "display_name": "Python [default]", + "display_name": "Python 3 (ipykernel)", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.13" + "pygments_lexer": "ipython3", + "version": "3.9.10" } }, "nbformat": 4, - "nbformat_minor": 1 + "nbformat_minor": 4 } diff --git a/notebook/releases/magics-4.11.0.ipynb b/notebook/releases/magics-4.11.0.ipynb index fa0d1e982..2ba8f643f 100644 --- a/notebook/releases/magics-4.11.0.ipynb +++ b/notebook/releases/magics-4.11.0.ipynb @@ -243,7 +243,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -257,7 +257,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.10" + "version": "3.9.12" } }, "nbformat": 4, diff --git a/notebook/releases/magics-4.12.0.ipynb b/notebook/releases/magics-4.12.0.ipynb index 6444f3f03..24dca77aa 100644 --- a/notebook/releases/magics-4.12.0.ipynb +++ b/notebook/releases/magics-4.12.0.ipynb @@ -357,7 +357,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.10" + "version": "3.9.12" } }, "nbformat": 4, diff --git a/share/magics/styles/ecmwf/test/styles.json b/share/magics/styles/ecmwf/test/styles.json new file mode 100644 index 000000000..1bd2ebcb3 --- /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/share/magics/symbols.svg b/share/magics/symbols.svg index 9fcc7014e..ad3889d35 100644 --- a/share/magics/symbols.svg +++ b/share/magics/symbols.svg @@ -7,6 +7,14 @@ + + + + + + + + diff --git a/src/attributes/BoxPlotBoxAttributes.cc b/src/attributes/BoxPlotBoxAttributes.cc deleted file mode 100644 index 93a26a82e..000000000 --- a/src/attributes/BoxPlotBoxAttributes.cc +++ /dev/null @@ -1,146 +0,0 @@ - -/****************************** 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 BoxPlotBoxAttributes.h - \\brief Definition of BoxPlotBox Attributes class. - - This file is automatically generated. - Do Not Edit! -*/ - -#include "BoxPlotBoxAttributes.h" -#include "MagicsParameter.h" -#include "ParameterSettings.h" - -using namespace magics; - -BoxPlotBoxAttributes::BoxPlotBoxAttributes(): - width_(ParameterManager::getDouble("boxplot_box_width")) - , - colour_(MagTranslator().magics("boxplot_box_colour")), - border_(MagTranslator().magics("boxplot_box_border")), - median_(MagTranslator().magics("boxplot_median")) - -{ -} - - -BoxPlotBoxAttributes::~BoxPlotBoxAttributes() -{ - -} - - -void BoxPlotBoxAttributes::set(const std::map& params) -{ - vector prefix(2); - int i = 0; - prefix[i++] = "boxplot"; - prefix[i++] = "boxplot_box"; - - setAttribute(prefix, "boxplot_box_width", width_, params); - - setMember(prefix, "boxplot_box_colour", colour_, params); - setMember(prefix, "boxplot_box_border", border_, params); - setMember(prefix, "boxplot_median", median_, params); - -} - -void BoxPlotBoxAttributes::copy(const BoxPlotBoxAttributes& other) -{ - width_ = other.width_; - colour_ = unique_ptr(other.colour_->clone()); - border_ = unique_ptr(other.border_->clone()); - median_ = unique_ptr(other.median_->clone()); - -} - - -bool BoxPlotBoxAttributes::accept(const string& node) -{ - - if ( magCompare(node, "box") ) - return true; - if ( acceptNode(node, border_) ) - return true; - if ( acceptNode(node, median_) ) - return true; - - return false; -} - -void BoxPlotBoxAttributes::set(const XmlNode& node) -{ - bool apply = false; - - if ( this->accept(node.name()) == false ) - return; - - if ( magCompare(node.name(), "box") ) - apply = true; - - - if ( apply ) - set(node.attributes()); - else { - setMember(node.name(), border_, node); - setMember(node.name(), median_, node); - - } - for (auto &elt : node.elements()) - { - setMember(elt->name(), border_, *elt); - setMember(elt->name(), median_, *elt); - - } -} - -void BoxPlotBoxAttributes::print(ostream& out) const -{ - out << "Attributes["; - out << " width = " << width_; - out << " colour = " << *colour_; - out << " border = " << *border_; - out << " median = " << *median_; - - out << "]" << "\n"; -} - -void BoxPlotBoxAttributes::toxml(ostream& out) const -{ - out << "\"box\""; - out << ", \"boxplot_box_width\":"; - niceprint(out,width_); - out << ", \"boxplot_box_colour\":"; - niceprint(out, *colour_); - out << ", \"boxplot_box_border\":"; - border_->toxml(out); - out << ", \"boxplot_median\":"; - median_->toxml(out); - -} - -static MagicsParameter boxplot_box_width("boxplot_box_width", 1.0); -static MagicsParameter boxplot_box_colour("boxplot_box_colour", "sky"); -static MagicsParameter boxplot_box_border("boxplot_box_border", "on"); -static MagicsParameter boxplot_median("boxplot_median", "on"); -#include "BoxPlotItem.h" -#include "BoxPlotBasicItem.h" -static SimpleObjectMaker border_BoxPlotBoxBorder("border"); -static SimpleObjectMaker on_BoxPlotBoxBorder("on"); -static SimpleObjectMaker noborder_NoBoxPlotBoxBorder("noborder"); -static SimpleObjectMaker off_NoBoxPlotBoxBorder("off"); -static SimpleObjectMaker median_BoxPlotMedian("median"); -static SimpleObjectMaker on_BoxPlotMedian("on"); -static SimpleObjectMaker nomedian_NoBoxPlotMedian("nomedian"); -static SimpleObjectMaker off_NoBoxPlotMedian("off"); diff --git a/src/attributes/BoxPlotBoxAttributes.h b/src/attributes/BoxPlotBoxAttributes.h deleted file mode 100644 index 5c8a80869..000000000 --- a/src/attributes/BoxPlotBoxAttributes.h +++ /dev/null @@ -1,69 +0,0 @@ - -/******************************* 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 *******************************/ - -/*! \fileBoxPlotBoxAttributes.h - \brief Definition of BoxPlotBox Attributes class. - - This file is automatically generated. - Do Not Edit! - - Generated: -*/ - - -#ifndef BoxPlotBoxAttributes_H -#define BoxPlotBoxAttributes_H - -#include "magics.h" -#include "Colour.h" -#include "BoxPlotBasicItem.h" -namespace magics { - -class XmlNode; -class BoxPlotBoxAttributes -{ -public: -// -- constructor - BoxPlotBoxAttributes(); - -// -- destructor - virtual ~BoxPlotBoxAttributes(); - - virtual void set(const std::map&); - virtual void set(const XmlNode&); - virtual void copy(const BoxPlotBoxAttributes&); - 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_; - double width_; - unique_ptr colour_; - unique_ptr border_; - unique_ptr median_; - - -private: - friend ostream& operator<<(ostream& s,const BoxPlotBoxAttributes& p) - { p.print(s); return s; } -}; - -} // namespace magics - -#endif - diff --git a/src/attributes/BoxPlotBoxBorderAttributes.cc b/src/attributes/BoxPlotBoxBorderAttributes.cc deleted file mode 100644 index 34fb3d96b..000000000 --- a/src/attributes/BoxPlotBoxBorderAttributes.cc +++ /dev/null @@ -1,121 +0,0 @@ - -/****************************** 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 BoxPlotBoxBorderAttributes.h - \\brief Definition of BoxPlotBoxBorder Attributes class. - - This file is automatically generated. - Do Not Edit! -*/ - -#include "BoxPlotBoxBorderAttributes.h" -#include "MagicsParameter.h" -#include "ParameterSettings.h" - -using namespace magics; - -BoxPlotBoxBorderAttributes::BoxPlotBoxBorderAttributes(): - thickness_(ParameterManager::getInt("boxplot_box_border_thickness")) - , - colour_(MagTranslator().magics("boxplot_box_border_colour")), - style_(MagTranslator().magics("boxplot_box_border_line_style")) - -{ -} - - -BoxPlotBoxBorderAttributes::~BoxPlotBoxBorderAttributes() -{ - -} - - -void BoxPlotBoxBorderAttributes::set(const std::map& params) -{ - vector prefix(2); - int i = 0; - prefix[i++] = "boxplot"; - prefix[i++] = "boxplot_box_border"; - - setAttribute(prefix, "boxplot_box_border_thickness", thickness_, params); - - setMember(prefix, "boxplot_box_border_colour", colour_, params); - setAttribute(prefix, "boxplot_box_border_line_style", style_, params); - -} - -void BoxPlotBoxBorderAttributes::copy(const BoxPlotBoxBorderAttributes& other) -{ - thickness_ = other.thickness_; - colour_ = unique_ptr(other.colour_->clone()); - style_ = other.style_; - -} - - -bool BoxPlotBoxBorderAttributes::accept(const string& node) -{ - - if ( magCompare(node, "box_border") ) - return true; - - return false; -} - -void BoxPlotBoxBorderAttributes::set(const XmlNode& node) -{ - bool apply = false; - - if ( this->accept(node.name()) == false ) - return; - - if ( magCompare(node.name(), "box_border") ) - apply = true; - - - if ( apply ) - set(node.attributes()); - else { - - } - for (auto &elt : node.elements()) - { - - } -} - -void BoxPlotBoxBorderAttributes::print(ostream& out) const -{ - out << "Attributes["; - out << " thickness = " << thickness_; - out << " colour = " << *colour_; - out << " style = " << style_; - - out << "]" << "\n"; -} - -void BoxPlotBoxBorderAttributes::toxml(ostream& out) const -{ - out << "\"box_border\""; - out << ", \"boxplot_box_border_thickness\":"; - niceprint(out,thickness_); - out << ", \"boxplot_box_border_colour\":"; - niceprint(out, *colour_); - out << ", \"boxplot_box_border_line_style\":"; - niceprint(out, style_); - -} - -static MagicsParameter boxplot_box_border_thickness("boxplot_box_border_thickness", 1); -static MagicsParameter boxplot_box_border_colour("boxplot_box_border_colour", "navy"); -static MagicsParameter boxplot_box_border_line_style("boxplot_box_border_line_style", "solid"); diff --git a/src/attributes/BoxPlotBoxBorderAttributes.h b/src/attributes/BoxPlotBoxBorderAttributes.h deleted file mode 100644 index 9a1009d8f..000000000 --- a/src/attributes/BoxPlotBoxBorderAttributes.h +++ /dev/null @@ -1,67 +0,0 @@ - -/******************************* 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 *******************************/ - -/*! \fileBoxPlotBoxBorderAttributes.h - \brief Definition of BoxPlotBoxBorder Attributes class. - - This file is automatically generated. - Do Not Edit! - - Generated: -*/ - - -#ifndef BoxPlotBoxBorderAttributes_H -#define BoxPlotBoxBorderAttributes_H - -#include "magics.h" -#include "Colour.h" -namespace magics { - -class XmlNode; -class BoxPlotBoxBorderAttributes -{ -public: -// -- constructor - BoxPlotBoxBorderAttributes(); - -// -- destructor - virtual ~BoxPlotBoxBorderAttributes(); - - virtual void set(const std::map&); - virtual void set(const XmlNode&); - virtual void copy(const BoxPlotBoxBorderAttributes&); - 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_; - int thickness_; - unique_ptr colour_; - LineStyle style_; - - -private: - friend ostream& operator<<(ostream& s,const BoxPlotBoxBorderAttributes& p) - { p.print(s); return s; } -}; - -} // namespace magics - -#endif - diff --git a/src/attributes/BoxPlotBoxBorderWrapper.cc b/src/attributes/BoxPlotBoxBorderWrapper.cc deleted file mode 100644 index 4c8993bd9..000000000 --- a/src/attributes/BoxPlotBoxBorderWrapper.cc +++ /dev/null @@ -1,91 +0,0 @@ - -/****************************** 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 BoxPlotBoxBorderAttributes.h - \\brief Definition of BoxPlotBoxBorder Attributes class. - - This file is automatically generated. - Do Not Edit! - -*/ - -#include "MagRequest.h" -#include "BoxPlotBoxBorderWrapper.h" -#include "MagicsParameter.h" -#include "Factory.h" -#include "MagTranslator.h" -#include "MagicsGlobal.h" - -using namespace magics; - - - -BoxPlotBoxBorderWrapper::BoxPlotBoxBorderWrapper(): boxplotboxborder_(new BoxPlotBoxBorder()) - - -{ - - - - NoBoxPlotBoxBorderWrapper::object(boxplotboxborder_); - - -} -BoxPlotBoxBorderWrapper::BoxPlotBoxBorderWrapper(BoxPlotBoxBorder* boxplotboxborder): boxplotboxborder_(boxplotboxborder) -{ - - - NoBoxPlotBoxBorderWrapper::object(boxplotboxborder_); - -} - -BoxPlotBoxBorderWrapper::~BoxPlotBoxBorderWrapper() -{ - -} - -void BoxPlotBoxBorderWrapper::set(const MagRequest& request) -{ - - - - NoBoxPlotBoxBorderWrapper::set(request); - - - if (request.countValues("BOXPLOT_BOX_BORDER_THICKNESS") ) { - int thickness_value = request("BOXPLOT_BOX_BORDER_THICKNESS"); - boxplotboxborder_->thickness_ = thickness_value; - } - - if (request.countValues("BOXPLOT_BOX_BORDER_COLOUR") ) { - string colour_value = request("BOXPLOT_BOX_BORDER_COLOUR"); - boxplotboxborder_->colour_ = unique_ptr(MagTranslator()(colour_value)); - } - - - if (request.countValues("BOXPLOT_BOX_BORDER_LINE_STYLE") ) { - string style_value = request("BOXPLOT_BOX_BORDER_LINE_STYLE"); - boxplotboxborder_->style_ = MagTranslator()(style_value); - } - - -} - -void BoxPlotBoxBorderWrapper::print(ostream& out) const -{ - out << "BoxPlotBoxBorderWrapper[]"; -} - - - - diff --git a/src/attributes/BoxPlotBoxBorderWrapper.h b/src/attributes/BoxPlotBoxBorderWrapper.h deleted file mode 100644 index 6a9a0667d..000000000 --- a/src/attributes/BoxPlotBoxBorderWrapper.h +++ /dev/null @@ -1,93 +0,0 @@ - -/******************************* 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 *******************************/ - -/*! \fileBoxPlotBoxBorderAttributes.h - \brief Definition of BoxPlotBoxBorder Attributes class. - - This file is automatically generated. - Do Not Edit! - - Generated: -*/ - - -#ifndef BoxPlotBoxBorderWrapper_H -#define BoxPlotBoxBorderWrapper_H - -#include "magics.h" -#include "ParameterManager.h" -#include "Factory.h" - - - -#include "BoxPlotItem.h" - - - -#include "NoBoxPlotBoxBorderWrapper.h" - - - - - - - - -namespace magics { - -class MagRequest; - - -class BoxPlotBoxBorderWrapper: public NoBoxPlotBoxBorderWrapper - -{ -public: -// -- constructor - BoxPlotBoxBorderWrapper(); - BoxPlotBoxBorderWrapper(BoxPlotBoxBorder*); -// -- destructor - virtual ~BoxPlotBoxBorderWrapper(); - virtual void set(const MagRequest&); - - BoxPlotBoxBorder* me() { return boxplotboxborder_; } - - virtual BoxPlotBoxBorder* object() { return boxplotboxborder_; } - - - virtual void object(BoxPlotBoxBorder* o) { - // Remember to delete the previous object - boxplotboxborder_ = o; - NoBoxPlotBoxBorderWrapper::object(o); - - - } - - - -protected: - BoxPlotBoxBorder* boxplotboxborder_; - - -// -- method - virtual void print(ostream&) const; - - -private: - string tag_; - friend ostream& operator<<(ostream& s,const BoxPlotBoxBorderWrapper& p) - { p.print(s); return s; } -}; - -} // namespace magics - -#endif \ No newline at end of file diff --git a/src/attributes/BoxPlotBoxWrapper.cc b/src/attributes/BoxPlotBoxWrapper.cc deleted file mode 100644 index ba0db189f..000000000 --- a/src/attributes/BoxPlotBoxWrapper.cc +++ /dev/null @@ -1,155 +0,0 @@ - -/****************************** 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 BoxPlotBoxAttributes.h - \\brief Definition of BoxPlotBox Attributes class. - - This file is automatically generated. - Do Not Edit! - -*/ - -#include "MagRequest.h" -#include "BoxPlotBoxWrapper.h" -#include "MagicsParameter.h" -#include "Factory.h" -#include "MagTranslator.h" -#include "MagicsGlobal.h" - -using namespace magics; - - - -BoxPlotBoxWrapper::BoxPlotBoxWrapper(): boxplotbox_(new BoxPlotBox()) - - -{ - - - - -} -BoxPlotBoxWrapper::BoxPlotBoxWrapper(BoxPlotBox* boxplotbox): boxplotbox_(boxplotbox) -{ - - -} - -BoxPlotBoxWrapper::~BoxPlotBoxWrapper() -{ - -} - -void BoxPlotBoxWrapper::set(const MagRequest& request) -{ - - - - if (request.countValues("BOXPLOT_BOX_WIDTH") ) { - double width_value = request("BOXPLOT_BOX_WIDTH"); - boxplotbox_->width_ = width_value; - } - - if (request.countValues("BOXPLOT_BOX_COLOUR") ) { - string colour_value = request("BOXPLOT_BOX_COLOUR"); - boxplotbox_->colour_ = unique_ptr(MagTranslator()(colour_value)); - } - - - string border_value = request.countValues("BOXPLOT_BOX_BORDER") ? (string) request("BOXPLOT_BOX_BORDER") : "on"; - MagLog::debug() << " BOXPLOT_BOX_BORDER set to " << border_value << endl; - NoBoxPlotBoxBorderWrapper* border_wrapper = 0; - try - { - border_wrapper = SimpleFactory::create(border_value); - } - catch (NoFactoryException&) { - if (MagicsGlobal::strict()) { - throw; - } - MagLog::warning() << "[" << border_value << "] is not a valid value for border: reset to default -> [on]" << endl; - border_wrapper = SimpleFactory::create("on"); - } - border_wrapper->set(request); - boxplotbox_->border_ = unique_ptr(border_wrapper->object()); - delete border_wrapper; - - string median_value = request.countValues("BOXPLOT_MEDIAN") ? (string) request("BOXPLOT_MEDIAN") : "on"; - MagLog::debug() << " BOXPLOT_MEDIAN set to " << median_value << endl; - NoBoxPlotMedianWrapper* median_wrapper = 0; - try - { - median_wrapper = SimpleFactory::create(median_value); - } - catch (NoFactoryException&) { - if (MagicsGlobal::strict()) { - throw; - } - MagLog::warning() << "[" << median_value << "] is not a valid value for median: reset to default -> [on]" << endl; - median_wrapper = SimpleFactory::create("on"); - } - median_wrapper->set(request); - boxplotbox_->median_ = unique_ptr(median_wrapper->object()); - delete median_wrapper; - -} - -void BoxPlotBoxWrapper::print(ostream& out) const -{ - out << "BoxPlotBoxWrapper[]"; -} - - - -#include "BoxPlotBoxBorderWrapper.h" -static SimpleObjectMaker BoxPlotBox_boxplot_box_border_border ("border"); -static SimpleObjectMaker BoxPlotBox_boxplot_box_border_border_wrapper ("border"); - - -#include "BoxPlotBoxBorderWrapper.h" -static SimpleObjectMaker BoxPlotBox_boxplot_box_border_on ("on"); -static SimpleObjectMaker BoxPlotBox_boxplot_box_border_on_wrapper ("on"); - - -#include "NoBoxPlotBoxBorderWrapper.h" - -static SimpleObjectMaker BoxPlotBox_boxplot_box_border_noborder_Wrapper("noborder"); - - -#include "NoBoxPlotBoxBorderWrapper.h" - -static SimpleObjectMaker BoxPlotBox_boxplot_box_border_off_Wrapper("off"); - - - -#include "BoxPlotMedianWrapper.h" -static SimpleObjectMaker BoxPlotBox_boxplot_median_median ("median"); -static SimpleObjectMaker BoxPlotBox_boxplot_median_median_wrapper ("median"); - - -#include "BoxPlotMedianWrapper.h" -static SimpleObjectMaker BoxPlotBox_boxplot_median_on ("on"); -static SimpleObjectMaker BoxPlotBox_boxplot_median_on_wrapper ("on"); - - -#include "NoBoxPlotMedianWrapper.h" - -static SimpleObjectMaker BoxPlotBox_boxplot_median_nomedian_Wrapper("nomedian"); - - -#include "NoBoxPlotMedianWrapper.h" - -static SimpleObjectMaker BoxPlotBox_boxplot_median_off_Wrapper("off"); - - - diff --git a/src/attributes/BoxPlotBoxWrapper.h b/src/attributes/BoxPlotBoxWrapper.h deleted file mode 100644 index 4997d8a6e..000000000 --- a/src/attributes/BoxPlotBoxWrapper.h +++ /dev/null @@ -1,93 +0,0 @@ - -/******************************* 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 *******************************/ - -/*! \fileBoxPlotBoxAttributes.h - \brief Definition of BoxPlotBox Attributes class. - - This file is automatically generated. - Do Not Edit! - - Generated: -*/ - - -#ifndef BoxPlotBoxWrapper_H -#define BoxPlotBoxWrapper_H - -#include "magics.h" -#include "ParameterManager.h" -#include "Factory.h" - - - -#include "BoxPlotItem.h" - - - - - - - - -#include "NoBoxPlotBoxBorderWrapper.h" -#include "NoBoxPlotMedianWrapper.h" - - -namespace magics { - -class MagRequest; - - - -class BoxPlotBoxWrapper - -{ -public: -// -- constructor - BoxPlotBoxWrapper(); - BoxPlotBoxWrapper(BoxPlotBox*); -// -- destructor - virtual ~BoxPlotBoxWrapper(); - virtual void set(const MagRequest&); - - BoxPlotBox* me() { return boxplotbox_; } - - virtual BoxPlotBox* object() { return boxplotbox_; } - - - virtual void object(BoxPlotBox* o) { - // Remember to delete the previous object - boxplotbox_ = o; - - - } - - - -protected: - BoxPlotBox* boxplotbox_; - - -// -- method - virtual void print(ostream&) const; - - -private: - string tag_; - friend ostream& operator<<(ostream& s,const BoxPlotBoxWrapper& p) - { p.print(s); return s; } -}; - -} // namespace magics - -#endif \ No newline at end of file diff --git a/src/attributes/BoxPlotMedianAttributes.cc b/src/attributes/BoxPlotMedianAttributes.cc deleted file mode 100644 index d1503228e..000000000 --- a/src/attributes/BoxPlotMedianAttributes.cc +++ /dev/null @@ -1,121 +0,0 @@ - -/****************************** 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 BoxPlotMedianAttributes.h - \\brief Definition of BoxPlotMedian Attributes class. - - This file is automatically generated. - Do Not Edit! -*/ - -#include "BoxPlotMedianAttributes.h" -#include "MagicsParameter.h" -#include "ParameterSettings.h" - -using namespace magics; - -BoxPlotMedianAttributes::BoxPlotMedianAttributes(): - thickness_(ParameterManager::getInt("boxplot_median_thickness")) - , - colour_(MagTranslator().magics("boxplot_median_colour")), - style_(MagTranslator().magics("boxplot_median_line_style")) - -{ -} - - -BoxPlotMedianAttributes::~BoxPlotMedianAttributes() -{ - -} - - -void BoxPlotMedianAttributes::set(const std::map& params) -{ - vector prefix(2); - int i = 0; - prefix[i++] = "boxplot"; - prefix[i++] = "boxplot_median"; - - setAttribute(prefix, "boxplot_median_thickness", thickness_, params); - - setMember(prefix, "boxplot_median_colour", colour_, params); - setAttribute(prefix, "boxplot_median_line_style", style_, params); - -} - -void BoxPlotMedianAttributes::copy(const BoxPlotMedianAttributes& other) -{ - thickness_ = other.thickness_; - colour_ = unique_ptr(other.colour_->clone()); - style_ = other.style_; - -} - - -bool BoxPlotMedianAttributes::accept(const string& node) -{ - - if ( magCompare(node, "median") ) - return true; - - return false; -} - -void BoxPlotMedianAttributes::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 BoxPlotMedianAttributes::print(ostream& out) const -{ - out << "Attributes["; - out << " thickness = " << thickness_; - out << " colour = " << *colour_; - out << " style = " << style_; - - out << "]" << "\n"; -} - -void BoxPlotMedianAttributes::toxml(ostream& out) const -{ - out << "\"median\""; - out << ", \"boxplot_median_thickness\":"; - niceprint(out,thickness_); - out << ", \"boxplot_median_colour\":"; - niceprint(out, *colour_); - out << ", \"boxplot_median_line_style\":"; - niceprint(out, style_); - -} - -static MagicsParameter boxplot_median_thickness("boxplot_median_thickness", 3); -static MagicsParameter boxplot_median_colour("boxplot_median_colour", "navy"); -static MagicsParameter boxplot_median_line_style("boxplot_median_line_style", "solid"); diff --git a/src/attributes/BoxPlotMedianAttributes.h b/src/attributes/BoxPlotMedianAttributes.h deleted file mode 100644 index b75f4389c..000000000 --- a/src/attributes/BoxPlotMedianAttributes.h +++ /dev/null @@ -1,67 +0,0 @@ - -/******************************* 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 *******************************/ - -/*! \fileBoxPlotMedianAttributes.h - \brief Definition of BoxPlotMedian Attributes class. - - This file is automatically generated. - Do Not Edit! - - Generated: -*/ - - -#ifndef BoxPlotMedianAttributes_H -#define BoxPlotMedianAttributes_H - -#include "magics.h" -#include "Colour.h" -namespace magics { - -class XmlNode; -class BoxPlotMedianAttributes -{ -public: -// -- constructor - BoxPlotMedianAttributes(); - -// -- destructor - virtual ~BoxPlotMedianAttributes(); - - virtual void set(const std::map&); - virtual void set(const XmlNode&); - virtual void copy(const BoxPlotMedianAttributes&); - 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_; - int thickness_; - unique_ptr colour_; - LineStyle style_; - - -private: - friend ostream& operator<<(ostream& s,const BoxPlotMedianAttributes& p) - { p.print(s); return s; } -}; - -} // namespace magics - -#endif - diff --git a/src/attributes/BoxPlotMedianWrapper.cc b/src/attributes/BoxPlotMedianWrapper.cc deleted file mode 100644 index 33e839efd..000000000 --- a/src/attributes/BoxPlotMedianWrapper.cc +++ /dev/null @@ -1,91 +0,0 @@ - -/****************************** 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 BoxPlotMedianAttributes.h - \\brief Definition of BoxPlotMedian Attributes class. - - This file is automatically generated. - Do Not Edit! - -*/ - -#include "MagRequest.h" -#include "BoxPlotMedianWrapper.h" -#include "MagicsParameter.h" -#include "Factory.h" -#include "MagTranslator.h" -#include "MagicsGlobal.h" - -using namespace magics; - - - -BoxPlotMedianWrapper::BoxPlotMedianWrapper(): boxplotmedian_(new BoxPlotMedian()) - - -{ - - - - NoBoxPlotMedianWrapper::object(boxplotmedian_); - - -} -BoxPlotMedianWrapper::BoxPlotMedianWrapper(BoxPlotMedian* boxplotmedian): boxplotmedian_(boxplotmedian) -{ - - - NoBoxPlotMedianWrapper::object(boxplotmedian_); - -} - -BoxPlotMedianWrapper::~BoxPlotMedianWrapper() -{ - -} - -void BoxPlotMedianWrapper::set(const MagRequest& request) -{ - - - - NoBoxPlotMedianWrapper::set(request); - - - if (request.countValues("BOXPLOT_MEDIAN_THICKNESS") ) { - int thickness_value = request("BOXPLOT_MEDIAN_THICKNESS"); - boxplotmedian_->thickness_ = thickness_value; - } - - if (request.countValues("BOXPLOT_MEDIAN_COLOUR") ) { - string colour_value = request("BOXPLOT_MEDIAN_COLOUR"); - boxplotmedian_->colour_ = unique_ptr(MagTranslator()(colour_value)); - } - - - if (request.countValues("BOXPLOT_MEDIAN_LINE_STYLE") ) { - string style_value = request("BOXPLOT_MEDIAN_LINE_STYLE"); - boxplotmedian_->style_ = MagTranslator()(style_value); - } - - -} - -void BoxPlotMedianWrapper::print(ostream& out) const -{ - out << "BoxPlotMedianWrapper[]"; -} - - - - diff --git a/src/attributes/BoxPlotMedianWrapper.h b/src/attributes/BoxPlotMedianWrapper.h deleted file mode 100644 index be54a7947..000000000 --- a/src/attributes/BoxPlotMedianWrapper.h +++ /dev/null @@ -1,93 +0,0 @@ - -/******************************* 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 *******************************/ - -/*! \fileBoxPlotMedianAttributes.h - \brief Definition of BoxPlotMedian Attributes class. - - This file is automatically generated. - Do Not Edit! - - Generated: -*/ - - -#ifndef BoxPlotMedianWrapper_H -#define BoxPlotMedianWrapper_H - -#include "magics.h" -#include "ParameterManager.h" -#include "Factory.h" - - - -#include "BoxPlotItem.h" - - - -#include "NoBoxPlotMedianWrapper.h" - - - - - - - - -namespace magics { - -class MagRequest; - - -class BoxPlotMedianWrapper: public NoBoxPlotMedianWrapper - -{ -public: -// -- constructor - BoxPlotMedianWrapper(); - BoxPlotMedianWrapper(BoxPlotMedian*); -// -- destructor - virtual ~BoxPlotMedianWrapper(); - virtual void set(const MagRequest&); - - BoxPlotMedian* me() { return boxplotmedian_; } - - virtual BoxPlotMedian* object() { return boxplotmedian_; } - - - virtual void object(BoxPlotMedian* o) { - // Remember to delete the previous object - boxplotmedian_ = o; - NoBoxPlotMedianWrapper::object(o); - - - } - - - -protected: - BoxPlotMedian* boxplotmedian_; - - -// -- method - virtual void print(ostream&) const; - - -private: - string tag_; - friend ostream& operator<<(ostream& s,const BoxPlotMedianWrapper& p) - { p.print(s); return s; } -}; - -} // namespace magics - -#endif \ No newline at end of file diff --git a/src/attributes/BoxPlotWhiskerBorderAttributes.cc b/src/attributes/BoxPlotWhiskerBorderAttributes.cc deleted file mode 100644 index b5e881a75..000000000 --- a/src/attributes/BoxPlotWhiskerBorderAttributes.cc +++ /dev/null @@ -1,123 +0,0 @@ - -/****************************** 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 BoxPlotWhiskerBorderAttributes.h - \\brief Definition of BoxPlotWhiskerBorder Attributes class. - - This file is automatically generated. - Do Not Edit! -*/ - -#include "BoxPlotWhiskerBorderAttributes.h" -#include "MagicsParameter.h" -#include "ParameterSettings.h" - -using namespace magics; - -BoxPlotWhiskerBorderAttributes::BoxPlotWhiskerBorderAttributes(): - thickness_(ParameterManager::getInt("boxplot_whisker_box_border_thickness")) - , - colour_(MagTranslator().magics("boxplot_whisker_box_border_colour")), - style_(MagTranslator().magics("boxplot_whisker_box_border_line_style")) - -{ -} - - -BoxPlotWhiskerBorderAttributes::~BoxPlotWhiskerBorderAttributes() -{ - -} - - -void BoxPlotWhiskerBorderAttributes::set(const std::map& params) -{ - vector prefix(4); - int i = 0; - prefix[i++] = "boxplot"; - prefix[i++] = "boxplot_whisker"; - prefix[i++] = "boxplot_whisker_box"; - prefix[i++] = "boxplot_whisker_box_border"; - - setAttribute(prefix, "boxplot_whisker_box_border_thickness", thickness_, params); - - setMember(prefix, "boxplot_whisker_box_border_colour", colour_, params); - setAttribute(prefix, "boxplot_whisker_box_border_line_style", style_, params); - -} - -void BoxPlotWhiskerBorderAttributes::copy(const BoxPlotWhiskerBorderAttributes& other) -{ - thickness_ = other.thickness_; - colour_ = unique_ptr(other.colour_->clone()); - style_ = other.style_; - -} - - -bool BoxPlotWhiskerBorderAttributes::accept(const string& node) -{ - - if ( magCompare(node, "whisker_border") ) - return true; - - return false; -} - -void BoxPlotWhiskerBorderAttributes::set(const XmlNode& node) -{ - bool apply = false; - - if ( this->accept(node.name()) == false ) - return; - - if ( magCompare(node.name(), "whisker_border") ) - apply = true; - - - if ( apply ) - set(node.attributes()); - else { - - } - for (auto &elt : node.elements()) - { - - } -} - -void BoxPlotWhiskerBorderAttributes::print(ostream& out) const -{ - out << "Attributes["; - out << " thickness = " << thickness_; - out << " colour = " << *colour_; - out << " style = " << style_; - - out << "]" << "\n"; -} - -void BoxPlotWhiskerBorderAttributes::toxml(ostream& out) const -{ - out << "\"whisker_border\""; - out << ", \"boxplot_whisker_box_border_thickness\":"; - niceprint(out,thickness_); - out << ", \"boxplot_whisker_box_border_colour\":"; - niceprint(out, *colour_); - out << ", \"boxplot_whisker_box_border_line_style\":"; - niceprint(out, style_); - -} - -static MagicsParameter boxplot_whisker_box_border_thickness("boxplot_whisker_box_border_thickness", 1); -static MagicsParameter boxplot_whisker_box_border_colour("boxplot_whisker_box_border_colour", "navy"); -static MagicsParameter boxplot_whisker_box_border_line_style("boxplot_whisker_box_border_line_style", "solid"); diff --git a/src/attributes/BoxPlotWhiskerBorderAttributes.h b/src/attributes/BoxPlotWhiskerBorderAttributes.h deleted file mode 100644 index b33eca0d1..000000000 --- a/src/attributes/BoxPlotWhiskerBorderAttributes.h +++ /dev/null @@ -1,67 +0,0 @@ - -/******************************* 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 *******************************/ - -/*! \fileBoxPlotWhiskerBorderAttributes.h - \brief Definition of BoxPlotWhiskerBorder Attributes class. - - This file is automatically generated. - Do Not Edit! - - Generated: -*/ - - -#ifndef BoxPlotWhiskerBorderAttributes_H -#define BoxPlotWhiskerBorderAttributes_H - -#include "magics.h" -#include "Colour.h" -namespace magics { - -class XmlNode; -class BoxPlotWhiskerBorderAttributes -{ -public: -// -- constructor - BoxPlotWhiskerBorderAttributes(); - -// -- destructor - virtual ~BoxPlotWhiskerBorderAttributes(); - - virtual void set(const std::map&); - virtual void set(const XmlNode&); - virtual void copy(const BoxPlotWhiskerBorderAttributes&); - 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_; - int thickness_; - unique_ptr colour_; - LineStyle style_; - - -private: - friend ostream& operator<<(ostream& s,const BoxPlotWhiskerBorderAttributes& p) - { p.print(s); return s; } -}; - -} // namespace magics - -#endif - diff --git a/src/attributes/BoxPlotWhiskerBorderWrapper.cc b/src/attributes/BoxPlotWhiskerBorderWrapper.cc deleted file mode 100644 index 1af523001..000000000 --- a/src/attributes/BoxPlotWhiskerBorderWrapper.cc +++ /dev/null @@ -1,84 +0,0 @@ - -/****************************** 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 BoxPlotWhiskerBorderAttributes.h - \\brief Definition of BoxPlotWhiskerBorder Attributes class. - - This file is automatically generated. - Do Not Edit! - -*/ - -#include "MagRequest.h" -#include "BoxPlotWhiskerBorderWrapper.h" -#include "MagicsParameter.h" -#include "Factory.h" -#include "MagTranslator.h" -#include "MagicsGlobal.h" - -using namespace magics; - - - -BoxPlotWhiskerBorderWrapper::BoxPlotWhiskerBorderWrapper(): boxplotwhiskerborder_(new BoxPlotWhiskerBorder()) - - -{ - - - - -} -BoxPlotWhiskerBorderWrapper::BoxPlotWhiskerBorderWrapper(BoxPlotWhiskerBorder* boxplotwhiskerborder): boxplotwhiskerborder_(boxplotwhiskerborder) -{ - - -} - -BoxPlotWhiskerBorderWrapper::~BoxPlotWhiskerBorderWrapper() -{ - -} - -void BoxPlotWhiskerBorderWrapper::set(const MagRequest& request) -{ - - - - if (request.countValues("BOXPLOT_WHISKER_BOX_BORDER_THICKNESS") ) { - int thickness_value = request("BOXPLOT_WHISKER_BOX_BORDER_THICKNESS"); - boxplotwhiskerborder_->thickness_ = thickness_value; - } - - if (request.countValues("BOXPLOT_WHISKER_BOX_BORDER_COLOUR") ) { - string colour_value = request("BOXPLOT_WHISKER_BOX_BORDER_COLOUR"); - boxplotwhiskerborder_->colour_ = unique_ptr(MagTranslator()(colour_value)); - } - - - if (request.countValues("BOXPLOT_WHISKER_BOX_BORDER_LINE_STYLE") ) { - string style_value = request("BOXPLOT_WHISKER_BOX_BORDER_LINE_STYLE"); - boxplotwhiskerborder_->style_ = MagTranslator()(style_value); - } - - -} - -void BoxPlotWhiskerBorderWrapper::print(ostream& out) const -{ - out << "BoxPlotWhiskerBorderWrapper[]"; -} - - - - diff --git a/src/attributes/BoxPlotWhiskerBorderWrapper.h b/src/attributes/BoxPlotWhiskerBorderWrapper.h deleted file mode 100644 index 5575b5199..000000000 --- a/src/attributes/BoxPlotWhiskerBorderWrapper.h +++ /dev/null @@ -1,91 +0,0 @@ - -/******************************* 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 *******************************/ - -/*! \fileBoxPlotWhiskerBorderAttributes.h - \brief Definition of BoxPlotWhiskerBorder Attributes class. - - This file is automatically generated. - Do Not Edit! - - Generated: -*/ - - -#ifndef BoxPlotWhiskerBorderWrapper_H -#define BoxPlotWhiskerBorderWrapper_H - -#include "magics.h" -#include "ParameterManager.h" -#include "Factory.h" - - - -#include "BoxPlotWhiskerBorder.h" - - - - - - - - - - -namespace magics { - -class MagRequest; - - - -class BoxPlotWhiskerBorderWrapper - -{ -public: -// -- constructor - BoxPlotWhiskerBorderWrapper(); - BoxPlotWhiskerBorderWrapper(BoxPlotWhiskerBorder*); -// -- destructor - virtual ~BoxPlotWhiskerBorderWrapper(); - virtual void set(const MagRequest&); - - BoxPlotWhiskerBorder* me() { return boxplotwhiskerborder_; } - - virtual BoxPlotWhiskerBorder* object() { return boxplotwhiskerborder_; } - - - virtual void object(BoxPlotWhiskerBorder* o) { - // Remember to delete the previous object - boxplotwhiskerborder_ = o; - - - } - - - -protected: - BoxPlotWhiskerBorder* boxplotwhiskerborder_; - - -// -- method - virtual void print(ostream&) const; - - -private: - string tag_; - friend ostream& operator<<(ostream& s,const BoxPlotWhiskerBorderWrapper& p) - { p.print(s); return s; } -}; - -} // namespace magics - -#endif \ No newline at end of file diff --git a/src/attributes/BoxPlotWhiskerBoxAttributes.cc b/src/attributes/BoxPlotWhiskerBoxAttributes.cc deleted file mode 100644 index 4277a3362..000000000 --- a/src/attributes/BoxPlotWhiskerBoxAttributes.cc +++ /dev/null @@ -1,132 +0,0 @@ - -/****************************** 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 BoxPlotWhiskerBoxAttributes.h - \\brief Definition of BoxPlotWhiskerBox Attributes class. - - This file is automatically generated. - Do Not Edit! -*/ - -#include "BoxPlotWhiskerBoxAttributes.h" -#include "MagicsParameter.h" -#include "ParameterSettings.h" - -using namespace magics; - -BoxPlotWhiskerBoxAttributes::BoxPlotWhiskerBoxAttributes(): - width_(ParameterManager::getDouble("boxplot_whisker_box_width")) - , - colour_(MagTranslator().magics("boxplot_whisker_box_colour")), - border_(MagTranslator().magics("boxplot_whisker_box_border")) - -{ -} - - -BoxPlotWhiskerBoxAttributes::~BoxPlotWhiskerBoxAttributes() -{ - -} - - -void BoxPlotWhiskerBoxAttributes::set(const std::map& params) -{ - vector prefix(3); - int i = 0; - prefix[i++] = "boxplot"; - prefix[i++] = "boxplot_whisker"; - prefix[i++] = "boxplot_whisker_box"; - - setAttribute(prefix, "boxplot_whisker_box_width", width_, params); - - setMember(prefix, "boxplot_whisker_box_colour", colour_, params); - setMember(prefix, "boxplot_whisker_box_border", border_, params); - -} - -void BoxPlotWhiskerBoxAttributes::copy(const BoxPlotWhiskerBoxAttributes& other) -{ - width_ = other.width_; - colour_ = unique_ptr(other.colour_->clone()); - border_ = unique_ptr(other.border_->clone()); - -} - - -bool BoxPlotWhiskerBoxAttributes::accept(const string& node) -{ - - if ( magCompare(node, "whisker_box") ) - return true; - if ( acceptNode(node, border_) ) - return true; - - return false; -} - -void BoxPlotWhiskerBoxAttributes::set(const XmlNode& node) -{ - bool apply = false; - - if ( this->accept(node.name()) == false ) - return; - - if ( magCompare(node.name(), "whisker_box") ) - apply = true; - - - if ( apply ) - set(node.attributes()); - else { - setMember(node.name(), border_, node); - - } - for (auto &elt : node.elements()) - { - setMember(elt->name(), border_, *elt); - - } -} - -void BoxPlotWhiskerBoxAttributes::print(ostream& out) const -{ - out << "Attributes["; - out << " width = " << width_; - out << " colour = " << *colour_; - out << " border = " << *border_; - - out << "]" << "\n"; -} - -void BoxPlotWhiskerBoxAttributes::toxml(ostream& out) const -{ - out << "\"whisker_box\""; - out << ", \"boxplot_whisker_box_width\":"; - niceprint(out,width_); - out << ", \"boxplot_whisker_box_colour\":"; - niceprint(out, *colour_); - out << ", \"boxplot_whisker_box_border\":"; - border_->toxml(out); - -} - -static MagicsParameter boxplot_whisker_box_width("boxplot_whisker_box_width", 0.25); -static MagicsParameter boxplot_whisker_box_colour("boxplot_whisker_box_colour", "sky"); -static MagicsParameter boxplot_whisker_box_border("boxplot_whisker_box_border", "on"); -#include "BoxPlotItem.h" -#include "BoxPlotBasicItem.h" -static SimpleObjectMaker border_BoxPlotWhiskerBorder("border"); -static SimpleObjectMaker on_BoxPlotWhiskerBorder("on"); -static SimpleObjectMaker noborder_NoBoxPlotWhiskerBorder("noborder"); -static SimpleObjectMaker off_NoBoxPlotWhiskerBorder("off"); diff --git a/src/attributes/BoxPlotWhiskerBoxAttributes.h b/src/attributes/BoxPlotWhiskerBoxAttributes.h deleted file mode 100644 index b0263b408..000000000 --- a/src/attributes/BoxPlotWhiskerBoxAttributes.h +++ /dev/null @@ -1,68 +0,0 @@ - -/******************************* 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 *******************************/ - -/*! \fileBoxPlotWhiskerBoxAttributes.h - \brief Definition of BoxPlotWhiskerBox Attributes class. - - This file is automatically generated. - Do Not Edit! - - Generated: -*/ - - -#ifndef BoxPlotWhiskerBoxAttributes_H -#define BoxPlotWhiskerBoxAttributes_H - -#include "magics.h" -#include "Colour.h" -#include "BoxPlotBasicItem.h" -namespace magics { - -class XmlNode; -class BoxPlotWhiskerBoxAttributes -{ -public: -// -- constructor - BoxPlotWhiskerBoxAttributes(); - -// -- destructor - virtual ~BoxPlotWhiskerBoxAttributes(); - - virtual void set(const std::map&); - virtual void set(const XmlNode&); - virtual void copy(const BoxPlotWhiskerBoxAttributes&); - 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_; - double width_; - unique_ptr colour_; - unique_ptr border_; - - -private: - friend ostream& operator<<(ostream& s,const BoxPlotWhiskerBoxAttributes& p) - { p.print(s); return s; } -}; - -} // namespace magics - -#endif - diff --git a/src/attributes/BoxPlotWhiskerBoxWrapper.cc b/src/attributes/BoxPlotWhiskerBoxWrapper.cc deleted file mode 100644 index de0a33629..000000000 --- a/src/attributes/BoxPlotWhiskerBoxWrapper.cc +++ /dev/null @@ -1,116 +0,0 @@ - -/****************************** 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 BoxPlotWhiskerBoxAttributes.h - \\brief Definition of BoxPlotWhiskerBox Attributes class. - - This file is automatically generated. - Do Not Edit! - -*/ - -#include "MagRequest.h" -#include "BoxPlotWhiskerBoxWrapper.h" -#include "MagicsParameter.h" -#include "Factory.h" -#include "MagTranslator.h" -#include "MagicsGlobal.h" - -using namespace magics; - - - -BoxPlotWhiskerBoxWrapper::BoxPlotWhiskerBoxWrapper(): boxplotwhiskerbox_(new BoxPlotWhiskerBox()) - - -{ - - - - -} -BoxPlotWhiskerBoxWrapper::BoxPlotWhiskerBoxWrapper(BoxPlotWhiskerBox* boxplotwhiskerbox): boxplotwhiskerbox_(boxplotwhiskerbox) -{ - - -} - -BoxPlotWhiskerBoxWrapper::~BoxPlotWhiskerBoxWrapper() -{ - -} - -void BoxPlotWhiskerBoxWrapper::set(const MagRequest& request) -{ - - - - if (request.countValues("BOXPLOT_WHISKER_BOX_WIDTH") ) { - double width_value = request("BOXPLOT_WHISKER_BOX_WIDTH"); - boxplotwhiskerbox_->width_ = width_value; - } - - if (request.countValues("BOXPLOT_WHISKER_BOX_COLOUR") ) { - string colour_value = request("BOXPLOT_WHISKER_BOX_COLOUR"); - boxplotwhiskerbox_->colour_ = unique_ptr(MagTranslator()(colour_value)); - } - - - string border_value = request.countValues("BOXPLOT_WHISKER_BOX_BORDER") ? (string) request("BOXPLOT_WHISKER_BOX_BORDER") : "on"; - MagLog::debug() << " BOXPLOT_WHISKER_BOX_BORDER set to " << border_value << endl; - NoBoxPlotWhiskerBorderWrapper* border_wrapper = 0; - try - { - border_wrapper = SimpleFactory::create(border_value); - } - catch (NoFactoryException&) { - if (MagicsGlobal::strict()) { - throw; - } - MagLog::warning() << "[" << border_value << "] is not a valid value for border: reset to default -> [on]" << endl; - border_wrapper = SimpleFactory::create("on"); - } - border_wrapper->set(request); - boxplotwhiskerbox_->border_ = unique_ptr(border_wrapper->object()); - delete border_wrapper; - -} - -void BoxPlotWhiskerBoxWrapper::print(ostream& out) const -{ - out << "BoxPlotWhiskerBoxWrapper[]"; -} - - - -#include "BoxPlotWhiskerBorderWrapper.h" -static SimpleObjectMaker BoxPlotWhiskerBox_boxplot_whisker_box_border_border ("border"); -static SimpleObjectMaker BoxPlotWhiskerBox_boxplot_whisker_box_border_border_wrapper ("border"); - - -#include "BoxPlotWhiskerBorderWrapper.h" -static SimpleObjectMaker BoxPlotWhiskerBox_boxplot_whisker_box_border_on ("on"); -static SimpleObjectMaker BoxPlotWhiskerBox_boxplot_whisker_box_border_on_wrapper ("on"); - - -#include "NoBoxPlotWhiskerBorderWrapper.h" - -static SimpleObjectMaker BoxPlotWhiskerBox_boxplot_whisker_box_border_noborder_Wrapper("noborder"); - - -#include "NoBoxPlotWhiskerBorderWrapper.h" - -static SimpleObjectMaker BoxPlotWhiskerBox_boxplot_whisker_box_border_off_Wrapper("off"); - - - diff --git a/src/attributes/BoxPlotWhiskerBoxWrapper.h b/src/attributes/BoxPlotWhiskerBoxWrapper.h deleted file mode 100644 index 6d5da7401..000000000 --- a/src/attributes/BoxPlotWhiskerBoxWrapper.h +++ /dev/null @@ -1,92 +0,0 @@ - -/******************************* 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 *******************************/ - -/*! \fileBoxPlotWhiskerBoxAttributes.h - \brief Definition of BoxPlotWhiskerBox Attributes class. - - This file is automatically generated. - Do Not Edit! - - Generated: -*/ - - -#ifndef BoxPlotWhiskerBoxWrapper_H -#define BoxPlotWhiskerBoxWrapper_H - -#include "magics.h" -#include "ParameterManager.h" -#include "Factory.h" - - - -#include "BoxPlotWhiskerBox.h" - - - - - - - - -#include "NoBoxPlotWhiskerBorderWrapper.h" - - -namespace magics { - -class MagRequest; - - - -class BoxPlotWhiskerBoxWrapper - -{ -public: -// -- constructor - BoxPlotWhiskerBoxWrapper(); - BoxPlotWhiskerBoxWrapper(BoxPlotWhiskerBox*); -// -- destructor - virtual ~BoxPlotWhiskerBoxWrapper(); - virtual void set(const MagRequest&); - - BoxPlotWhiskerBox* me() { return boxplotwhiskerbox_; } - - virtual BoxPlotWhiskerBox* object() { return boxplotwhiskerbox_; } - - - virtual void object(BoxPlotWhiskerBox* o) { - // Remember to delete the previous object - boxplotwhiskerbox_ = o; - - - } - - - -protected: - BoxPlotWhiskerBox* boxplotwhiskerbox_; - - -// -- method - virtual void print(ostream&) const; - - -private: - string tag_; - friend ostream& operator<<(ostream& s,const BoxPlotWhiskerBoxWrapper& p) - { p.print(s); return s; } -}; - -} // namespace magics - -#endif \ No newline at end of file diff --git a/src/attributes/BoxPlotWhiskerLineAttributes.cc b/src/attributes/BoxPlotWhiskerLineAttributes.cc deleted file mode 100644 index 4d291e96f..000000000 --- a/src/attributes/BoxPlotWhiskerLineAttributes.cc +++ /dev/null @@ -1,122 +0,0 @@ - -/****************************** 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 BoxPlotWhiskerLineAttributes.h - \\brief Definition of BoxPlotWhiskerLine Attributes class. - - This file is automatically generated. - Do Not Edit! -*/ - -#include "BoxPlotWhiskerLineAttributes.h" -#include "MagicsParameter.h" -#include "ParameterSettings.h" - -using namespace magics; - -BoxPlotWhiskerLineAttributes::BoxPlotWhiskerLineAttributes(): - thickness_(ParameterManager::getInt("boxplot_whisker_line_thickness")) - , - colour_(MagTranslator().magics("boxplot_whisker_line_colour")), - style_(MagTranslator().magics("boxplot_whisker_line_style")) - -{ -} - - -BoxPlotWhiskerLineAttributes::~BoxPlotWhiskerLineAttributes() -{ - -} - - -void BoxPlotWhiskerLineAttributes::set(const std::map& params) -{ - vector prefix(3); - int i = 0; - prefix[i++] = "boxplot"; - prefix[i++] = "boxplot_whisker"; - prefix[i++] = "boxplot_whisker_line"; - - setAttribute(prefix, "boxplot_whisker_line_thickness", thickness_, params); - - setMember(prefix, "boxplot_whisker_line_colour", colour_, params); - setAttribute(prefix, "boxplot_whisker_line_style", style_, params); - -} - -void BoxPlotWhiskerLineAttributes::copy(const BoxPlotWhiskerLineAttributes& other) -{ - thickness_ = other.thickness_; - colour_ = unique_ptr(other.colour_->clone()); - style_ = other.style_; - -} - - -bool BoxPlotWhiskerLineAttributes::accept(const string& node) -{ - - if ( magCompare(node, "whisker_line") ) - return true; - - return false; -} - -void BoxPlotWhiskerLineAttributes::set(const XmlNode& node) -{ - bool apply = false; - - if ( this->accept(node.name()) == false ) - return; - - if ( magCompare(node.name(), "whisker_line") ) - apply = true; - - - if ( apply ) - set(node.attributes()); - else { - - } - for (auto &elt : node.elements()) - { - - } -} - -void BoxPlotWhiskerLineAttributes::print(ostream& out) const -{ - out << "Attributes["; - out << " thickness = " << thickness_; - out << " colour = " << *colour_; - out << " style = " << style_; - - out << "]" << "\n"; -} - -void BoxPlotWhiskerLineAttributes::toxml(ostream& out) const -{ - out << "\"whisker_line\""; - out << ", \"boxplot_whisker_line_thickness\":"; - niceprint(out,thickness_); - out << ", \"boxplot_whisker_line_colour\":"; - niceprint(out, *colour_); - out << ", \"boxplot_whisker_line_style\":"; - niceprint(out, style_); - -} - -static MagicsParameter boxplot_whisker_line_thickness("boxplot_whisker_line_thickness", 3); -static MagicsParameter boxplot_whisker_line_colour("boxplot_whisker_line_colour", "navy"); -static MagicsParameter boxplot_whisker_line_style("boxplot_whisker_line_style", "solid"); diff --git a/src/attributes/BoxPlotWhiskerLineAttributes.h b/src/attributes/BoxPlotWhiskerLineAttributes.h deleted file mode 100644 index ed7d910a9..000000000 --- a/src/attributes/BoxPlotWhiskerLineAttributes.h +++ /dev/null @@ -1,67 +0,0 @@ - -/******************************* 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 *******************************/ - -/*! \fileBoxPlotWhiskerLineAttributes.h - \brief Definition of BoxPlotWhiskerLine Attributes class. - - This file is automatically generated. - Do Not Edit! - - Generated: -*/ - - -#ifndef BoxPlotWhiskerLineAttributes_H -#define BoxPlotWhiskerLineAttributes_H - -#include "magics.h" -#include "Colour.h" -namespace magics { - -class XmlNode; -class BoxPlotWhiskerLineAttributes -{ -public: -// -- constructor - BoxPlotWhiskerLineAttributes(); - -// -- destructor - virtual ~BoxPlotWhiskerLineAttributes(); - - virtual void set(const std::map&); - virtual void set(const XmlNode&); - virtual void copy(const BoxPlotWhiskerLineAttributes&); - 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_; - int thickness_; - unique_ptr colour_; - LineStyle style_; - - -private: - friend ostream& operator<<(ostream& s,const BoxPlotWhiskerLineAttributes& p) - { p.print(s); return s; } -}; - -} // namespace magics - -#endif - diff --git a/src/attributes/BoxPlotWhiskerLineWrapper.cc b/src/attributes/BoxPlotWhiskerLineWrapper.cc deleted file mode 100644 index bb17b8055..000000000 --- a/src/attributes/BoxPlotWhiskerLineWrapper.cc +++ /dev/null @@ -1,84 +0,0 @@ - -/****************************** 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 BoxPlotWhiskerLineAttributes.h - \\brief Definition of BoxPlotWhiskerLine Attributes class. - - This file is automatically generated. - Do Not Edit! - -*/ - -#include "MagRequest.h" -#include "BoxPlotWhiskerLineWrapper.h" -#include "MagicsParameter.h" -#include "Factory.h" -#include "MagTranslator.h" -#include "MagicsGlobal.h" - -using namespace magics; - - - -BoxPlotWhiskerLineWrapper::BoxPlotWhiskerLineWrapper(): boxplotwhiskerline_(new BoxPlotWhiskerLine()) - - -{ - - - - -} -BoxPlotWhiskerLineWrapper::BoxPlotWhiskerLineWrapper(BoxPlotWhiskerLine* boxplotwhiskerline): boxplotwhiskerline_(boxplotwhiskerline) -{ - - -} - -BoxPlotWhiskerLineWrapper::~BoxPlotWhiskerLineWrapper() -{ - -} - -void BoxPlotWhiskerLineWrapper::set(const MagRequest& request) -{ - - - - if (request.countValues("BOXPLOT_WHISKER_LINE_THICKNESS") ) { - int thickness_value = request("BOXPLOT_WHISKER_LINE_THICKNESS"); - boxplotwhiskerline_->thickness_ = thickness_value; - } - - if (request.countValues("BOXPLOT_WHISKER_LINE_COLOUR") ) { - string colour_value = request("BOXPLOT_WHISKER_LINE_COLOUR"); - boxplotwhiskerline_->colour_ = unique_ptr(MagTranslator()(colour_value)); - } - - - if (request.countValues("BOXPLOT_WHISKER_LINE_STYLE") ) { - string style_value = request("BOXPLOT_WHISKER_LINE_STYLE"); - boxplotwhiskerline_->style_ = MagTranslator()(style_value); - } - - -} - -void BoxPlotWhiskerLineWrapper::print(ostream& out) const -{ - out << "BoxPlotWhiskerLineWrapper[]"; -} - - - - diff --git a/src/attributes/BoxPlotWhiskerLineWrapper.h b/src/attributes/BoxPlotWhiskerLineWrapper.h deleted file mode 100644 index 1696ec867..000000000 --- a/src/attributes/BoxPlotWhiskerLineWrapper.h +++ /dev/null @@ -1,91 +0,0 @@ - -/******************************* 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 *******************************/ - -/*! \fileBoxPlotWhiskerLineAttributes.h - \brief Definition of BoxPlotWhiskerLine Attributes class. - - This file is automatically generated. - Do Not Edit! - - Generated: -*/ - - -#ifndef BoxPlotWhiskerLineWrapper_H -#define BoxPlotWhiskerLineWrapper_H - -#include "magics.h" -#include "ParameterManager.h" -#include "Factory.h" - - - -#include "BoxPlotWhiskerLine.h" - - - - - - - - - - -namespace magics { - -class MagRequest; - - - -class BoxPlotWhiskerLineWrapper - -{ -public: -// -- constructor - BoxPlotWhiskerLineWrapper(); - BoxPlotWhiskerLineWrapper(BoxPlotWhiskerLine*); -// -- destructor - virtual ~BoxPlotWhiskerLineWrapper(); - virtual void set(const MagRequest&); - - BoxPlotWhiskerLine* me() { return boxplotwhiskerline_; } - - virtual BoxPlotWhiskerLine* object() { return boxplotwhiskerline_; } - - - virtual void object(BoxPlotWhiskerLine* o) { - // Remember to delete the previous object - boxplotwhiskerline_ = o; - - - } - - - -protected: - BoxPlotWhiskerLine* boxplotwhiskerline_; - - -// -- method - virtual void print(ostream&) const; - - -private: - string tag_; - friend ostream& operator<<(ostream& s,const BoxPlotWhiskerLineWrapper& p) - { p.print(s); return s; } -}; - -} // namespace magics - -#endif \ No newline at end of file diff --git a/src/attributes/ColourTechniqueAttributes.cc b/src/attributes/ColourTechniqueAttributes.cc index 2af62957e..77857f215 100644 --- a/src/attributes/ColourTechniqueAttributes.cc +++ b/src/attributes/ColourTechniqueAttributes.cc @@ -24,7 +24,9 @@ using namespace magics; -ColourTechniqueAttributes::ColourTechniqueAttributes() +ColourTechniqueAttributes::ColourTechniqueAttributes(): + oob_min_colour_(ParameterManager::getString("contour_out_of_bound_min_colour")), + oob_max_colour_(ParameterManager::getString("contour_out_of_bound_max_colour")) { @@ -43,12 +45,16 @@ 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_; } @@ -87,6 +93,8 @@ 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"; } @@ -94,6 +102,12 @@ 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 532f28a55..f4d011342 100644 --- a/src/attributes/ColourTechniqueAttributes.h +++ b/src/attributes/ColourTechniqueAttributes.h @@ -50,6 +50,8 @@ 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 e615ccaed..740661f99 100644 --- a/src/attributes/ColourTechniqueWrapper.cc +++ b/src/attributes/ColourTechniqueWrapper.cc @@ -55,6 +55,14 @@ 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/GeoJSonAttributes.cc b/src/attributes/GeoJSonAttributes.cc index ab58f95be..2c3672dd4 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,6 +54,7 @@ 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 23385a67a..3c567c1d9 100644 --- a/src/attributes/GribDecoderAttributes.cc +++ b/src/attributes/GribDecoderAttributes.cc @@ -41,9 +41,13 @@ 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")) , @@ -83,9 +87,13 @@ 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); @@ -112,9 +120,13 @@ 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()); @@ -181,9 +193,13 @@ 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_; @@ -227,12 +243,20 @@ 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\":"; @@ -260,6 +284,7 @@ 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); diff --git a/src/attributes/GribDecoderAttributes.h b/src/attributes/GribDecoderAttributes.h index e096edeaf..090aa4ba8 100644 --- a/src/attributes/GribDecoderAttributes.h +++ b/src/attributes/GribDecoderAttributes.h @@ -68,9 +68,13 @@ 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 008b6cf54..50e0c340e 100644 --- a/src/attributes/GribDecoderWrapper.cc +++ b/src/attributes/GribDecoderWrapper.cc @@ -129,6 +129,10 @@ 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; @@ -141,6 +145,18 @@ 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/IsoShadingAttributes.cc b/src/attributes/IsoShadingAttributes.cc index 67694dd79..8d855cd25 100644 --- a/src/attributes/IsoShadingAttributes.cc +++ b/src/attributes/IsoShadingAttributes.cc @@ -25,9 +25,7 @@ using namespace magics; IsoShadingAttributes::IsoShadingAttributes(): - max_(ParameterManager::getDouble("contour_shade_max_level")), - min_(ParameterManager::getDouble("contour_shade_min_level")) - , + technique_(MagTranslator().magics("contour_shade_technique")), colourMethod_(MagTranslator().magics("contour_shade_colour_method")) @@ -51,8 +49,6 @@ void IsoShadingAttributes::set(const std::map& params) prefix[i++] = "contour_shade"; prefix[i++] = "contour_shade"; - setAttribute(prefix, "contour_shade_max_level", max_, params); - setAttribute(prefix, "contour_shade_min_level", min_, params); setMember(prefix, "contour_shade_technique", technique_, params); setMember(prefix, "contour_shade_colour_method", colourMethod_, params); @@ -61,8 +57,6 @@ void IsoShadingAttributes::set(const std::map& params) void IsoShadingAttributes::copy(const IsoShadingAttributes& other) { - max_ = other.max_; - min_ = other.min_; technique_ = unique_ptr(other.technique_->clone()); colourMethod_ = unique_ptr(other.colourMethod_->clone()); @@ -111,8 +105,6 @@ void IsoShadingAttributes::set(const XmlNode& node) void IsoShadingAttributes::print(ostream& out) const { out << "Attributes["; - out << " max = " << max_; - out << " min = " << min_; out << " technique = " << *technique_; out << " colourMethod = " << *colourMethod_; @@ -122,10 +114,6 @@ void IsoShadingAttributes::print(ostream& out) const void IsoShadingAttributes::toxml(ostream& out) const { out << "\"shading\""; - out << ", \"contour_shade_max_level\":"; - niceprint(out,max_); - out << ", \"contour_shade_min_level\":"; - niceprint(out,min_); out << ", \"contour_shade_technique\":"; technique_->toxml(out); out << ", \"contour_shade_colour_method\":"; @@ -133,8 +121,6 @@ void IsoShadingAttributes::toxml(ostream& out) const } -static MagicsParameter contour_shade_max_level("contour_shade_max_level", 1.0e+21); -static MagicsParameter contour_shade_min_level("contour_shade_min_level", -1.0e+21); static MagicsParameter contour_shade_technique("contour_shade_technique", "polygon_shading"); static MagicsParameter contour_shade_colour_method("contour_shade_colour_method", "calculate"); #include "PolyShadingTechnique.h" diff --git a/src/attributes/IsoShadingAttributes.h b/src/attributes/IsoShadingAttributes.h index 36273b00a..6dceef32a 100644 --- a/src/attributes/IsoShadingAttributes.h +++ b/src/attributes/IsoShadingAttributes.h @@ -52,8 +52,6 @@ class IsoShadingAttributes virtual void toxml(std::ostream& out) const; // -- members: string tag_; - double max_; - double min_; unique_ptr technique_; unique_ptr colourMethod_; diff --git a/src/attributes/IsoShadingWrapper.cc b/src/attributes/IsoShadingWrapper.cc index 85627a968..0f160de6d 100644 --- a/src/attributes/IsoShadingWrapper.cc +++ b/src/attributes/IsoShadingWrapper.cc @@ -62,14 +62,6 @@ void IsoShadingWrapper::set(const MagRequest& request) NoIsoShadingWrapper::set(request); - if (request.countValues("CONTOUR_SHADE_MAX_LEVEL") ) { - double max_value = request("CONTOUR_SHADE_MAX_LEVEL"); - isoshading_->max_ = max_value; - } - if (request.countValues("CONTOUR_SHADE_MIN_LEVEL") ) { - double min_value = request("CONTOUR_SHADE_MIN_LEVEL"); - isoshading_->min_ = min_value; - } string technique_value = request.countValues("CONTOUR_SHADE_TECHNIQUE") ? (string) request("CONTOUR_SHADE_TECHNIQUE") : "polygon_shading"; diff --git a/src/attributes/LevelSelectionAttributes.cc b/src/attributes/LevelSelectionAttributes.cc index ae20e3011..6f83ad279 100644 --- a/src/attributes/LevelSelectionAttributes.cc +++ b/src/attributes/LevelSelectionAttributes.cc @@ -27,8 +27,10 @@ using namespace magics; LevelSelectionAttributes::LevelSelectionAttributes(): max_(ParameterManager::getDouble("contour_max_level")), min_(ParameterManager::getDouble("contour_min_level")), - max_shade_(ParameterManager::getDouble("contour_shade_max_level")), - min_shade_(ParameterManager::getDouble("contour_shade_min_level")) + shade_max_(ParameterManager::getDouble("contour_shade_max_level")), + shade_min_(ParameterManager::getDouble("contour_shade_min_level")), + oob_min_(ParameterManager::getDouble("contour_out_of_bound_min")), + oob_max_(ParameterManager::getDouble("contour_out_of_bound_max")) { @@ -49,8 +51,10 @@ void LevelSelectionAttributes::set(const std::map& params) setAttribute(prefix, "contour_max_level", max_, params); setAttribute(prefix, "contour_min_level", min_, params); - setAttribute(prefix, "contour_shade_max_level", max_shade_, params); - setAttribute(prefix, "contour_shade_min_level", min_shade_, params); + setAttribute(prefix, "contour_shade_max_level", shade_max_, params); + setAttribute(prefix, "contour_shade_min_level", shade_min_, params); + setAttribute(prefix, "contour_out_of_bound_min", oob_min_, params); + setAttribute(prefix, "contour_out_of_bound_max", oob_max_, params); } @@ -59,8 +63,10 @@ void LevelSelectionAttributes::copy(const LevelSelectionAttributes& other) { max_ = other.max_; min_ = other.min_; - max_shade_ = other.max_shade_; - min_shade_ = other.min_shade_; + shade_max_ = other.shade_max_; + shade_min_ = other.shade_min_; + oob_min_ = other.oob_min_; + oob_max_ = other.oob_max_; } @@ -101,8 +107,10 @@ void LevelSelectionAttributes::print(ostream& out) const out << "Attributes["; out << " max = " << max_; out << " min = " << min_; - out << " max_shade = " << max_shade_; - out << " min_shade = " << min_shade_; + out << " shade_max = " << shade_max_; + out << " shade_min = " << shade_min_; + out << " oob_min = " << oob_min_; + out << " oob_max = " << oob_max_; out << "]" << "\n"; } @@ -115,9 +123,13 @@ void LevelSelectionAttributes::toxml(ostream& out) const out << ", \"contour_min_level\":"; niceprint(out,min_); out << ", \"contour_shade_max_level\":"; - niceprint(out,max_shade_); + niceprint(out,shade_max_); out << ", \"contour_shade_min_level\":"; - niceprint(out,min_shade_); + niceprint(out,shade_min_); + out << ", \"contour_out_of_bound_min\":"; + niceprint(out,oob_min_); + out << ", \"contour_out_of_bound_max\":"; + niceprint(out,oob_max_); } @@ -125,3 +137,5 @@ static MagicsParameter contour_max_level("contour_max_level", 1.0e+21); static MagicsParameter contour_min_level("contour_min_level", -1.0e+21); static MagicsParameter contour_shade_max_level("contour_shade_max_level", 1.0e+21); static MagicsParameter contour_shade_min_level("contour_shade_min_level", -1.0e+21); +static MagicsParameter contour_out_of_bound_min("contour_out_of_bound_min", -1.0e+21); +static MagicsParameter contour_out_of_bound_max("contour_out_of_bound_max", 1.0e+21); diff --git a/src/attributes/LevelSelectionAttributes.h b/src/attributes/LevelSelectionAttributes.h index f86c651aa..700f67428 100644 --- a/src/attributes/LevelSelectionAttributes.h +++ b/src/attributes/LevelSelectionAttributes.h @@ -52,8 +52,10 @@ class LevelSelectionAttributes string tag_; double max_; double min_; - double max_shade_; - double min_shade_; + double shade_max_; + double shade_min_; + double oob_min_; + double oob_max_; private: diff --git a/src/attributes/LevelSelectionWrapper.cc b/src/attributes/LevelSelectionWrapper.cc index 158128cfa..89285d892 100644 --- a/src/attributes/LevelSelectionWrapper.cc +++ b/src/attributes/LevelSelectionWrapper.cc @@ -64,12 +64,20 @@ void LevelSelectionWrapper::set(const MagRequest& request) levelselection_->min_ = min_value; } if (request.countValues("CONTOUR_SHADE_MAX_LEVEL") ) { - double max_shade_value = request("CONTOUR_SHADE_MAX_LEVEL"); - levelselection_->max_shade_ = max_shade_value; + double shade_max_value = request("CONTOUR_SHADE_MAX_LEVEL"); + levelselection_->shade_max_ = shade_max_value; } if (request.countValues("CONTOUR_SHADE_MIN_LEVEL") ) { - double min_shade_value = request("CONTOUR_SHADE_MIN_LEVEL"); - levelselection_->min_shade_ = min_shade_value; + double shade_min_value = request("CONTOUR_SHADE_MIN_LEVEL"); + levelselection_->shade_min_ = shade_min_value; + } + if (request.countValues("CONTOUR_OUT_OF_BOUND_MIN") ) { + double oob_min_value = request("CONTOUR_OUT_OF_BOUND_MIN"); + levelselection_->oob_min_ = oob_min_value; + } + if (request.countValues("CONTOUR_OUT_OF_BOUND_MAX") ) { + double oob_max_value = request("CONTOUR_OUT_OF_BOUND_MAX"); + levelselection_->oob_max_ = oob_max_value; } diff --git a/src/attributes/NoBoxPlotBoxBorderAttributes.cc b/src/attributes/NoBoxPlotBoxBorderAttributes.cc deleted file mode 100644 index fdfea170c..000000000 --- a/src/attributes/NoBoxPlotBoxBorderAttributes.cc +++ /dev/null @@ -1,100 +0,0 @@ - -/****************************** 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 deleted file mode 100644 index cd9e91048..000000000 --- a/src/attributes/NoBoxPlotBoxBorderAttributes.h +++ /dev/null @@ -1,63 +0,0 @@ - -/******************************* 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 deleted file mode 100644 index 14fb00eb2..000000000 --- a/src/attributes/NoBoxPlotBoxBorderWrapper.cc +++ /dev/null @@ -1,67 +0,0 @@ - -/****************************** 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 deleted file mode 100644 index bde7f82f2..000000000 --- a/src/attributes/NoBoxPlotBoxBorderWrapper.h +++ /dev/null @@ -1,91 +0,0 @@ - -/******************************* 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/NoBoxPlotMedianAttributes.cc b/src/attributes/NoBoxPlotMedianAttributes.cc deleted file mode 100644 index 50dcf6f01..000000000 --- a/src/attributes/NoBoxPlotMedianAttributes.cc +++ /dev/null @@ -1,100 +0,0 @@ - -/****************************** 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 deleted file mode 100644 index 3a6b29a1c..000000000 --- a/src/attributes/NoBoxPlotMedianAttributes.h +++ /dev/null @@ -1,63 +0,0 @@ - -/******************************* 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 deleted file mode 100644 index b3011118d..000000000 --- a/src/attributes/NoBoxPlotMedianWrapper.cc +++ /dev/null @@ -1,67 +0,0 @@ - -/****************************** 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 deleted file mode 100644 index 97b82f4ba..000000000 --- a/src/attributes/NoBoxPlotMedianWrapper.h +++ /dev/null @@ -1,91 +0,0 @@ - -/******************************* 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/SymbolPlottingAttributes.h b/src/attributes/SymbolPlottingAttributes.h index 2d46d6ff7..75239b939 100644 --- a/src/attributes/SymbolPlottingAttributes.h +++ b/src/attributes/SymbolPlottingAttributes.h @@ -54,6 +54,7 @@ class SymbolPlottingAttributes string tag_; bool legend_; string unit_method_; + string unit_method_; string type_; string marker_mode_; string format_; diff --git a/src/basic/FortranMagics.cc b/src/basic/FortranMagics.cc index cfd91bc10..960b2e3a2 100644 --- a/src/basic/FortranMagics.cc +++ b/src/basic/FortranMagics.cc @@ -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()) { @@ -453,6 +455,7 @@ void FortranMagics::pobs() { // top()->push_back(action_); action_->visdef(new ObsPlotting()); + } #include "MatrixTestDecoder.h" @@ -652,7 +655,7 @@ const char* FortranMagics::metainput() { StyleEntry style; library->getStyle(request, attributes, style); ostringstream out; - out << style; + out << "{" << style << "}"; static string temp; temp = out.str(); return temp.c_str(); @@ -833,6 +836,8 @@ void FortranMagics::ptext() { void FortranMagics::psymb() { actions(); + + string mode; string wind; ParameterManager::get("symbol_position_mode", mode); diff --git a/src/basic/LegendVisitor.cc b/src/basic/LegendVisitor.cc index 96984d914..af4ed6669 100644 --- a/src/basic/LegendVisitor.cc +++ b/src/basic/LegendVisitor.cc @@ -639,6 +639,7 @@ Colour BoxEntry::colour() { return box_->getFillColour(); } + void LegendEntry::rowBox(const PaperPoint& point, BasicGraphicsObjectContainer& legend) { Polyline* box = new Polyline(); FillShadingProperties* shading = new FillShadingProperties(); @@ -730,28 +731,50 @@ void BoxEntry::set(const PaperPoint& point, BasicGraphicsObjectContainer& legend PaperPoint p = centreSymbolBox(point); double x = p.x(); double y = p.y(); - box_->push_back(PaperPoint(x - width, y - height)); - box_->push_back(PaperPoint(x - width, y + height)); - box_->push_back(PaperPoint(x + width, y + height)); - box_->push_back(PaperPoint(x + width, y - height)); - box_->push_back(PaperPoint(x - width, y - height)); - box_->setColour(Colour("black")); + if ( isOobMin() ) { + box_->push_back(PaperPoint(x - width, y)); + box_->push_back(PaperPoint(x + width, y + height)); + box_->push_back(PaperPoint(x + width, y - height)); + box_->push_back(PaperPoint(x - width, y)); + LegendVisitor::addLegendInfo("legend_entry_min_text", ""); + LegendVisitor::addLegendInfo("legend_entry_max_text", to()); + LegendVisitor::addLegendInfo("legend_entry_type", "min_out_of_bond"); + } + else if ( isOobMax() ) { + box_->push_back(PaperPoint(x - width, y - height)); + box_->push_back(PaperPoint(x - width, y + height)); + box_->push_back(PaperPoint(x + width, y)); + box_->push_back(PaperPoint(x - width, y - height)); + LegendVisitor::addLegendInfo("legend_entry_min_text", from()); + LegendVisitor::addLegendInfo("legend_entry_max_text", ""); + LegendVisitor::addLegendInfo("legend_entry_type", "max_out_of_bond"); + } + else { + box_->push_back(PaperPoint(x - width, y - height)); + box_->push_back(PaperPoint(x - width, y + height)); + box_->push_back(PaperPoint(x + width, y + height)); + box_->push_back(PaperPoint(x + width, y - height)); + box_->push_back(PaperPoint(x - width, y - height)); + box_->setColour(Colour("black")); + LegendVisitor::addLegendInfo("legend_entry_min_text", from()); + LegendVisitor::addLegendInfo("legend_entry_max_text", to()); + LegendVisitor::addLegendInfo("legend_entry_type", "colorbar"); + } + box_->setColour(Colour("black")); LegendVisitor::addLegendInfo("legend_entry_colour", box_->getFillColour().rgb()); - LegendVisitor::addLegendInfo("legend_entry_min_text", from()); - LegendVisitor::addLegendInfo("legend_entry_max_text", to()); - LegendVisitor::addLegendInfo("legend_entry_type", "colorbar"); - legend.push_back(box_); } + + void BoxEntry::rowBox(const PaperPoint& point, BasicGraphicsObjectContainer& legend) { double width = 1; double height = 0.4; double x = point.x(); double y = point.y(); - if (text_) { + if (text_ && !isOobMin()) { Text* from = new Text(); from->push_back(PaperPoint(x - width, y - height - 0.25)); from->setVerticalAlign(VerticalAlign::BOTTOM); @@ -775,41 +798,60 @@ void BoxEntry::rowBox(const PaperPoint& point, BasicGraphicsObjectContainer& leg from->addText(bottom.str(), font_); } } - if (last_) { - Text* to = new Text(); - to->setAngle(angle_); - to->setVerticalAlign(VerticalAlign::BOTTOM); - to->push_back(PaperPoint(x + width, y - height - 0.25)); - legend.push_back(to); - if (automatic_) { - if (!userMax_) { - ostringstream to; - to << MagicsFormat(format_, to_); - maxText_ = to.str(); - } - to->addText(maxText_, font_); - } - else - to->addText(userText_, font_); - } + Polyline* top = new Polyline(); - top->push_back(PaperPoint(x - (width * 1.), y + (height * 2))); - top->push_back(PaperPoint(x + (width * 1.), y + (height * 2))); top->setColour(borderColour_); top->setThickness(2); - Polyline* bottom = new Polyline(); - bottom->push_back(PaperPoint(x - width, y - height)); - bottom->push_back(PaperPoint(x + width, y - height)); bottom->setColour(borderColour_); bottom->setThickness(2); - box_->push_back(PaperPoint(x - width, y - height)); - box_->push_back(PaperPoint(x - width, y + height + height)); - box_->push_back(PaperPoint(x + width, y + height + height)); - box_->push_back(PaperPoint(x + width, y - height)); - box_->push_back(PaperPoint(x - width, y - height)); + if ( isOobMin() ) { + top->push_back(PaperPoint(x, y)); + top->push_back(PaperPoint(x + (width * 1.), y + (height * 2))); + + bottom->push_back(PaperPoint(x, y)); + bottom->push_back(PaperPoint(x + width, y - height)); + + box_->push_back(PaperPoint(x, y)); + box_->push_back(PaperPoint(x + width, y + height + height)); + box_->push_back(PaperPoint(x + width, y - height)); + box_->push_back(PaperPoint(x, y)); + } + else if ( isOobMax() ) { + top->push_back(PaperPoint(x - (width * 1.), y + (height * 2))); + top->push_back(PaperPoint(x , y)); + + bottom->push_back(PaperPoint(x - width, y - height)); + bottom->push_back(PaperPoint(x, y)); + + box_->push_back(PaperPoint(x - width, y - height)); + box_->push_back(PaperPoint(x - width, y + height + height)); + box_->push_back(PaperPoint(x , y)); + box_->push_back(PaperPoint(x - width, y - height)); + + } + else { + top->push_back(PaperPoint(x - (width * 1.), y + (height * 2))); + top->push_back(PaperPoint(x + (width * 1.), y + (height * 2))); + + bottom->push_back(PaperPoint(x - width, y - height)); + bottom->push_back(PaperPoint(x + width, y - height)); + + box_->push_back(PaperPoint(x - width, y - height)); + box_->push_back(PaperPoint(x - width, y + height + height)); + box_->push_back(PaperPoint(x + width, y + height + height)); + box_->push_back(PaperPoint(x + width, y - height)); + box_->push_back(PaperPoint(x - width, y - height)); + + } + + + + + + // Small check Colour colour = (borderColour_.automatic()) ? box_->getFillColour() : borderColour_; @@ -824,16 +866,31 @@ void BoxEntry::rowBox(const PaperPoint& point, BasicGraphicsObjectContainer& leg legend.push_back(top); legend.push_back(bottom); - if (last_) { + if (last_ && !oob_max_) { Polyline* right = new Polyline(); right->push_back(PaperPoint(x + width, y - height)); right->push_back(PaperPoint(x + width, y + (height * 2))); right->setColour(borderColour_); right->setThickness(2); legend.push_back(right); + Text* to = new Text(); + to->setAngle(angle_); + to->setVerticalAlign(VerticalAlign::BOTTOM); + to->push_back(PaperPoint(x + width, y - height - 0.25)); + legend.push_back(to); + if (automatic_) { + if (!userMax_) { + ostringstream to; + to << MagicsFormat(format_, to_); + maxText_ = to.str(); + } + to->addText(maxText_, font_); + } + else + to->addText(userText_, font_); } - if (first_) { + if (first_ && !oob_min_) { Polyline* left = new Polyline(); left->push_back(PaperPoint(x - width, y - height)); left->push_back(PaperPoint(x - width, y + (height * 2))); @@ -848,6 +905,13 @@ void BoxEntry::rowBox(const PaperPoint& point, BasicGraphicsObjectContainer& leg LegendVisitor::addLegendInfo("legend_entry_type", "colorbar"); } + + + + + + + void BoxEntry::rowHisto(const PaperPoint& point, BasicGraphicsObjectContainer& legend, const Colour& colour) { // ShadingProperties* shading = box_->getShading(); // Normall the pilyline left the low value on their left! @@ -1118,6 +1182,7 @@ void BoxEntry::columnBox(const PaperPoint& point, BasicGraphicsObjectContainer& LegendVisitor::addLegendInfo("legend_entry_max_text", to()); LegendVisitor::addLegendInfo("legend_entry_type", "colorbar"); } + void BoxEntry::columnHisto(const PaperPoint& point, BasicGraphicsObjectContainer& legend, const Colour& colour) { MagLog::debug() << "BoxEntry--->set at " << point << endl; @@ -1512,6 +1577,7 @@ void LegendVisitor::visit(MetaDataVisitor& visitor) { ostringstream out; out << "{"; string c1 = ""; + for (auto& entry : legendInfo_) { out << c1 << "\"" << entry.first << "\":\"" << entry.second << "\""; c1 = ","; @@ -1548,3 +1614,4 @@ DoubleLineEntry::~DoubleLineEntry() {} //{ { delete line1_; delete line2_; } LineEntry::~LineEntry() {} CdfEntry::~CdfEntry() {} //{ delete line_;} RainbowEntry::~RainbowEntry() {} //{ delete line_;} + diff --git a/src/basic/LegendVisitor.h b/src/basic/LegendVisitor.h index 02f77248a..1ccddc4c0 100644 --- a/src/basic/LegendVisitor.h +++ b/src/basic/LegendVisitor.h @@ -45,6 +45,8 @@ class LegendEntry { LegendEntry(const string& label) : last_(false), first_(false), + oob_max_(false), + oob_min_(false), text_(true), label_(label), fromto_(false), @@ -56,6 +58,8 @@ class LegendEntry { LegendEntry(double label) : last_(false), first_(false), + oob_max_(false), + oob_min_(false), text_(true), label_(""), fromto_(false), @@ -69,6 +73,8 @@ class LegendEntry { LegendEntry(double min, double max) : last_(false), first_(false), + oob_max_(false), + oob_min_(false), text_(true), label_(""), fromto_(false), @@ -117,7 +123,10 @@ class LegendEntry { void angle(double angle) { angle_ = angle; } void set(const LegendVisitor&); void last() { last_ = true; } + void oob(bool oob_min, bool oob_max) { oob_min_ = oob_min, oob_max_ = oob_max; } bool isLast() { return last_; } + bool isOobMin() { return first_ && oob_min_; } + bool isOobMax() { return last_ && oob_max_; } bool isFirst() { return first_; } void first() { first_ = true; } void notext() { text_ = false; } @@ -157,6 +166,8 @@ class LegendEntry { protected: bool last_; bool first_; + bool oob_max_; + bool oob_min_; bool text_; bool automatic_; // True if the tlegend text is generated automaticaly from the value. mutable string label_; @@ -368,6 +379,7 @@ class BoxEntry : public LegendEntry { }; + class LegendVisitor : public LayoutVisitor, public LegendVisitorAttributes, public BasicPositionalObject, diff --git a/src/common/Proj4Projection.cc b/src/common/Proj4Projection.cc index abfbfadc0..ebe810fb7 100644 --- a/src/common/Proj4Projection.cc +++ b/src/common/Proj4Projection.cc @@ -1418,7 +1418,6 @@ void Proj4Projection::setMinMaxX(double min, double max) { } - diff --git a/src/decoders/NetcdfGeopointsInterpretor.cc b/src/decoders/NetcdfGeopointsInterpretor.cc index abc0c0b28..ce8107183 100644 --- a/src/decoders/NetcdfGeopointsInterpretor.cc +++ b/src/decoders/NetcdfGeopointsInterpretor.cc @@ -395,7 +395,6 @@ void NetcdfXYpointsInterpretor::print(ostream& out) const { void NetcdfXYpointsInterpretor::visit(Transformation& transformation) { // get the data ... - try { refDateX_ = (transformation.getAutomaticX()) ? "" : transformation.getReferenceX(); refDateY_ = (transformation.getAutomaticY()) ? "" : transformation.getReferenceY(); diff --git a/src/params/BoxPlotBox.xml b/src/params/BoxPlotBox.xml deleted file mode 100644 index b329d2649..000000000 --- a/src/params/BoxPlotBox.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - Colour of the box - - - Width of the box in centimeters - - - Determines whether the box border is drawn or not - - - - - Determines whether the median line is drawn or not - - - Magics++1.3 - - - diff --git a/src/params/BoxPlotBoxBorder.xml b/src/params/BoxPlotBoxBorder.xml deleted file mode 100644 index b7acc4ff9..000000000 --- a/src/params/BoxPlotBoxBorder.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Colour of the box border - - - Thickness of the box border - - - Line style of the box border - - - diff --git a/src/params/BoxPlotMedian.xml b/src/params/BoxPlotMedian.xml deleted file mode 100644 index eb6a146ea..000000000 --- a/src/params/BoxPlotMedian.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Colour of the median line - - - Thickness of the median line - - - Line style of the median line - - - diff --git a/src/params/BoxPlotWhiskerBorder.xml b/src/params/BoxPlotWhiskerBorder.xml deleted file mode 100644 index 8e4fed9c9..000000000 --- a/src/params/BoxPlotWhiskerBorder.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Colour of the whisker box border - - - Thickness of the whisker box border - - - Line style of the whisker box border - - - diff --git a/src/params/BoxPlotWhiskerBox.xml b/src/params/BoxPlotWhiskerBox.xml deleted file mode 100644 index f058aff7a..000000000 --- a/src/params/BoxPlotWhiskerBox.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - Colour of the whisker box - - - Width of the whisker box in centimeters - - - Determines whether the whisker box border is drawn or not - - - - - diff --git a/src/params/BoxPlotWhiskerLine.xml b/src/params/BoxPlotWhiskerLine.xml deleted file mode 100644 index c57a27977..000000000 --- a/src/params/BoxPlotWhiskerLine.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Colour of the whisker line - - - Thickness of the whisker line - - - Line style of the whisker line - - - diff --git a/src/params/ColourTechnique.xml b/src/params/ColourTechnique.xml index f3a6bc32a..d0e223401 100644 --- a/src/params/ColourTechnique.xml +++ b/src/params/ColourTechnique.xml @@ -7,6 +7,25 @@ granted to it by virtue of its status as an intergovernmental organisation nor 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/GribDecoder.xml b/src/params/GribDecoder.xml index ac740dd39..5f0b9efa1 100644 --- a/src/params/GribDecoder.xml +++ b/src/params/GribDecoder.xml @@ -40,6 +40,30 @@ does it submit to any jurisdiction. The name of the input file containing the u-component of wind + + The name of the input file containing the v-component of wind + + + + The name of the input file containing the u-component of wind + + + + The name of the input file containing the u-component of wind + + - - - - Maximum level for which shading is required - - - Minimum level for which shading is required + Highest level for contours to be drawn - New Magics: Parameter contour_max_level sent to new Magics[LevelSelection]. - Magics++0.3 + Lowest level for contours to be drawn - New Magics: Parameter contour_min_level sent to new Magics[LevelSelection]. - Magics++0.3 + - Highest level for contours to be shaded + Maximimum level for which shading is required + - Lowest level for contours to be shaded + Minimum level for which shading is required + + + Out of bound minimum value : below that the out_of_bound_min_colour will be used + + + + Out of bound maximun value : above that the out_of_bound_max_colour will be used + + diff --git a/src/params/SymbolPlotting.xml b/src/params/SymbolPlotting.xml index e2c28d46a..1feb18985 100644 --- a/src/params/SymbolPlotting.xml +++ b/src/params/SymbolPlotting.xml @@ -29,6 +29,9 @@ does it submit to any jurisdiction. Turn legend on or off (ON/OFF) : New Parameter! + colours; Palette palette; string name = palette_; library.find(name, palette); - + if (palette.colours_.empty()) { MagLog::warning() << "Could not load palette " << palette_ << ": using a default one " << endl; colours.push_back("blue"); diff --git a/src/visualisers/ColourTechnique.h b/src/visualisers/ColourTechnique.h index bfc794c19..75c3778b6 100644 --- a/src/visualisers/ColourTechnique.h +++ b/src/visualisers/ColourTechnique.h @@ -87,6 +87,9 @@ class ColourTechnique : public map, 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). virtual void print(ostream&) const; @@ -95,6 +98,9 @@ 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 555541cd7..0fe91451b 100644 --- a/src/visualisers/CountSelectionType.cc +++ b/src/visualisers/CountSelectionType.cc @@ -30,23 +30,63 @@ using namespace magics; CountSelectionType::CountSelectionType() {} +#define MINSET(v) !same(v, -1.0e+21) +#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; -void CountSelectionType::calculate(double min, double max, bool) { - 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(maxi, mini)) { - push_back(mini); + if (same(max_limit, min_limit)) { + push_back(min_limit); return; } - double step = (maxi - mini) / nb; + + if (min_limit > max_limit) { + push_back(max_limit); + push_back(min_limit); + return; + } + + + double step = (max_limit - min_limit) / nb; double toleranceProportion = (double)tolerance_ / (double)(levelCount_ + 1 + i); // tolerance as a proportion of the number of levels @@ -54,7 +94,7 @@ void CountSelectionType::calculate(double min, double max, bool) { // number of levels we will not actually plot, ie the min/max contours). if (same(step, 0)) { // Only one isoline! - push_back(mini); + push_back(min_limit); return; } @@ -105,13 +145,12 @@ void CountSelectionType::calculate(double min, double max, bool) { inc *= istep; // convert back into proper range + double first = floor(min_limit / inc) * inc; - double first = floor(mini / inc) * inc; - - while (first > mini) + while (first > min_limit) first -= inc; - push_back(mini); + push_back(min_limit); first += inc; double epsilon = inc / 10000.0; while (same(epsilon, 0)) { @@ -120,18 +159,20 @@ void CountSelectionType::calculate(double min, double max, bool) { } - for (double val = first; val < maxi; val += inc) { + + for (double val = first; val < max_limit; 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, maxi)) - push_back(maxi); + else if (same(val, max_limit)) + push_back(max_limit); else push_back(val); } - if (maxi != back()) - push_back(maxi); + if (max_limit != back()) + push_back(max_limit); + int si = static_cast(size()); @@ -139,26 +180,34 @@ void CountSelectionType::calculate(double min, double max, bool) { // 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 = (maxi - mini) / (levelCount_ - 1); - double val = mini; + step = (max_limit - min_limit) / (levelCount_ - 1); + double val = min_limit; while (1) { + if ( val >= min_limit && val <= max_limit ) push_back(val); - if (same(val, maxi) || val > maxi) + if (same(val, max_limit) || val > max_limit) break; val += step; } MagLog::debug() << "New size-->" << size() << endl; } - MagLog::debug() << "count=" << levelCount_ << ", tolerance=" << tolerance_ << ", result=" << size() << endl; + if ( minOutOfBond_ ) { + insert(begin(), std::max(min, min_)); + } + + 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; } diff --git a/src/visualisers/GradientsColourTechnique.cc b/src/visualisers/GradientsColourTechnique.cc index 290a5e635..83c526db3 100644 --- a/src/visualisers/GradientsColourTechnique.cc +++ b/src/visualisers/GradientsColourTechnique.cc @@ -33,7 +33,6 @@ void GradientsColourTechnique::set(LevelSelection& out, LevelSelection& in, Colo // First make sure that ColourTableDefinitionCompute helper; - if (colours_.size() < 2) { MagLog::warning() << " No enough colours given to the gradients method" << endl; return; @@ -161,7 +160,6 @@ void GradientsColourTechnique::set(LevelSelection& out, LevelSelection& in, Colo --step; } } - in.push_back(stops.back()); out.push_back(stops.back()); } diff --git a/src/visualisers/IntervalSelectionType.cc b/src/visualisers/IntervalSelectionType.cc index 824b04a3c..7bbe06222 100644 --- a/src/visualisers/IntervalSelectionType.cc +++ b/src/visualisers/IntervalSelectionType.cc @@ -95,9 +95,9 @@ void IntervalSelectionType::calculate(double min, double max, bool shading) { push_back(*level); } out << "]" << endl; - MagLog::dev() << out.str() << endl; + // cout << out.str() << endl; - // Now make sure that the reference is inside the interval .. + } double IntervalSelectionType::reference(int freq) const { diff --git a/src/visualisers/IsoPlot.cc b/src/visualisers/IsoPlot.cc index bca072258..016f728d5 100644 --- a/src/visualisers/IsoPlot.cc +++ b/src/visualisers/IsoPlot.cc @@ -1342,7 +1342,7 @@ bool IsoPlot::prepare(MatrixHandler& data) { double min = data.min(); double max = data.max(); (*levelSelection_).clear(); - (*levelSelection_).calculate(min, max, true); + (*levelSelection_).calculate(min, max, shading_->isShading()); bool need_isolines = (*shading_)(*levelSelection_); shading_->reset(); (*label_).prepare(*levelSelection_, (*colour_).name()); diff --git a/src/visualisers/LegendMethod.cc b/src/visualisers/LegendMethod.cc index 8c97904b0..e10ee24bd 100644 --- a/src/visualisers/LegendMethod.cc +++ b/src/visualisers/LegendMethod.cc @@ -67,6 +67,10 @@ void ContinuousLegendMethod::row(LegendEntry& entry, double x, double y, Text& l } labelCount_++; + LegendVisitor::legendInfo_.insert(make_pair("legend_display_type", "continuous")); + LegendVisitor::legendInfo_.insert(make_pair("legend_label_frequency", tostring(label_frequency_))); + + } void ContinuousLegendMethod::column(LegendEntry& entry, double x, double y, Text& legend, diff --git a/src/visualisers/LevelListSelectionType.cc b/src/visualisers/LevelListSelectionType.cc index 3db25b1af..1f400d8d6 100644 --- a/src/visualisers/LevelListSelectionType.cc +++ b/src/visualisers/LevelListSelectionType.cc @@ -39,16 +39,53 @@ void LevelListSelectionType::print(ostream& out) const { out << "]"; } +#define MINSET(v) !same(v, -1.0e+21) +#define MAXSET(v) !same(v, +1.0e+21) -void LevelListSelectionType::calculate(double, double, bool) { +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_; + } + + doublearray::const_iterator last = list_.begin(); double prevVal = min_; for (doublearray::const_iterator val = list_.begin(); val != list_.end(); ++val) { MagLog::dev() << "LevelListSelectionType::calculate(double min, double max)--->" << *val << "\n"; - if (min_ <= *val && *val <= max_) { + if (min_level <= *val && *val <= max_level) { if (*val < prevVal) { MagLog::error() << " level list values should increase, but " << *val << " follows " << prevVal << endl; break; @@ -58,19 +95,24 @@ void LevelListSelectionType::calculate(double, double, bool) { } ++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 << "]"; - MagLog::dev() << print.str() << endl; + // 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; } diff --git a/src/visualisers/LevelSelection.h b/src/visualisers/LevelSelection.h index ca9e5b3b6..218d342b6 100644 --- a/src/visualisers/LevelSelection.h +++ b/src/visualisers/LevelSelection.h @@ -58,9 +58,15 @@ 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 @@ -74,6 +80,7 @@ class LevelSelection : public LevelSelectionAttributes, public doublearray { p.print(s); return s; } + }; template <> diff --git a/src/visualisers/PolyShadingTechnique.h b/src/visualisers/PolyShadingTechnique.h index d4e544a8c..5724699c8 100644 --- a/src/visualisers/PolyShadingTechnique.h +++ b/src/visualisers/PolyShadingTechnique.h @@ -141,9 +141,11 @@ 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(); + } for (vector::iterator val = legend_.values_list_.begin(); val != legend_.values_list_.end(); ++val) { if (min <= *val && *val < max) { diff --git a/src/visualisers/SymbolPlotting.cc b/src/visualisers/SymbolPlotting.cc index 944acde58..cd16b58da 100644 --- a/src/visualisers/SymbolPlotting.cc +++ b/src/visualisers/SymbolPlotting.cc @@ -30,6 +30,8 @@ #include "IntervalMap.h" +#include "IntervalMap.h" + using namespace magics;