[Prev] [Next] [TOC] [Chapters]
25 Appendix G: Figure Definitions
This appendix provides a reference to defining figures in NED files.
25.1 Built-in Figure Types
The following table lists the figure types supported by OMNeT++.
Additional figure types can be defined with the
custom:<type> syntax; see FigureType below.
25.2 Attribute Types
This section lists what attribute types exist and their value syntaxes.
- bool : 
true or false.
 - int : 
An integer.
 - double : 
A real number.
 - double01 : 
A real number in the [0,1] interval.
 - degrees : 
A real number that will be interpreted as degrees.
 - string : 
A string. It only needs to be enclosed in quotes if it contains comma,
semicolon, unmatched close parenthesis or other character that prevents
it from being parsed properly as a property value.
 - Anchor : 
c, center, n, e, s, w, nw,
ne, se, sw, start, middle, or end.
The last three are only valid for text figures.
 - Arrowhead : 
none, simple, triangle, or barbed.
 - CapStyle : 
butt, square, or round.
 - Color : 
A color in HTML format (#rrggbb), a color in
HSB format (@hhssbb), or a valid SVG color name.
 - Dimensions : width, height 
Size given as width and height.
 - FigureType : 
One of the built-in figure types (e.g. line or arc, see
[25.1]), or a figure type registered
with Register_Figure().
 - FillRule : 
evenodd or nonzero.
 - Font : typeface, size, style 
All three items are optional. size is the font size in points.
style is space-sparated list of zero or more of the following
words: normal, bold, italic, underline.
 - ImageName : 
The name of an image.
 - Interpolation : 
none, fast, or best.
 - JoinStyle : 
bevel, miter, or round.
 - LineStyle : 
solid, dotted, or dashed.
 - Point : x, y 
A point with (x,y) coordinates.
 - Point2 : x1, y1, x2, y2 
Two points: (x1,y1) and (x2,y2).
 - PointList : x1, y1, x2, y2, x3, y3... 
A list of the (x1,y1), (x2,y2), (x3,y3), etc. points.
 - Rectangle : x, y, width, height 
A rectangle given with its top-left corner and dimensions.
 - TagList : tag1, tag2, tag3... 
A list of string tags.
 - Tint : Color, double01 
Specifies tint color and the amount of tinting for images.
 - Transform : 
One or more transform steps. A step is one of: 
translate(x, y), 
rotate(deg), 
rotate(deg, centerx, centery), 
scale(s), scale(sx, sy), 
scale(s, centerx, centery), 
scale(sx, sy, centerx, centery), 
skewx(coeff), 
skewx(coeff, centery), 
skewy(coeff), 
skewy(coeff, centerx), 
matrix(a, b, c, d, t1, t2)
 
25.3 Figure Attributes
This section lists what attributes are accepted by individual figure types.
Types enclosed in parentheses are abstract types which cannot be used
directly; their sole purpose is to provide a base for more specialized
types.
- (figure) : 
    type=<FigureType>;
    visible=<bool>;
    tags=<TagList>;
    childZ=<int>;
    transform=<Transform>;
 - (abstractLine) : figure 
    lineColor=<Color>;
    lineStyle=<LineStyle>;
    lineWidth=<double>;
    lineOpacity=<double>;
    capStyle=<CapStyle>;
    startArrowhead=<Arrowhead>;
    endArrowhead=<Arrowhead>;
    zoomLineWidth=<bool>;
 - line : abstractLine 
    points=<Point2>
 - arc : abstractLine 
    bounds=<Rectangle>
    pos=<Point>;
    size=<Dimensions>;
    anchor=<Anchor>;
    startAngle=<degrees>;
    endAngle=<degrees>
 - polyline : abstractLine 
    points=<PointList>;
    smooth=<bool>;
    joinstyle=<JoinStyle>
 - (abstractShape) : figure 
    lineColor=<Color>;
    fillColor=<Color>;
    lineStyle=<LineStyle>;
    lineWidth=<double>;
    lineOpacity=<double01>;
    fillOpacity=<double01>;
    zoomLineWidth=<bool>
 - rectangle : abstractShape 
    bounds=<Rectangle>
    pos=<Point>;
    size=<Dimensions>;
    anchor=<Anchor>;
    cornerRadius=<double>|<Dimensions>
 - oval : abstractShape 
    bounds=<Rectangle>
    pos=<Point>;
    size=<Dimensions>;
    anchor=<Anchor>
 - ring : abstractShape 
    bounds=<Rectangle>
    pos=<Point>;
    size=<Dimensions>;
    anchor=<Anchor>;
    innerSize=<Dimensions>
 - pieslice : abstractShape 
    bounds=<Rectangle>
    pos=<Point>;
    size=<Dimensions>;
    anchor=<Anchor>;
    startAngle=<degrees>;
    endAngle=<degrees>
 - polygon : abstractShape 
    points=<PointList>;
    smooth=<bool>;
    joinStyle=<JoinStyle>;
    fillRule=<FillRule>
 - path : abstractShape 
    path=<string>;
    offset=<Point>;
    joinStyle=<JoinStyle>;
    capStyle=<CapStyle>;
    fillRule=<FillRule>
 - (abstractText) : figure 
    pos=<Point>;
    anchor=<Anchor>
    text=<string>;
    font=<Font>;
    opacity=<double01>;
    color=<Color>;
 - label : abstractText
 - text : abstractText
 - (abstractImage) : figure 
    bounds=<Rectangle>
    pos=<Point>;
    size=<Dimensions>;
    anchor=<Anchor>;
    interpolation=<Interpolation>;
    opacity=<double01>;
    tint=<Tint>
 - image : abstractImage 
    image=<ImageName>
 - icon : abstractImage 
    image=<ImageName>
 - pixmap : abstractImage 
    resolution=<Dimensions>
 
[Prev] [Next] [TOC] [Chapters]