Appendix: Figure Definitions¶
This appendix provides a reference for defining figures in NED files.
Built-in Figure Types¶
The following table lists the figure types supported by OMNeT++.
@figure type |
C++ class |
|---|---|
line |
|
arc |
|
polyline |
|
rectangle |
|
oval |
|
ring |
|
pieslice |
|
polygon |
|
path |
|
text |
|
label |
|
image |
|
icon |
|
pixmap |
|
group |
Additional figure types can be defined with the
custom:``<type>`` syntax; see the FigureType below.
Attribute Types¶
This section lists the available attribute types and their value syntaxes.
- bool
- :
trueorfalse. - int
- :An integer.
- double
- :A real number.
- double01
- :A real number in the interval [0,1].
- degrees
- :A real number that will be interpreted as degrees.
- string
- :A string. It only needs to be enclosed in quotes if it contains a comma, a semicolon, an unmatched close parenthesis, or any other character that prevents it from being properly parsed as a property value.
- Anchor
- :
c,center,n,e,s,w,nw,ne,se,sw,start,middle, orend. The last three are only valid for text figures. - Arrowhead
- :
none,simple,triangle, orbarbed. - CapStyle
- :
butt,square, orround. - Color
- :A color in HTML format (#rrggbb), a color in HSB format (@hhssbb), or a valid SVG color name.
- Dimensions
- : width, heightSize given as width and height.
- FigureType
- :One of the built-in figure types (e.g.
lineorarc, see Built-in Figure Types), or a figure type registered with Register_Figure(). - FillRule
- :
evenoddornonzero. - Font
- : typeface, size, styleAll three items are optional. size is the font size in points. style is a space-separated list of zero or more of the following words:
normal,bold,italic,underline. - ImageName
- :The name of an image.
- Interpolation
- :
none,fast, orbest. - JoinStyle
- :
bevel,miter, orround. - LineStyle
- :
solid,dotted, ordashed. - Point
- : x, yA point with coordinates \((x,y)\).
- Point2
- : x1, y1, x2, y2Two points: \((x1,y1)\) and \((x2,y2)\).
- PointList
- : x1, y1, x2, y2, x3, y3…A list of points such as \((x1,y1)\), \((x2,y2)\), \((x3,y3)\), etc.
- Rectangle
- : x, y, width, heightA rectangle given by its top-left corner and dimensions.
- TagList
- : tag1, tag2, tag3…A list of string tags.
- Tint
- : Color, double01Specifies the tint color and the amount of tinting for images.
- Transform
- :One or more transform steps. A step can be one of the following:
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\))
Figure Attributes¶
This section lists the attributes accepted by individual figure types. Types enclosed in parentheses are abstract types that 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>;clipChildren=<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
angle=<degrees>; - 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>