QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
diagramcontent.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2024 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#include <QVector>
23
24class QGraphicsItem;
25class Conductor;
26class Element;
29class QetShapeItem;
32class Diagram;
33class DiagramTextItem;
36
47{
48 public:
50 DiagramContent(Diagram *diagram, bool selected = true);
52
70
71 QList<Element *> m_elements;
72 QSet<IndependentTextItem *> m_text_fields;
73 QSet<DiagramImageItem *> m_images;
74 QSet<QetShapeItem *> m_shapes;
75 QList<Conductor *> m_conductors_to_update;
76 QList<Conductor *> m_conductors_to_move;
77 QList<Conductor *> m_other_conductors;
78 QList<Conductor *> m_potential_conductors;
79 QSet<DynamicElementTextItem *> m_element_texts;
80 QSet<ElementTextItemGroup *> m_texts_groups;
81 QList<QGraphicsItem *> m_selected_items;
82 QVector<QetGraphicsTableItem *> m_tables;
83 QVector<TerminalStripItem *> m_terminal_strip;
84
85
86 QList<DiagramTextItem *> selectedTexts() const;
87 QList<ElementTextItemGroup *> selectedTextsGroup() const;
88 QList<Conductor *> conductors(int = AnyConductor) const;
89 bool hasDeletableItems() const;
90 bool hasCopiableItems() const;
91 QList<QGraphicsItem *> items(int = All) const;
92 QString sentence(int = All) const;
93 int count(int = All) const;
94 void clear();
96
98 bool potentialIsManaged(QList<Conductor *>conductors);
99 bool hasTextEditing();
100};
101QDebug &operator<<(QDebug, DiagramContent &);
102#endif
Definition conductor.h:43
Definition diagramcontent.h:47
QList< DiagramTextItem * > selectedTexts() const
DiagramContent::selectedTexts.
Definition diagramcontent.cpp:135
void clear()
DiagramContent::clear Remove all items from the diagram content.
Definition diagramcontent.cpp:233
QList< Element * > m_elements
Definition diagramcontent.h:71
int removeNonMovableItems()
DiagramContent::removeNonMovableItems Remove all non movable item.
Definition diagramcontent.cpp:254
QList< ElementTextItemGroup * > selectedTextsGroup() const
DiagramContent::selectedTextsGroup.
Definition diagramcontent.cpp:155
QList< Conductor * > m_conductors_to_update
Definition diagramcontent.h:75
QList< QGraphicsItem * > items(int=All) const
DiagramContent::items.
Definition diagramcontent.cpp:381
QSet< DynamicElementTextItem * > m_element_texts
Definition diagramcontent.h:79
QList< Conductor * > conductors(int=AnyConductor) const
DiagramContent::conductors.
Definition diagramcontent.cpp:172
QVector< TerminalStripItem * > m_terminal_strip
Definition diagramcontent.h:83
QList< Conductor * > m_potential_conductors
Definition diagramcontent.h:78
QList< Conductor * > m_other_conductors
Definition diagramcontent.h:77
int count(int=All) const
DiagramContent::count.
Definition diagramcontent.cpp:409
DiagramContent & operator+=(const DiagramContent &other)
Definition diagramcontent.cpp:285
QList< Conductor * > m_conductors_to_move
Definition diagramcontent.h:76
DiagramContent()
DiagramContent::DiagramContent.
Definition diagramcontent.cpp:38
Filter
Used to filter the different items carried by this container.
Definition diagramcontent.h:54
@ Elements
Definition diagramcontent.h:55
@ ConductorsToUpdate
Definition diagramcontent.h:60
@ Shapes
Definition diagramcontent.h:63
@ AnyConductor
Definition diagramcontent.h:62
@ SelectedOnly
Definition diagramcontent.h:68
@ Tables
Definition diagramcontent.h:65
@ ConductorsToMove
Definition diagramcontent.h:59
@ TextFields
Definition diagramcontent.h:56
@ All
Definition diagramcontent.h:67
@ ElementTextFields
Definition diagramcontent.h:57
@ TextGroup
Definition diagramcontent.h:64
@ OtherConductors
Definition diagramcontent.h:61
@ Images
Definition diagramcontent.h:58
QSet< IndependentTextItem * > m_text_fields
Definition diagramcontent.h:72
QSet< ElementTextItemGroup * > m_texts_groups
Definition diagramcontent.h:80
QString sentence(int=All) const
DiagramContent::sentence.
Definition diagramcontent.cpp:448
~DiagramContent()
Definition diagramcontent.cpp:125
bool potentialIsManaged(QList< Conductor * >conductors)
DiagramContent::potentialIsManaged.
Definition diagramcontent.cpp:348
QSet< QetShapeItem * > m_shapes
Definition diagramcontent.h:74
QVector< QetGraphicsTableItem * > m_tables
Definition diagramcontent.h:82
bool hasTextEditing()
DiagramContent::hasTextEditing.
Definition diagramcontent.cpp:365
bool hasCopiableItems() const
DiagramContent::hasCopiableItems.
Definition diagramcontent.cpp:219
QList< QGraphicsItem * > m_selected_items
Definition diagramcontent.h:81
bool hasDeletableItems() const
DiagramContent::hasDeletableItems.
Definition diagramcontent.cpp:195
QSet< DiagramImageItem * > m_images
Definition diagramcontent.h:73
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:56
Definition diagramimageitem.h:31
Definition diagramtextitem.h:34
The DynamicElementTextItem class This class provide a simple text field of element who can be added o...
Definition dynamicelementtextitem.h:40
Definition element.h:43
The ElementTextItemGroup class This class represent a group of element text Texts in the group can be...
Definition elementtextitemgroup.h:36
Definition independenttextitem.h:28
The QetGraphicsTableItem class This item display a table destined to represent the content of a QAbst...
Definition qetgraphicstableitem.h:43
The QetShapeItem class this class is used to draw a basic shape (line, rectangle, ellipse) into a dia...
Definition qetshapeitem.h:37
The TerminalStrip class This class hold all the datas and configurations of a terminal strip (but the...
Definition terminalstrip.h:45
Definition terminalstripitem.h:30
QDebug & operator<<(QDebug, DiagramContent &)
operator << Use to debug a diagram content
Definition diagramcontent.cpp:478