VirtualLabBuilder.src.ViewElements.Drawables

Drawable elements and base classes

Information


 

Drawables package

Drawables package includes the container elements and the base classes that the library developer has to extend to create new container elements.

The relationship between the interfaces, the base classes and the classes describing the drawables elements is shown in Figure 1. The class names are placed inside rectangles. The partial class names are placed inside rectangles with dashed line borders. An arrow going from a rectangle A, containing one class, to a rectangle B, indicates that the classes contained in rectangle B inherit from the class contained in rectangle A.


Figure 1.Classes included in the Drawables package.

Package Content

NameDescription
VirtualLabBuilder.src.ViewElements.Drawables.Drawable Drawable Base class of the classes describing drawable elements
Shape Base class of the classes lasses describing 2-D drawables with shape
VirtualLabBuilder.src.ViewElements.Drawables.Polygon Polygon Polygon
VirtualLabBuilder.src.ViewElements.Drawables.Oval Oval Oval
VirtualLabBuilder.src.ViewElements.Drawables.Text Text Displays a string
VirtualLabBuilder.src.ViewElements.Drawables.Arrow Arrow Draws an arrow
VirtualLabBuilder.src.ViewElements.Drawables.Trail Trail Draws a trail
VirtualLabBuilder.src.ViewElements.Drawables.TrailSet TrailSet Draws a set of trails
VirtualLabBuilder.src.ViewElements.Drawables.PolygonSet PolygonSet Draws a set of polygons
VirtualLabBuilder.src.ViewElements.Drawables.Mechanics Mechanics Mechanic elements


VirtualLabBuilder.src.ViewElements.Drawables.Drawable VirtualLabBuilder.src.ViewElements.Drawables.Drawable

Base class of the classes describing drawable elements

VirtualLabBuilder.src.ViewElements.Drawables.Drawable

Information


                        

Drawable class has to be inhereted from the classes describing drawable elements. This class inherits from the IDrawable class.

The Drawable class includes the code required to perform the two following tasks:

Connectors

TypeNameDescription
ParentpLeftConnector of drawable components
ChildcLeftConnector of drawable components

Modelica definition

partial model Drawable 
  "Base class of the classes describing drawable elements" 
 extends Interfaces.IDrawable;
  import Modelica.Utilities.*;
  
//Global Variables*****************
  outer Boolean refreshView "true if the view is refreshed";
  outer Integer p "Socket Descriptor";
  
protected 
  Boolean windowClosed( start = false, fixed = true);
  outer parameter String fileName "Name of the java file";
  outer parameter String fComponent;
//********************************
  Real out1( start = 1);
  parameter Integer numInt=1;
  parameter Integer numIntColor=1;
  Real colors[numIntColor+1];
  Real vert[ numInt+1];
  
algorithm 
    when (change(refreshView) and 
                                 not (windowClosed)) then
        out1 :=if ((numInt + numIntColor) > 0) then CServer.sendOutput(
      p,
      numInt,
      vert[1:numInt],
      numIntColor,
      colors[1:numIntColor],
      num) else 1;
    end when;
  
  when (out1 <0.5) then
      Modelica.Utilities.Files.removeFile(fComponent);
      CServer.shutdownConnection(p);
      windowClosed :=true;
      terminate("Main window closed");
    
 end when;
  
end Drawable;

VirtualLabBuilder.src.ViewElements.Drawables.Shape

Base class of the classes lasses describing 2-D drawables with shape

Information


                        

Shape class is inhereted from classes describing 2-D drawables with shape (i.e., Polygon and Oval). This class includes the parameters required to describe the color properties of the drawable element.

This class includes the declaration of the two following variables: lineColor[:] and fillColor[:]. The value of lineColor[:]/fillColor[:] is set to the value of the lineColorp[:]/fillColorp[:] parameters if the intlineColor/intfillColor parameter is 0, or it has to be provided by the virtual-lab developer otherwise.


Parameters

