cPixmapFigure Class Reference¶

API: cPixmapFigure Class Reference
API
cPixmapFigure Class Reference
Inheritance diagram for cPixmapFigure:
[legend]

Public Member Functions

Constructors, destructor, assignment.
Redefined cObject and cFigure member functions.
virtual cPixmapFiguredup () const override
virtual std::string str () const override
virtual void parse (cProperty *property) override
virtual const char * getRendererClassName () const override
Pixmap manipulation
virtual const PixmapgetPixmap () const
virtual void setPixmap (const Pixmap &pixmap)
virtual int getPixmapHeight () const
virtual int getPixmapWidth () const
virtual void setPixmapSize (int width, int height, const RGBA &fill)
virtual void setPixmapSize (int width, int height, const Color &color, double opacity)
virtual void fillPixmap (const RGBA &fill)
virtual void fillPixmap (const Color &color, double opacity)
virtual const RGBA getPixel (int x, int y) const
virtual void setPixel (int x, int y, const RGBA &argb)
virtual void setPixel (int x, int y, const Color &color, double opacity=1.0)
virtual const Color getPixelColor (int x, int y) const
virtual void setPixelColor (int x, int y, const Color &color)
virtual double getPixelOpacity (int x, int y) const
virtual void setPixelOpacity (int x, int y, double opacity)
Public Member Functions inherited from cAbstractImageFigure
virtual void moveLocal (double dx, double dy) override
virtual const PointgetPosition () const
virtual void setPosition (const Point &position)
virtual Anchor getAnchor () const
virtual void setAnchor (Anchor anchor)
virtual double getWidth () const
virtual void setWidth (double width)
virtual double getHeight () const
virtual void setHeight (double height)
virtual void setSize (double width, double height)
virtual Rectangle getBounds () const
virtual Interpolation getInterpolation () const
virtual void setInterpolation (Interpolation interpolation)
virtual double getOpacity () const
virtual void setOpacity (double opacity)
virtual const ColorgetTintColor () const
virtual void setTintColor (const Color &tintColor)
virtual double getTintAmount () const
virtual void setTintAmount (double tintAmount)
Public Member Functions inherited from cFigure
 cFigure (const char *name=nullptr)
 cFigure (const cFigure &other)
virtual ~cFigure ()
cFigureoperator= (const cFigure &other)
virtual void forEachChild (cVisitor *v) override
int getId () const
virtual bool isVisible () const
virtual void setVisible (bool visible)
virtual const TransformgetTransform () 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 cObjectgetAssociatedObject () const
virtual void setAssociatedObject (cObject *obj)
virtual const char * getTags () const
virtual void setTags (const char *tags)
virtual cFiguregetParentFigure () const
virtual cCanvasgetCanvas () const
virtual int getNumFigures () const
virtual cFiguregetFigure (int pos) const
virtual cFiguregetFigure (const char *name) const
virtual int findFigure (const char *name) const
virtual int findFigure (const cFigure *figure) const
virtual bool containsFigures () const
virtual cFigurefindFigureRecursively (const char *name) const
virtual cFiguregetFigureByPath (const char *path) const
virtual void addFigure (cFigure *figure)
virtual void addFigure (cFigure *figure, int pos)
virtual cFigureremoveFigure (cFigure *figure)
virtual cFigureremoveFigure (int pos)
virtual cFigureremoveFromParent ()
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 cFiguredupTree () const
virtual void move (double dx, double dy)
virtual void refreshDisplay ()
Public Member Functions inherited from cOwnedObject
 cOwnedObject ()
 cOwnedObject (const char *name, bool namepooling=true)
 cOwnedObject (const cOwnedObject &obj)
virtual ~cOwnedObject ()
cOwnedObjectoperator= (const cOwnedObject &o)
virtual void parsimPack (cCommBuffer *buffer) const override
virtual void parsimUnpack (cCommBuffer *buffer) override
virtual cObjectgetOwner () const override
virtual bool isOwnedObject () const override
Public Member Functions inherited from cNamedObject
 cNamedObject ()
 cNamedObject (const char *name, bool namepooling=true)
 cNamedObject (const cNamedObject &obj)
virtual ~cNamedObject ()
cNamedObjectoperator= (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)=default
virtual ~cObject ()
virtual const char * getClassName () const
bool isName (const char *s) const
virtual const char * getFullName () const
virtual std::string getFullPath () const
virtual std::string getClassAndFullName () const
virtual std::string getClassAndFullPath () const
const cObjectgetThisPtr () const
virtual std::ostream & printOn (std::ostream &os) const
virtual bool isSoftOwner () const
cObjectfindObject (const char *name, bool deep=true)
virtual cClassDescriptorgetDescriptor () const
void copyNotSupported () const

