mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-02-19 01:59:59 +01:00
Translated all comments found in header files (*.h) from French to English.
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@1960 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -22,26 +22,25 @@
|
||||
class PartArc;
|
||||
class StyleEditor;
|
||||
/**
|
||||
Cette classe represente le widget d'edition d'un arc dans l'editeur
|
||||
d'element.
|
||||
This class provides a widget to edit elliptical arcs within the element editor.
|
||||
*/
|
||||
class ArcEditor : public ElementItemEditor {
|
||||
Q_OBJECT
|
||||
//constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ArcEditor(QETElementEditor *, PartArc * = 0, QWidget * = 0);
|
||||
virtual ~ArcEditor();
|
||||
private:
|
||||
ArcEditor(const ArcEditor &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
PartArc *part;
|
||||
StyleEditor *style_;
|
||||
QLineEdit *x, *y, *h, *v;
|
||||
QSpinBox *angle, *start_angle;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual bool setPart(CustomElementPart *);
|
||||
virtual CustomElementPart *currentPart() const;
|
||||
|
||||
@@ -22,9 +22,7 @@
|
||||
class PartCircle;
|
||||
class StyleEditor;
|
||||
/**
|
||||
Cette classe represente un editeur de cercle.
|
||||
Elle permet d'editer a travers une interface graphique les
|
||||
proprietes d'une cercle composant le dessin d'un element.
|
||||
This class provides a widget to edit circles within the element editor.
|
||||
*/
|
||||
class CircleEditor : public ElementItemEditor {
|
||||
Q_OBJECT
|
||||
@@ -35,13 +33,13 @@ class CircleEditor : public ElementItemEditor {
|
||||
private:
|
||||
CircleEditor(const CircleEditor &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
PartCircle *part;
|
||||
StyleEditor *style_;
|
||||
QLineEdit *x, *y, *r;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual bool setPart(CustomElementPart *);
|
||||
virtual CustomElementPart *currentPart() const;
|
||||
|
||||
@@ -23,44 +23,43 @@
|
||||
class QETElementEditor;
|
||||
typedef CustomElementGraphicPart CEGP;
|
||||
/**
|
||||
Cette classe represente une partie graphique d'element
|
||||
Elle encapsule des methodes afin de gerer les attributs de style communs
|
||||
a la plupart des parties d'elements
|
||||
This class represents an element visual/geometric primitive. It provides
|
||||
methods to manage style attributes common to most primitives.
|
||||
*/
|
||||
class CustomElementGraphicPart : public CustomElementPart {
|
||||
public:
|
||||
/// Qualifie le style de ligne utilise pour dessiner la partie
|
||||
/// This enum lists the various line styles available to draw primitives.
|
||||
enum LineStyle {
|
||||
NormalStyle, ///< Ligne pleine
|
||||
DashedStyle, ///< Ligne pointillee (tirets)
|
||||
DottedStyle ///< Ligne pointillee (points)
|
||||
NormalStyle, ///< Normal line
|
||||
DashedStyle, ///< Dashed line
|
||||
DottedStyle ///< Dotted line
|
||||
};
|
||||
|
||||
/// Qualifie l'epaisseur de ligne utilisee pour dessiner la partie
|
||||
/// This enum lists the various line weights available to draw primitives.
|
||||
enum LineWeight {
|
||||
NormalWeight, ///< Ligne normale
|
||||
ThinWeight, ///< Ligne fine
|
||||
NoneWeight ///< Ligne invisible
|
||||
NormalWeight, ///< Normal line
|
||||
ThinWeight, ///< Thin line
|
||||
NoneWeight ///< Invisible line
|
||||
};
|
||||
|
||||
/// Qualifie la couleur utilisee pour remplir la partie
|
||||
/// This enum lists the various filling colors available to draw primitives.
|
||||
enum Filling {
|
||||
NoneFilling, ///< Remplissage transparent
|
||||
BlackFilling, ///< Remplissage en noir
|
||||
WhiteFilling ///< Remplissage en blanc
|
||||
NoneFilling, ///< No filling (i.e. transparent)
|
||||
BlackFilling, ///< Black filling
|
||||
WhiteFilling ///< White filling
|
||||
};
|
||||
|
||||
/// Qualifie la couleur de ligne utilisee pour dessiner la partie
|
||||
/// This enum lists the various line colors available to draw primitives.
|
||||
enum Color {
|
||||
BlackColor, ///< Ligne noire
|
||||
WhiteColor ///< Ligne blanche
|
||||
BlackColor, ///< Black line
|
||||
WhiteColor ///< White line
|
||||
};
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
/**
|
||||
Constructeur
|
||||
@param editor Editeur d'element auquel cette partie est rattachee
|
||||
Constructor
|
||||
@param editor Element editor this primitive lives in.
|
||||
*/
|
||||
CustomElementGraphicPart(QETElementEditor *editor) :
|
||||
CustomElementPart(editor),
|
||||
@@ -72,11 +71,11 @@ class CustomElementGraphicPart : public CustomElementPart {
|
||||
{
|
||||
};
|
||||
|
||||
/// Destructeur
|
||||
/// Destructor
|
||||
virtual ~CustomElementGraphicPart() {
|
||||
};
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
LineStyle _linestyle;
|
||||
LineWeight _lineweight;
|
||||
@@ -84,7 +83,7 @@ class CustomElementGraphicPart : public CustomElementPart {
|
||||
Color _color;
|
||||
bool _antialiased;
|
||||
|
||||
//methodes
|
||||
// methods
|
||||
public:
|
||||
void setLineStyle(LineStyle);
|
||||
void setLineWeight(LineWeight);
|
||||
@@ -109,75 +108,75 @@ class CustomElementGraphicPart : public CustomElementPart {
|
||||
};
|
||||
|
||||
/**
|
||||
Change le style de trait
|
||||
@param ls Le nouveau style de trait
|
||||
Set the primitive line style.
|
||||
@param ls the new line style
|
||||
*/
|
||||
inline void CustomElementGraphicPart::setLineStyle(LineStyle ls) {
|
||||
_linestyle = ls;
|
||||
}
|
||||
|
||||
/**
|
||||
Change l'epaisseur de trait
|
||||
@param lw La nouvelle epaisseur de trait
|
||||
Set the primitive line weight.
|
||||
@param lw the new line weight
|
||||
*/
|
||||
inline void CustomElementGraphicPart::setLineWeight(LineWeight lw) {
|
||||
_lineweight = lw;
|
||||
}
|
||||
|
||||
/**
|
||||
Change la couleur de remplissage
|
||||
@param f La nouvelle couleur de remplissage
|
||||
Set the filling color.
|
||||
@param f the new filling color
|
||||
*/
|
||||
inline void CustomElementGraphicPart::setFilling(Filling f) {
|
||||
_filling = f;
|
||||
}
|
||||
|
||||
/**
|
||||
Change la couleur de trait
|
||||
@param c La nouvelle couleur de trait
|
||||
Set the line color.
|
||||
@param c the new line color
|
||||
*/
|
||||
inline void CustomElementGraphicPart::setColor(Color c) {
|
||||
_color = c;
|
||||
}
|
||||
|
||||
/**
|
||||
@return Le style de trait
|
||||
@return the current line style
|
||||
*/
|
||||
inline CustomElementGraphicPart::LineStyle CustomElementGraphicPart::lineStyle() const {
|
||||
return(_linestyle);
|
||||
}
|
||||
|
||||
/**
|
||||
@return L'epaisseur de trait
|
||||
@return the current line weight
|
||||
*/
|
||||
inline CustomElementGraphicPart::LineWeight CustomElementGraphicPart::lineWeight() const {
|
||||
return(_lineweight);
|
||||
}
|
||||
|
||||
/**
|
||||
@return La couleur de remplissage
|
||||
@return the current filling color
|
||||
*/
|
||||
inline CustomElementGraphicPart::Filling CustomElementGraphicPart::filling() const {
|
||||
return(_filling);
|
||||
}
|
||||
|
||||
/**
|
||||
@return La couleur de trait
|
||||
@return the current line color
|
||||
*/
|
||||
inline CustomElementGraphicPart::Color CustomElementGraphicPart::color() const {
|
||||
return(_color);
|
||||
}
|
||||
|
||||
/**
|
||||
Definit si la partie doit etre antialiasee ou non
|
||||
@param aa True pour activer l'antialiasing, false pour le desactiver
|
||||
Set whether the primitive should be drawn antialiased.
|
||||
@param aa True to enable antialiasing, false to disable it.
|
||||
*/
|
||||
inline void CustomElementGraphicPart::setAntialiased(bool aa) {
|
||||
_antialiased = aa;
|
||||
}
|
||||
|
||||
/**
|
||||
@return true si la partie est antialiasee, false sinon
|
||||
@return whether the primitive is drawn antialiased.
|
||||
*/
|
||||
inline bool CustomElementGraphicPart::antialiased() const {
|
||||
return(_antialiased);
|
||||
|
||||
@@ -24,69 +24,67 @@ class CustomElement;
|
||||
class QETElementEditor;
|
||||
class ElementScene;
|
||||
/**
|
||||
Cette classe abstraite represente une partie de la representation graphique
|
||||
d'un element de schema electrique. Les attributs et methodes qu'elle
|
||||
encapsule ne sont pas integres directement dans la classe CustomElement
|
||||
afin de ne pas alourdir celle-ci. Il est en effet inutile pour cette classe
|
||||
de retenir sa conception graphique autrement que sous la forme d'une
|
||||
QImage.
|
||||
This abstract class represents a primitive of the visual representation of an
|
||||
electrical element. The Element, FixedElement and CustomElement classes do not
|
||||
embed its attributes and methods in order to remain lightweight; indeed, there
|
||||
is no point for those classes to store their visual representation with
|
||||
anything more complex than a QImage.
|
||||
*/
|
||||
class CustomElementPart {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
/**
|
||||
Constructeur
|
||||
@param editor Editeur d'element auquel cette partie est rattachee
|
||||
Constructor
|
||||
@param editor Element editor this primitive is attached to
|
||||
*/
|
||||
CustomElementPart(QETElementEditor *editor) : element_editor(editor) {}
|
||||
/// Destructeur
|
||||
/// Destructor
|
||||
virtual ~CustomElementPart() {}
|
||||
|
||||
private:
|
||||
CustomElementPart(const CustomElementPart &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QETElementEditor *element_editor;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
/**
|
||||
Charge la partie depuis un element XML sense le decrire
|
||||
Load the primitive from an XML element that describes it
|
||||
*/
|
||||
virtual void fromXml(const QDomElement &) = 0;
|
||||
/**
|
||||
Enregistre la partie dans un document XML
|
||||
Export the primitive as an XML element
|
||||
*/
|
||||
virtual const QDomElement toXml(QDomDocument &) const = 0;
|
||||
/**
|
||||
Permet de modifier une des proprietes de la partie
|
||||
Set a specific property of the primitive
|
||||
*/
|
||||
virtual void setProperty(const QString &, const QVariant &) = 0;
|
||||
/**
|
||||
Permet de lire une des proprietes de la partie
|
||||
Get the current value of a specific primitive property
|
||||
*/
|
||||
virtual QVariant property(const QString &) = 0;
|
||||
/**
|
||||
@return true si la partie n'est pas pertinente, false sinon
|
||||
Typiquement, une partie non pertinente n'est pas conservee lors de
|
||||
l'enregistrement de l'element.
|
||||
@return whether the primitive appears to be useless (e.g. 0-length line)
|
||||
Typically, useless primitives are discarded when saving the element.
|
||||
*/
|
||||
virtual bool isUseless() const = 0;
|
||||
/// @return un pointeur vers l'editeur d'element parent
|
||||
/// @return a pointer to the parent element editor
|
||||
virtual QETElementEditor *elementEditor() const;
|
||||
/**
|
||||
Appelle le slot updateCurrentPartEditor de l'editeur
|
||||
Call the updateCurrentPartEditor() slot of the editor
|
||||
@see QETElementEditor::updateCurrentPartEditor()
|
||||
*/
|
||||
virtual void updateCurrentPartEditor() const;
|
||||
/// @return un pointeur vers la scene d'edition parente
|
||||
/// @return a pointer to the parent editing scene
|
||||
virtual ElementScene *elementScene() const;
|
||||
/// @return la pile d'annulations a utiliser
|
||||
/// @return the element editor undo stack
|
||||
virtual QUndoStack &undoStack() const;
|
||||
/// @return le nom de la partie
|
||||
/// @return the name of the primitive
|
||||
virtual QString name() const = 0;
|
||||
/// @return le nom qui sera utilise pour nommer l'element XML lors de l'export
|
||||
/// @return the name that will be used as XML tag when exporting the primitive
|
||||
virtual QString xmlName() const = 0;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -25,69 +25,69 @@
|
||||
#include "qgimanager.h"
|
||||
#include <QtGui>
|
||||
/**
|
||||
Cette classe represente l'action de supprimer une ou plusieurs
|
||||
parties lors de l'edition d'un element
|
||||
This command deletes one or several primitives/parts when editing an
|
||||
electrical element.
|
||||
*/
|
||||
class DeletePartsCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
DeletePartsCommand(ElementScene *, const QList<QGraphicsItem *>, QUndoCommand * = 0);
|
||||
virtual ~DeletePartsCommand();
|
||||
private:
|
||||
DeletePartsCommand(const DeletePartsCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// Liste des parties supprimees
|
||||
/// Deleted primitives
|
||||
QList<QGraphicsItem *> deleted_parts;
|
||||
/// scene sur laquelle se produisent les actions
|
||||
/// Element editor/view/scene the command should take place on
|
||||
ElementScene *editor_scene;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de coller quelque chose dans un element
|
||||
This command pastes primitives when editing an electrical element.
|
||||
*/
|
||||
class PastePartsCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
PastePartsCommand(ElementView *, const ElementContent &, QUndoCommand * = 0);
|
||||
virtual ~PastePartsCommand();
|
||||
private:
|
||||
PastePartsCommand(const PastePartsCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
virtual void setOffset(int, const QPointF &, int, const QPointF &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// contenu ajoute
|
||||
/// Pasted content
|
||||
ElementContent content_;
|
||||
/// schema sur lequel on colle les elements et conducteurs
|
||||
/// Element editor/view/scene the command should take place on
|
||||
ElementView *editor_view_;
|
||||
ElementScene *editor_scene_;
|
||||
/// Informations pour annuler un c/c avec decalage
|
||||
/// Data required to undo a copy/paste with offset
|
||||
int old_offset_paste_count_;
|
||||
QPointF old_start_top_left_corner_;
|
||||
int new_offset_paste_count_;
|
||||
QPointF new_start_top_left_corner_;
|
||||
bool uses_offset;
|
||||
/// booleen pour empecher le premier appel a redo
|
||||
/// Prevent the first call to redo()
|
||||
bool first_redo;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de supprimer des parties d'un element
|
||||
This command cut primitives when editing an electrical element.
|
||||
*/
|
||||
class CutPartsCommand : public DeletePartsCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
CutPartsCommand(ElementScene *, const QList<QGraphicsItem *>, QUndoCommand * = 0);
|
||||
virtual ~CutPartsCommand();
|
||||
@@ -96,127 +96,127 @@ class CutPartsCommand : public DeletePartsCommand {
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de deplacer une ou plusieurs
|
||||
parties lors de l'edition d'un element
|
||||
This command moves primitives when editing an electrical element.
|
||||
*/
|
||||
class MovePartsCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
MovePartsCommand(const QPointF &, ElementScene *, const QList<QGraphicsItem *>, QUndoCommand * = 0);
|
||||
virtual ~MovePartsCommand();
|
||||
private:
|
||||
MovePartsCommand(const MovePartsCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// Liste des parties supprimees
|
||||
/// List of moved primitives
|
||||
QList<QGraphicsItem *> moved_parts;
|
||||
/// scene sur laquelle se produisent les actions
|
||||
/// Element editor/view/scene the command should take place on
|
||||
ElementScene *editor_scene;
|
||||
/// translation appliquee
|
||||
/// applied movement
|
||||
QPointF movement;
|
||||
/// booleen pour eviter d'appeler redo() lors de la construction de l'objet
|
||||
/// Prevent the first call to redo()
|
||||
bool first_redo;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action d'ajouter une partie lors de l'edition
|
||||
d'un element
|
||||
This command adds a primitive when editing an electrical element.
|
||||
*/
|
||||
class AddPartCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
AddPartCommand(const QString &, ElementScene *, QGraphicsItem *, QUndoCommand * = 0);
|
||||
virtual ~AddPartCommand();
|
||||
private:
|
||||
AddPartCommand(const AddPartCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// Liste des parties supprimees
|
||||
/// Added primitive
|
||||
QGraphicsItem *part;
|
||||
/// scene sur laquelle se produisent les actions
|
||||
/// Element editor/view/scene the command should take place on
|
||||
ElementScene *editor_scene;
|
||||
/// booleen pour eviter d'appeler redo() lors de la construction de l'objet
|
||||
/// Prevent the first call to redo()
|
||||
bool first_redo;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de modifier une propriete d'une partie
|
||||
lors de l'edition d'un element
|
||||
This command changes a property of a primitive when editing an electrical
|
||||
element.
|
||||
*/
|
||||
class ChangePartCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ChangePartCommand(const QString &, CustomElementPart *, const QString &, const QVariant &, const QVariant &, QUndoCommand * = 0);
|
||||
virtual ~ChangePartCommand();
|
||||
private:
|
||||
ChangePartCommand(const ChangePartCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// Partie modifiee
|
||||
/// Changed primitive
|
||||
CustomElementPart *cep;
|
||||
/// Propriete modifiee
|
||||
/// Changed property
|
||||
QString property;
|
||||
/// ancienne valeur
|
||||
/// Former value
|
||||
QVariant old_value;
|
||||
/// nouvelle valeur
|
||||
/// New value
|
||||
QVariant new_value;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de modifier les points composants un polygone
|
||||
This command changes the points of a polygon when editing an electrical
|
||||
element.
|
||||
*/
|
||||
class ChangePolygonPointsCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ChangePolygonPointsCommand(PartPolygon *, const QVector<QPointF> &, const QVector<QPointF> &, QUndoCommand * = 0);
|
||||
virtual ~ChangePolygonPointsCommand();
|
||||
private:
|
||||
ChangePolygonPointsCommand(const ChangePolygonPointsCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
// attributs
|
||||
/// Polygone modifie
|
||||
// attributes
|
||||
/// Changed polygon
|
||||
PartPolygon *polygon;
|
||||
/// anciens points
|
||||
/// Former points
|
||||
QVector<QPointF> old_points;
|
||||
/// nouveaux points
|
||||
/// New points
|
||||
QVector<QPointF> new_points;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de modifier les dimensions et le point de saisie d'un element
|
||||
This command changes the dimensions and/or the hotspot of an electrical
|
||||
element.
|
||||
*/
|
||||
class ChangeHotspotCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ChangeHotspotCommand(ElementScene *, const QSize &, const QSize &, const QPoint &, const QPoint &, const QPoint & = QPoint(), QUndoCommand * = 0);
|
||||
virtual ~ChangeHotspotCommand();
|
||||
private:
|
||||
ChangeHotspotCommand(const ChangeHotspotCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
@@ -224,92 +224,93 @@ class ChangeHotspotCommand : public QUndoCommand {
|
||||
private:
|
||||
void applyOffset(const QPointF &);
|
||||
|
||||
// attributs
|
||||
/// Element edite auquel il faut appliquer les modifications
|
||||
// attributes
|
||||
/// Element editor/view/scene the command should take place on
|
||||
ElementScene *element;
|
||||
/// dimensions avant l'action
|
||||
/// Former dimensions
|
||||
QSize size_before;
|
||||
/// dimensions apres l'action
|
||||
/// new dimensions
|
||||
QSize size_after;
|
||||
/// point de saisie avant l'action
|
||||
/// Former hotspot
|
||||
QPoint hotspot_before;
|
||||
/// point de saisie apres l'action
|
||||
/// New hotspot
|
||||
QPoint hotspot_after;
|
||||
/// decalage a appliquer aux elements
|
||||
/// Offset to be applied to primitives
|
||||
QPoint offset;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de changer les noms d'un element
|
||||
This command changes the translated names of an electrical element.
|
||||
*/
|
||||
class ChangeNamesCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ChangeNamesCommand(ElementScene *, const NamesList &, const NamesList &, QUndoCommand * = 0);
|
||||
virtual ~ChangeNamesCommand();
|
||||
private:
|
||||
ChangeNamesCommand(const ChangeNamesCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// Liste des noms avant changement
|
||||
/// List of former names
|
||||
NamesList names_before;
|
||||
/// Liste des noms apres changement
|
||||
/// List of new names
|
||||
NamesList names_after;
|
||||
/// Element edite auquel il faut appliquer les modifications
|
||||
/// Element editor/view/scene the command should take place on
|
||||
ElementScene *element;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de changer les noms d'un element
|
||||
This command changes the allowed orientations of an electrical element.
|
||||
*/
|
||||
class ChangeOrientationsCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ChangeOrientationsCommand(ElementScene *, const OrientationSet &, const OrientationSet &, QUndoCommand * = 0);
|
||||
virtual ~ChangeOrientationsCommand();
|
||||
private:
|
||||
ChangeOrientationsCommand(const ChangeOrientationsCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// Orientations avant changement
|
||||
/// Former orientations
|
||||
OrientationSet ori_before;
|
||||
/// Orientations apres changement
|
||||
/// New orientations
|
||||
OrientationSet ori_after;
|
||||
/// Element edite auquel il faut appliquer les modifications
|
||||
/// Element editor/view/scene the command should take place on
|
||||
ElementScene *element;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de changer les noms d'un element
|
||||
This command changes the zValue of a set of primitives when editing an
|
||||
electrical element.
|
||||
*/
|
||||
class ChangeZValueCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
/// Qualifie le type de changement de zValue
|
||||
/// List the various kind of changes for the zValue
|
||||
enum Option {
|
||||
BringForward, ///< Amene la partie a l'avant-plan ; elle a alors la plus haute zValue
|
||||
Raise, ///< Amene la partie un plan au-dessus ; la zValue de la partie est incrementee
|
||||
Lower, ///< Envoie la partie un plan en-dessous ; la zValue de la partie est decrementee
|
||||
SendBackward ///< Envoie la partie a l'arriere-plan ; elle a alors la plus faible zValue
|
||||
BringForward, ///< Bring primitives to the foreground so they have the highest zValue
|
||||
Raise, ///< Raise primitives one layer above their current one; zValues are incremented
|
||||
Lower, ///< Send primitives one layer below their current one; zValues are decremented
|
||||
SendBackward ///< Send primitives to the background so they have the lowest zValue
|
||||
};
|
||||
ChangeZValueCommand(ElementScene *, Option, QUndoCommand * = 0);
|
||||
virtual ~ChangeZValueCommand();
|
||||
private:
|
||||
ChangeZValueCommand(const ChangeZValueCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
@@ -320,67 +321,66 @@ class ChangeZValueCommand : public QUndoCommand {
|
||||
void applyLower(const QList<QGraphicsItem *> &);
|
||||
void applySendBackward(const QList<QGraphicsItem *> &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// zValues avant changement
|
||||
/// associates impacted primitives with their former zValues
|
||||
QHash<QGraphicsItem *, qreal> undo_hash;
|
||||
/// zValues apres changement
|
||||
/// associates impacted primitives with their new zValues
|
||||
QHash<QGraphicsItem *, qreal> redo_hash;
|
||||
/// Element edite auquel il faut appliquer les modifications
|
||||
/// Element editor/view/scene the command should take place on
|
||||
ElementScene *element;
|
||||
/// type de traitement
|
||||
/// kind of treatment to apply
|
||||
Option option;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action d'autoriser ou non les connexions
|
||||
internes pour un element.
|
||||
This command enables or disables internal connections for an electrical
|
||||
element.
|
||||
*/
|
||||
class AllowInternalConnectionsCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
AllowInternalConnectionsCommand(ElementScene *, bool, QUndoCommand * = 0);
|
||||
virtual ~AllowInternalConnectionsCommand();
|
||||
private:
|
||||
AllowInternalConnectionsCommand(const AllowInternalConnectionsCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// Element edite auquel il faut appliquer les modifications
|
||||
/// Element editor/view/scene the command should take place on
|
||||
ElementScene *element;
|
||||
/// autorisation des connexions internes apres modification
|
||||
/// whether internal connections are allowed afterward
|
||||
bool ic;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de changer les informations
|
||||
complementaires d'un element.
|
||||
This command changes extra information carried by an electrical element.
|
||||
*/
|
||||
class ChangeInformationsCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ChangeInformationsCommand(ElementScene *, const QString &, const QString &, QUndoCommand * = 0);
|
||||
virtual ~ChangeInformationsCommand();
|
||||
private:
|
||||
ChangeInformationsCommand(const ChangeInformationsCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// Element edite auquel il faut appliquer les modifications
|
||||
/// Element editor/view/scene the command should take place on
|
||||
ElementScene *element;
|
||||
/// Informations avant modification
|
||||
/// Former information
|
||||
QString old_informations_;
|
||||
/// Informations apres modification
|
||||
/// New information
|
||||
QString new_informations_;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -20,11 +20,12 @@
|
||||
#include <QList>
|
||||
class QGraphicsItem;
|
||||
/**
|
||||
Lors de son edition dans l'editeur d'element, un element est decompose en
|
||||
parties graphiques. La classe ElementContent represente un ensemble de parties
|
||||
graphiques constituant tout ou partie d'un element.
|
||||
Note : pour le moment, ElementContent est un typedef pour QList\<QGraphicsItem *\>
|
||||
@see la documentation Qt de la classe QList
|
||||
When edited using the element editor, electrical elements are decomposed into
|
||||
visual primitives. The ElementContent class represents a set of visual
|
||||
primitives composing all or a part of an electrical element.
|
||||
|
||||
Note: currently, ElementContent is a simple typedef for
|
||||
QList\<QGraphicsItem *\>
|
||||
*/
|
||||
typedef QList<QGraphicsItem *> ElementContent;
|
||||
#endif
|
||||
|
||||
@@ -22,21 +22,20 @@ class QETElementEditor;
|
||||
class ElementScene;
|
||||
class CustomElementPart;
|
||||
/**
|
||||
Cette classe est la classe de base pour les editeurs de parties dans
|
||||
l'editeur d'element. Elle fournit des methodes pour acceder facilement
|
||||
a l'editeur, a la pile d'annulation, a la scene d'edition ou encore pour
|
||||
ajouter facilement une annulation de type ChangePartCommand.
|
||||
This is the base class for primitives editors within the element editor. It
|
||||
provides methods to access the editor itself, the undo stack, the edition
|
||||
scene and even a method to easily take a ChangePartCommand into account.
|
||||
*/
|
||||
class ElementItemEditor : public QWidget {
|
||||
Q_OBJECT
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ElementItemEditor(QETElementEditor *, QWidget * = 0);
|
||||
virtual ~ElementItemEditor() {};
|
||||
private:
|
||||
ElementItemEditor(const ElementItemEditor &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual QETElementEditor *elementEditor() const;
|
||||
virtual ElementScene *elementScene() const;
|
||||
@@ -49,7 +48,7 @@ class ElementItemEditor : public QWidget {
|
||||
virtual CustomElementPart *currentPart() const = 0;
|
||||
virtual void updateForm() = 0;
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QETElementEditor *element_editor;
|
||||
QString element_type_name;
|
||||
|
||||
@@ -31,10 +31,9 @@ class PartCircle;
|
||||
class PartPolygon;
|
||||
class PartArc;
|
||||
/**
|
||||
Cette classe est le canevas permettant l'edition d'un element electrique.
|
||||
Elle regroupe les differentes parties composant le dessin de l'element mais
|
||||
egalement les informations complementaires : dimensions, orientations,
|
||||
noms.
|
||||
This class is the canvas allowing the visual edition of an electrial element.
|
||||
It displays the various primitives composing the drawing of the element, the
|
||||
border due to its fixed size and its hotspot.
|
||||
*/
|
||||
class ElementScene : public QGraphicsScene {
|
||||
Q_OBJECT
|
||||
@@ -42,7 +41,7 @@ class ElementScene : public QGraphicsScene {
|
||||
// enum
|
||||
enum Behavior { Normal, Line, Rectangle, Circle, Ellipse, Polygon, Text, Terminal, Arc, TextField, PasteArea };
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ElementScene(QETElementEditor *, QObject * = 0);
|
||||
virtual ~ElementScene();
|
||||
@@ -50,37 +49,36 @@ class ElementScene : public QGraphicsScene {
|
||||
private:
|
||||
ElementScene(const ElementScene &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// longueur de l'element en dizaines de pixels
|
||||
/// element width, in dozens of pixels
|
||||
uint _width;
|
||||
/// hauteur de l'element en dizaines de pixels
|
||||
/// element height, in dozens of pixels
|
||||
uint _height;
|
||||
/// position du point de saisie
|
||||
/// hotspot position
|
||||
QPoint _hotspot;
|
||||
/// Liste des noms de l'element
|
||||
/// List of localized names
|
||||
NamesList _names;
|
||||
/// Liste des orientations de l'element
|
||||
/// Set of orientations
|
||||
OrientationSet ori;
|
||||
/// booleen indiquant si les bornes de l'element peuvent etre reliees a des bornes de ce meme element
|
||||
/// whether internal connections (i.e. connections between terminals of a same element) are accepted
|
||||
bool internal_connections;
|
||||
/// Chaine contenant les informations complementaires de l'element
|
||||
/// Extra informations
|
||||
QString informations_;
|
||||
/// Gestionnaire de QGraphicsItem
|
||||
/// QGraphicsItem manager
|
||||
QGIManager qgi_manager;
|
||||
/// Pile des actions annulables
|
||||
/// Undo stack
|
||||
QUndoStack undo_stack;
|
||||
/**
|
||||
fsi_pos (first selected item pos) : Position du premier item
|
||||
selectionne : utilise pour annuler les deplacements a la souris ;
|
||||
egalement utilise pour gerer les deplacements avec les fleches du
|
||||
clavier.
|
||||
fsi_pos (first selected item pos) : Position of the forst selected item: used
|
||||
to cancel mouse movements; also used to handle movements using keybard
|
||||
arrwows.
|
||||
*/
|
||||
QPointF fsi_pos;
|
||||
QPointF moving_press_pos;
|
||||
bool moving_parts_;
|
||||
|
||||
/// Variables relatives a la gestion du dessin des parties sur la scene
|
||||
/// Variables related to drawing
|
||||
Behavior behavior;
|
||||
PartLine *current_line;
|
||||
PartRectangle *current_rectangle;
|
||||
@@ -90,19 +88,19 @@ class ElementScene : public QGraphicsScene {
|
||||
PartArc *current_arc;
|
||||
QETElementEditor *element_editor;
|
||||
|
||||
/// Variables relatives a la gestion de la zone de collage sur la scene
|
||||
/// Variables to manage the paste area on the scene
|
||||
QGraphicsRectItem *paste_area_;
|
||||
QRectF defined_paste_area_;
|
||||
|
||||
/// Variables relatives au copier-coller avec decalage
|
||||
/// Variables to handle copy/paste with offset
|
||||
QString last_copied_;
|
||||
|
||||
///< Taille horizontale de la grille
|
||||
///< Size of the horizontal grid step
|
||||
int x_grid;
|
||||
///< Taille verticale de la grille
|
||||
///< Size of the vertical grid step
|
||||
int y_grid;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
void setWidth(const uint &);
|
||||
uint width() const;
|
||||
@@ -188,22 +186,22 @@ class ElementScene : public QGraphicsScene {
|
||||
|
||||
signals:
|
||||
/**
|
||||
Signal emis lorsque la scene exige que l'editeur d'element repasse
|
||||
en mode normal
|
||||
Signal emitted when the scene requires the element editor to switch back to
|
||||
normal mode.
|
||||
*/
|
||||
void needNormalMode();
|
||||
/// Signal emis lorsqu'une ou plusieurs parties sont ajoutees
|
||||
/// Signal emitted after one or several parts were added
|
||||
void partsAdded();
|
||||
/// Signal emis lorsqu'une ou plusieurs parties sont enlevees
|
||||
/// Signal emitted after one or several parts were removed
|
||||
void partsRemoved();
|
||||
/// Signal emis lorsque la zValue d'une ou plusieurs parties change
|
||||
/// Signal emitted when the zValue of one or several parts change
|
||||
void partsZValueChanged();
|
||||
/// Signal emis lorsque l'utilisateur a fini de choisir une zone pour un copier/coller
|
||||
/// Signal emitted when users have defined the copy/paste area
|
||||
void pasteAreaDefined(const QRectF &);
|
||||
};
|
||||
|
||||
/**
|
||||
@param wid Nouvelle largeur de l'element edite
|
||||
@param wid the new width for the currently edited element
|
||||
*/
|
||||
inline void ElementScene::setWidth(const uint &wid) {
|
||||
_width = wid;
|
||||
@@ -212,14 +210,14 @@ inline void ElementScene::setWidth(const uint &wid) {
|
||||
}
|
||||
|
||||
/**
|
||||
@return la largeur de l'element edite
|
||||
@return the height of the currently edited element
|
||||
*/
|
||||
inline uint ElementScene::width() const {
|
||||
return(_width * 10);
|
||||
}
|
||||
|
||||
/**
|
||||
@param hei Nouvelle hauteur de l'element edite
|
||||
@param hei the new height for the currently edited element
|
||||
*/
|
||||
inline void ElementScene::setHeight(const uint &hei) {
|
||||
_height = hei;
|
||||
@@ -228,77 +226,77 @@ inline void ElementScene::setHeight(const uint &hei) {
|
||||
}
|
||||
|
||||
/**
|
||||
@return la largeur de l'element edite
|
||||
@return the width of the currently edited element
|
||||
*/
|
||||
inline uint ElementScene::height() const {
|
||||
return(_height * 10);
|
||||
}
|
||||
|
||||
/**
|
||||
@param hs Nouveau point de saisie de l'element edite
|
||||
@param hs the new hotspot for the currently edited element
|
||||
*/
|
||||
inline void ElementScene::setHotspot(const QPoint &hs) {
|
||||
_hotspot = hs;
|
||||
}
|
||||
|
||||
/**
|
||||
@return le point de saisie de l'element edite
|
||||
@return the hotspot of the currently edited element
|
||||
*/
|
||||
inline QPoint ElementScene::hotspot() const {
|
||||
return(_hotspot);
|
||||
}
|
||||
|
||||
/**
|
||||
@param nameslist Nouvel ensemble de noms de l'element edite
|
||||
@param nameslist New set of naes for the currently edited element
|
||||
*/
|
||||
inline void ElementScene::setNames(const NamesList &nameslist) {
|
||||
_names = nameslist;
|
||||
}
|
||||
|
||||
/**
|
||||
@return l'ensemble de noms de l'element edite
|
||||
@return the list of names of the currently edited element
|
||||
*/
|
||||
inline NamesList ElementScene::names() const {
|
||||
return(_names);
|
||||
}
|
||||
|
||||
/**
|
||||
@return l'ensemble d'orientations de l'element edite
|
||||
@return the orientation set of the currently edited element
|
||||
*/
|
||||
inline OrientationSet ElementScene::orientations() {
|
||||
return(ori);
|
||||
}
|
||||
|
||||
/**
|
||||
@param orientation_set Nouvel ensemble d'orientations de l'element edite
|
||||
@param orientation_set the new orientation set for the currently edited element
|
||||
*/
|
||||
inline void ElementScene::setOrientations(const OrientationSet &orientation_set) {
|
||||
ori = orientation_set;
|
||||
}
|
||||
|
||||
/**
|
||||
@return true si les connexions internes sont acceptees, false sinon
|
||||
@return whether internal connections are accepted
|
||||
*/
|
||||
inline bool ElementScene::internalConnections() {
|
||||
return(internal_connections);
|
||||
}
|
||||
|
||||
/**
|
||||
@param ic true pour que les connexions internes soient acceptees, false sinon
|
||||
@param ic true for internal connections to be accepted, false otherwise
|
||||
*/
|
||||
inline void ElementScene::setInternalConnections(bool ic) {
|
||||
internal_connections = ic;
|
||||
}
|
||||
|
||||
/**
|
||||
@return les informations complementaires de cet element
|
||||
@return extra informations of the currently edited element
|
||||
*/
|
||||
inline QString ElementScene::informations() const {
|
||||
return(informations_);
|
||||
}
|
||||
|
||||
/**
|
||||
@param infos les nouvelles informations complementaires de cet element
|
||||
@param infos new extra information for the currently edited element
|
||||
*/
|
||||
inline void ElementScene::setInformations(const QString &infos) {
|
||||
informations_ = infos;
|
||||
|
||||
@@ -20,14 +20,14 @@
|
||||
#include <QGraphicsView>
|
||||
#include "elementscene.h"
|
||||
/**
|
||||
Cette classe represente un widget permettant de visualiser une
|
||||
ElementScene, c'est-a-dire la classe d'edition des elements.
|
||||
This class provides a widget to render an ElementScene instance, i.e. the
|
||||
edition class for electrical elements.
|
||||
*/
|
||||
class ElementView : public QGraphicsView {
|
||||
Q_OBJECT
|
||||
friend class PastePartsCommand;
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ElementView(ElementScene *, QWidget * = 0);
|
||||
virtual ~ElementView();
|
||||
@@ -35,7 +35,7 @@ class ElementView : public QGraphicsView {
|
||||
private:
|
||||
ElementView(const ElementView &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
ElementScene *scene() const;
|
||||
void setScene(ElementScene *);
|
||||
@@ -50,7 +50,6 @@ class ElementView : public QGraphicsView {
|
||||
private:
|
||||
QRectF applyMovement(const QRectF &, const QET::OrientedMovement &, const QPointF &);
|
||||
|
||||
// slots
|
||||
public slots:
|
||||
void zoomIn();
|
||||
void zoomOut();
|
||||
@@ -69,7 +68,7 @@ class ElementView : public QGraphicsView {
|
||||
ElementContent paste(const QDomDocument &, const QPointF &);
|
||||
ElementContent pasteWithOffset(const QDomDocument &);
|
||||
|
||||
//attributs
|
||||
// attributes
|
||||
private:
|
||||
ElementScene *scene_;
|
||||
QString to_paste_in_area_;
|
||||
|
||||
@@ -22,25 +22,24 @@
|
||||
class PartEllipse;
|
||||
class StyleEditor;
|
||||
/**
|
||||
Cette classe represente le widget d'edition d'une ellipse dans l'editeur
|
||||
d'element.
|
||||
This class provides a widget to edit ellipses within the element editor.
|
||||
*/
|
||||
class EllipseEditor : public ElementItemEditor {
|
||||
Q_OBJECT
|
||||
//constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
EllipseEditor(QETElementEditor *, PartEllipse * = 0, QWidget * = 0);
|
||||
virtual ~EllipseEditor();
|
||||
private:
|
||||
EllipseEditor(const EllipseEditor &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
PartEllipse *part;
|
||||
StyleEditor *style_;
|
||||
QLineEdit *x, *y, *h, *v;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual bool setPart(CustomElementPart *);
|
||||
virtual CustomElementPart *currentPart() const;
|
||||
|
||||
@@ -22,19 +22,18 @@
|
||||
class PartLine;
|
||||
class StyleEditor;
|
||||
/**
|
||||
Cette classe represente le widget d'edition d'une ligne dans l'editeur
|
||||
d'element.
|
||||
This class provides a widget to edit lines within the element editor.
|
||||
*/
|
||||
class LineEditor : public ElementItemEditor {
|
||||
Q_OBJECT
|
||||
//constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
LineEditor(QETElementEditor *, PartLine * = 0, QWidget * = 0);
|
||||
virtual ~LineEditor();
|
||||
private:
|
||||
LineEditor(const LineEditor &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
PartLine *part;
|
||||
StyleEditor *style_;
|
||||
@@ -42,7 +41,7 @@ class LineEditor : public ElementItemEditor {
|
||||
QComboBox *end1_type, *end2_type;
|
||||
QLineEdit *end1_length, *end2_length;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual bool setPart(CustomElementPart *);
|
||||
virtual CustomElementPart *currentPart() const;
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
#include <QtGui>
|
||||
#include "customelementgraphicpart.h"
|
||||
/**
|
||||
Cette classe represente un arc pouvant etre utilise pour composer le
|
||||
dessin d'un element dans l'editeur d'element.
|
||||
This class represents an elliptical arc primitive which may be used to
|
||||
compose the drawing of an electrical element within the element editor.
|
||||
*/
|
||||
class PartArc : public QGraphicsEllipseItem, public CustomElementGraphicPart {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
PartArc(QETElementEditor *, QGraphicsItem * = 0, QGraphicsScene * = 0);
|
||||
virtual ~PartArc();
|
||||
@@ -32,17 +32,18 @@ class PartArc : public QGraphicsEllipseItem, public CustomElementGraphicPart {
|
||||
private:
|
||||
PartArc(const PartArc &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
int _angle;
|
||||
int start_angle;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
enum { Type = UserType + 1101 };
|
||||
/**
|
||||
permet de caster un QGraphicsItem en PartArc avec qgraphicsitem_cast
|
||||
@return le type de QGraphicsItem
|
||||
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a
|
||||
PartArc.
|
||||
@return the QGraphicsItem type
|
||||
*/
|
||||
virtual int type() const { return Type; }
|
||||
virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = 0);
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
#include <QtGui>
|
||||
#include "customelementgraphicpart.h"
|
||||
/**
|
||||
Cette classe represente un cercle pouvant etre utilise pour composer le
|
||||
dessin d'un element dans l'editeur d'element.
|
||||
This class represents a circle primitive which may be used to compose the
|
||||
drawing of an electrical element within the element editor.
|
||||
*/
|
||||
class PartCircle : public QGraphicsEllipseItem, public CustomElementGraphicPart {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
PartCircle(QETElementEditor *, QGraphicsItem * = 0, QGraphicsScene * = 0);
|
||||
virtual ~PartCircle();
|
||||
@@ -32,12 +32,13 @@ class PartCircle : public QGraphicsEllipseItem, public CustomElementGraphicPart
|
||||
private:
|
||||
PartCircle(const PartCircle &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
enum { Type = UserType + 1102 };
|
||||
/**
|
||||
permet de caster un QGraphicsItem en PartCircle avec qgraphicsitem_cast
|
||||
@return le type de QGraphicsItem
|
||||
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a
|
||||
PartCircle.
|
||||
@return the QGraphicsItem type
|
||||
*/
|
||||
virtual int type() const { return Type; }
|
||||
virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = 0);
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
#include <QtGui>
|
||||
#include "customelementgraphicpart.h"
|
||||
/**
|
||||
Cette classe represente une ellipse pouvant etre utilisee pour composer le
|
||||
dessin d'un element dans l'editeur d'element.
|
||||
This class represents an ellipse primitive which may be used to compose the
|
||||
drawing of an electrical element within the element editor.
|
||||
*/
|
||||
class PartEllipse : public QGraphicsEllipseItem, public CustomElementGraphicPart {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
PartEllipse(QETElementEditor *, QGraphicsItem * = 0, QGraphicsScene * = 0);
|
||||
virtual ~PartEllipse();
|
||||
@@ -32,12 +32,13 @@ class PartEllipse : public QGraphicsEllipseItem, public CustomElementGraphicPart
|
||||
private:
|
||||
PartEllipse(const PartEllipse &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
enum { Type = UserType + 1103 };
|
||||
/**
|
||||
permet de caster un QGraphicsItem en PartEllipse avec qgraphicsitem_cast
|
||||
@return le type de QGraphicsItem
|
||||
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a
|
||||
PartEllipse.
|
||||
@return the QGraphicsItem type
|
||||
*/
|
||||
virtual int type() const { return Type; }
|
||||
virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = 0);
|
||||
|
||||
@@ -21,18 +21,16 @@
|
||||
#include "customelementgraphicpart.h"
|
||||
#include "qet.h"
|
||||
/**
|
||||
Cette classe represente une ligne pouvant etre utilisee pour composer le
|
||||
dessin d'un element dans l'editeur d'element.
|
||||
Une ligne est composee de deux points. Elle peut comporter des extremites
|
||||
speciales definissables grace aux methodes setFirstEndType et
|
||||
setSecondEndType. La taille des extremites est definissable via les
|
||||
methodes setFirstEndLength et setSecondEndLength.
|
||||
A noter que les extremites ne sont pas dessinees si la longueur requise
|
||||
pour leur dessin n'est pas contenue dans la ligne. S'il n'y a de la place
|
||||
que pour une seule extremite, c'est la premiere qui est privilegiee.
|
||||
This class represents a line primitive which may be used to compose the
|
||||
drawing of an electrical element within the element editor. Lines may have
|
||||
specific visual ends (e.g. arrows) through the setFirstEndType and
|
||||
setSecondEndType methods. Their size can be defined using the
|
||||
setFirstEndLength and setSecondEndLength methods. Please note ends are not
|
||||
drawn if the required length for their drawing is longer than the line itself.
|
||||
In case there is room for a single end only, the first one get priority.
|
||||
*/
|
||||
class PartLine : public QGraphicsLineItem, public CustomElementGraphicPart {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
PartLine(QETElementEditor *, QGraphicsItem * = 0, QGraphicsScene * = 0);
|
||||
virtual ~PartLine();
|
||||
@@ -40,20 +38,21 @@ class PartLine : public QGraphicsLineItem, public CustomElementGraphicPart {
|
||||
private:
|
||||
PartLine(const PartLine &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QET::EndType first_end;
|
||||
qreal first_length;
|
||||
QET::EndType second_end;
|
||||
qreal second_length;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
enum { Type = UserType + 1104 };
|
||||
|
||||
/**
|
||||
permet de caster un QGraphicsItem en PartLine avec qgraphicsitem_cast
|
||||
@return le type de QGraphicsItem
|
||||
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a
|
||||
PartLine.
|
||||
@return the QGraphicsItem type
|
||||
*/
|
||||
virtual int type() const { return Type; }
|
||||
virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = 0);
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
#include <QtGui>
|
||||
#include "customelementgraphicpart.h"
|
||||
/**
|
||||
Cette classe represente un polygone pouvant etre utilise pour composer le
|
||||
dessin d'un element dans l'editeur d'element.
|
||||
This class represents a polygon primitive which may be used to compose the
|
||||
drawing of an electrical element within the element editor.
|
||||
*/
|
||||
class PartPolygon : public QGraphicsPolygonItem, public CustomElementGraphicPart {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
PartPolygon(QETElementEditor *, QGraphicsItem * = 0, QGraphicsScene * = 0);
|
||||
virtual ~PartPolygon();
|
||||
@@ -32,16 +32,17 @@ class PartPolygon : public QGraphicsPolygonItem, public CustomElementGraphicPart
|
||||
private:
|
||||
PartPolygon(const PartPolygon &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
bool closed;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
enum { Type = UserType + 1105 };
|
||||
/**
|
||||
permet de caster un QGraphicsItem en PartPolygon avec qgraphicsitem_cast
|
||||
@return le type de QGraphicsItem
|
||||
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a
|
||||
PartPolygon.
|
||||
@return the QGraphicsItem type
|
||||
*/
|
||||
virtual int type() const { return Type; }
|
||||
virtual QString name() const { return(QObject::tr("polygone", "element part name")); }
|
||||
@@ -61,16 +62,16 @@ class PartPolygon : public QGraphicsPolygonItem, public CustomElementGraphicPart
|
||||
};
|
||||
|
||||
/**
|
||||
Specifie si le polygone doit etre ferme
|
||||
@param c true pour un polygone ferme, false sinon
|
||||
Whether the polygon should be closed.
|
||||
@param c true for the polygon to be closed, false otherwise
|
||||
*/
|
||||
inline void PartPolygon::setClosed(bool c) {
|
||||
closed = c;
|
||||
}
|
||||
|
||||
/**
|
||||
Indique si le polygone est ferme
|
||||
@return true si le polygone est ferme, false sinon
|
||||
Indicate whether the polygon is closed.
|
||||
@return true if the polygon is closed, false otherwise
|
||||
*/
|
||||
inline bool PartPolygon::isClosed() const {
|
||||
return(closed);
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
#include <QtGui>
|
||||
#include "customelementgraphicpart.h"
|
||||
/**
|
||||
Cette classe represente un rectangle pouvant etre utilise pour composer le
|
||||
dessin d'un element dans l'editeur d'element.
|
||||
This class represents a rectangle primitive which may be used to compose the
|
||||
drawing of an electrical element within the element editor.
|
||||
*/
|
||||
class PartRectangle : public QGraphicsRectItem, public CustomElementGraphicPart {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
PartRectangle(QETElementEditor *, QGraphicsItem * = 0, QGraphicsScene * = 0);
|
||||
virtual ~PartRectangle();
|
||||
@@ -32,12 +32,13 @@ class PartRectangle : public QGraphicsRectItem, public CustomElementGraphicPart
|
||||
private:
|
||||
PartRectangle(const PartRectangle &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
enum { Type = UserType + 1109 };
|
||||
/**
|
||||
permet de caster un QGraphicsItem en PartRectangle avec qgraphicsitem_cast
|
||||
@return le type de QGraphicsItem
|
||||
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a
|
||||
PartRectangle.
|
||||
@return the QGraphicsItem type
|
||||
*/
|
||||
virtual int type() const { return Type; }
|
||||
virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget * = 0);
|
||||
|
||||
@@ -21,28 +21,29 @@
|
||||
#include "qet.h"
|
||||
#include <QtGui>
|
||||
/**
|
||||
Cette classe represente une borne pouvant etre utilisee pour composer le
|
||||
dessin d'un element dans l'editeur d'element.
|
||||
This class represents a terminal which may be used to compose the drawing of
|
||||
an electrical element within the element editor.
|
||||
*/
|
||||
class PartTerminal : public CustomElementPart, public QGraphicsItem {
|
||||
public:
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
PartTerminal(QETElementEditor *, QGraphicsItem * = 0, QGraphicsScene * = 0);
|
||||
virtual ~PartTerminal();
|
||||
private:
|
||||
PartTerminal(const PartTerminal &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QET::Orientation _orientation;
|
||||
QPointF second_point;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
enum { Type = UserType + 1106 };
|
||||
/**
|
||||
permet de caster un QGraphicsItem en PartTerminal avec qgraphicsitem_cast
|
||||
@return le type de QGraphicsItem
|
||||
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a
|
||||
PartTerminal.
|
||||
@return the QGraphicsItem type
|
||||
*/
|
||||
virtual int type() const { return Type; }
|
||||
virtual QString name() const { return(QObject::tr("borne", "element part name")); }
|
||||
|
||||
@@ -21,13 +21,13 @@
|
||||
#include "customelementpart.h"
|
||||
class TextEditor;
|
||||
/**
|
||||
Cette classe represente un texte pouvant etre utilise pour composer le
|
||||
dessin d'un element dans l'editeur d'element.
|
||||
This class represents an static text primitive which may be used to compose
|
||||
the drawing of an electrical element within the element editor.
|
||||
*/
|
||||
class PartText : public QGraphicsTextItem, public CustomElementPart {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
PartText(QETElementEditor *, QGraphicsItem * = 0, ElementScene * = 0);
|
||||
virtual ~PartText();
|
||||
@@ -35,12 +35,13 @@ class PartText : public QGraphicsTextItem, public CustomElementPart {
|
||||
private:
|
||||
PartText(const PartText &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
enum { Type = UserType + 1107 };
|
||||
/**
|
||||
permet de caster un QGraphicsItem en PartText avec qgraphicsitem_cast
|
||||
@return le type de QGraphicsItem
|
||||
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a
|
||||
PartText.
|
||||
@return the QGraphicsItem type
|
||||
*/
|
||||
virtual int type() const { return Type; }
|
||||
virtual QString name() const { return(QObject::tr("texte", "element part name")); }
|
||||
|
||||
@@ -22,15 +22,15 @@
|
||||
class TextFieldEditor;
|
||||
class QETElementEditor;
|
||||
/**
|
||||
Cette classe represente un champ de texte editable pouvant etre utilise
|
||||
pour composer le dessin d'un element dans l'editeur d'element.
|
||||
L'utilisateur peut specifier un valeur par defaut. Le champ sera editable
|
||||
lorsque l'element sera pose sur un schema.
|
||||
This class represents an editable text field which may be used to compose the
|
||||
drawing of an electrical element within the element editor. Users may specify
|
||||
a default value. The field will remain editable once the element is added onto
|
||||
a diagram. lorsque l'element sera pose sur un schema.
|
||||
*/
|
||||
class PartTextField : public QGraphicsTextItem, public CustomElementPart {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
PartTextField(QETElementEditor *, QGraphicsItem * = 0, QGraphicsScene * = 0);
|
||||
virtual ~PartTextField();
|
||||
@@ -38,15 +38,16 @@ class PartTextField : public QGraphicsTextItem, public CustomElementPart {
|
||||
private:
|
||||
PartTextField(const PartTextField &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
bool follow_parent_rotations;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
enum { Type = UserType + 1108 };
|
||||
/**
|
||||
permet de caster un QGraphicsItem en PartTextField avec qgraphicsitem_cast
|
||||
@return le type de QGraphicsItem
|
||||
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a
|
||||
PartTextField.
|
||||
@return the QGraphicsItem type
|
||||
*/
|
||||
virtual int type() const { return Type; }
|
||||
virtual QString name() const { return(QObject::tr("champ de texte", "element part name")); }
|
||||
|
||||
@@ -21,14 +21,13 @@
|
||||
class PartPolygon;
|
||||
class StyleEditor;
|
||||
/**
|
||||
Cette classe represente le widget d'edition d'un polygone dans l'editeur
|
||||
d'element.
|
||||
This class provides a widget to edit polygons within the element editor.
|
||||
*/
|
||||
class PolygonEditor : public ElementItemEditor {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
PolygonEditor(QETElementEditor *, PartPolygon * = 0, QWidget * = 0);
|
||||
virtual ~PolygonEditor();
|
||||
@@ -36,14 +35,14 @@ class PolygonEditor : public ElementItemEditor {
|
||||
private:
|
||||
PolygonEditor(const PolygonEditor &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
PartPolygon *part;
|
||||
StyleEditor *style_;
|
||||
QTreeWidget points_list;
|
||||
QCheckBox close_polygon;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual bool setPart(CustomElementPart *);
|
||||
virtual CustomElementPart *currentPart() const;
|
||||
|
||||
@@ -26,72 +26,71 @@
|
||||
class ElementItemEditor;
|
||||
class ElementView;
|
||||
/**
|
||||
Cette classe represente un editeur d'element. Elle permet a l'utilisateur
|
||||
de dessiner, modifier et parametrer un element electrique. Le dessin se
|
||||
fait par ajout de parties (Part).
|
||||
This class represents an element editor, allowing users to draw, change and
|
||||
configure a particular electrical element.
|
||||
*/
|
||||
class QETElementEditor : public QETMainWindow {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeur, destructeur
|
||||
// constructor, destructor
|
||||
public:
|
||||
QETElementEditor(QWidget * = 0);
|
||||
virtual ~QETElementEditor();
|
||||
private:
|
||||
QETElementEditor(const QETElementEditor &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// booleen indiquant si l'editeur est en mode "lecture seule" ou non
|
||||
/// whether the editor is "read-only"
|
||||
bool read_only;
|
||||
/// menus
|
||||
QMenu *file_menu, *edit_menu, *paste_from_menu, *display_menu, *tools_menu;
|
||||
/// vue sur la scene d'edition
|
||||
/// view widget for the editing scene
|
||||
ElementView *ce_view;
|
||||
/// scene d'edition
|
||||
/// editing scene
|
||||
ElementScene *ce_scene;
|
||||
/// container pour les widgets d'edition des parties
|
||||
/// container for widgets dedicated to primitive edition
|
||||
QDockWidget *tools_dock;
|
||||
/// Pile de widgets pour tools_dock
|
||||
/// Stack of widgets for tools_dock
|
||||
QStackedWidget *tools_dock_stack_;
|
||||
/// label affiche lors de la selection de plusieurs elements
|
||||
/// label displayed when several primitives are selected
|
||||
QLabel *default_informations;
|
||||
/// Hash permettant d'acceder aux widgets d'editions disponibles
|
||||
/// Hash associating primitive names with their matching edition widget
|
||||
QHash<QString, ElementItemEditor *> editors_;
|
||||
/// ScrollArea pour le DockWidget affichant des infos sur la partie selectionnee
|
||||
/// ScrollArea for the tools_dock DockWidget
|
||||
QScrollArea *tools_dock_scroll_area_;
|
||||
/// container pour la liste des annulations
|
||||
/// container for the undo list
|
||||
QDockWidget *undo_dock;
|
||||
/// Container pour la liste des parties
|
||||
/// Container for the list of existing primitives
|
||||
QDockWidget *parts_dock;
|
||||
/// Liste des parties
|
||||
/// List of primitives
|
||||
QListWidget *parts_list;
|
||||
/// actions du menu fichier
|
||||
/// actions for the "file" menu
|
||||
QAction *new_element, *open, *open_file, *save, *save_as, *save_as_file, *reload, *quit;
|
||||
/// actions du menu edition
|
||||
/// actions for the "edit" menu
|
||||
QAction *selectall, *deselectall, *inv_select;
|
||||
QAction *cut, *copy, *paste, *paste_in_area, *paste_from_file, *paste_from_elmt;
|
||||
QAction *undo, *redo;
|
||||
QAction *edit_delete, *edit_size_hs, *edit_names, *edit_ori, *edit_author;
|
||||
QAction *edit_raise, *edit_lower, *edit_backward, *edit_forward;
|
||||
/// actions du menu affichage
|
||||
/// actions for the "display" menu
|
||||
QAction *zoom_in, *zoom_out, *zoom_fit, *zoom_reset;
|
||||
/// barres d'outils
|
||||
/// toolbars
|
||||
QToolBar *parts_toolbar, *main_toolbar, *view_toolbar, *depth_toolbar, *element_toolbar;
|
||||
/// actions de la barre d'outils
|
||||
/// toolbars actions
|
||||
QActionGroup *parts;
|
||||
QAction *move, *add_line, *add_circle, *add_rectangle, *add_ellipse, *add_polygon, *add_text;
|
||||
QAction *add_arc, *add_terminal, *add_textfield;
|
||||
/// titre minimal
|
||||
/// minimum window title
|
||||
QString min_title;
|
||||
/// Nom de fichier de l'element edite
|
||||
/// filename of the currently edited element
|
||||
QString filename_;
|
||||
/// Emplacement de l'element edite
|
||||
/// location of the currently edited element
|
||||
ElementsLocation location_;
|
||||
/// booleen indiquant si l'element en cours d'edition provient d'un fichier ou d'un emplacement
|
||||
/// whether the currently edited element comes from a file or a location
|
||||
bool opened_from_file;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
void setSize(const QSize &);
|
||||
QSize size() const;
|
||||
@@ -158,7 +157,7 @@ class QETElementEditor : public QETMainWindow {
|
||||
};
|
||||
|
||||
/**
|
||||
@param siz La nouvelle taille de l'element edite
|
||||
@param siz The new size for the currently edited element
|
||||
*/
|
||||
inline void QETElementEditor::setSize(const QSize &siz) {
|
||||
ce_scene -> setWidth(siz.width());
|
||||
@@ -166,7 +165,7 @@ inline void QETElementEditor::setSize(const QSize &siz) {
|
||||
}
|
||||
|
||||
/**
|
||||
@return la taille de l'element edite
|
||||
@return the size of the currently edited element
|
||||
*/
|
||||
inline QSize QETElementEditor::size() const {
|
||||
return(
|
||||
@@ -178,56 +177,56 @@ inline QSize QETElementEditor::size() const {
|
||||
}
|
||||
|
||||
/**
|
||||
@param hs Le nouveau point de saisie de l'element edite
|
||||
@param hs The new hotspot for the currently edited element
|
||||
*/
|
||||
inline void QETElementEditor::setHotspot(const QPoint &hs) {
|
||||
ce_scene -> setHotspot(hs);
|
||||
}
|
||||
|
||||
/**
|
||||
@return le point de saisie de l'element edite
|
||||
@return the hotspot of the currently edited element
|
||||
*/
|
||||
inline QPoint QETElementEditor::hotspot() const {
|
||||
return(ce_scene -> hotspot());
|
||||
}
|
||||
|
||||
/**
|
||||
@param nameslist le nouvel ensemble de noms de l'element edite
|
||||
@param nameslist the new list of names for the currently edited element
|
||||
*/
|
||||
inline void QETElementEditor::setNames(const NamesList &nameslist) {
|
||||
ce_scene -> setNames(nameslist);
|
||||
}
|
||||
|
||||
/**
|
||||
@param orientation_set le nouvel ensemble d'orientations de l'element edite
|
||||
@param orientation_set the new set of orientations for the currently edited element
|
||||
*/
|
||||
inline void QETElementEditor::setOrientations(const OrientationSet &orientation_set) {
|
||||
ce_scene -> setOrientations(orientation_set);
|
||||
}
|
||||
|
||||
/**
|
||||
@return le nouvel ensemble d'orientations de l'element edite
|
||||
@param the set of orientations for the currently edited element
|
||||
*/
|
||||
inline OrientationSet QETElementEditor::orientations() const {
|
||||
return(ce_scene -> orientations());
|
||||
}
|
||||
|
||||
/**
|
||||
@return l'emplacement de l'element edite
|
||||
@return the location of the currently edited element
|
||||
*/
|
||||
inline ElementsLocation QETElementEditor::location() const {
|
||||
return(location_);
|
||||
}
|
||||
|
||||
/**
|
||||
@return le nom de fichier de l'element edite
|
||||
@return the filename of the currently edited element
|
||||
*/
|
||||
inline QString QETElementEditor::fileName() const {
|
||||
return(filename_);
|
||||
}
|
||||
|
||||
/**
|
||||
@return la scene d'edition de l'element
|
||||
@return the editing scene
|
||||
*/
|
||||
inline ElementScene *QETElementEditor::elementScene() const {
|
||||
return(ce_scene);
|
||||
|
||||
@@ -22,25 +22,24 @@
|
||||
class PartRectangle;
|
||||
class StyleEditor;
|
||||
/**
|
||||
Cette classe represente le widget d'edition d'un rectangle dans l'editeur
|
||||
d'element.
|
||||
This class provides a widget to edit rectangles within the element editor.
|
||||
*/
|
||||
class RectangleEditor : public ElementItemEditor {
|
||||
Q_OBJECT
|
||||
//constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
RectangleEditor(QETElementEditor *, PartRectangle * = 0, QWidget * = 0);
|
||||
virtual ~RectangleEditor();
|
||||
private:
|
||||
RectangleEditor(const RectangleEditor &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
PartRectangle *part;
|
||||
StyleEditor *style_;
|
||||
QLineEdit *x, *y, *w, *h;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual bool setPart(CustomElementPart *);
|
||||
virtual CustomElementPart *currentPart() const;
|
||||
|
||||
@@ -21,14 +21,14 @@
|
||||
#include "elementitemeditor.h"
|
||||
class CustomElementGraphicPart;
|
||||
/**
|
||||
Cette classe represente un widget d'edition des styles que peut comporter
|
||||
une partie d'elements (couleur, epaisseur et style du trait, remplissage,
|
||||
antialiasing). Elle peut accueillir un widget sous cette interface grace a
|
||||
la methode appendWidget.
|
||||
This class provides a widget to edit styles (color, pen style and thickness,
|
||||
filling, antialiasing) common to most primitives within the element editor.
|
||||
Its appendWidget() method makes the insertion of another widget below it
|
||||
easier.
|
||||
*/
|
||||
class StyleEditor : public ElementItemEditor {
|
||||
Q_OBJECT
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
StyleEditor(QETElementEditor *, CustomElementGraphicPart * = 0, QWidget * = 0);
|
||||
virtual ~StyleEditor();
|
||||
@@ -36,7 +36,7 @@ class StyleEditor : public ElementItemEditor {
|
||||
private:
|
||||
StyleEditor(const StyleEditor &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
CustomElementGraphicPart *part;
|
||||
QVBoxLayout *main_layout;
|
||||
@@ -46,7 +46,7 @@ class StyleEditor : public ElementItemEditor {
|
||||
QRadioButton *black_filling, *white_filling;
|
||||
QCheckBox *antialiasing;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual bool setPart(CustomElementPart *);
|
||||
virtual CustomElementPart *currentPart() const;
|
||||
|
||||
@@ -21,26 +21,24 @@
|
||||
#include "elementitemeditor.h"
|
||||
class PartTerminal;
|
||||
/**
|
||||
Cette classe represente un editeur de borne.
|
||||
Elle permet d'editer a travers une interface graphique les
|
||||
proprietes d'une borne d'element.
|
||||
This class provides a widget to edit terminals within the element editor.
|
||||
*/
|
||||
class TerminalEditor : public ElementItemEditor {
|
||||
Q_OBJECT
|
||||
// Constructeurs, destructeur
|
||||
// Constructors, destructor
|
||||
public:
|
||||
TerminalEditor(QETElementEditor *, PartTerminal * = 0, QWidget * = 0);
|
||||
virtual ~TerminalEditor();
|
||||
private:
|
||||
TerminalEditor(const TerminalEditor &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
PartTerminal *part;
|
||||
QLineEdit *qle_x, *qle_y;
|
||||
QComboBox *orientation;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual bool setPart(CustomElementPart *);
|
||||
virtual CustomElementPart *currentPart() const;
|
||||
|
||||
@@ -22,20 +22,19 @@
|
||||
class PartText;
|
||||
class QTextOrientationSpinBoxWidget;
|
||||
/**
|
||||
Cette classe represente un editeur de champ de texte non editable
|
||||
Elle permet d'editer a travers une interface graphique les
|
||||
proprietes d'un champ de texte non editable.
|
||||
This class provides a widget to edit static texts within the element
|
||||
editor.
|
||||
*/
|
||||
class TextEditor : public ElementItemEditor {
|
||||
Q_OBJECT
|
||||
// Constructeurs, destructeur
|
||||
// Constructors, destructor
|
||||
public:
|
||||
TextEditor(QETElementEditor *, PartText * = 0, QWidget * = 0);
|
||||
virtual ~TextEditor();
|
||||
private:
|
||||
TextEditor(const TextEditor &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
PartText *part;
|
||||
QLineEdit *qle_x, *qle_y, *qle_text;
|
||||
@@ -44,7 +43,7 @@ class TextEditor : public ElementItemEditor {
|
||||
QRadioButton *black_color_, *white_color_;
|
||||
QTextOrientationSpinBoxWidget *rotation_angle_;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual bool setPart(CustomElementPart *);
|
||||
virtual CustomElementPart *currentPart() const;
|
||||
|
||||
@@ -22,21 +22,18 @@
|
||||
class PartTextField;
|
||||
class QTextOrientationSpinBoxWidget;
|
||||
/**
|
||||
Cette classe represente un editeur de champ de texte
|
||||
Elle permet d'editer a travers une interface graphique les
|
||||
proprietes d'un champ de texte : taille de la police, texte par
|
||||
defaut et position.
|
||||
This class provides a widget to edit text fields within the element editor.
|
||||
*/
|
||||
class TextFieldEditor : public ElementItemEditor {
|
||||
Q_OBJECT
|
||||
// Constructeurs, destructeur
|
||||
// Constructors, destructor
|
||||
public:
|
||||
TextFieldEditor(QETElementEditor *, PartTextField * = 0, QWidget * = 0);
|
||||
virtual ~TextFieldEditor();
|
||||
private:
|
||||
TextFieldEditor(const TextFieldEditor &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
PartTextField *part;
|
||||
QLineEdit *qle_x, *qle_y, *qle_text;
|
||||
@@ -44,7 +41,7 @@ class TextFieldEditor : public ElementItemEditor {
|
||||
QCheckBox *rotate;
|
||||
QTextOrientationSpinBoxWidget *rotation_angle_;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual bool setPart(CustomElementPart *);
|
||||
virtual CustomElementPart *currentPart() const;
|
||||
|
||||
Reference in New Issue
Block a user