QElectroTech  0.70
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DeleteQGraphicsItemCommand Class Reference

#include <deleteqgraphicsitemcommand.h>

Public Member Functions

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

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. More...
 
TerminalterminalInSamePotential (Terminal *terminal, Conductor *conductor_to_exclude)
 DeleteQGraphicsItemCommand::terminalInSamePotential Return a terminal at the same potential of , by traveling through the conductors connected to only if the owner element of the terminal is not delete by this undo command. Return nullptr if a terminal can't be found. More...
 

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. More...
 
QHash< DynamicElementTextItem *, ElementTextItemGroup * > m_grp_texts_hash
 Keep the parent element of each deleted dynamic element text item. More...
 
QList< QPair< Terminal *, Terminal * > > m_connected_terminals
 Keep the parent group of each deleted element text item. More...
 

Detailed Description

Definition at line 28 of file deleteqgraphicsitemcommand.h.

Constructor & Destructor Documentation

◆ DeleteQGraphicsItemCommand() [1/2]

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

◆ ~DeleteQGraphicsItemCommand()

DeleteQGraphicsItemCommand::~DeleteQGraphicsItemCommand ( )
override

◆ DeleteQGraphicsItemCommand() [2/2]

DeleteQGraphicsItemCommand::DeleteQGraphicsItemCommand ( const DeleteQGraphicsItemCommand )
private

Member Function Documentation

◆ redo()

void DeleteQGraphicsItemCommand::redo ( )
override

◆ setPotentialsOfRemovedElements()

void DeleteQGraphicsItemCommand::setPotentialsOfRemovedElements ( )
private

◆ terminalInSamePotential()

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

DeleteQGraphicsItemCommand::terminalInSamePotential Return a terminal at the same potential of , by traveling through the conductors connected to 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

Definition at line 181 of file deleteqgraphicsitemcommand.cpp.

References Terminal::conductors(), DiagramContent::Elements, DiagramContent::items(), m_removed_contents, and Terminal::parentElement().

Referenced by setPotentialsOfRemovedElements().

◆ undo()

void DeleteQGraphicsItemCommand::undo ( )
override

Member Data Documentation

◆ m_connected_terminals

QList<QPair<Terminal *, Terminal *> > DeleteQGraphicsItemCommand::m_connected_terminals
private

Keep the parent group of each deleted element text item.

Definition at line 51 of file deleteqgraphicsitemcommand.h.

Referenced by setPotentialsOfRemovedElements().

◆ 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.

Definition at line 49 of file deleteqgraphicsitemcommand.h.

Referenced by DeleteQGraphicsItemCommand(), and undo().

◆ m_grp_texts_hash

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

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

Definition at line 50 of file deleteqgraphicsitemcommand.h.

Referenced by DeleteQGraphicsItemCommand(), and undo().

◆ m_link_hash

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

Definition at line 48 of file deleteqgraphicsitemcommand.h.

Referenced by redo(), and undo().

◆ m_removed_contents

DiagramContent DeleteQGraphicsItemCommand::m_removed_contents
private

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