TypeNameDefaultDescription
booleanValuefilled"true"True if the poligon is filled and false otherwise
ColorlineColorp[4]{0,0,0,255}The color used for the lines of the component
ColorfillColorp[4]{0,0,255,255}The color used to fill the component
IntegerintLineColor01 if the line color change in time and 0 otherwise
IntegerintFillColor01 if the filling color change in time and 0 otherwise

Modelica definition

partial model Shape 
  "Base class of the classes lasses describing 2-D drawables with shape " 
  parameter TypesDef.booleanValue filled = "true" 
    "True if the poligon is filled and false otherwise";
  parameter TypesDef.Color lineColorp = {0,0,0,255} 
    "The color used for the lines of the component";
  parameter TypesDef.Color fillColorp = {0,0,255,255} 
    "The color used to fill the component";
  
  parameter Integer intLineColor = 0 
    "1 if the line color change in time and 0 otherwise";
  parameter Integer intFillColor = 0 
    "1 if the filling color change in time and 0 otherwise";
  Real lineColor[4];
  Real fillColor[4];
  
equation 
  if (intLineColor== 0) then
   lineColor = lineColorp;
  end if;
  if (intFillColor == 0) then
   fillColor = fillColorp;
  end if;
  
  
end Shape;

VirtualLabBuilder.src.ViewElements.Drawables.Polygon VirtualLabBuilder.src.ViewElements.Drawables.Polygon

Polygon

VirtualLabBuilder.src.ViewElements.Drawables.Polygon

Information


                        

This class extends the following two classes: Drawable and Shape.
Draws a polygonal curve specified by the coordinates of its vertexes points. The x and y coordinates of the vertexes points of the polygon (x[:] and y[:] vectors) can be linked to model variables.


Parameters

TypeNameDefaultDescription
booleanValuefilled"true"True if the poligon is filled and false otherwise
ColorlineColorp[4]{0,0,0,255}The color used for the lines of the component
ColorfillColorp[4]{0,0,255,255}The color used to fill the component
IntegerintLineColor01 if the line color change in time and 0 otherwise
IntegerintFillColor01 if the filling color change in time and 0 otherwise
IntegernPoints1Number of vertices
booleanValueclosed"true"True if the poligon is closed and false otherwise
IntegerintVertexesX[:]zeros(nPoints)intVertexesX[i] = 1 if coordinate x of vertex i changes in time
IntegerintVertexesY[:]zeros(nPoints)intVertexesY[i] = 1 if coordinate y of vertex i changes in time
Realstroke1.0Stroke used to draw the lines
Integergradient01 if there is a gradient in the filling color
Realp1[2]{0,0}Position where the color gradient starts
Colorcolor1[4]{192,192,192,255}Color at point p1
Realp2[2]{0,10}Position where the color gradient finishes
Colorcolor2[4]{64,64,64,255}Color at point p2
booleanValuecyclic"true"True if the color gradient is cyclic

Connectors

TypeNameDescription
ParentpLeftConnector of drawable components
ChildcLeftConnector of drawable components

Modelica definition

model Polygon "Polygon" 
              extends Drawable(numIntColor =  (intLineColor+intFillColor)*4, numInt = numIntX+numIntY);
              extends Shape;
  import Modelica.Utilities.*;
  parameter Integer nPoints = 1 "Number of vertices";
  parameter TypesDef.booleanValue closed = "true" 
    "True if the poligon is closed and false otherwise";
  parameter Integer intVertexesX[:] = zeros(nPoints) 
    "intVertexesX[i] = 1 if coordinate x of vertex i changes in time";
  parameter Integer intVertexesY[:] = zeros(nPoints) 
    "intVertexesY[i] = 1 if coordinate y of vertex i changes in time";
  parameter Real stroke = 1.0 "Stroke used to draw the lines";
  
  input Real x[nPoints] "X coordinates of the polygon vertices";
  input Real y[nPoints] "y coordinates of the polygon vertices";
  parameter Integer gradient = 0 
    "1 if there is a gradient in the filling color";
  parameter Real p1[2] = {0,0} "Position where  the color gradient starts";
  parameter TypesDef.Color color1 = {192, 192, 192, 255} "Color at point p1";
  parameter Real p2[2] = {0, 10} "Position where the color gradient finishes";
  parameter TypesDef.Color color2 = {64, 64, 64, 255} "Color at point p2";
  parameter TypesDef.booleanValue cyclic= "true" 
    "True if the color gradient is cyclic";
