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

#include <polygoneditor.h>

Public Slots

void updatePolygonPoints ()
 
void updatePolygonClosedState ()
 
void updateForm () override
 
void validColumn (QTreeWidgetItem *qtwi, int column)
 

Public Member Functions

 PolygonEditor (QETElementEditor *, PartPolygon *=nullptr, QWidget *=nullptr)
 
 ~PolygonEditor () override
 Destructeur. More...
 
bool setPart (CustomElementPart *) override
 
CustomElementPartcurrentPart () const override
 
- Public Member Functions inherited from ElementItemEditor
 ElementItemEditor (QETElementEditor *, QWidget *=nullptr)
 
 ~ElementItemEditor () override
 
virtual QETElementEditorelementEditor () const
 
virtual ElementSceneelementScene () const
 
virtual QUndoStack & undoStack () const
 
virtual QString elementTypeName () const
 
virtual void setElementTypeName (const QString &)
 
virtual void detach ()
 
virtual bool setParts (QList< CustomElementPart *>)
 
virtual void updateForm ()=0
 

Private Member Functions

 PolygonEditor (const PolygonEditor &)
 
QVector< QPointF > getPointsFromTree ()
 
void activeConnections (bool)
 

Private Attributes

PartPolygonpart
 
StyleEditorstyle_
 
QTreeWidget points_list
 
QCheckBox close_polygon
 

Detailed Description

This class provides a widget to edit polygons within the element editor.

Definition at line 32 of file polygoneditor.h.

Constructor & Destructor Documentation

◆ PolygonEditor() [1/2]

PolygonEditor::PolygonEditor ( QETElementEditor editor,
PartPolygon p = nullptr,
QWidget *  parent = nullptr 
)

Constructeur

Parameters
editorL'editeur d'element concerne
pLe polygone a editer
parentle Widget parent

Definition at line 31 of file polygoneditor.cpp.

References close_polygon, points_list, style_, QET::Icons::tr, and updateForm().

◆ ~PolygonEditor()

PolygonEditor::~PolygonEditor ( )
override

Destructeur.

Definition at line 59 of file polygoneditor.cpp.

◆ PolygonEditor() [2/2]

PolygonEditor::PolygonEditor ( const PolygonEditor )
private

Member Function Documentation

◆ activeConnections()

void PolygonEditor::activeConnections ( bool  active)
private

Active ou desactive les connexionx signaux/slots entre les widgets internes.

Parameters
activetrue pour activer les connexions, false pour les desactiver

Definition at line 198 of file polygoneditor.cpp.

References close_polygon, points_list, updatePolygonClosedState(), and validColumn().

Referenced by updateForm().

◆ currentPart()

CustomElementPart * PolygonEditor::currentPart ( ) const
overridevirtual
Returns
la primitive actuellement editee, ou 0 si ce widget n'en edite pas

Implements ElementItemEditor.

Definition at line 159 of file polygoneditor.cpp.

References part.

◆ getPointsFromTree()

QVector< QPointF > PolygonEditor::getPointsFromTree ( )
private
Returns
Un vecteur contenant les points composant le polygone a partir du formulaire d'edition

Definition at line 167 of file polygoneditor.cpp.

References part, and points_list.

Referenced by updatePolygonPoints().

◆ setPart()

bool PolygonEditor::setPart ( CustomElementPart new_part)
overridevirtual

Permet de specifier a cet editeur quelle primitive il doit editer. A noter qu'un editeur peut accepter ou refuser d'editer une primitive. L'editeur de polygone acceptera d'editer la primitive new_part s'il s'agit d'un objet de la classe PartPolygon.

Parameters
new_partNouvelle primitive a editer
Returns
true si l'editeur a accepter d'editer la primitive, false sinon

Implements ElementItemEditor.

Definition at line 125 of file polygoneditor.cpp.

References PartPolygon::closedChange(), part, PartPolygon::polygonChanged(), style_, and updateForm().

◆ updateForm

void PolygonEditor::updateForm ( )
overrideslot

Met a jour le formulaire d'edition

Definition at line 101 of file polygoneditor.cpp.

References activeConnections(), close_polygon, part, and points_list.

Referenced by PolygonEditor(), and setPart().

◆ updatePolygonClosedState

void PolygonEditor::updatePolygonClosedState ( )
slot

Met a jour l'etat ferme ou non du polygone

Definition at line 86 of file polygoneditor.cpp.

References close_polygon, PartPolygon::isClosed(), part, CustomElementGraphicPart::property(), QET::Icons::tr, and ElementItemEditor::undoStack().

Referenced by activeConnections().

◆ updatePolygonPoints

void PolygonEditor::updatePolygonPoints ( )
slot

Met a jour les points du polygone et cree un objet d'annulation

Definition at line 65 of file polygoneditor.cpp.

References getPointsFromTree(), part, PartPolygon::polygon, CustomElementGraphicPart::property(), QET::Icons::tr, ElementItemEditor::undoStack(), and QET::QetMessageBox::warning().

Referenced by validColumn().

◆ validColumn

void PolygonEditor::validColumn ( QTreeWidgetItem *  qtwi,
int  column 
)
slot
Parameters
qtwiQTreeWidgetItem a valider
columnColonne exacte du QTreeWidgetItem a valider

Definition at line 185 of file polygoneditor.cpp.

References points_list, and updatePolygonPoints().

Referenced by activeConnections().

Member Data Documentation

◆ close_polygon

QCheckBox PolygonEditor::close_polygon
private

◆ part

PartPolygon* PolygonEditor::part
private

◆ points_list

QTreeWidget PolygonEditor::points_list
private

◆ style_

StyleEditor* PolygonEditor::style_
private

Definition at line 47 of file polygoneditor.h.

Referenced by PolygonEditor(), and setPart().


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