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

#include <editorcommands.h>

Public Member Functions

 ChangeZValueCommand (ElementScene *, QET::DepthOption, QUndoCommand *=nullptr)
 
 ~ChangeZValueCommand () override
 Destructeur. More...
 
void undo () override
 Annule les changements de zValue. More...
 
void redo () override
 Refait les changements de zValue. More...
 
- Public Member Functions inherited from ElementEditionCommand
 ElementEditionCommand (ElementScene *=nullptr, ElementView *=nullptr, QUndoCommand *=nullptr)
 
 ElementEditionCommand (const QString &, ElementScene *=nullptr, ElementView *=nullptr, QUndoCommand *=nullptr)
 
 ~ElementEditionCommand () override
 
ElementSceneelementScene () const
 
void setElementScene (ElementScene *)
 
ElementViewelementView () const
 
void setElementView (ElementView *)
 

Private Member Functions

 ChangeZValueCommand (const ChangeZValueCommand &)
 
void applyBringForward (const QList< QGraphicsItem *> &)
 
void applyRaise (const QList< QGraphicsItem *> &)
 
void applyLower (const QList< QGraphicsItem *> &)
 
void applySendBackward (const QList< QGraphicsItem *> &)
 

Private Attributes

QHash< QGraphicsItem *, qreal > undo_hash
 associates impacted primitives with their former zValues More...
 
QHash< QGraphicsItem *, qreal > redo_hash
 associates impacted primitives with their new zValues More...
 
QET::DepthOption m_option
 kind of treatment to apply More...
 

Additional Inherited Members

- Protected Attributes inherited from ElementEditionCommand
ElementScenem_scene
 Element editor/view/scene the command should take place on. More...
 
ElementViewm_view
 

Detailed Description

This command changes the zValue of a set of primitives when editing an electrical element.

Definition at line 200 of file editorcommands.h.

Constructor & Destructor Documentation

◆ ChangeZValueCommand() [1/2]

ChangeZValueCommand::ChangeZValueCommand ( ElementScene elmt,
QET::DepthOption  o,
QUndoCommand *  parent = nullptr 
)

Constructeur

Parameters
elmtElementScene concernee
oOption decrivant le type de traitement applique aux zValues des parties de l'element
parentQUndoCommand parent

Definition at line 344 of file editorcommands.cpp.

References applyBringForward(), applyLower(), applyRaise(), applySendBackward(), QET::BringForward, QET::Lower, m_option, ElementEditionCommand::m_scene, QET::Raise, ElementScene::SelectedOrNot, QET::SendBackward, ElementScene::SortByZValue, QET::Icons::tr, and undo_hash.

◆ ~ChangeZValueCommand()

ChangeZValueCommand::~ChangeZValueCommand ( )
override

Destructeur.

Definition at line 375 of file editorcommands.cpp.

◆ ChangeZValueCommand() [2/2]

ChangeZValueCommand::ChangeZValueCommand ( const ChangeZValueCommand )
private

Member Function Documentation

◆ applyBringForward()

void ChangeZValueCommand::applyBringForward ( const QList< QGraphicsItem *> &  items_list)
private

Amene les elements selectionnes au premier plan

Parameters
items_listListe des elements (selectionnes et non selectionnes)

Definition at line 392 of file editorcommands.cpp.

References redo_hash.

Referenced by ChangeZValueCommand().

◆ applyLower()

void ChangeZValueCommand::applyLower ( const QList< QGraphicsItem *> &  items_list)
private

Descend les elements selectionnes d'un plan

Parameters
items_listListe des elements (selectionnes et non selectionnes)

Definition at line 428 of file editorcommands.cpp.

References redo_hash.

Referenced by ChangeZValueCommand().

◆ applyRaise()

void ChangeZValueCommand::applyRaise ( const QList< QGraphicsItem *> &  items_list)
private

Remonte les elements selectionnes d'un plan

Parameters
items_listListe des elements (selectionnes et non selectionnes)

Definition at line 410 of file editorcommands.cpp.

References redo_hash.

Referenced by ChangeZValueCommand().

◆ applySendBackward()

void ChangeZValueCommand::applySendBackward ( const QList< QGraphicsItem *> &  items_list)
private

Envoie les elements selectionnes au fond

Parameters
items_listListe des elements (selectionnes et non selectionnes)

Definition at line 447 of file editorcommands.cpp.

References redo_hash.

Referenced by ChangeZValueCommand().

◆ redo()

void ChangeZValueCommand::redo ( )
override

Refait les changements de zValue.

Definition at line 384 of file editorcommands.cpp.

References redo_hash.

◆ undo()

void ChangeZValueCommand::undo ( )
override

Annule les changements de zValue.

Definition at line 379 of file editorcommands.cpp.

References undo_hash.

Member Data Documentation

◆ m_option

QET::DepthOption ChangeZValueCommand::m_option
private

kind of treatment to apply

Definition at line 227 of file editorcommands.h.

Referenced by ChangeZValueCommand().

◆ redo_hash

QHash<QGraphicsItem *, qreal> ChangeZValueCommand::redo_hash
private

associates impacted primitives with their new zValues

Definition at line 225 of file editorcommands.h.

Referenced by applyBringForward(), applyLower(), applyRaise(), applySendBackward(), and redo().

◆ undo_hash

QHash<QGraphicsItem *, qreal> ChangeZValueCommand::undo_hash
private

associates impacted primitives with their former zValues

Definition at line 223 of file editorcommands.h.

Referenced by ChangeZValueCommand(), and undo().


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