QElectroTech 0.100.0-dev
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
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.
 

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< QPair< 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:

◆ ~DeleteQGraphicsItemCommand()

DeleteQGraphicsItemCommand::~DeleteQGraphicsItemCommand ( )
override
Here is the call graph for this function:

◆ DeleteQGraphicsItemCommand() [2/2]

DeleteQGraphicsItemCommand::DeleteQGraphicsItemCommand ( const DeleteQGraphicsItemCommand )
private

Member Function Documentation

◆ 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<QPair<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: