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

kalzium

KalziumPainter Class Reference

#include <kalziumpainter.h>

List of all members.


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.


Public Types

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

Public Member Functions

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

Member Enumeration Documentation

enum KalziumPainter::MODE

Enumerator:
NORMAL 
SOM  State of matter.
TIME  Timeline.
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 50 of file kalziumpainter.cpp.

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

Definition at line 65 of file kalziumpainter.h.


Member Function Documentation

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

Definition at line 67 of file kalziumpainter.h.

void KalziumPainter::begin ( QPaintDevice *  pd  ) 

Begin painting on the painting device pd.

Definition at line 64 of file kalziumpainter.cpp.

void KalziumPainter::end (  ) 

Finish painting.

Definition at line 70 of file kalziumpainter.cpp.

KalziumTableType * KalziumPainter::currentTableType (  )  const

Definition at line 81 of file kalziumpainter.cpp.

void KalziumPainter::drawAll (  ) 

Draw all the things it can: elements and numeration.

Definition at line 86 of file kalziumpainter.cpp.

void KalziumPainter::drawElements (  ) 

Draw all the elements.

Definition at line 92 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 107 of file kalziumpainter.cpp.

void KalziumPainter::drawNumeration (  ) 

Draw the numeration.

Definition at line 251 of file kalziumpainter.cpp.

void KalziumPainter::drawElementSelector ( int  element  ) 

Paint a marker around the element number element.

Definition at line 263 of file kalziumpainter.cpp.

void KalziumPainter::setMode ( MODE  m  ) 

Definition at line 285 of file kalziumpainter.cpp.

MODE KalziumPainter::mode (  )  const [inline]

Returns:
Return the current MODE

Definition at line 122 of file kalziumpainter.h.

void KalziumPainter::setScheme ( int  s  ) 

Definition at line 290 of file kalziumpainter.cpp.

void KalziumPainter::setScheme ( const QByteArray &  s  ) 

Definition at line 299 of file kalziumpainter.cpp.

KalziumSchemeType * KalziumPainter::scheme (  )  const

Definition at line 308 of file kalziumpainter.cpp.

void KalziumPainter::setGradient ( int  cs  ) 

Definition at line 313 of file kalziumpainter.cpp.

void KalziumPainter::setGradient ( const QByteArray &  cs  ) 

Definition at line 322 of file kalziumpainter.cpp.

KalziumGradientType * KalziumPainter::gradient (  )  const

Definition at line 331 of file kalziumpainter.cpp.

void KalziumPainter::setNumeration ( int  n  ) 

Set the numeration n for the periodic table.

Definition at line 336 of file kalziumpainter.cpp.

void KalziumPainter::setNumeration ( const QByteArray &  n  ) 

Definition at line 345 of file kalziumpainter.cpp.

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

Definition at line 140 of file kalziumpainter.h.

void KalziumPainter::setTemperature ( int  temp  ) 

Definition at line 354 of file kalziumpainter.cpp.

int KalziumPainter::temperature (  )  const [inline]

Definition at line 146 of file kalziumpainter.h.

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

Definition at line 150 of file kalziumpainter.h.

int KalziumPainter::time (  )  const [inline]

Definition at line 154 of file kalziumpainter.h.

QBrush KalziumPainter::brushForElement ( int  element  )  const

Definition at line 359 of file kalziumpainter.cpp.


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"
  • kalzium
  • kanagram
  • kig
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
Generated for kdeedu by doxygen 1.5.4
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