Warning, file /education/kalzium/src/psetable/periodictablestates.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002     SPDX-FileCopyrightText: 2011 Rebetez Etienne <etienne.rebetez@oberwallis.ch>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef PERIODICTABLESTATES_H
0008 #define PERIODICTABLESTATES_H
0009 
0010 #include <QParallelAnimationGroup>
0011 #include <QStateMachine>
0012 
0013 #include "kalziumelementproperty.h"
0014 
0015 #include "elementitem.h"
0016 #include "numerationitem.h"
0017 #include "statemachine.h"
0018 
0019 /**
0020  * @class PeriodicTableStates
0021  * In this class all states of element items and numeration items are defined.
0022  * The position and animations of the items are set.
0023  *
0024  * @short Setting up the pse states
0025  * @author Etienne Rebetez
0026  *
0027  */
0028 
0029 class PeriodicTableStates
0030 {
0031 public:
0032     /**
0033      * Constructor need list of Items.
0034      * @param elementItemList List of the Element items in the table.
0035      * @param numerationItemList List of the Numeration items in the table.
0036      */
0037     PeriodicTableStates(const QList<ElementItem *> &elementItemList, const QList<NumerationItem *> &numerationItemList);
0038 
0039     virtual ~PeriodicTableStates();
0040 
0041     /**
0042      * Get the rectangle of the given periodic table.
0043      * @param tableIndex Index of the table @see pseTables.
0044      * @return Rectangle in floating point precision.
0045      */
0046     QRectF pseRect(int tableIndex) const;
0047 
0048     /**
0049      * Set the table index
0050      * @param tableIndex Index of the table @see pseTables..
0051      */
0052     void setTableState(int tableIndex);
0053 
0054 private:
0055     void setNumerationItemPositions(int tableIndex);
0056     void hideAllNumerationItems(int tableIndex);
0057     int maxNumerationItemXCoordinate(int tableIndex);
0058 
0059     void addElementAnimation(QGraphicsObject *object, int factor = 1);
0060 
0061     void setElementItemPositions(int tableIndex);
0062 
0063     QPoint hiddenPoint() const;
0064 
0065     QStateMachine m_states;
0066     QParallelAnimationGroup *m_group;
0067     StateSwitcher *m_stateSwitcher;
0068 
0069     QList<ElementItem *> m_elementItemList;
0070     QList<NumerationItem *> m_numerationItemList;
0071 
0072     int m_width;
0073     int m_height;
0074 
0075     QList<QState *> m_tableStatesList;
0076 };
0077 
0078 #endif // PERIODICTABLESTATES_H