COPASI API  4.16.103
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CQCopasiEffect Class Reference

#include <CQCopasiEffect.h>

Inheritance diagram for CQCopasiEffect:
Inheritance graph
[legend]
Collaboration diagram for CQCopasiEffect:
Collaboration graph
[legend]

Public Member Functions

 CQCopasiEffect ()
 
void setScale (qreal scale)
 
virtual ~CQCopasiEffect ()
 

Protected Member Functions

void draw (QPainter *painter)
 

Protected Attributes

qreal mScale
 

Detailed Description

Definition at line 13 of file CQCopasiEffect.h.

Constructor & Destructor Documentation

CQCopasiEffect::CQCopasiEffect ( )

Definition at line 11 of file CQCopasiEffect.cpp.

12  : mScale(1.0)
13 {
14 }
CQCopasiEffect::~CQCopasiEffect ( )
virtual

Definition at line 16 of file CQCopasiEffect.cpp.

17 {
18 }

Member Function Documentation

void CQCopasiEffect::draw ( QPainter *  painter)
protected

Definition at line 25 of file CQCopasiEffect.cpp.

References mScale.

26 {
27  QPoint offset;
28  const QPixmap pixmap = sourcePixmap(Qt::DeviceCoordinates, &offset);
29 
30  if (pixmap.isNull())
31  return;
32 
33  painter->save();
34  painter->setWorldTransform(QTransform());
35  QRectF rect = pixmap.rect();
36 
37  QTransform trans = QTransform::fromScale(mScale, mScale);
38  QPixmap transformed = pixmap.transformed(trans, Qt::SmoothTransformation);
39  QRectF transRect = transformed.rect();
40 
41  QPointF newOffset = offset + (rect.center() - transRect.center());
42 
43  painter->drawPixmap(newOffset, transformed);
44  painter->restore();
45 }
void CQCopasiEffect::setScale ( qreal  scale)

Definition at line 20 of file CQCopasiEffect.cpp.

References mScale.

Referenced by CQEffectDescription::applyToScene().

21 {
22  mScale = scale;
23 }

Member Data Documentation

qreal CQCopasiEffect::mScale
protected

Definition at line 24 of file CQCopasiEffect.h.

Referenced by draw(), and setScale().


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