QElectroTech  0.70
diagramcontent.h
Go to the documentation of this file.
1 /*
2  Copyright 2006-2019 The QElectroTech Team
3  This file is part of QElectroTech.
4 
5  QElectroTech is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 2 of the License, or
8  (at your option) any later version.
9 
10  QElectroTech is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef DIAGRAM_CONTENT_H
19 #define DIAGRAM_CONTENT_H
20 
21 #include <QSet>
22 
23 class QGraphicsItem;
24 class Conductor;
25 class Element;
27 class DiagramImageItem;
28 class QetShapeItem;
31 class Diagram;
32 class DiagramTextItem;
33 
44 {
45  public:
47  DiagramContent(Diagram *diagram, bool selected = true);
50 
52  enum Filter {
53  Elements = 1,
56  Images = 8,
60  AnyConductor = 112,
61  Shapes = 128,
62  TextGroup = 256,
63  All = 511,
65  };
66 
67  QList<Element *> m_elements;
68  QSet<IndependentTextItem *> m_text_fields;
69  QSet<DiagramImageItem *> m_images;
70  QSet<QetShapeItem *> m_shapes;
71  QList<Conductor *> m_conductors_to_update;
72  QList<Conductor *> m_conductors_to_move;
73  QList<Conductor *> m_other_conductors;
74  QList<Conductor *> m_potential_conductors;
75  QSet<DynamicElementTextItem *> m_element_texts;
76  QSet<ElementTextItemGroup *> m_texts_groups;
77  QList<QGraphicsItem *> m_selected_items;
78 
79  QList<DiagramTextItem *> selectedTexts() const;
80  QList<ElementTextItemGroup *> selectedTextsGroup() const;
81  QList<Conductor *> conductors(int = AnyConductor) const;
82  bool hasDeletableItems() const;
83  bool hasCopiableItems() const;
84  QList<QGraphicsItem *> items(int = All) const;
85  QString sentence(int = All) const;
86  int count(int = All) const;
87  void clear();
89 
91  bool potentialIsManaged(QList<Conductor *>conductors);
92  bool hasTextEditing();
93 };
94 QDebug &operator<<(QDebug, DiagramContent &);
95 #endif
QList< Conductor * > m_potential_conductors
bool hasCopiableItems() const
DiagramContent::hasCopiableItems.
The DynamicElementTextItem class This class provide a simple text field of element who can be added o...
QList< DiagramTextItem * > selectedTexts() const
DiagramContent::selectedTexts.
QSet< QetShapeItem * > m_shapes
QString sentence(int=All) const
DiagramContent::sentence.
Filter
Used to filter the different items carried by this container.
QList< Conductor * > m_conductors_to_move
QDebug & operator<<(QDebug, DiagramContent &)
operator << Use to debug a diagram content
bool potentialIsManaged(QList< Conductor *>conductors)
DiagramContent::potentialIsManaged.
QList< QGraphicsItem * > items(int=All) const
DiagramContent::items.
QSet< IndependentTextItem * > m_text_fields
int removeNonMovableItems()
DiagramContent::removeNonMovableItems Remove all non movable item.
QList< Conductor * > m_other_conductors
QSet< DynamicElementTextItem * > m_element_texts
QList< ElementTextItemGroup * > selectedTextsGroup() const
DiagramContent::selectedTextsGroup.
The ElementTextItemGroup class This class represent a group of element text Texts in the group can be...
QList< Element * > m_elements
QList< Conductor * > m_conductors_to_update
The QetShapeItem class this class is used to draw a basic shape (line, rectangle, ellipse) into a dia...
Definition: qetshapeitem.h:35
QList< QGraphicsItem * > m_selected_items
DiagramContent()
DiagramContent::DiagramContent.
bool hasTextEditing()
DiagramContent::hasTextEditing.
void clear()
DiagramContent::clear Remove all items from the diagram content.
QSet< DiagramImageItem * > m_images
bool hasDeletableItems() const
DiagramContent::hasDeletableItems.
QList< Conductor * > conductors(int=AnyConductor) const
DiagramContent::conductors.
int count(int=All) const
DiagramContent::count.
QSet< ElementTextItemGroup * > m_texts_groups
DiagramContent & operator+=(const DiagramContent &other)