{"action":"closed","issue":{"url":"https://api.github.com/repos/modelica/ModelicaSpecification/issues/1978","repository_url":"https://api.github.com/repos/modelica/ModelicaSpecification","labels_url":"https://api.github.com/repos/modelica/ModelicaSpecification/issues/1978/labels{/name}","comments_url":"https://api.github.com/repos/modelica/ModelicaSpecification/issues/1978/comments","events_url":"https://api.github.com/repos/modelica/ModelicaSpecification/issues/1978/events","html_url":"https://github.com/modelica/ModelicaSpecification/issues/1978","id":377175842,"node_id":"MDU6SXNzdWUzNzcxNzU4NDI=","number":1978,"title":"Scaling of inherited ports in an Icon when derived class has no specified extent","user":{"login":"modelica-trac-importer","id":22202507,"node_id":"MDQ6VXNlcjIyMjAyNTA3","avatar_url":"https://avatars1.githubusercontent.com/u/22202507?v=4","gravatar_id":"","url":"https://api.github.com/users/modelica-trac-importer","html_url":"https://github.com/modelica-trac-importer","followers_url":"https://api.github.com/users/modelica-trac-importer/followers","following_url":"https://api.github.com/users/modelica-trac-importer/following{/other_user}","gists_url":"https://api.github.com/users/modelica-trac-importer/gists{/gist_id}","starred_url":"https://api.github.com/users/modelica-trac-importer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modelica-trac-importer/subscriptions","organizations_url":"https://api.github.com/users/modelica-trac-importer/orgs","repos_url":"https://api.github.com/users/modelica-trac-importer/repos","events_url":"https://api.github.com/users/modelica-trac-importer/events{/privacy}","received_events_url":"https://api.github.com/users/modelica-trac-importer/received_events","type":"User","site_admin":false},"labels":[{"id":971423507,"node_id":"MDU6TGFiZWw5NzE0MjM1MDc=","url":"https://api.github.com/repos/modelica/ModelicaSpecification/labels/bug","name":"bug","color":"d73a4a","default":true}],"state":"closed","locked":false,"assignee":{"login":"HansOlsson","id":13217430,"node_id":"MDQ6VXNlcjEzMjE3NDMw","avatar_url":"https://avatars0.githubusercontent.com/u/13217430?v=4","gravatar_id":"","url":"https://api.github.com/users/HansOlsson","html_url":"https://github.com/HansOlsson","followers_url":"https://api.github.com/users/HansOlsson/followers","following_url":"https://api.github.com/users/HansOlsson/following{/other_user}","gists_url":"https://api.github.com/users/HansOlsson/gists{/gist_id}","starred_url":"https://api.github.com/users/HansOlsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HansOlsson/subscriptions","organizations_url":"https://api.github.com/users/HansOlsson/orgs","repos_url":"https://api.github.com/users/HansOlsson/repos","events_url":"https://api.github.com/users/HansOlsson/events{/privacy}","received_events_url":"https://api.github.com/users/HansOlsson/received_events","type":"User","site_admin":false},"assignees":[{"login":"HansOlsson","id":13217430,"node_id":"MDQ6VXNlcjEzMjE3NDMw","avatar_url":"https://avatars0.githubusercontent.com/u/13217430?v=4","gravatar_id":"","url":"https://api.github.com/users/HansOlsson","html_url":"https://github.com/HansOlsson","followers_url":"https://api.github.com/users/HansOlsson/followers","following_url":"https://api.github.com/users/HansOlsson/following{/other_user}","gists_url":"https://api.github.com/users/HansOlsson/gists{/gist_id}","starred_url":"https://api.github.com/users/HansOlsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HansOlsson/subscriptions","organizations_url":"https://api.github.com/users/HansOlsson/orgs","repos_url":"https://api.github.com/users/HansOlsson/repos","events_url":"https://api.github.com/users/HansOlsson/events{/privacy}","received_events_url":"https://api.github.com/users/HansOlsson/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/modelica/ModelicaSpecification/milestones/6","html_url":"https://github.com/modelica/ModelicaSpecification/milestone/6","labels_url":"https://api.github.com/repos/modelica/ModelicaSpecification/milestones/6/labels","id":3792652,"node_id":"MDk6TWlsZXN0b25lMzc5MjY1Mg==","number":6,"title":"ModelicaSpec3.4","description":"","creator":{"login":"modelica-trac-importer","id":22202507,"node_id":"MDQ6VXNlcjIyMjAyNTA3","avatar_url":"https://avatars1.githubusercontent.com/u/22202507?v=4","gravatar_id":"","url":"https://api.github.com/users/modelica-trac-importer","html_url":"https://github.com/modelica-trac-importer","followers_url":"https://api.github.com/users/modelica-trac-importer/followers","following_url":"https://api.github.com/users/modelica-trac-importer/following{/other_user}","gists_url":"https://api.github.com/users/modelica-trac-importer/gists{/gist_id}","starred_url":"https://api.github.com/users/modelica-trac-importer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/modelica-trac-importer/subscriptions","organizations_url":"https://api.github.com/users/modelica-trac-importer/orgs","repos_url":"https://api.github.com/users/modelica-trac-importer/repos","events_url":"https://api.github.com/users/modelica-trac-importer/events{/privacy}","received_events_url":"https://api.github.com/users/modelica-trac-importer/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":145,"state":"open","created_at":"2018-11-03T10:03:48Z","updated_at":"2018-11-04T17:39:05Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2018-11-04T17:37:01Z","updated_at":"2018-11-04T17:39:05Z","closed_at":"2018-11-04T17:39:05Z","author_association":"COLLABORATOR","body":"**Reported by stefanv on 6 Apr 2016 19:58 UTC**\nConsider the following code excerpt:\n\n```modelica\nconnector Flange\n    annotation (\n      Icon(\n\tcoordinateSystem(\n\t  extent = {\n\t    {-100, -100}, \n\t    {100, 100}}),\n        graphics = {\n\t  Rectangle(extent = {{-100,-100},{100,100}},\n\t  \t    lineColor = {255,0,0}) } ));\nend Flange;\n\nmodel A\n    Flange f1\n        annotation (Placement(transformation(extent = {\n\t\t{-200, -150}, \n\t\t{-180, -130}})));\n    Flange f2\n        annotation (Placement(transformation(extent = {\n\t\t{180, -150}, \n\t\t{200, -130}})));\nequation\n    annotation (\n      Documentation(info = \"<html>Help for A</html>\"),\n      Icon(\n\tcoordinateSystem(\n\t  extent = {\n\t    {-200, -200}, \n\t    {200, 200}}),\n\tgraphics = {\n\t  Rectangle(extent = {{-200,-200},{200,200}},\n\t            fillColor = {255,255,191},\n\t\t    fillPattern = FillPattern.Solid),\n\t  Rectangle(extent = {{-100,-100},{100,100}},\n\t  \t    lineColor = {127,127,0}) } ));\nend A;\n\nmodel B\n    extends A\n\n    annotation (\n      Documentation(info = \"<html>Help for B</html>\"),\n      Icon(\n        graphics = {\n\t  Rectangle(extent = {{-90,-90},{90,90}},\n\t  \t    lineColor = {0,255,0}) } ));\nend B;\n```\n\nSection 18.6.3 of the 3.3rev1 specification states (text in [] inserted by me):\n\n The  base  class  coordinate  system  is mapped to the region specified by the attribute extent. If the extent [of the IconMap or DiagramMap] defines a null region (the default), the base class coordinate system shall be fitted to the derived class coordinate system with center alignment and respected preserveAspectRatio of the base class.\n\nIn the example I present above, there is no IconMap, thus the \"extent defines a null region\" by default, and thus the graphics of the inherited f1 and f2 \"shall be fitted to the derived class coordinate system\".\n\nThe problem in this case is that derived class B doesn't have an explicitly written coordinate system. Thus, does it get the default Icon.coordinateSystem.extent of {{-100,-100},{100,100}}, or does it inherit the Icon.coordinateSystem of base class A?\n\nA library I'm currently working with seems to be expecting the latter to be the case.\n\nBut if that is indeed what should happen, what happens in this case?\n\n```modelica\nmodel A1\n    Flange f1\n        annotation (Placement(transformation(extent = {\n\t\t{-200, -150}, \n\t\t{-180, -130}})));\n    annotation (\n      Documentation(info = \"<html>Help for A1</html>\"),\n      Icon(\n\tcoordinateSystem(\n\t  extent = {\n\t    {-200, -200}, \n\t    {200, 200}}),\n\tgraphics = {\n\t  Rectangle(extent = {{-200,-200},{200,200}},\n\t            fillColor = {191,255,255},\n\t\t    fillPattern = FillPattern.Solid),\n\t  Rectangle(extent = {{-110,-110},{110,110}},\n\t  \t    lineColor = {0,127,127}) } ));\nend A1;\n\nmodel A2\n    Flange f2\n        annotation (Placement(transformation(extent = {\n\t\t{180, -150}, \n\t\t{200, -130}})));\n    annotation (\n      Documentation(info = \"<html>Help for A2</html>\"),\n      Icon(\n\tcoordinateSystem(\n\t  extent = {\n\t    {-314, -159}, \n\t    {265, 359}}),\n\tgraphics = {\n\t  Rectangle(extent = {{-314,-159},{265,359}},\n\t            fillColor = {191,191,255},\n\t\t    fillPattern = FillPattern.Solid),\n\t  Rectangle(extent = {{-100,-100},{100,100}},\n\t  \t    lineColor = {0,0,255}) } ));\nend A2;\n\nmodel C\n    extends A1;\n    extends A2;\n\n    annotation (\n      Documentation(info = \"<html>Help for C</html>\"),\n      Icon(\n        graphics = {\n\t  Rectangle(extent = {{-90,-90},{90,90}},\n\t  \t    lineColor = {127,0,127}) } ));\nend C;\n```\n\nWhat is C's Icon.coordinateSystem.extent?\n\nFor that matter, what is the value of C's Icon.coordinateSystem.preserveAspectRatio?\n\nI've attached a package.mo file that contains all of the above definitions in case others want to try loading this into their tool and generating the icons for it.\n\n----\n\nMigrated-From: https://trac.modelica.org/Modelica/ticket/1978"}}
{"actor":{"display_login":"modelica-trac-importer"}}