Closed MarkusOlssonModelon closed 2 years ago
I think it would be more natural if the attributes of the coordinate system were inherited separately.
I agree.
If a class defines a local coordinate system to modify one the attributes that are not extent, e.g., preserveAspectRatio, should the extent be inherited? My interpretation of the specification is that it should not be inherited (from point 1 below). Is this the desired behavior? I think it would be more natural if the attributes of the coordinate system were inherited separately.
I agree for this example, and to me the problem is that if you just set preserveAspectRatio there is no extent defined in step 1 (no default for the extent), so it makes sense that we inherit the extent in step 2 as there isn't any value in step 1.
However, if you on the other hand have:
model BaseClass
annotation(Icon(coordinateSystem(preserveAspectRatio=false)));
end BaseClass;
model Example
extends BaseClass;
annotation(Icon(coordinateSystem(extent={{0,0},{100,100}})));
end Example;
there does exist a default for preserveAspectRatio in CoordinateSystem, and thus preserveAspectRatio=true shall be used.
That is consistent with the goal when we introduced the slightly complicated rules:
Note models normally don't specify preserveAspectRatio, and of the ones that do most also give the extent. I believe there are about 20 cases of specifying coordinatesystem without extent in MSL; and I haven't found any cases where these rules matter.
If a class defines a local coordinate system to modify one the attributes that are not extent, e.g.,
preserveAspectRatio
, should the extent be inherited? My interpretation of the specification is that it should not be inherited (from point 1 below). Is this the desired behavior? I think it would be more natural if the attributes of the coordinate system were inherited separately.From section 18.6.1.1 Coordinate Systems:
Example
What is the extent for the icon of
Example
?