Canvas (2D Graphics)¶
|
API
|
Classes | |
| class | cFigure |
| A lightweight graphical object for cCanvas. More... | |
| struct | cFigure::Point |
| Represents a point as (x,y) coordinates. More... | |
| struct | cFigure::Rectangle |
| Represents a rectangle as an (x,y,width,height) tuple. More... | |
| struct | cFigure::Color |
| Represents an RGB color. More... | |
| struct | cFigure::Font |
| Represents properties of a font. More... | |
| struct | cFigure::Transform |
| Homogeneous 2D transformation matrix. More... | |
| struct | cFigure::RGBA |
| Represents an RGBA pixel, for Pixmap manipulation. More... | |
| class | cFigure::Pixmap |
| A rectangular RGBA pixel array. More... | |
| class | cGroupFigure |
| A figure with the sole purpose of grouping its children, and no visual representation. More... | |
| class | cPanelFigure |
| Sets up an axis-aligned, unscaled coordinate system for children, canceling the effect of any transformation (scaling, rotation, etc.) inherited from ancestor figures. More... | |
| class | cAbstractLineFigure |
| Common base class for line figures. More... | |
| class | cLineFigure |
| A figure that displays a straight line segment. More... | |
| class | cArcFigure |
| A figure that displays an arc. More... | |
| class | cPolylineFigure |
| A figure that displays a line that consists of multiple connecting straight line segments or of a single smooth curve. More... | |
| class | cAbstractShapeFigure |
| Abstract base class for various shapes. More... | |
| class | cRectangleFigure |
| A figure that displays a rectangle, with optionally rounded corners. More... | |
| class | cOvalFigure |
| A figure that draws a circle or ellipse. More... | |
| class | cRingFigure |
| A figure that displays a ring, with explicitly controllable inner/outer radii. More... | |
| class | cPieSliceFigure |
| A figure that displays a pie slice, that is, a section of an axis-aligned disc or filled ellipse. More... | |
| class | cPolygonFigure |
| A figure that displays a (closed) polygon, determined by a sequence of points. More... | |
| class | cPathFigure |
| A figure that displays a "path", a complex shape or line modeled after SVG paths. More... | |
| class | cAbstractTextFigure |
| Abstract base class for figures that display text. Text may be multi-line. More... | |
| class | cTextFigure |
| A figure that displays text which is affected by zooming and transformations. More... | |
| class | cLabelFigure |
| A figure that displays text which is unaffected by zooming or transformations, except for its position. More... | |
| class | cAbstractImageFigure |
| Abstract base class for figures that display an image. More... | |
| class | cImageFigure |
| A figure that displays an image, typically an icon or a background image, loaded from the OMNeT++ image path. More... | |
| class | cIconFigure |
| A figure that displays an image, typically an icon or a background image, loaded from the OMNeT++ image path, in a non-zooming way. More... | |
| class | cPixmapFigure |
| A figure that displays an image that can be manipulated programmatically. More... | |
| class | cCanvas |
| Provides a scene graph based 2D drawing API for modules. More... | |
Predefined colors. | |
| enum | FontStyle |
| Font style constants: FONT_NONE, FONT_BOLD, etc. More... | |
| enum | LineStyle |
| Line style constants: LINE_SOLID, LINE_DOTTED, etc. More... | |
| enum | CapStyle |
| Line cap style constants: CAP_BUTT, CAP_SQUARE, etc. More... | |
| enum | JoinStyle |
| Line join style constants: JOIN_BEVEL, JOIN_MITER, etc. More... | |
| enum | FillRule |
| Fill rule constants: FILL_EVENODD, FILL_NONZERO. More... | |
| enum | Arrowhead |
| Arrowhead style constants: ARROW_NONE, ARROW_SIMPLE, etc. More... | |
| enum | Interpolation |
| Image interpolation mode constants: INTERPOLATION_NONE, INTERPOLATION_FAST, etc. More... | |
| enum | Anchor |
| Anchoring mode constants: ANCHOR_CENTER, ANCHOR_N, etc. More... | |
| enum | Alignment |
| Text alignment mode constants: ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER. More... | |
Description
OMNeT++ provides a 2D figure-based drawing API. The central classes are cFigure and cCanvas.
One can create figure objects (derived from cFigure), and place them on a canvas (cCanvas). Every module has its own canvas (cModule::getCanvas()), and one may create additional ones directly.
cFigure contains the following utility classes:
- cFigure::Point, cFigure::Rectangle, cFigure::Color, cFigure::Font, cFigure::Transform, cFigure::RGBA, cFigure::Pixmap.
Figures for grouping:
- cGroupFigure - for grouping other figures, no visual appearance
Line figures:
- cLineFigure - a single line segment
- cArcFigure - arc
- cPolylineFigure - (smoothed) polyline
Shape figures:
- cRectangleFigure - (rounded) rectangle
- cOvalFigure - circle or ellipse
- cRingFigure - ring
- cPieSliceFigure - pie slice
- cPolygonFigure - (smoothed) polygon
- cPathFigure - optionally filled path, modeled after SVG
Text figures:
- cTextFigure - text
- cLabelFigure - non-zooming text
Image figures:
- cImageFigure - image loaded from the image path
- cIconFigure - non-zooming image loaded from the image path
- cPixmapFigure - programmatically created image
Enumeration Type Documentation
◆ FontStyle
◆ LineStyle
| enum LineStyle |
Line style constants: LINE_SOLID, LINE_DOTTED, etc.
◆ CapStyle
| enum CapStyle |
Line cap style constants: CAP_BUTT, CAP_SQUARE, etc.
◆ JoinStyle
| enum JoinStyle |
Line join style constants: JOIN_BEVEL, JOIN_MITER, etc.
◆ FillRule
| enum FillRule |
Fill rule constants: FILL_EVENODD, FILL_NONZERO.
◆ Arrowhead
◆ Interpolation
| enum Interpolation |
Image interpolation mode constants: INTERPOLATION_NONE, INTERPOLATION_FAST, etc.
◆ Anchor
| enum Anchor |
Anchoring mode constants: ANCHOR_CENTER, ANCHOR_N, etc.
◆ Alignment
| enum Alignment |
Text alignment mode constants: ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER.
Generated on for API by