OMNeT++ Simulation Library
5.6.1
|
#include <ccanvas.h>
Sets up an axis-aligned, unscaled coordinate system for children, canceling the effect of any transformation (scaling, rotation, etc.) inherited from ancestor figures.
This allows pixel-based positioning of children, and makes them immune to zooming. The anchorPoint in the coordinate system is mapped to the position of the panel figure. Setting a transformation on the panel figure itself allows rotation, scaling, and skewing of the coordinate system. The anchorPoint is affected by this transformation.
The panel figure itself has no visual appearance.
Public Member Functions | |
Constructors, destructor, assignment. | |
cPanelFigure (const char *name=nullptr) | |
cPanelFigure (const cPanelFigure &other) | |
cPanelFigure & | operator= (const cPanelFigure &other) |
Redefined cObject and cFigure member functions. | |
virtual cPanelFigure * | dup () const override |
virtual std::string | str () const override |
virtual const char * | getRendererClassName () const override |
virtual void | updateParentTransform (Transform &transform) override |
virtual void | move (double dx, double dy) override |
virtual void | moveLocal (double dx, double dy) override |
Figure attributes | |
virtual const Point & | getPosition () const |
virtual void | setPosition (const Point &position) |
virtual const Point & | getAnchorPoint () const |
virtual void | setAnchorPoint (const Point &anchorPoint) |
Public Member Functions inherited from cFigure | |
cFigure (const char *name=nullptr) | |
cFigure (const cFigure &other) | |
virtual | ~cFigure () |
cFigure & | operator= (const cFigure &other) |
virtual void | forEachChild (cVisitor *v) override |
int | getId () const |
virtual bool | isVisible () const |
virtual void | setVisible (bool visible) |
virtual const Transform & | getTransform () const |
virtual void | setTransform (const Transform &transform) |
virtual void | resetTransform () |
virtual double | getZIndex () const |
virtual void | setZIndex (double zIndex) |
virtual double | getEffectiveZIndex () const |
virtual const char * | getTooltip () const |
virtual void | setTooltip (const char *tooltip) |
virtual cObject * | getAssociatedObject () const |
virtual void | setAssociatedObject (cObject *obj) |
virtual const char * | getTags () const |
virtual void | setTags (const char *tags) |
virtual cFigure * | getParentFigure () const |
virtual cCanvas * | getCanvas () const |
virtual int | getNumFigures () const |
virtual cFigure * | getFigure (int pos) const |
virtual cFigure * | getFigure (const char *name) const |
virtual int | findFigure (const char *name) const |
virtual int | findFigure (const cFigure *figure) const |
virtual bool | containsFigures () const |
virtual cFigure * | findFigureRecursively (const char *name) const |
virtual cFigure * | getFigureByPath (const char *path) const |
virtual void | addFigure (cFigure *figure) |
virtual void | addFigure (cFigure *figure, int pos) |
_OPPDEPRECATED void | addFigureAbove (cFigure *figure, cFigure *referenceFigure) |
_OPPDEPRECATED void | addFigureBelow (cFigure *figure, cFigure *referenceFigure) |
virtual cFigure * | removeFigure (cFigure *figure) |
virtual cFigure * | removeFigure (int pos) |
virtual cFigure * | removeFromParent () |
virtual bool | isAbove (const cFigure *figure) const |
virtual bool | isBelow (const cFigure *figure) const |
virtual void | insertAbove (cFigure *referenceFigure) |
virtual void | insertBelow (cFigure *referenceFigure) |
virtual void | insertAfter (const cFigure *referenceFigure) |
virtual void | insertBefore (const cFigure *referenceFigure) |
virtual void | raiseAbove (cFigure *figure) |
virtual void | lowerBelow (cFigure *figure) |
virtual void | raiseToTop () |
virtual void | lowerToBottom () |
virtual cFigure * | dupTree () const |
virtual void | translate (double dx, double dy) |
virtual void | scale (double s) |
virtual void | scale (double sx, double sy) |
virtual void | scale (double sx, double sy, double cx, double cy) |
virtual void | scale (double sx, double sy, const Point &c) |
virtual void | rotate (double phi) |
virtual void | rotate (double phi, double cx, double cy) |
virtual void | rotate (double phi, const Point &c) |
virtual void | skewx (double coeff) |
virtual void | skewy (double coeff) |
virtual void | skewx (double coeff, double cy) |
virtual void | skewy (double coeff, double cx) |
virtual void | refreshDisplay () |
Public Member Functions inherited from cOwnedObject | |
cOwnedObject () | |
cOwnedObject (const char *name, bool namepooling=true) | |
cOwnedObject (const cOwnedObject &obj) | |
virtual | ~cOwnedObject () |
cOwnedObject & | operator= (const cOwnedObject &o) |
virtual void | parsimPack (cCommBuffer *buffer) const override |
virtual void | parsimUnpack (cCommBuffer *buffer) override |
virtual cObject * | getOwner () const override |
virtual bool | isOwnedObject () const override |
virtual bool | isSoftOwner () const |
Public Member Functions inherited from cNamedObject | |
cNamedObject () | |
cNamedObject (const char *name, bool namepooling=true) | |
cNamedObject (const cNamedObject &obj) | |
virtual | ~cNamedObject () |
cNamedObject & | operator= (const cNamedObject &o) |
virtual void | setName (const char *s) |
virtual const char * | getName () const override |
virtual void | setNamePooling (bool b) |
virtual bool | getNamePooling () |
Public Member Functions inherited from cObject | |
cObject () | |
cObject (const cObject &other) | |
virtual | ~cObject () |
virtual const char * | getClassName () const |
bool | isName (const char *s) const |
virtual const char * | getFullName () const |
virtual std::string | getFullPath () const |
const cObject * | getThisPtr () const |
virtual _OPPDEPRECATED std::string | info () const |
virtual _OPPDEPRECATED std::string | detailedInfo () const |
cObject * | findObject (const char *name, bool deep=true) |
void | copyNotSupported () const |
Protected Member Functions | |
virtual const char ** | getAllowedPropertyKeys () const override |
virtual void | parse (cProperty *property) override |
Protected Member Functions inherited from cObject | |
virtual void | take (cOwnedObject *obj) |
virtual void | drop (cOwnedObject *obj) |
void | dropAndDelete (cOwnedObject *obj) |
Additional Inherited Members | |
Public Types inherited from cFigure | |
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... | |
Static Public Member Functions inherited from cOwnedObject | |
static long | getTotalObjectCount () |
static long | getLiveObjectCount () |
static void | resetObjectCounters () |
static cDefaultList * | getDefaultOwner () |
Static Public Attributes inherited from cFigure | |
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] |
|
overrideprotectedvirtual |
Returns the list of allowed keys in @figure properties with this figure type, in a nullptr-terminated array of const char* elements. This method is invoked e.g. from parse(), in order to be able to issue error messages for invalid keys in the property. Note that property keys starting with "x-" are already allowed by default. Custom figure classes usually need to override this method together with parse(); see the source code of the library classes for example implementations.
Reimplemented from cFigure.
|
overrideprotectedvirtual |
This method is invoked by the simulation library to initialize the figure from a @figure NED property. Custom figure classes usually need to override this method (and call the super class' similar method in it).
Note: When overriding parse(), it is usually also necessary to override getAllowedPropertyKeys(), in order to allow new keys in the @figure property.
Reimplemented from cFigure.
|
inlineoverridevirtual |
|
overridevirtual |
Returns a one-line string with the most characteristic data of the figure.
Reimplemented from cFigure.
|
inlineoverridevirtual |
Returns the name of the class responsible for rendering this figure. Renderer classes are specific to, and are usually implemented as part of, the graphical user interface library (Tkenv or Qtenv).
Implements cFigure.
|
inlineoverridevirtual |
Change the position of this figure and the figures in its subtree by the given x and y deltas. The implementation of this method calls moveLocal() on this figure, then move() recursively on child figures.
Reimplemented from cFigure.
|
inlineoverridevirtual |
Change the figure's position by the given x and y deltas. Child figures will not be affected.
Implements cFigure.
|
inlinevirtual |
By default, the (0,0) point in cPanelFigure's coordinate system will be mapped to the given position (i.e. getPosition()) in the parent figure's coordinate system. By setting an anchorPoint, one can change (0,0) to an arbitrary point. E.g. by setting anchorPoint=(100,0), the (100,0) point will be mapped to the given position, i.e. panel contents will appear 100 pixels to the left (given there are no transforms set). The translation part of the local transform is cancelled out because the anchorPoint is subject to the transformation of the panel figure the same way as the child figures.