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

#include <diagramcommands.h>

Public Member Functions

 ChangeConductorCommand (Conductor *, const ConductorProfile &, const ConductorProfile &, Qt::Corner, QUndoCommand *=nullptr)
 
 ~ChangeConductorCommand () override
 Destructeur. More...
 
void undo () override
 Annule la modification du conducteur. More...
 
void redo () override
 Refait la modification du conducteur. More...
 
virtual void setConductorTextItemMove (const QPointF &, const QPointF &)
 

Private Member Functions

 ChangeConductorCommand (const ChangeConductorCommand &)
 

Private Attributes

Conductorconductor
 changed conductor More...
 
ConductorProfile old_profile
 profile before the change More...
 
ConductorProfile new_profile
 profile after the change More...
 
Qt::Corner path_type
 Path type of the modified conductor. More...
 
QPointF text_pos_before_mov_
 position of the text item before the change More...
 
QPointF text_pos_after_mov_
 position of the text item after the change More...
 
bool first_redo
 prevent the first call to redo() More...
 
Diagramdiagram
 

Detailed Description

This command changes a particular conductor.

Definition at line 219 of file diagramcommands.h.

Constructor & Destructor Documentation

◆ ChangeConductorCommand() [1/2]

ChangeConductorCommand::ChangeConductorCommand ( Conductor c,
const ConductorProfile old_p,
const ConductorProfile new_p,
Qt::Corner  path_t,
QUndoCommand *  parent = nullptr 
)

Constructeur

Parameters
cConducteur modifie
old_pancien profil du conducteur
new_pnouveau profil du conducteur
path_tTrajectoire du trajet modifie
parentQUndoCommand parent

Definition at line 429 of file diagramcommands.cpp.

◆ ~ChangeConductorCommand()

ChangeConductorCommand::~ChangeConductorCommand ( )
override

Destructeur.

Definition at line 447 of file diagramcommands.cpp.

◆ ChangeConductorCommand() [2/2]

ChangeConductorCommand::ChangeConductorCommand ( const ChangeConductorCommand )
private

Member Function Documentation

◆ redo()

void ChangeConductorCommand::redo ( )
override

Refait la modification du conducteur.

Definition at line 458 of file diagramcommands.cpp.

References conductor, diagram, first_redo, new_profile, path_type, and text_pos_after_mov_.

◆ setConductorTextItemMove()

void ChangeConductorCommand::setConductorTextItemMove ( const QPointF &  pos_before,
const QPointF &  pos_after 
)
virtual

Integre dans cet objet d'annulation le repositionnement du champ de texte du conducteur

Parameters
pos_beforePosition du texte avant la modification du conducteur
pos_afterPosition du texte apres la modification du conducteur

Definition at line 474 of file diagramcommands.cpp.

References text_pos_after_mov_, and text_pos_before_mov_.

◆ undo()

void ChangeConductorCommand::undo ( )
override

Annule la modification du conducteur.

Definition at line 451 of file diagramcommands.cpp.

References conductor, diagram, old_profile, path_type, and text_pos_before_mov_.

Member Data Documentation

◆ conductor

Conductor* ChangeConductorCommand::conductor
private

changed conductor

Definition at line 236 of file diagramcommands.h.

Referenced by redo(), and undo().

◆ diagram

Diagram* ChangeConductorCommand::diagram
private

Definition at line 249 of file diagramcommands.h.

Referenced by redo(), and undo().

◆ first_redo

bool ChangeConductorCommand::first_redo
private

prevent the first call to redo()

Definition at line 248 of file diagramcommands.h.

Referenced by redo().

◆ new_profile

ConductorProfile ChangeConductorCommand::new_profile
private

profile after the change

Definition at line 240 of file diagramcommands.h.

Referenced by redo().

◆ old_profile

ConductorProfile ChangeConductorCommand::old_profile
private

profile before the change

Definition at line 238 of file diagramcommands.h.

Referenced by undo().

◆ path_type

Qt::Corner ChangeConductorCommand::path_type
private

Path type of the modified conductor.

Definition at line 242 of file diagramcommands.h.

Referenced by redo(), and undo().

◆ text_pos_after_mov_

QPointF ChangeConductorCommand::text_pos_after_mov_
private

position of the text item after the change

Definition at line 246 of file diagramcommands.h.

Referenced by redo(), and setConductorTextItemMove().

◆ text_pos_before_mov_

QPointF ChangeConductorCommand::text_pos_before_mov_
private

position of the text item before the change

Definition at line 244 of file diagramcommands.h.

Referenced by setConductorTextItemMove(), and undo().


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