• Skip to content
  • Skip to link menu
KDE 4.5 API Reference
  • KDE API Reference
  • kdeedu
  • Sitemap
  • Contact Us
 

kalzium

KalziumPainter Class Reference

The KalziumPainter is /the/ way to draw a table, any kind of it. More...

#include <kalziumpainter.h>

List of all members.

Public Types

enum  MODE {
  NORMAL = 0, SOM, TIME, GRADIENT,
  NORMAL_GRADIENT
}

Public Member Functions

 KalziumPainter (KalziumTableType *ktt)
virtual ~KalziumPainter ()
void begin (QPaintDevice *pd)
QBrush brushForElement (int element) const
KalziumTableType * currentTableType () const
void drawAll ()
void drawElement (int element, const QRect &r=QRect())
void drawElements ()
void drawElementSelector (int element)
void drawNumeration ()
void end ()
KalziumGradientType * gradient () const
MODE mode () const
KalziumNumerationType * numeration () const
KalziumSchemeType * scheme () const
void setGradient (const QByteArray &cs)
void setGradient (int cs)
void setMode (MODE m)
void setNumeration (const QByteArray &n)
void setNumeration (int n)
void setScheme (const QByteArray &s)
void setScheme (int s)
void setTableType (KalziumTableType *ktt)
void setTemperature (int temp)
void setTime (int time)
int temperature () const
int time () const

Detailed Description

The KalziumPainter is /the/ way to draw a table, any kind of it.

One of the best features of it is that you can construct it once and do multiple drawing session without destroying it.

A typical usage would be:

 // build the classic periodic table
 KalziumTableType *table = KalziumTableTypeFactory::instance()->build( "Classic" );
 // creating the painter with the table type
 KalziumPainter painter = new KalziumPainter( table );
 // setting the various options
 ...
 painter->begin( widget/pixmap/paintdevice );
 painter->drawAll();
 // draw the element selector for the element with atomic number 20 (Calcium)
 painter->drawElementSelector( 20 );
 painter->end();
Author:
Pino Toscano

Definition at line 58 of file kalziumpainter.h.


Member Enumeration Documentation

enum KalziumPainter::MODE
Enumerator:
NORMAL 
SOM 

State of matter.

TIME 

Timeline.

GRADIENT 
NORMAL_GRADIENT 

Schema + Gradient.

Definition at line 71 of file kalziumpainter.h.


Constructor & Destructor Documentation

KalziumPainter::KalziumPainter ( KalziumTableType *  ktt  ) 

Construct a new KalziumPainter for the table type ktt.

Definition at line 46 of file kalziumpainter.cpp.

virtual KalziumPainter::~KalziumPainter (  )  [inline, virtual]

Definition at line 65 of file kalziumpainter.h.


Member Function Documentation

void KalziumPainter::begin ( QPaintDevice *  pd  ) 

Begin painting on the painting device pd.

Definition at line 60 of file kalziumpainter.cpp.

QBrush KalziumPainter::brushForElement ( int  element  )  const

Definition at line 1799 of file kalziumpainter.cpp.

KalziumTableType * KalziumPainter::currentTableType (  )  const

Definition at line 77 of file kalziumpainter.cpp.

void KalziumPainter::drawAll (  ) 

Draw all the things it can: elements and numeration.

Definition at line 82 of file kalziumpainter.cpp.

void KalziumPainter::drawElement ( int  element,
const QRect &  r = QRect() 
)

Draw the element with atomic number element.

Pass a QRect() to the r parameter if you want to use the default rect for that element.

Definition at line 1523 of file kalziumpainter.cpp.

void KalziumPainter::drawElements (  ) 

Draw all the elements.

Definition at line 88 of file kalziumpainter.cpp.

void KalziumPainter::drawElementSelector ( int  element  ) 

Paint a marker around the element number element.

Definition at line 1701 of file kalziumpainter.cpp.

void KalziumPainter::drawNumeration (  ) 

Draw the numeration.

Definition at line 1689 of file kalziumpainter.cpp.

void KalziumPainter::end (  ) 

Finish painting.

Definition at line 66 of file kalziumpainter.cpp.

KalziumGradientType * KalziumPainter::gradient (  )  const

Definition at line 1771 of file kalziumpainter.cpp.

MODE KalziumPainter::mode (  )  const [inline]
Returns:
Return the current MODE

Definition at line 123 of file kalziumpainter.h.

KalziumNumerationType* KalziumPainter::numeration (  )  const [inline]

Definition at line 141 of file kalziumpainter.h.

KalziumSchemeType * KalziumPainter::scheme (  )  const

Definition at line 1748 of file kalziumpainter.cpp.

void KalziumPainter::setGradient ( const QByteArray &  cs  ) 

Definition at line 1762 of file kalziumpainter.cpp.

void KalziumPainter::setGradient ( int  cs  ) 

Definition at line 1753 of file kalziumpainter.cpp.

void KalziumPainter::setMode ( MODE  m  ) 

Definition at line 1725 of file kalziumpainter.cpp.

void KalziumPainter::setNumeration ( const QByteArray &  n  ) 

Definition at line 1785 of file kalziumpainter.cpp.

void KalziumPainter::setNumeration ( int  n  ) 

Set the numeration n for the periodic table.

Definition at line 1776 of file kalziumpainter.cpp.

void KalziumPainter::setScheme ( const QByteArray &  s  ) 

Definition at line 1739 of file kalziumpainter.cpp.

void KalziumPainter::setScheme ( int  s  ) 

Definition at line 1730 of file kalziumpainter.cpp.

void KalziumPainter::setTableType ( KalziumTableType *  ktt  )  [inline]

Definition at line 67 of file kalziumpainter.h.

void KalziumPainter::setTemperature ( int  temp  ) 

Definition at line 1794 of file kalziumpainter.cpp.

void KalziumPainter::setTime ( int  time  )  [inline]

Definition at line 151 of file kalziumpainter.h.

int KalziumPainter::temperature (  )  const [inline]

Definition at line 147 of file kalziumpainter.h.

int KalziumPainter::time (  )  const [inline]

Definition at line 155 of file kalziumpainter.h.


The documentation for this class was generated from the following files:
  • kalziumpainter.h
  • kalziumpainter.cpp

kalzium

Skip menu "kalzium"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdeedu

Skip menu "kdeedu"
  •     lib
  • kalzium
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  •   stepcore
Generated for kdeedu by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal