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

#include <deleteqgraphicsitemcommand.h>

Inheritance diagram for DeleteQGraphicsItemCommand:
Inheritance graph
Collaboration diagram for DeleteQGraphicsItemCommand:
Collaboration graph

Public Member Functions

 DeleteQGraphicsItemCommand (Diagram *diagram, const DiagramContent &content, QUndoCommand *parent=nullptr)
 DeleteQGraphicsItemCommand::DeleteQGraphicsItemCommand.
 ~DeleteQGraphicsItemCommand () override
void undo () override
 DeleteQGraphicsItemCommand::undo Undo this command.
void redo () override
 DeleteQGraphicsItemCommand::redo Redo the delete command.

Static Public Member Functions

static bool hasNonDeletableTerminal (const DiagramContent &content)
 DeleteQGraphicsItemCommand::hasNonDeletableTerminal Return true if @content have terminal element which can't be deleted. The reason why a terminal can't be deleted is because they have bridge or belong to a physical terminal with more than one level.

Private Member Functions

 DeleteQGraphicsItemCommand (const DeleteQGraphicsItemCommand &)
void setPotentialsOfRemovedElements ()
 DeleteQGraphicsItemCommand::setPotentialsOfRemovedElements This function creates new conductors (if needed) for conserve the electrical potentials present at the terminals of each removed elements.
TerminalterminalInSamePotential (Terminal *terminal, Conductor *conductor_to_exclude)
 DeleteQGraphicsItemCommand::terminalInSamePotential Return a terminal at the same potential of terminal, by traveling through the conductors connected to terminal only if the owner element of the terminal is not delete by this undo command. Return nullptr if a terminal can't be found.

Private Attributes

DiagramContent m_removed_contents
Diagramm_diagram
QHash< Element *, QList< Element * > > m_link_hash
QHash< DynamicElementTextItem *, Element * > m_elmt_text_hash
 keep linked element for each removed element linked to other element.
QHash< DynamicElementTextItem *, ElementTextItemGroup * > m_grp_texts_hash
 Keep the parent element of each deleted dynamic element text item.
QList< std::pair< Terminal *, Terminal * > > m_connected_terminals
 Keep the parent group of each deleted element text item.
QHash< QetGraphicsTableItem *, QPointer< QGraphicsScene > > m_table_scene_hash
bool m_remove_linked_table = false

Constructor & Destructor Documentation

◆ DeleteQGraphicsItemCommand() [1/2]

DeleteQGraphicsItemCommand::DeleteQGraphicsItemCommand ( Diagram * diagram,
const DiagramContent & content,
QUndoCommand * parent = nullptr )

DeleteQGraphicsItemCommand::DeleteQGraphicsItemCommand.

Parameters
diagram: diagram where this undo work
content: content to remove
parent: parent undo
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~DeleteQGraphicsItemCommand()

DeleteQGraphicsItemCommand::~DeleteQGraphicsItemCommand ( )
override

◆ DeleteQGraphicsItemCommand() [2/2]

DeleteQGraphicsItemCommand::DeleteQGraphicsItemCommand ( const DeleteQGraphicsItemCommand & )
private
Here is the call graph for this function:

Member Function Documentation

◆ hasNonDeletableTerminal()

bool DeleteQGraphicsItemCommand::hasNonDeletableTerminal ( const DiagramContent & content)
static

DeleteQGraphicsItemCommand::hasNonDeletableTerminal Return true if @content have terminal element which can't be deleted. The reason why a terminal can't be deleted is because they have bridge or belong to a physical terminal with more than one level.

Parameters
diagram
content
dialog
Returns
Here is the caller graph for this function:

◆ redo()

void DeleteQGraphicsItemCommand::redo ( )
override

DeleteQGraphicsItemCommand::redo Redo the delete command.

Here is the call graph for this function:

◆ setPotentialsOfRemovedElements()

void DeleteQGraphicsItemCommand::setPotentialsOfRemovedElements ( )
private

DeleteQGraphicsItemCommand::setPotentialsOfRemovedElements This function creates new conductors (if needed) for conserve the electrical potentials present at the terminals of each removed elements.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ terminalInSamePotential()

Terminal * DeleteQGraphicsItemCommand::terminalInSamePotential ( Terminal * terminal,
Conductor * conductor_to_exclude )
private

DeleteQGraphicsItemCommand::terminalInSamePotential Return a terminal at the same potential of terminal, by traveling through the conductors connected to terminal only if the owner element of the terminal is not delete by this undo command. Return nullptr if a terminal can't be found.

Parameters
terminal- terminal from search
conductor_to_exclude- a conductor to exlcude from search.
Returns
Here is the call graph for this function:
Here is the caller graph for this function:

◆ undo()

void DeleteQGraphicsItemCommand::undo ( )
override

DeleteQGraphicsItemCommand::undo Undo this command.

Here is the call graph for this function:

Member Data Documentation

◆ m_connected_terminals

QList<std::pair<Terminal *, Terminal *> > DeleteQGraphicsItemCommand::m_connected_terminals
private

Keep the parent group of each deleted element text item.

◆ m_diagram

Diagram* DeleteQGraphicsItemCommand::m_diagram
private

◆ m_elmt_text_hash

QHash<DynamicElementTextItem *, Element *> DeleteQGraphicsItemCommand::m_elmt_text_hash
private

keep linked element for each removed element linked to other element.

◆ m_grp_texts_hash

QHash<DynamicElementTextItem *, ElementTextItemGroup *> DeleteQGraphicsItemCommand::m_grp_texts_hash
private

Keep the parent element of each deleted dynamic element text item.

◆ m_link_hash

QHash<Element *, QList<Element *> > DeleteQGraphicsItemCommand::m_link_hash
private

◆ m_remove_linked_table

bool DeleteQGraphicsItemCommand::m_remove_linked_table = false
private

◆ m_removed_contents

DiagramContent DeleteQGraphicsItemCommand::m_removed_contents
private

◆ m_table_scene_hash

QHash<QetGraphicsTableItem *, QPointer<QGraphicsScene> > DeleteQGraphicsItemCommand::m_table_scene_hash
private

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