protected 
  parameter Integer numIntX = Functions.Sum(intVertexesX);
  parameter Integer numIntY = Functions.Sum(intVertexesY);
  
  Integer j;
  Integer i;
  
initial algorithm 
  
  num :=Functions.processingFile(fComponent);
  Functions.fPolygon(fileName, "node"+String(pLeft.nodeReference), "node"+String(num), String(num), x, y, nPoints, filled, integer(lineColor),
  integer(fillColor), closed, intVertexesX, intVertexesY, intLineColor, intFillColor, stroke, gradient, p1, color1, p2, color2, cyclic);
  
algorithm 
  j :=1;
  i :=1;
  
 vert[numInt+1] := -1;
 colors[numIntColor+1] :=-1;
  while j<=nPoints and (numIntX>0) and (i<=numIntX) loop
     vert[i] :=x[j];
     i  :=if (intVertexesX[j] < 1) and (i<=numIntX) then i else i + 1;
     j :=j + 1;
  end while;
 j:=1;
  while j<=nPoints and (numIntY>0) and (i<=numInt) loop
     vert[i]:=y[j];
     i  :=if intVertexesY[j] < 1 then i else i + 1;
     j :=j + 1;
  end while;
  i :=1;
  while  (intLineColor)>0 and (i<=numIntColor) loop
     colors[i] := lineColor[i];
     i := i+1;
  end while;
    j :=i;
    i :=1;
  while i<= numIntColor and (intFillColor)>0 loop
    colors[j] :=fillColor[i];
    j := j + 1;
    i :=i + 1;
  end while;
equation 
  
end Polygon;

VirtualLabBuilder.src.ViewElements.Drawables.Oval VirtualLabBuilder.src.ViewElements.Drawables.Oval

Oval

VirtualLabBuilder.src.ViewElements.Drawables.Oval

Information


                        

This class extends the following two classes: Drawable and Shape.
Oval class draws an oval. The position of the oval center (Center[:]/i> variable) and the lengths of the axes (Axes[:] variable) can be linked to the model variables.


Parameters

TypeNameDefaultDescription
booleanValuefilled"true"True if the poligon is filled and false otherwise
ColorlineColorp[4]{0,0,0,255}The color used for the lines of the component
ColorfillColorp[4]{0,0,255,255}The color used to fill the component
IntegerintLineColor01 if the line color change in time and 0 otherwise
IntegerintFillColor01 if the filling color change in time and 0 otherwise
IntegerintCenter0intCenter = 1 ==> the center changes in time
IntegerintAxes0intAxes = 1 ==> the axes change in time
Realstroke1.0Stroke used to draw the lines
Integergradient01 if there is a gradient in the filling color
Realp1[2]{0,0}Position where the color gradient starts
Colorcolor1[4]{192,192,192,255}Color at point p1
Realp2[2]{0,10}Position where the color gradient finishes
Colorcolor2[4]{64,64,64,255}Color at point p2
booleanValuecyclic"true"True if the color gradient is cyclic

Connectors

TypeNameDescription
ParentpLeftConnector of drawable components
ChildcLeftConnector of drawable components

Modelica definition

model Oval "Oval" 
  extends Drawable(numIntColor = (intLineColor+intFillColor)*4, numInt = (intCenter+intAxes)*2);
  extends Shape;
  import Modelica.Utilities.*;
  
  parameter Integer intCenter = 0 
    "intCenter = 1 ==> the center changes in time";
  parameter Integer intAxes = 0 "intAxes = 1 ==> the axes change in time ";
  
  input Real Center[2] "x coordinates of the poligon vertexes";
  input Real Axes[2] "y coordinates of the poligon vertexes";
  parameter Real stroke = 1.0 "Stroke used to draw the lines";
  parameter Integer gradient = 0 
    "1 if there is a gradient in the filling color";
  parameter Real p1[2] = {0,0} "Position where  the color gradient starts";
  parameter TypesDef.Color color1 = {192, 192, 192, 255} "Color at point p1";
  parameter Real p2[2] = {0, 10} "Position where the color gradient finishes";
  parameter TypesDef.Color color2 = {64, 64, 64, 255} "Color at point p2";
  parameter TypesDef.booleanValue cyclic= "true" 
    "True if the color gradient is cyclic";
protected 
  Integer j;
  Integer i;
  
initial algorithm 
 num :=Functions.processingFile(fComponent);
  Functions.fOval(fileName, "node"+String(pLeft.nodeReference), "node"+String(num), String(num), Center, Axes, filled, integer(lineColor),
 integer(fillColor), intCenter, intAxes, intLineColor, intFillColor, stroke, gradient, p1, color1, p2, color2, cyclic);
  
algorithm 
  j :=1;
  i :=1;
  vert[numInt+1] :=-1;
  colors[numIntColor+1] :=-1;
 if (intCenter>0 and intAxes>0) then
   for i in 1:2 loop
     vert[i] :=Center[i];
     vert[i+2] :=Axes[i];
   end for;
 end if;
 if (intCenter>0 and intAxes==0) then
  for i in 1:2 loop
     vert[i] :=Center[i];
   end for;
 end if;
  
 if (intCenter==0 and intAxes>0) then
  for i in 1:2 loop
     vert[i] := Axes[i];
   end for;
 end if;
  i :=1;
  while  (intLineColor)>0 and (i<=numIntColor) loop
     colors[i] := lineColor[i];
     i := i+1;
  end while;
    j :=i;
    i :=1;
  while i<= numIntColor and (intFillColor)>0 loop
    colors[j] :=fillColor[i];
    j := j + 1;
    i :=i + 1;
  end while;
equation 
  
end Oval;

VirtualLabBuilder.src.ViewElements.Drawables.Text VirtualLabBuilder.src.ViewElements.Drawables.Text

Displays a string

VirtualLabBuilder.src.ViewElements.Drawables.Text

Information


                        

This class inherits from the Drawable class.
Text class displays a string. The position of the string center (Center[:] variable) can be linked to the model variables.


Parameters

TypeNameDefaultDescription
ColortextColor[4]{0,0,0,255}string color
IntegerintCenter0= 0 if the center change in time and 0 otherwise
StringtextString""String displayed by the element

Connectors

TypeNameDescription
ParentpLeftConnector of drawable components
ChildcLeftConnector of drawable components

Modelica definition

model Text "Displays a string" 
            extends Drawable(numIntColor = 0, numInt = intCenter*2);
  
  import Modelica.Utilities.*;
  
  parameter TypesDef.Color textColor = {0,0,0,255} "string color";
  
  parameter Integer intCenter = 0 
    "= 0 if the center change in time and 0 otherwise ";
  parameter String textString = "" "String displayed by the element";
  
  input Real Center[2] "position of the string";
  
initial algorithm 
 num :=Functions.processingFile(fComponent);
  Functions.text(fileName, "node"+String(pLeft.nodeReference), "node"+String(num), String(num), Center, textColor, textString, intCenter);
  
equation 
  colors[1] = -1;
algorithm 
  vert[numInt+1] :=-1;
 if (intCenter>0) then
   for i in 1:2 loop
     vert[i] :=Center[i];
    end for;
 end if;
end Text;

VirtualLabBuilder.src.ViewElements.Drawables.Arrow VirtualLabBuilder.src.ViewElements.Drawables.Arrow

Draws an arrow

