QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
DiagramContent Class Reference

#include <diagramcontent.h>

Collaboration diagram for DiagramContent:
Collaboration graph

Public Types

enum  Filter {
  Elements = 1 , TextFields = 2 , ElementTextFields = 4 , Images = 8 ,
  ConductorsToMove = 16 , ConductorsToUpdate = 32 , OtherConductors = 64 , AnyConductor = 112 ,
  Shapes = 128 , TextGroup = 256 , Tables = 512 , TerminalStrip = 1024 ,
  All = 2047 , SelectedOnly = 2048
}
 Used to filter the different items carried by this container. More...

Public Member Functions

 DiagramContent ()
 DiagramContent::DiagramContent.
 DiagramContent (Diagram *diagram, bool selected=true)
 DiagramContent::DiagramContent Constructor.
 ~DiagramContent ()
QList< DiagramTextItem * > selectedTexts () const
 DiagramContent::selectedTexts.
QList< ElementTextItemGroup * > selectedTextsGroup () const
 DiagramContent::selectedTextsGroup.
QList< Conductor * > conductors (int=AnyConductor) const
 DiagramContent::conductors.
bool hasDeletableItems () const
 DiagramContent::hasDeletableItems.
bool hasCopiableItems () const
 DiagramContent::hasCopiableItems.
QList< QGraphicsItem * > items (int=All) const
 DiagramContent::items.
QString sentence (int=All) const
 DiagramContent::sentence.
int count (int=All) const
 DiagramContent::count.
void clear ()
 DiagramContent::clear Remove all items from the diagram content.
int removeNonMovableItems ()
 DiagramContent::removeNonMovableItems Remove all non movable item.
DiagramContentoperator+= (const DiagramContent &other)
bool potentialIsManaged (QList< Conductor * >conductors)
 DiagramContent::potentialIsManaged.
bool hasTextEditing ()
 DiagramContent::hasTextEditing.

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
QVector< QetGraphicsTableItem * > m_tables
QVector< TerminalStripItem * > m_terminal_strip
QVector< QPointer< TerminalElement > > m_terminal_elements

Detailed Description

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.

Member Enumeration Documentation

◆ Filter

Used to filter the different items carried by this container.

Enumerator
Elements 
TextFields 
ElementTextFields 
Images 
ConductorsToMove 
ConductorsToUpdate 
OtherConductors 
AnyConductor 
Shapes 
TextGroup 
Tables 
TerminalStrip 
All 
SelectedOnly 

Constructor & Destructor Documentation

◆ DiagramContent() [1/2]

DiagramContent::DiagramContent ( )

DiagramContent::DiagramContent.

Here is the caller graph for this function:

◆ DiagramContent() [2/2]

DiagramContent::DiagramContent ( Diagram * diagram,
bool selected = true )

DiagramContent::DiagramContent Constructor.

Parameters
diagram: Construct a diagramContent and fill it with the selected item of diagram
selected: this diagramcontent get only selected items if true.
Here is the call graph for this function:

◆ ~DiagramContent()

DiagramContent::~DiagramContent ( )

Member Function Documentation

◆ clear()

void DiagramContent::clear ( )

DiagramContent::clear Remove all items from the diagram content.

◆ conductors()

QList< Conductor * > DiagramContent::conductors ( int filter = AnyConductor) const

DiagramContent::conductors.

Parameters
filter
Returns
Every conductors according to the filter
Here is the caller graph for this function:

◆ count()

int DiagramContent::count ( int filter = All) const

DiagramContent::count.

Parameters
filter
Returns
The number of items, according to filter
Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasCopiableItems()

bool DiagramContent::hasCopiableItems ( ) const

DiagramContent::hasCopiableItems.

Returns
true if this diagram content have copiable items.
Here is the caller graph for this function:

◆ hasDeletableItems()

bool DiagramContent::hasDeletableItems ( ) const

DiagramContent::hasDeletableItems.

Returns
true if this diagram content have deletable item The deletable items correspond to the selected items of diagram at the moment of the creation of this DiagramContent, with the constructor : DiagramContent::DiagramContent(Diagram *diagram)
Here is the caller graph for this function:

◆ hasTextEditing()

bool DiagramContent::hasTextEditing ( )

DiagramContent::hasTextEditing.

Returns
true if handle a text currently in editing interaction
Here is the call graph for this function:
Here is the caller graph for this function:

◆ items()

QList< QGraphicsItem * > DiagramContent::items ( int filter = All) const

DiagramContent::items.

Parameters
filter
Returns
The items of this diagram content according to filter
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator+=()

DiagramContent & DiagramContent::operator+= ( const DiagramContent & other)
Here is the call graph for this function:

◆ potentialIsManaged()

bool DiagramContent::potentialIsManaged ( QList< Conductor * > conductors)

DiagramContent::potentialIsManaged.

Parameters
conductorsa list of conductors at the same potential.
Returns
true, if m_potential_conductors already have a conductor of this potential.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeNonMovableItems()

int DiagramContent::removeNonMovableItems ( )

DiagramContent::removeNonMovableItems Remove all non movable item.

Returns
: return the numbers of removed item

◆ selectedTexts()

QList< DiagramTextItem * > DiagramContent::selectedTexts ( ) const

DiagramContent::selectedTexts.

Returns
a list of every selected texts (every kind of texts) Note that the returned list of texts, correspond to the selected texts at the moment of the creation of this DiagramContent, with the constructor : DiagramContent::DiagramContent(Diagram *diagram)
Here is the caller graph for this function:

◆ selectedTextsGroup()

QList< ElementTextItemGroup * > DiagramContent::selectedTextsGroup ( ) const

DiagramContent::selectedTextsGroup.

Returns
a list of selected texts group Note that the returned list of texts group, correspond to the selected texts group at the moment of the creation of this DiagramContent, with the constructor : DiagramContent::DiagramContent(Diagram *diagram)
Here is the caller graph for this function:

◆ sentence()

QString DiagramContent::sentence ( int filter = All) const

DiagramContent::sentence.

Parameters
filter
Returns
A string that describe the items of the diagram content according to filter. Example : X elements, Y conductors etc....
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_conductors_to_move

QList<Conductor *> DiagramContent::m_conductors_to_move

◆ m_conductors_to_update

QList<Conductor *> DiagramContent::m_conductors_to_update

◆ m_element_texts

QSet<DynamicElementTextItem *> DiagramContent::m_element_texts

◆ m_elements

QList<Element *> DiagramContent::m_elements

◆ m_images

QSet<DiagramImageItem *> DiagramContent::m_images

◆ m_other_conductors

QList<Conductor *> DiagramContent::m_other_conductors

◆ m_potential_conductors

QList<Conductor *> DiagramContent::m_potential_conductors

◆ m_selected_items

QList<QGraphicsItem *> DiagramContent::m_selected_items

◆ m_shapes

QSet<QetShapeItem *> DiagramContent::m_shapes

◆ m_tables

QVector<QetGraphicsTableItem *> DiagramContent::m_tables

◆ m_terminal_elements

QVector<QPointer<TerminalElement> > DiagramContent::m_terminal_elements

◆ m_terminal_strip

QVector<TerminalStripItem *> DiagramContent::m_terminal_strip

◆ m_text_fields

QSet<IndependentTextItem *> DiagramContent::m_text_fields

◆ m_texts_groups

QSet<ElementTextItemGroup *> DiagramContent::m_texts_groups

The documentation for this class was generated from the following files: