QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
diagramcontent.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2026 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
24#include "../qetgraphicsitem/terminalelement.h"
25
26class QGraphicsItem;
27class Conductor;
28class Element;
31class QetShapeItem;
34class Diagram;
35class DiagramTextItem;
38
49{
50 public:
52 DiagramContent(Diagram *diagram, bool selected = true);
54
72
73 QList<Element *> m_elements;
74 QSet<IndependentTextItem *> m_text_fields;
75 QSet<DiagramImageItem *> m_images;
76 QSet<QetShapeItem *> m_shapes;
77 QList<Conductor *> m_conductors_to_update;
78 QList<Conductor *> m_conductors_to_move;
79 QList<Conductor *> m_other_conductors;
80 QList<Conductor *> m_potential_conductors;
81 QSet<DynamicElementTextItem *> m_element_texts;
82 QSet<ElementTextItemGroup *> m_texts_groups;
83 QList<QGraphicsItem *> m_selected_items;
84 QVector<QetGraphicsTableItem *> m_tables;
85 QVector<TerminalStripItem *> m_terminal_strip;
86 QVector<QPointer<TerminalElement>> m_terminal_elements;
87
88
89 QList<DiagramTextItem *> selectedTexts() const;
90 QList<ElementTextItemGroup *> selectedTextsGroup() const;
91 QList<Conductor *> conductors(int = AnyConductor) const;
92 bool hasDeletableItems() const;
93 bool hasCopiableItems() const;
94 QList<QGraphicsItem *> items(int = All) const;
95 QString sentence(int = All) const;
96 int count(int = All) const;
97 void clear();
99
101 bool potentialIsManaged(QList<Conductor *>conductors);
102 bool hasTextEditing();
103};
104QDebug &operator<<(QDebug, DiagramContent &);
105#endif
Definition conductor.h:44
Definition diagramcontent.h:49
QList< DiagramTextItem * > selectedTexts() const
DiagramContent::selectedTexts.
Definition diagramcontent.cpp:143
void clear()
DiagramContent::clear Remove all items from the diagram content.
Definition diagramcontent.cpp:241
QList< Element * > m_elements
Definition diagramcontent.h:73
int removeNonMovableItems()
DiagramContent::removeNonMovableItems Remove all non movable item.
Definition diagramcontent.cpp:262
QList< ElementTextItemGroup * > selectedTextsGroup() const
DiagramContent::selectedTextsGroup.
Definition diagramcontent.cpp:163
QList< Conductor * > m_conductors_to_update
Definition diagramcontent.h:77
QVector< QPointer< TerminalElement > > m_terminal_elements
Definition diagramcontent.h:86
QList< QGraphicsItem * > items(int=All) const
DiagramContent::items.
Definition diagramcontent.cpp:389
QSet< DynamicElementTextItem * > m_element_texts
Definition diagramcontent.h:81
QList< Conductor * > conductors(int=AnyConductor) const
DiagramContent::conductors.
Definition diagramcontent.cpp:180
QVector< TerminalStripItem * > m_terminal_strip
Definition diagramcontent.h:85
QList< Conductor * > m_potential_conductors
Definition diagramcontent.h:80
QList< Conductor * > m_other_conductors
Definition diagramcontent.h:79
int count(int=All) const
DiagramContent::count.
Definition diagramcontent.cpp:417
DiagramContent & operator+=(const DiagramContent &other)
Definition diagramcontent.cpp:293
QList< Conductor * > m_conductors_to_move
Definition diagramcontent.h:78
DiagramContent()
DiagramContent::DiagramContent.
Definition diagramcontent.cpp:38
Filter
Used to filter the different items carried by this container.
Definition diagramcontent.h:56
@ Elements
Definition diagramcontent.h:57
@ ConductorsToUpdate
Definition diagramcontent.h:62
@ Shapes
Definition diagramcontent.h:65
@ AnyConductor
Definition diagramcontent.h:64
@ SelectedOnly
Definition diagramcontent.h:70
@ Tables
Definition diagramcontent.h:67
@ ConductorsToMove
Definition diagramcontent.h:61
@ TerminalStrip
Definition diagramcontent.h:68
@ TextFields
Definition diagramcontent.h:58
@ All
Definition diagramcontent.h:69
@ ElementTextFields
Definition diagramcontent.h:59
@ TextGroup
Definition diagramcontent.h:66
@ OtherConductors
Definition diagramcontent.h:63
@ Images
Definition diagramcontent.h:60
QSet< IndependentTextItem * > m_text_fields
Definition diagramcontent.h:74
QSet< ElementTextItemGroup * > m_texts_groups
Definition diagramcontent.h:82
QString sentence(int=All) const
DiagramContent::sentence.
Definition diagramcontent.cpp:456
~DiagramContent()
Definition diagramcontent.cpp:133
bool potentialIsManaged(QList< Conductor * >conductors)
DiagramContent::potentialIsManaged.
Definition diagramcontent.cpp:356
QSet< QetShapeItem * > m_shapes
Definition diagramcontent.h:76
QVector< QetGraphicsTableItem * > m_tables
Definition diagramcontent.h:84
bool hasTextEditing()
DiagramContent::hasTextEditing.
Definition diagramcontent.cpp:373
bool hasCopiableItems() const
DiagramContent::hasCopiableItems.
Definition diagramcontent.cpp:227
QList< QGraphicsItem * > m_selected_items
Definition diagramcontent.h:83
bool hasDeletableItems() const
DiagramContent::hasDeletableItems.
Definition diagramcontent.cpp:203
QSet< DiagramImageItem * > m_images
Definition diagramcontent.h:75
The Diagram class This class represents an electric diagram. It manages its various child elements,...
Definition diagram.h:54
Definition diagramimageitem.h:40
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:44
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,...
Definition qetshapeitem.h:42
Definition terminalstripitem.h:30
QDebug & operator<<(QDebug, DiagramContent &)
operator << Use to debug a diagram content
Definition diagramcontent.cpp:486