VirtualLabBuilder.src.ViewElements.Drawables.Arrow

Information


                        

This class inherits from the Drawable class.
Arrow class displays a vector. The position of the origin (Origin[:] variable) and horizontal and vertical components of the vector (Length[:] variable) can be linked to the model variables.


Parameters

TypeNameDefaultDescription
Colorcolor[4]{0,0,0,255}string color
IntegerintOrigin0= 0 if the center change in time and 0 otherwise
IntegerintLength0= 0 if the center change in time and 0 otherwise
Realstroke02Stroke used to draw the lines
IntegerintStroke0 = 0 if the stroke change in time and 0 otherwise

Connectors

TypeNameDescription
ParentpLeftConnector of drawable components
ChildcLeftConnector of drawable components

Modelica definition

model Arrow "Draws an arrow" 
  
            extends Drawable(numIntColor = 0, numInt = (intLength*2+intOrigin*2+intStroke));
  import Modelica.Utilities.*;
  
  parameter TypesDef.Color color = {0,0,0,255} "string color";
  
  parameter Integer intOrigin = 0 
    "= 0 if the center change in time and 0 otherwise ";
  
  parameter Integer intLength = 0 
    "= 0 if the center change in time and 0 otherwise ";
 parameter Real stroke0 = 2 "Stroke used to draw the lines";
 input Real stroke( min = 1, max = 10) "Stroke used to draw the lines";
 parameter Integer intStroke = 0 
    " = 0 if the stroke change in time and 0 otherwise";
  input Real Origin[2] "position of the arrow origin";
  input Real Length[2] "horizontal and vertical components";
  
protected 
 Integer j;
  
initial algorithm 
  
 num :=Functions.processingFile(fComponent);
  Functions.arrow(fileName, "node"+String(pLeft.nodeReference), "node"+String(num), String(num), Origin, Length, color, intOrigin, intLength, stroke, intStroke);
  
equation 
 colors[1] = -1;
algorithm 
  vert[numInt+1] :=-1;
  j :=0;
 if (intOrigin>0 and intLength>0) then
   for i in 1:2 loop
     vert[i] := Origin[i];
     vert[i+2] := Length[i];
     j :=j + 1;
   end for;
 if (intStroke >0) then
   vert[j+1] :=stroke;
 end if;
 end if;
 if (intOrigin>0 and intLength==0) then
  for i in 1:2 loop
     vert[i] := Origin[i];
     j :=j + 1;
   end for;
 if (intStroke >0) then
   vert[j+1] :=stroke;
      
 end if;
 end if;
  
 if (intOrigin==0 and intLength>0) then
  for i in 1:2 loop
     vert[i] := Length[i];
     j :=j + 1;
   end for;
 if (intStroke >0) then
   vert[j+1] :=stroke;
      
 end if;
 end if;
  
equation 
 if (intStroke == 0) then
                          stroke = stroke0;
                                            end if;
end Arrow;

VirtualLabBuilder.src.ViewElements.Drawables.Trail VirtualLabBuilder.src.ViewElements.Drawables.Trail

Draws a trail

VirtualLabBuilder.src.ViewElements.Drawables.Trail

Information


                        

This class inherits from the Drawable class.
Creates a drawing element that displays a sequence of points at given coordinates of the hosting container. The point coordinates (point[:] variable) can be linked to the model variables.


Parameters

TypeNameDefaultDescription
IntegermaximumPoints100Maximum number of points to be drawn
IntegernSkip100Number of points to skip before plotting one
ColorlineColor[4]{0,0,0,255}Line color
booleanValueconnected"true"Whether to connect next point with the previous

Connectors

TypeNameDescription
ParentpLeftConnector of drawable components
ChildcLeftConnector of drawable components

Modelica definition

