Avogadro  1.1.0
/home/kitware/dashboards/avogadro/libavogadro/src/elementdetail_p.h
00001 /**********************************************************************
00002  ElementDetail - Element Detail, part of the Periodic Table Graphics View for
00003  Avogadro
00004 
00005  Copyright (C) 2007-2009 by Marcus D. Hanwell
00006 
00007  This file is part of the Avogadro molecular editor project.
00008  For more information, see <http://avogadro.openmolecules.net/>
00009 
00010  Avogadro is free software; you can redistribute it and/or modify
00011  it under the terms of the GNU Lesser General Public License as published by
00012  the Free Software Foundation; either version 2.1 of the License, or
00013  (at your option) any later version.
00014 
00015  Avogadro is distributed in the hope that it will be useful,
00016  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  GNU General Public License for more details.
00019 
00020  You should have received a copy of the GNU General Public License
00021  along with this program; if not, write to the Free Software
00022  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00023  02110-1301, USA.
00024  **********************************************************************/
00025 
00026 #ifndef ELEMENTDETAIL_P_H
00027 #define ELEMENTDETAIL_P_H
00028 
00029 #include <QGraphicsItem>
00030 #include <QObject>
00031 
00032 namespace Avogadro{
00033 
00043   class ElementDetail : public QObject, public QGraphicsItem
00044   {
00045   Q_OBJECT
00046 #if QT_VERSION >= 0x40600
00047   Q_INTERFACES(QGraphicsItem)
00048 #endif
00049 
00050   public:
00054     ElementDetail(int elementNumber = 0);
00055 
00059     QRectF boundingRect() const;
00060 
00064     QPainterPath shape() const;
00065 
00070     void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
00071                QWidget *widget);
00072 
00073   public Q_SLOTS:
00078     void elementChanged(int element);
00079 
00080   private:
00084     int m_width, m_height;
00085 
00089     int m_element;
00090   };
00091 
00092 } // End namespace Avogadro
00093 
00094 #endif // ELEMENTDETAIL_P_H