Skip to content

Commit

Permalink
Merge pull request #3326 from henrikt-ma/icon-transformation
Browse files Browse the repository at this point in the history
Simplified presentation of Transformation-annotation
  • Loading branch information
HansOlsson committed Dec 20, 2022
2 parents d31cb23 + cbef87d commit 46905d5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions chapters/annotations.tex
Expand Up @@ -728,29 +728,29 @@ \subsection{Component Instance}\label{component-instance}

A component instance can be placed within a diagram or icon layer.
It has an annotation with a \lstinline!Placement! modifier to describe the placement.
Placements are defined in term of coordinate systems transformations:
Placements are defined in terms of coordinate system transformations:
\begin{lstlisting}[language=modelica]
record Transformation
Point origin = {0, 0};
Extent extent;
Real rotation(quantity = "angle", unit = "deg") = 0;
Point origin = {0, 0};
end Transformation;
\end{lstlisting}%
\annotationindex{Transformation}
The origin attribute defines the position of the component in the coordinate system of the enclosing class.
The \lstinline!extent! defines the position, size and flipping of the component, relative to the \lstinline!origin! attribute.
The \lstinline!extent! is defined relative to the \lstinline!origin! attribute of the component instance.
Given an extent \lstinline!{{$x_{1}$, $y_{1}$}, {$x_{2}$, $y_{2}$}}!, $x_{2} < x_{1}$ defines horizontal flipping and $y_{2} < y_{1}$ defines vertical flipping around the center of the object.

The \lstinline!rotation! attribute specifies rotation of the extent around the point defined by the \lstinline!origin! attribute.

The graphical operations are applied in the order: scaling, flipping and rotation.
The attributes are applied in the order \lstinline!extent!, \lstinline!rotation!, \lstinline!origin!, as follows:
\begin{enumerate}
\item
The \lstinline!extent! of the component icon is mapped to the \lstinline!extent! rectangle (possibly shifting, scaling, and flipping contents).
\item
The \lstinline!rotation! specifies counter-clockwise rotation around the origin (that is \lstinline!{0, 0}!, not the \lstinline!origin! attribute).
\item
The \lstinline!origin! specifies a shift (moving \lstinline!{0, 0}! to \lstinline!origin!).
\end{enumerate}

\begin{lstlisting}[language=modelica]
record Placement
Boolean visible = true;
Transformation transformation "Placement in the diagram layer";

Boolean iconVisible "Visible in icon layer; for public connector";
Transformation iconTransformation
"Placement in the icon layer; for public connector";
Expand Down

0 comments on commit 46905d5

Please sign in to comment.