model Trail "Draws a trail" 
  
              extends Drawable(numIntColor = 0, numInt = 2);
  
  import Modelica.Utilities.*;
  parameter Integer maximumPoints = 100 "Maximum number of points to be drawn";
  parameter Integer nSkip = 100 "Number of points to skip before plotting one";
  parameter TypesDef.Color lineColor = {0,0,0,255} "Line color";
  parameter TypesDef.booleanValue connected = "true" 
    "Whether to connect next point with the previous";
  input Real point[2] "Coordinates x and y of the new point";
  
initial algorithm 
  
  num :=Functions.processingFile(fComponent);
  Functions.trail(fileName, "node"+String(pLeft.nodeReference), "node"+String(num), String(num),
  point, maximumPoints, nSkip, connected, lineColor);
  
algorithm 
  vert[numInt+1] :=-1;
 for i in 1:2 loop
     vert[i] := point[i];
 end for;
equation 
   colors[1] = -1;
  
end Trail;

VirtualLabBuilder.src.ViewElements.Drawables.TrailSet VirtualLabBuilder.src.ViewElements.Drawables.TrailSet

Draws a set of trails

VirtualLabBuilder.src.ViewElements.Drawables.TrailSet

Information


                        

Draws a set of elements of the Trail class.


Parameters

TypeNameDefaultDescription
IntegerN_trails2Number of trails
IntegermaximumPoints100Maximum number of points to be drawn
IntegernSkip1Number of points to skip before plotting one
ColorlineColor[4]{0,0,0,255}Line color
booleanValueconnected"true"Whether to connect next point with the previous

Connectors

TypeNameDescription
ParentparentConnector of the drawable elements
ChildchildConnector of the drawable elements

Modelica definition

model TrailSet "Draws a set of trails" 
  parameter Integer N_trails = 2 "Number of trails";
  parameter Integer maximumPoints = 100 "Maximum number of points to be drawn";
  parameter Integer nSkip = 1 "Number of points to skip before plotting one";
  parameter TypesDef.Color lineColor = {0,0,0,255} "Line color";
  parameter TypesDef.booleanValue connected = "true" 
    "Whether to connect next point with the previous";
  input Real point[N_trails, 2] "position of the point (x1, y1)";
  
 Trail trails[N_trails](each maximumPoints = maximumPoints, each nSkip = nSkip, each 
      lineColor =                                                                      lineColor, each 
      connected =                                                                                                  connected);
  VirtualLabBuilder.src.Interfaces.Parent parent 
    "Connector of the drawable elements";
  VirtualLabBuilder.src.Interfaces.Child child 
    "Connector of the drawable elements";
equation 
    connect(trails[1].pLeft,parent);
    connect(trails[N_trails].cLeft,child);
 for i in 1:N_trails-1 loop
    connect(trails[i].cLeft,trails[i+1].pLeft);
 end for;
 for i in 1:N_trails loop
    trails[i].point = point[i,1:2];
 end for;
end TrailSet;

VirtualLabBuilder.src.ViewElements.Drawables.PolygonSet VirtualLabBuilder.src.ViewElements.Drawables.PolygonSet

Draws a set of polygons

VirtualLabBuilder.src.ViewElements.Drawables.PolygonSet

Information


                        

Draws a set of elements of the Polygon class.


Parameters

TypeNameDefaultDescription
booleanValuefilled"true"True if the poligon is filled and false otherwise
ColorlineColorp[4]{0,0,0,255}The color used for the lines of the component
ColorfillColorp[4]{0,0,255,255}The color used to fill the component
IntegerintLineColor01 if the line color change in time and 0 otherwise
IntegerintFillColor01 if the filling color change in time and 0 otherwise
IntegerN2Number of polygons
IntegernPoints1Number of vertices
booleanValueclosed"true"True if the poligon is closed and false otherwise
IntegerintVertexesX[:]zeros(nPoints)intVertexesX[i] = 1 if coordinate x of vertex i changes in time
IntegerintVertexesY[:]zeros(nPoints)intVertexesY[i] = 1 if coordinate y of vertex i changes in time
Realstroke1Stroke used to draw the lines
Integergradient01 if there is a gradient in the filling color
Realp1[2]zeros(2)Position where the color gradient starts
Colorcolor1[4]{192,192,192,255}Color at point p1
Realp2[2]{0,10}Position where the color gradient finishes
Colorcolor2[4]{64,64,64,255}Color at point p2
booleanValuecyclic"true"True if the color gradient is cyclic

