Avogadro  1.1.0
/home/kitware/dashboards/avogadro/libavogadro/src/elementitem_p.h
00001 /**********************************************************************
00002  ElementItem - Element Item, 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 ELEMENTITEM_P_H
00027 #define ELEMENTITEM_P_H
00028 
00029 #include <QGraphicsItem>
00030 
00031 namespace Avogadro{
00032 
00042   class ElementItem : public QGraphicsItem
00043   {
00044   public:
00050     ElementItem(int elementNumber = 0);
00051 
00055     ~ElementItem();
00056 
00060     QRectF boundingRect() const;
00061 
00065     QPainterPath shape() const;
00066 
00071     void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
00072                QWidget *widget);
00073 
00074   private:
00078     bool m_valid;
00082     QString m_symbol;
00083 
00088     QColor *m_color;
00089 
00093     int m_width, m_height;
00094 
00098     int m_element;
00099   };
00100 
00101 } // End namespace Avogadro
00102 
00103 #endif // ELEMENTITEM_P_H