OMNeT++ Simulation Library  6.0.3
Canvas (2D Graphics)

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:

Figures for grouping:

Line figures:

Shape figures:

Text figures:

Image figures:

Classes

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  cFigure
 A lightweight graphical object for cCanvas. 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...
 
enum  
 
static const Color BLACK
 
static const Color WHITE
 
static const Color GREY
 
static const Color RED
 
static const Color GREEN
 
static const Color BLUE
 
static const Color YELLOW
 
static const Color CYAN
 
static const Color MAGENTA
 
static const int NUM_GOOD_DARK_COLORS
 
static const int NUM_GOOD_LIGHT_COLORS
 
static const Color GOOD_DARK_COLORS [14]
 
static const Color GOOD_LIGHT_COLORS [10]
 
virtual void validatePropertyKeys (cProperty *property) const
 
virtual bool isAllowedPropertyKey (const char *key) const
 
virtual cFiguregetRootFigure () const
 
void fireStructuralChange ()
 
void fireTransformChange ()
 
void fireGeometryChange ()
 
void fireVisualChange ()
 
void fireInputDataChange ()
 
virtual void fire (uint8_t flags)
 
virtual void hashTo (cHasher &hasher) const
 
static Point parsePoint (cProperty *property, const char *key, int index)
 
static std::vector< PointparsePoints (cProperty *property, const char *key)
 
static Rectangle parseBounds (cProperty *property, const Rectangle &defaults)
 
static Transform parseTransform (cProperty *property, const char *key)
 
static Font parseFont (cProperty *property, const char *key)
 
static Rectangle computeBoundingBox (const Point &position, const Point &size, double ascent, Anchor anchor)
 
static void concatArrays (const char **dest, const char **first, const char **second)
 
static Point parsePoint (const char *s)
 
static Rectangle parseRectangle (const char *s)
 
static Transform parseTransform (const char *s)
 
static Font parseFont (const char *s)
 
static Color parseColor (const char *s)
 
static bool parseBool (const char *s)
 
static LineStyle parseLineStyle (const char *s)
 
static CapStyle parseCapStyle (const char *s)
 
static JoinStyle parseJoinStyle (const char *s)
 
static FillRule parseFillRule (const char *s)
 
static Arrowhead parseArrowhead (const char *s)
 
static Interpolation parseInterpolation (const char *s)
 
static Anchor parseAnchor (const char *s)
 
static Alignment parseAlignment (const char *s)
 
virtual void updateParentTransform (Transform &transform)
 
virtual void callRefreshDisplay ()
 
uint8_t getLocalChangeFlags () const
 
uint8_t getSubtreeChangeFlags () const
 
void clearChangeFlags ()
 
void refreshTagBitsRec (cCanvas *ownerCanvas)
 
int64_t getTagBits () const
 
void setTagBits (uint64_t tagBits)
 
uint32_t getHash () const
 
void clearCachedHash ()
 

Enumeration Type Documentation

◆ FontStyle

enum FontStyle

Font style constants: FONT_NONE, FONT_BOLD, etc.

◆ 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

enum Arrowhead

Arrowhead style constants: ARROW_NONE, ARROW_SIMPLE, etc.

◆ 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.