Protected Member Functions

virtual const char ** getAllowedPropertyKeys () const override
Protected Member Functions inherited from cObject
virtual void take (cOwnedObject *obj)
virtual void drop (cOwnedObject *obj)
void dropAndDelete (cOwnedObject *obj)

Additional Inherited Members

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...
Static Public Member Functions inherited from cOwnedObject
static long getTotalObjectCount ()
static long getLiveObjectCount ()
static void resetObjectCounters ()
static cSoftOwnergetOwningContext ()

Description

A figure that displays an image that can be manipulated programmatically.

A pixmap figure may be used to display e.g. a heat map. Support for scaling and various interpolation modes are useful here.

See also
cFigure::Pixmap

Member Function Documentation

◆ getAllowedPropertyKeys()

virtual const char ** getAllowedPropertyKeys ( ) const
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 cAbstractImageFigure.

◆ dup()

virtual cPixmapFigure * dup ( ) const
inlineoverridevirtual

Clones the figure, ignoring its child figures. (The copy will have no children.) To clone a figure together with its figure subtree, use dupTree().

Reimplemented from cAbstractImageFigure.

◆ str()

virtual std::string str ( ) const
overridevirtual

Returns a one-line string with the most characteristic data of the figure.

Reimplemented from cFigure.

◆ parse()

virtual void parse ( cProperty * property)
overridevirtual

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

◆ getRendererClassName()

virtual const char * getRendererClassName ( ) const
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 e.g. Qtenv.

Implements cFigure.

◆ getPixmap()

virtual const Pixmap & getPixmap ( ) const
inlinevirtual

Returns the displayed pixmap. It must not be modified directly (e.g. after casting away the const modifier), because the GUI would not be notified about the change. Use the pixel manipulation methods of the figure class, or make a copy of the pixmap, update it, and then set it back on the figure using setPixmap().

◆ setPixmap()

virtual void setPixmap ( const Pixmap & pixmap)
virtual

Sets the pixmap to be displayed. Note that this involves copying the pixmap data.

◆ getPixmapHeight()

virtual int getPixmapHeight ( ) const
inlinevirtual

Delegates to the similar method of the contained Pixmap instance.

◆ getPixmapWidth()

virtual int getPixmapWidth ( ) const
inlinevirtual

Delegates to the similar method of the contained Pixmap instance.

◆ setPixmapSize() [1/2]

virtual void setPixmapSize ( int width,
int height,
const RGBA & fill )
virtual

Delegates to the similar method of the contained Pixmap instance.

◆ setPixmapSize() [2/2]

virtual void setPixmapSize ( int width,
int height,
const Color & color,
double opacity )
virtual

Delegates to the similar method of the contained Pixmap instance.

◆ fillPixmap() [1/2]

virtual void fillPixmap ( const RGBA & fill)
virtual

Delegates to the similar method of the contained Pixmap instance.

◆ fillPixmap() [2/2]

virtual void fillPixmap ( const Color & color,
double opacity )
virtual

Delegates to the similar method of the contained Pixmap instance.

◆ getPixel()

virtual const RGBA getPixel ( int x,
int y ) const
inlinevirtual

Delegates to the similar method of the contained Pixmap instance.

◆ setPixel() [1/2]

virtual void setPixel ( int x,
int y,
const RGBA & argb )
virtual

Delegates to the similar method of the contained Pixmap instance.

◆ setPixel() [2/2]

virtual void setPixel ( int x,
int y,
const Color & color,
double opacity = 1.0 )
virtual

Delegates to the similar method of the contained Pixmap instance.

◆ getPixelColor()

virtual const Color getPixelColor ( int x,
int y ) const
inlinevirtual

Delegates to the similar method of the contained Pixmap instance.

◆ setPixelColor()

virtual void setPixelColor ( int x,
int y,
const Color & color )
virtual

Delegates to the similar method of the contained Pixmap instance.

◆ getPixelOpacity()

virtual double getPixelOpacity ( int x,
int y ) const
inlinevirtual

Delegates to the similar method of the contained Pixmap instance.

◆ setPixelOpacity()

virtual void setPixelOpacity ( int x,
int y,
double opacity )
virtual

Delegates to the similar method of the contained Pixmap instance.