QtPdWidgets  2.3.1
Classes | Public Types | Public Member Functions | Protected Member Functions | Properties | Private Member Functions | Private Attributes | List of all members
Pd::Image Class Reference

Image display widget. More...

#include <Image.h>

Inheritance diagram for Pd::Image:
Inheritance graph
[legend]
Collaboration diagram for Pd::Image:
Collaboration graph
[legend]

Classes

struct  Impl
 

Public Types

enum  Axis { X, Y }
 
typedef QHash< int, QPixmap > PixmapHash
 Pixmap hash type. More...
 

Public Member Functions

 Image (QWidget *parent=0)
 Constructor. More...
 
virtual ~Image ()
 Destructor. More...
 
void clearData ()
 
int getValue () const
 
void setValue (int)
 Sets the current #value. More...
 
void setPixmapHash (const PixmapHash *)
 Sets the PixmapHash to use. More...
 
const QPixmap & getDefaultPixmap () const
 
void setDefaultPixmap (const QPixmap &)
 Sets the defaultPixmap. More...
 
void resetDefaultPixmap ()
 Resets the defaultPixmap. More...
 
qreal getAngle () const
 
void setAngle (qreal)
 Sets the angle to use. More...
 
void resetAngle ()
 Resets the angle. More...
 
bool hasScaledContents () const
 
void setScaledContents (bool)
 Sets whether to scale contents (scaledContents). More...
 
void resetScaledContents ()
 Resets the scaledContents. More...
 
void clearTransformations ()
 
void translate (qreal, qreal)
 
void translate (Axis axis, PdCom::Variable pv, const PdCom::Selector &selector={}, const QtPdCom::Transmission &=QtPdCom::event_mode, double scale=1.0, double offset=0.0, double tau=0.0)
 
void translate (Axis axis, PdCom::Process *p, const QString &path, const PdCom::Selector &selector={}, const QtPdCom::Transmission &=QtPdCom::event_mode, double scale=1.0, double offset=0.0, double tau=0.0)
 
void rotate (qreal)
 
void rotate (PdCom::Variable pv, const PdCom::Selector &selector={}, const QtPdCom::Transmission &=QtPdCom::event_mode, double scale=1.0, double offset=0.0, double tau=0.0)
 
void rotate (PdCom::Process *process, const QString &path, const PdCom::Selector &selector={}, const QtPdCom::Transmission &=QtPdCom::event_mode, double scale=1.0, double offset=0.0, double tau=0.0)
 

Protected Member Functions

bool event (QEvent *) override
 Event handler. More...
 
void paintEvent (QPaintEvent *) override
 

Properties

QPixmap defaultPixmap
 
qreal angle
 
bool scaledContents
 

Private Member Functions

PD_PRIVATE void newValues (std::chrono::nanoseconds) override
 This virtual method is called by the ProcessVariable, if its value changes. More...
 

Private Attributes

struct PD_PRIVATE Impl
 
std::unique_ptr< Implimpl
 

Detailed Description

Image display widget.

This widget can display images from a hash, depending on the attached process variable's value.

Todo:
Default image property.

Member Typedef Documentation

◆ PixmapHash

typedef QHash<int, QPixmap> Pd::Image::PixmapHash

Pixmap hash type.

The used pixmap hash shall contain a pixmap for every value to display.

Member Enumeration Documentation

◆ Axis

Enumerator

Constructor & Destructor Documentation

◆ Image()

Image::Image ( QWidget *  parent = 0)

Constructor.

Parameters
parentParent widget.

References Impl.

◆ ~Image()

Image::~Image ( )
virtual

Destructor.

References clearTransformations().

Member Function Documentation

◆ clearData()

void Image::clearData ( )

References impl.

◆ clearTransformations()

void Image::clearTransformations ( )

References impl.

Referenced by ~Image().

◆ event()

bool Image::event ( QEvent *  event)
overrideprotected

Event handler.

Parameters
eventPaint event flags.

References impl.

Referenced by paintEvent().

◆ getAngle()

qreal Image::getAngle ( ) const

References impl.

◆ getDefaultPixmap()

const QPixmap & Image::getDefaultPixmap ( ) const

References impl.

◆ getValue()

int Image::getValue ( ) const
inline
Returns
The current process #value.

References impl.

◆ hasScaledContents()

bool Image::hasScaledContents ( ) const

References impl.

◆ newValues()

