Skip to content

Commit

Permalink
- support for Modelica 3.x graphical annotations.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/branches/OpenModelica1.5.0@4323 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Oct 8, 2009
1 parent 93b8dd8 commit ae99f50
Showing 1 changed file with 77 additions and 12 deletions.
89 changes: 77 additions & 12 deletions Compiler/Constants.mo
Expand Up @@ -187,22 +187,21 @@ record CoordinateSystem
Real extent[2,2](final unit=\"mm\");
Boolean preserveAspectRatio=true;
Real initialScale = 0.1;
Real grid[2];
Real grid[2](final unit=\"mm\") = {1.0, 1.0};
end CoordinateSystem;
// example
// CoordinateSystem(extent = {{-10, -10}, {10, 10}});
// i.e. a coordinate system with width 20 units and height 20 units.
record Icon \"Representation of the icon layer\"
CoordinateSystem coordinateSystem(extent = {{-100, -100}, {100, 100}});
GraphicItem[:] graphics;
//GraphicItem[:] graphics;
end Icon;
record Diagram \"Representation of the diagram layer\"
CoordinateSystem coordinateSystem(extent = {{-100, -100}, {100, 100}});
GraphicItem[:] graphics;
//GraphicItem[:] graphics;
end Diagram;
type Color = Integer[3](min=0, max=255) \"RGB representation\";
Expand Down Expand Up @@ -248,7 +247,12 @@ record DiagramMap
end DiagramMap;
record Line
extends GraphicItem;
//extends GraphicItem;
Boolean visible = true;
Real origin[2](final unit=\"mm\") = {0.0, 0.0};
Real rotation(quantity=\"angle\", unit=\"deg\")=0;
// end GraphicItem
Real points[2,:](final unit=\"mm\");
Integer color[3] = {0, 0, 0};
LinePattern pattern = LinePattern.Solid;
Expand All @@ -259,23 +263,79 @@ record Line
end Line;
record Polygon
extends GraphicItem;
extends FilledShape;
//extends GraphicItem;
Boolean visible = true;
Real origin[2](final unit=\"mm\") = {0.0, 0.0};
Real rotation(quantity=\"angle\", unit=\"deg\")=0;
// end GraphicItem
//extends FilledShape;
Integer lineColor[3] = {0, 0, 0} \"Color of border line\";
Integer fillColor[3] = {0, 0, 0} \"Interior fill color\";
LinePattern pattern = LinePattern.Solid \"Border line pattern\";
FillPattern fillPattern = FillPattern.None \"Interior fill pattern\";
Real lineThickness = 0.25 \"Line thickness\";
// end FilledShape
Real points[2,:](final unit=\"mm\");
Smooth smooth = Smooth.None \"Spline outline\";
end Polygon;
record Rectangle
//extends GraphicItem;
Boolean visible = true;
Real origin[2](final unit=\"mm\") = {0.0, 0.0};
Real rotation(quantity=\"angle\", unit=\"deg\")=0;
// end GraphicItem
//extends FilledShape;
Integer lineColor[3] = {0, 0, 0} \"Color of border line\";
Integer fillColor[3] = {0, 0, 0} \"Interior fill color\";
LinePattern pattern = LinePattern.Solid \"Border line pattern\";
FillPattern fillPattern = FillPattern.None \"Interior fill pattern\";
Real lineThickness = 0.25 \"Line thickness\";
// end FilledShape
BorderPattern borderPattern = BorderPattern.None;
Real extent[2,2](final unit=\"mm\");
Real radius(final unit=\"mm\") = 0 \"Corner radius\";
end Rectangle;
record Ellipse
extends GraphicItem;
extends FilledShape;
//extends GraphicItem;
Boolean visible = true;
Real origin[2](final unit=\"mm\") = {0.0, 0.0};
Real rotation(quantity=\"angle\", unit=\"deg\")=0;
// end GraphicItem
//extends FilledShape;
Integer lineColor[3] = {0, 0, 0} \"Color of border line\";
Integer fillColor[3] = {0, 0, 0} \"Interior fill color\";
LinePattern pattern = LinePattern.Solid \"Border line pattern\";
FillPattern fillPattern = FillPattern.None \"Interior fill pattern\";
Real lineThickness = 0.25 \"Line thickness\";
// end FilledShape
Real extent[2,2](final unit=\"mm\");
Real startAngle(quantity=\"angle\", unit=\"deg\")=0;
Real endAngle(quantity=\"angle\", unit=\"deg\")=360;
end Ellipse;
record Text
extends GraphicItem;
extends FilledShape;
//extends GraphicItem;
Boolean visible = true;
Real origin[2](final unit=\"mm\") = {0.0, 0.0};
Real rotation(quantity=\"angle\", unit=\"deg\")=0;
// end GraphicItem
//extends FilledShape;
Integer lineColor[3] = {0, 0, 0} \"Color of border line\";
Integer fillColor[3] = {0, 0, 0} \"Interior fill color\";
LinePattern pattern = LinePattern.Solid \"Border line pattern\";
FillPattern fillPattern = FillPattern.None \"Interior fill pattern\";
Real lineThickness = 0.25 \"Line thickness\";
// end FilledShape
Real extent[2,2](final unit=\"mm\");
String textString;
Real fontSize = 0 \"unit pt\";
Expand All @@ -285,7 +345,12 @@ record Text
end Text;
record Bitmap
extends GraphicItem;
//extends GraphicItem;
Boolean visible = true;
Real origin[2](final unit=\"mm\") = {0.0, 0.0};
Real rotation(quantity=\"angle\", unit=\"deg\")=0;
// end GraphicItem
Real extent[2,2](final unit=\"mm\");
String fileName \"Name of bitmap file\";
String imageSource \"Base64 representation of bitmap\";
Expand Down

0 comments on commit ae99f50

Please sign in to comment.