blob: ae102f531a09a944cd589e895eb41ddc48232e8d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
/****************************************************************
**
** Definition of Molek class,
**
****************************************************************/
#ifndef MOLEK_H
#define MOLEK_H
#include <stdio.h>
#include <stdlib.h>
#include <tqwidget.h>
#include <tqpoint.h>
#include <tqpainter.h>
#include <tqpixmap.h>
#include "atom.h"
#include <tqvaluelist.h>
class KSimpleConfig;
#define MOLEK_SIZE 15
class Molek : public TQWidget
{
Q_OBJECT
TQ_OBJECT
public:
Molek (TQWidget *parent=0, const char *name=0);
~Molek ();
void load(const KSimpleConfig& config);
const atom& getAtom(uint index) const;
int atomSize() const { return atoms.count(); }
TQSize molecSize() const { return _size; }
uint getAtom(int x, int y) const { return molek[x][y]; }
protected:
void paintEvent( TQPaintEvent * );
private:
TQPixmap data;
uint molek[MOLEK_SIZE][MOLEK_SIZE]; // the indexes within atoms
TQValueList<atom> atoms;
TQString mname;
TQSize _size;
};
#endif // MOLEK_H
|