void Image::newValues ( std::chrono::nanoseconds  )
overrideprivate

This virtual method is called by the ProcessVariable, if its value changes.

References setValue().

◆ paintEvent()

void Image::paintEvent ( QPaintEvent *  event)
overrideprotected

References event(), and impl.

◆ resetAngle()

void Image::resetAngle ( )

Resets the angle.

References setAngle().

◆ resetDefaultPixmap()

void Image::resetDefaultPixmap ( )

Resets the defaultPixmap.

References setDefaultPixmap().

◆ resetScaledContents()

void Image::resetScaledContents ( )

Resets the scaledContents.

References setScaledContents().

◆ rotate() [1/3]

void Image::rotate ( qreal  alpha)

References impl.

◆ rotate() [2/3]

void Image::rotate ( PdCom::Variable  pv,
const PdCom::Selector &  selector = {},
const QtPdCom::Transmission &  transmission = QtPdCom::event_mode,
double  scale = 1.0,
double  offset = 0.0,
double  tau = 0.0 
)
Parameters
pvProcess variable.
selectorSelector.
transmissionTransmission.
scaleScale factor.
offsetOffset (applied after scaling).
tauPT1 filter time constant. A value less or equal to 0.0 means, that no filter is applied.

References impl.

◆ rotate() [3/3]

void Image::rotate ( PdCom::Process *  process,
const QString &  path,
const PdCom::Selector &  selector = {},
const QtPdCom::Transmission &  transmission = QtPdCom::event_mode,
double  scale = 1.0,
double  offset = 0.0,
double  tau = 0.0 
)
Parameters
processProcess.
pathVariable path.
selectorSelector.
transmissionTransmission.
scaleScale factor.
offsetOffset (applied after scaling).
tauPT1 filter time constant. A value less or equal to 0.0 means, that no filter is applied.

References impl.

◆ setAngle()

void Image::setAngle ( qreal  a)

Sets the angle to use.

References impl.

Referenced by resetAngle().

◆ setDefaultPixmap()

void Image::setDefaultPixmap ( const QPixmap &  p)

Sets the defaultPixmap.

References impl.

Referenced by resetDefaultPixmap().

◆ setPixmapHash()

void Image::setPixmapHash ( const PixmapHash ph)

Sets the PixmapHash to use.

References impl.

◆ setScaledContents()

void Image::setScaledContents ( bool  scale)

Sets whether to scale contents (scaledContents).

References impl.

Referenced by resetScaledContents().

◆ setValue()

void Image::setValue ( int  value)

Sets the current #value.

If the value has changed, updatePixmap() is called.

References impl.

Referenced by newValues().

◆ translate() [1/3]

void Image::translate ( qreal  x,
qreal  y 
)

References impl.

◆ translate() [2/3]

void Image::translate ( Axis  axis,
PdCom::Variable  pv,
const PdCom::Selector &  selector = {},
const QtPdCom::Transmission &  transmission = QtPdCom::event_mode,
double  scale = 1.0,
double  offset = 0.0,
double  tau = 0.0 
)
Parameters
axisTranslation axis.
pvProcess variable.
selectorSelector.
transmissionTransmission.
scaleScale factor.
offsetOffset (applied after scaling).
tauPT1 filter time constant. A value less or equal to 0.0 means, that no filter is applied.

References impl.

◆ translate() [3/3]

void Image::translate ( Axis  axis,
PdCom::Process *  p,
const QString &  path,
const PdCom::Selector &  selector = {},
const QtPdCom::Transmission &  transmission = QtPdCom::event_mode,
double  scale = 1.0,
double  offset = 0.0,
double  tau = 0.0 
)
Parameters
axisTranslation axis.
pProcess variable.
pathVariable path.
selectorSelector.
transmissionTransmission.
scaleScale factor.
offsetOffset (applied after scaling).
tauPT1 filter time constant. A value less or equal to 0.0 means, that no filter is applied.

References impl.

Member Data Documentation

◆ Impl

struct PD_PRIVATE Pd::Image::Impl
private

Referenced by Image().

◆ impl

std::unique_ptr<Impl> Pd::Image::impl
private

Property Documentation

◆ angle

qreal Pd::Image::angle
readwrite

◆ defaultPixmap

QPixmap Pd::Image::defaultPixmap
readwrite

◆ scaledContents

bool Pd::Image::scaledContents
readwrite

The documentation for this class was generated from the following files: