1
/**********************************************************************
2
NumerationItem - Numeration Item, part of the Periodic Table Graphics View
5
Copyright (C) 2007-2009 by Marcus D. Hanwell
6
Copyright (C) 2010 by Etienne Rebetez
8
This file is part of the Avogadro molecular editor project.
9
For more information, see <http://avogadro.openmolecules.net/>
11
Kalzium is free software; you can redistribute it and/or modify
12
it under the terms of the GNU Lesser General Public License as published by
13
the Free Software Foundation; either version 2.1 of the License, or
14
(at your option) any later version.
16
Avogadro is distributed in the hope that it will be useful,
17
but WITHOUT ANY WARRANTY; without even the implied warranty of
18
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
GNU General Public License for more details.
21
You should have received a copy of the GNU General Public License
22
along with this program; if not, write to the Free Software
23
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25
**********************************************************************/
27
#ifndef NUMERATIONTITEM_P_H
28
#define NUMERATIONTITEM_P_H
30
#include <QGraphicsItem>
31
#include "kalziumdataobject.h"
33
#include <chemicaldataobject.h>
36
* @class NumerationItem
37
* @author Marcus D. Hanwell
38
* @author Etienne Rebetez
39
* @brief An Numeration item, intended to display a id of the numeration row.
42
class NumerationItem : public QGraphicsObject
48
* Constructor. Should be called with the element number for this item. The
49
* constructor uses setData to set the element number using the key 0. This
50
* is then used by PeriodicTable to figure out which element was clicked on.
52
NumerationItem(int xPosition = 0);
60
* @return the bounding rectangle of the element item.
62
QRectF boundingRect() const;
65
* @return the painter path which is also a rectangle in this case.
67
QPainterPath shape() const;
70
* This is where most of the action takes place. The element box is drawn
71
* along with its symbol.
73
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
77
void setNumerationType( int type );
81
* Width and height of the elements.
83
int m_width, m_height;
85
* The row Position of the Numeration item
90
* The numeration symbol.
95
* The color of the element.
102
#endif // NUMERATIONTITEM_P_H