Connectors

TypeNameDescription
ParentparentConnector of the drawable elements
ChildchildConnector of the drawable elements

Modelica definition

model PolygonSet "Draws a set of polygons" 
    parameter TypesDef.booleanValue filled = "true" 
    "True if the poligon is filled and false otherwise";
  parameter TypesDef.Color lineColorp = {0,0,0,255} 
    "The color used for the lines of the component";
  parameter TypesDef.Color fillColorp = {0,0,255,255} 
    "The color used to fill the component";
  
  parameter Integer intLineColor = 0 
    "1 if the line color change in time and 0 otherwise";
  parameter Integer intFillColor = 0 
    "1 if the filling color change in time and 0 otherwise";
  parameter Integer N = 2 "Number of polygons";
  parameter Integer nPoints = 1 "Number of vertices";
  parameter TypesDef.booleanValue closed = "true" 
    "True if the poligon is closed and false otherwise";
  parameter Integer intVertexesX[:] = zeros(nPoints) 
    "intVertexesX[i] = 1 if coordinate x of vertex i changes in time";
  parameter Integer intVertexesY[:] = zeros(nPoints) 
    "intVertexesY[i] = 1 if coordinate y of vertex i changes in time";
  parameter Real stroke = 1 "Stroke used to draw the lines";
  
  input Real x[N, nPoints] "X coordinates of the polygon vertices";
  input Real y[N, nPoints] "y coordinates of the polygon vertices";
  parameter Integer gradient = 0 
    "1 if there is a gradient in the filling color";
  parameter Real p1[2] = zeros(2) "Position where  the color gradient starts";
  parameter TypesDef.Color color1 = {192, 192, 192, 255} "Color at point p1";
  parameter Real p2[2] = {0, 10} "Position where the color gradient finishes";
  parameter TypesDef.Color color2 = {64, 64, 64, 255} "Color at point p2";
  parameter TypesDef.booleanValue cyclic= "true" 
    "True if the color gradient is cyclic";
  
  input Real lineColor[N,4];
  input Real fillColor[N,4];
 Polygon polygons[N](each filled = filled,
   each intLineColor = intLineColor, each intFillColor = intFillColor, each 
      nPoints =                                                                       nPoints, each 
      closed =                                                                                               closed,
   each intVertexesX = intVertexesX,
   each intVertexesY = intVertexesY, each stroke = stroke, each gradient = gradient, each p1 = p1, each 
      color1 =                                                                                                  color1,
   each p2 = p2, each color2 = color2, each cyclic = cyclic, each lineColorp = lineColorp, each 
      fillColorp =                                                                                           fillColorp);
  VirtualLabBuilder.src.Interfaces.Parent parent 
    "Connector of the drawable elements";
  VirtualLabBuilder.src.Interfaces.Child child 
    "Connector of the drawable elements";
equation 
    connect(polygons[1].pLeft,parent);
    connect(polygons[N].cLeft,child);
 for i in 1:N-1 loop
    connect(polygons[i].cLeft, polygons[i+1].pLeft);
 end for;
  
 for i in 1:N loop
    polygons[i].x = x[i,1:nPoints];
    polygons[i].y = y[i,1:nPoints];
    if (intLineColor> 0) then
     polygons[i].lineColor = lineColor[i,:];
    else
     lineColor[i,:] = lineColorp;
    end if;
    if (intFillColor > 0) then
     polygons[i].fillColor = fillColor[i,:];
    else
     fillColor[i,:] = fillColorp;
    end if;
    
 end for;
end PolygonSet;

HTML-documentation generated by Dymola Tue Jul 24 18:58:13 2007.