QElectroTech
0.70
|
#include <diagramcontent.h>
Public Types | |
enum | Filter { Elements = 1, TextFields = 2, ElementTextFields = 4, Images = 8, ConductorsToMove = 16, ConductorsToUpdate = 32, OtherConductors = 64, AnyConductor = 112, Shapes = 128, TextGroup = 256, All = 511, SelectedOnly = 512 } |
Used to filter the different items carried by this container. More... | |
Public Attributes | |
QList< Element * > | m_elements |
QSet< IndependentTextItem * > | m_text_fields |
QSet< DiagramImageItem * > | m_images |
QSet< QetShapeItem * > | m_shapes |
QList< Conductor * > | m_conductors_to_update |
QList< Conductor * > | m_conductors_to_move |
QList< Conductor * > | m_other_conductors |
QList< Conductor * > | m_potential_conductors |
QSet< DynamicElementTextItem * > | m_element_texts |
QSet< ElementTextItemGroup * > | m_texts_groups |
QList< QGraphicsItem * > | m_selected_items |
This class provides a container that makes the transmission of diagram content to other functions/methods easier. The different kind of items are made available through a handful of filter-aware methods. Considering selected elements are to be moved, the filter notably distinguishes conductors to be moved from those to be updated. Please note this container does not systematically contains a whole diagram: it may describe only a part of it, e.g. selected items.
Definition at line 43 of file diagramcontent.h.
Used to filter the different items carried by this container.
Enumerator | |
---|---|
Elements | |
TextFields | |
ElementTextFields | |
Images | |
ConductorsToMove | |
ConductorsToUpdate | |
OtherConductors | |
AnyConductor | |
Shapes | |
TextGroup | |
All | |
SelectedOnly |
Definition at line 52 of file diagramcontent.h.
DiagramContent::DiagramContent | ( | ) |
DiagramContent::DiagramContent.
Definition at line 34 of file diagramcontent.cpp.
DiagramContent::DiagramContent | ( | Diagram * | diagram, |
bool | selected = true |
||
) |
DiagramContent::DiagramContent Constructor.
diagram | : Construct a diagramContent and fill it with the selected item of |
selected | : this diagramcontent get only selected items if true. |
Definition at line 42 of file diagramcontent.cpp.
References m_conductors_to_move, m_conductors_to_update, m_element_texts, m_elements, m_images, m_other_conductors, m_potential_conductors, m_selected_items, m_shapes, m_text_fields, m_texts_groups, and potentialIsManaged().
DiagramContent::DiagramContent | ( | const DiagramContent & | other | ) |
DiagramContent::DiagramContent Copy constructor.
other |
Definition at line 116 of file diagramcontent.cpp.
DiagramContent::~DiagramContent | ( | ) |
Definition at line 130 of file diagramcontent.cpp.
void DiagramContent::clear | ( | ) |
DiagramContent::clear Remove all items from the diagram content.
Definition at line 236 of file diagramcontent.cpp.
References m_conductors_to_move, m_conductors_to_update, m_element_texts, m_elements, m_images, m_other_conductors, m_selected_items, m_shapes, m_text_fields, and m_texts_groups.
Referenced by ElementsMover::endMovement(), and MultiPasteDialog::updatePreview().
QList< Conductor * > DiagramContent::conductors | ( | int | filter = AnyConductor | ) | const |
filter |
Definition at line 177 of file diagramcontent.cpp.
References ConductorsToMove, ConductorsToUpdate, m_conductors_to_move, m_conductors_to_update, m_other_conductors, OtherConductors, and SelectedOnly.
Referenced by DiagramView::editSelectedConductorColor(), items(), potentialIsManaged(), Diagram::potentials(), DeleteQGraphicsItemCommand::redo(), and sentence().
int DiagramContent::count | ( | int | filter = All | ) | const |
filter |
Definition at line 404 of file diagramcontent.cpp.
References ConductorsToMove, ConductorsToUpdate, Elements, ElementTextFields, Images, m_conductors_to_move, m_conductors_to_update, m_element_texts, m_elements, m_images, m_other_conductors, m_shapes, m_text_fields, m_texts_groups, OtherConductors, SelectedOnly, Shapes, TextFields, and TextGroup.
Referenced by ElementsMover::beginMovement(), MultiPasteDialog::on_m_button_box_accepted(), DiagramView::paste(), QETDiagramEditor::slot_updateComplexActions(), and MultiPasteDialog::updatePreview().
bool DiagramContent::hasCopiableItems | ( | ) | const |
DiagramContent::hasCopiableItems.
Definition at line 222 of file diagramcontent.cpp.
References m_elements, m_images, m_shapes, and m_text_fields.
Referenced by QETDiagramEditor::slot_updateComplexActions().
bool DiagramContent::hasDeletableItems | ( | ) | const |
DiagramContent::hasDeletableItems.
Definition at line 200 of file diagramcontent.cpp.
References m_selected_items, IndependentTextItem::Type, DiagramImageItem::Type, DynamicElementTextItem::Type, QetShapeItem::Type, Conductor::Type, and Element::Type.
Referenced by QETDiagramEditor::slot_updateComplexActions().
bool DiagramContent::hasTextEditing | ( | ) |
DiagramContent::hasTextEditing.
Definition at line 362 of file diagramcontent.cpp.
References selectedTexts().
Referenced by DiagramView::keyPressEvent().
QList< QGraphicsItem * > DiagramContent::items | ( | int | filter = All | ) | const |
filter |
Definition at line 378 of file diagramcontent.cpp.
References conductors(), Elements, ElementTextFields, Images, m_element_texts, m_elements, m_images, m_shapes, m_text_fields, m_texts_groups, SelectedOnly, Shapes, TextFields, and TextGroup.
Referenced by Diagram::changeZValue(), ElementsMover::continueMovement(), DeleteQGraphicsItemCommand::DeleteQGraphicsItemCommand(), ElementsMover::endMovement(), DiagramView::keyPressEvent(), Diagram::keyPressEvent(), MoveElementsCommand::move(), PasteDiagramCommand::PasteDiagramCommand(), DeleteQGraphicsItemCommand::redo(), PasteDiagramCommand::redo(), DiagramView::scrollOnMovement(), DeleteQGraphicsItemCommand::setPotentialsOfRemovedElements(), QETDiagramEditor::slot_updateComplexActions(), DeleteQGraphicsItemCommand::terminalInSamePotential(), DeleteQGraphicsItemCommand::undo(), PasteDiagramCommand::undo(), MultiPasteDialog::updatePreview(), DeleteQGraphicsItemCommand::~DeleteQGraphicsItemCommand(), MultiPasteDialog::~MultiPasteDialog(), and PasteDiagramCommand::~PasteDiagramCommand().
DiagramContent & DiagramContent::operator+= | ( | const DiagramContent & | other | ) |
Definition at line 286 of file diagramcontent.cpp.
References m_conductors_to_move, m_conductors_to_update, m_element_texts, m_elements, m_images, m_other_conductors, m_potential_conductors, m_selected_items, m_shapes, m_text_fields, m_texts_groups, potentialIsManaged(), and Conductor::relatedPotentialConductors().
bool DiagramContent::potentialIsManaged | ( | QList< Conductor *> | conductors | ) |
DiagramContent::potentialIsManaged.
conductors | a list of conductors at the same potential. |
Definition at line 345 of file diagramcontent.cpp.
References conductors(), and m_potential_conductors.
Referenced by DiagramContent(), and operator+=().
int DiagramContent::removeNonMovableItems | ( | ) |
DiagramContent::removeNonMovableItems Remove all non movable item.
Definition at line 255 of file diagramcontent.cpp.
References m_elements, m_images, and m_shapes.
Referenced by ElementsMover::beginMovement().
QList< DiagramTextItem * > DiagramContent::selectedTexts | ( | ) | const |
DiagramContent::selectedTexts.
Definition at line 140 of file diagramcontent.cpp.
References m_selected_items, IndependentTextItem::Type, ConductorTextItem::Type, and DynamicElementTextItem::Type.
Referenced by hasTextEditing(), DiagramView::keyPressEvent(), RotateTextsCommand::RotateTextsCommand(), and QETDiagramEditor::slot_updateComplexActions().
QList< ElementTextItemGroup * > DiagramContent::selectedTextsGroup | ( | ) | const |
DiagramContent::selectedTextsGroup.
Definition at line 160 of file diagramcontent.cpp.
References m_selected_items.
Referenced by RotateTextsCommand::RotateTextsCommand(), and QETDiagramEditor::slot_updateComplexActions().
QString DiagramContent::sentence | ( | int | filter = All | ) | const |
filter |
Definition at line 438 of file diagramcontent.cpp.
References conductors(), Elements, QET::ElementsAndConductorsSentence(), ElementTextFields, Images, m_element_texts, m_elements, m_images, m_shapes, m_text_fields, Shapes, and TextFields.
Referenced by CutDiagramCommand::CutDiagramCommand(), DeleteQGraphicsItemCommand::DeleteQGraphicsItemCommand(), MoveElementsCommand::MoveElementsCommand(), and PasteDiagramCommand::PasteDiagramCommand().
QList<Conductor *> DiagramContent::m_conductors_to_move |
Definition at line 72 of file diagramcontent.h.
Referenced by clear(), conductors(), Diagram::content(), ElementsMover::continueMovement(), count(), DiagramContent(), MoveElementsCommand::move(), operator+=(), and PasteDiagramCommand::redo().
QList<Conductor *> DiagramContent::m_conductors_to_update |
Definition at line 71 of file diagramcontent.h.
Referenced by clear(), conductors(), ElementsMover::continueMovement(), count(), DiagramContent(), MoveElementsCommand::move(), and operator+=().
QSet<DynamicElementTextItem *> DiagramContent::m_element_texts |
Definition at line 75 of file diagramcontent.h.
Referenced by ImportElementTextPattern::apply(), ElementsMover::beginMovement(), clear(), count(), DeleteQGraphicsItemCommand::DeleteQGraphicsItemCommand(), DiagramContent(), items(), DynamicElementTextItemEditor::on_m_remove_selection_clicked(), operator+=(), DeleteQGraphicsItemCommand::redo(), QETDiagramEditor::selectionGroupTriggered(), sentence(), QETDiagramEditor::slot_updateComplexActions(), and DeleteQGraphicsItemCommand::undo().
QList<Element *> DiagramContent::m_elements |
Definition at line 67 of file diagramcontent.h.
Referenced by ElementsMover::beginMovement(), clear(), Diagram::content(), count(), DeleteQGraphicsItemCommand::DeleteQGraphicsItemCommand(), DiagramContent(), ElementsMover::endMovement(), SearchAndReplaceWidget::fillItemsList(), hasCopiableItems(), items(), Diagram::keyPressEvent(), operator+=(), DeleteQGraphicsItemCommand::redo(), PasteDiagramCommand::redo(), removeNonMovableItems(), sentence(), DeleteQGraphicsItemCommand::setPotentialsOfRemovedElements(), and DeleteQGraphicsItemCommand::undo().
QSet<DiagramImageItem *> DiagramContent::m_images |
Definition at line 69 of file diagramcontent.h.
Referenced by clear(), count(), DiagramContent(), hasCopiableItems(), items(), operator+=(), removeNonMovableItems(), and sentence().
QList<Conductor *> DiagramContent::m_other_conductors |
Definition at line 73 of file diagramcontent.h.
Referenced by clear(), conductors(), count(), DiagramContent(), and operator+=().
QList<Conductor *> DiagramContent::m_potential_conductors |
Definition at line 74 of file diagramcontent.h.
Referenced by DiagramContent(), SearchAndReplaceWidget::fillItemsList(), operator+=(), and potentialIsManaged().
QList<QGraphicsItem *> DiagramContent::m_selected_items |
Definition at line 77 of file diagramcontent.h.
Referenced by clear(), DiagramContent(), hasDeletableItems(), operator+=(), selectedTexts(), and selectedTextsGroup().
QSet<QetShapeItem *> DiagramContent::m_shapes |
Definition at line 70 of file diagramcontent.h.
Referenced by clear(), count(), DiagramContent(), hasCopiableItems(), items(), operator+=(), removeNonMovableItems(), and sentence().
QSet<IndependentTextItem *> DiagramContent::m_text_fields |
Definition at line 68 of file diagramcontent.h.
Referenced by clear(), Diagram::content(), count(), DiagramContent(), SearchAndReplaceWidget::fillItemsList(), hasCopiableItems(), items(), operator+=(), and sentence().
QSet<ElementTextItemGroup *> DiagramContent::m_texts_groups |
Definition at line 76 of file diagramcontent.h.
Referenced by ElementsMover::beginMovement(), clear(), count(), DeleteQGraphicsItemCommand::DeleteQGraphicsItemCommand(), DiagramContent(), items(), and operator+=().