mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +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:
@@ -20,13 +20,12 @@
|
||||
#include <QDialog>
|
||||
class QLabel;
|
||||
/**
|
||||
Cette classe represente la boite de dialogue
|
||||
"A propos de QElectroTech".
|
||||
This class represents the "About QElectroTech" dialog.
|
||||
*/
|
||||
class AboutQET : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
AboutQET(QWidget * = 0);
|
||||
virtual ~AboutQET();
|
||||
@@ -34,7 +33,7 @@ class AboutQET : public QDialog {
|
||||
private:
|
||||
AboutQET(AboutQET &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
private:
|
||||
QWidget *title() const;
|
||||
QWidget *aboutTab() const;
|
||||
|
||||
@@ -19,21 +19,21 @@
|
||||
#define BASIC_MOVE_ELEMENTS_HANDLER
|
||||
#include "moveelementshandler.h"
|
||||
/**
|
||||
Cette classe implemente basiquement la classe strategie MoveElementsHandler
|
||||
Elle retourne toujours la meme action (parametrable) pour une methode
|
||||
donnee.
|
||||
This class implements the MoveElementsHandler Strategy class in a baasic way.
|
||||
It always returns the same (configurable) action or value for a particular
|
||||
question.
|
||||
*/
|
||||
class BasicMoveElementsHandler : public MoveElementsHandler {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
BasicMoveElementsHandler(QObject * = 0);
|
||||
virtual ~BasicMoveElementsHandler();
|
||||
private:
|
||||
BasicMoveElementsHandler(const BasicMoveElementsHandler &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void setActionIfItemAlreadyExists(QET::Action);
|
||||
virtual void setActionIfItemIsNotReadable(QET::Action);
|
||||
@@ -51,7 +51,7 @@ class BasicMoveElementsHandler : public MoveElementsHandler {
|
||||
virtual QET::Action errorWithAnElement(ElementDefinition *, const QString &);
|
||||
virtual QString nameForRenamingOperation();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QET::Action already_exists_;
|
||||
QET::Action not_readable_;
|
||||
|
||||
@@ -20,12 +20,12 @@
|
||||
#include <QtCore>
|
||||
#include <QtXml>
|
||||
/**
|
||||
Cette classe est un conteneur pour les dimensions et proprietes d'affichage
|
||||
d'un schema : affichage, nombre et dimensions des colonnes et lignes, ...
|
||||
This class is a container for dimensions and display properties of a
|
||||
diagram.
|
||||
*/
|
||||
class BorderProperties {
|
||||
public:
|
||||
// constructeur, destructeur, operateurs
|
||||
// constructor, destructor, operators
|
||||
BorderProperties();
|
||||
virtual ~BorderProperties();
|
||||
|
||||
@@ -37,15 +37,15 @@ class BorderProperties {
|
||||
void toSettings(QSettings &, const QString & = QString()) const;
|
||||
void fromSettings(QSettings &, const QString & = QString());
|
||||
|
||||
// attributs
|
||||
int columns_count; ///< Nombre de colonnes
|
||||
qreal columns_width; ///< Largeur des colonnes
|
||||
qreal columns_header_height; ///< Hauteur des entetes des colonnes
|
||||
bool display_columns; ///< Afficher ou non les entetes des colonnes
|
||||
// attributes
|
||||
int columns_count; ///< Columns count
|
||||
qreal columns_width; ///< Columns width
|
||||
qreal columns_header_height; ///< Column headers height
|
||||
bool display_columns; ///< Whether to display column headers
|
||||
|
||||
int rows_count; ///< Nombre de lignes
|
||||
qreal rows_height; ///< Hauteur des lignes
|
||||
qreal rows_header_width; ///< Largeur des entetes des lignes
|
||||
bool display_rows; ///< Afficher ou non les entetes des lignes
|
||||
int rows_count; ///< Rows count
|
||||
qreal rows_height; ///< Rows height
|
||||
qreal rows_header_width; ///< Row headers width
|
||||
bool display_rows; ///< Whether to display row headers
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -22,21 +22,21 @@
|
||||
class QCheckBox;
|
||||
class QSpinBox;
|
||||
/**
|
||||
Cette classe represente un widget permettant d'editer les dimensions et les
|
||||
options d'affichage d'un schema, cartouche non inclus.
|
||||
This class provides a widget to edit dimensions and display properties of a
|
||||
diagram, title block excluded.
|
||||
@see TitleBlockPropertiesWidget
|
||||
*/
|
||||
class BorderPropertiesWidget : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
BorderPropertiesWidget(const BorderProperties &, QWidget * = 0);
|
||||
virtual ~BorderPropertiesWidget();
|
||||
private:
|
||||
BorderPropertiesWidget(const BorderPropertiesWidget &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
const BorderProperties &borderProperties();
|
||||
bool isReadOnly() const;
|
||||
@@ -46,14 +46,14 @@ class BorderPropertiesWidget : public QWidget {
|
||||
private:
|
||||
void build();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
BorderProperties border_; ///< Proprietes editees
|
||||
QSpinBox *columns_count; ///< Widget d'edition du nombre de colonnes
|
||||
QSpinBox *columns_width; ///< Widget d'edition de la largeur des colonnes
|
||||
QCheckBox *display_columns; ///< Case a cocher pour afficher ou non les entetes des colonnes
|
||||
QSpinBox *rows_count; ///< Widget d'edition du nombre de lignes
|
||||
QSpinBox *rows_height; ///< Widget d'edition de la hauteur des lignes
|
||||
QCheckBox *display_rows; ///< Case a cocher pour afficher ou non les entetes des lignes
|
||||
BorderProperties border_; ///< Edited properties
|
||||
QSpinBox *columns_count; ///< Widget to edit the columns count
|
||||
QSpinBox *columns_width; ///< Widget to edit the columns width
|
||||
QCheckBox *display_columns; ///< Checkbox stating whether to display column headers
|
||||
QSpinBox *rows_count; ///< Widget to edit the rows count
|
||||
QSpinBox *rows_height; ///< Widget to edit the rows height
|
||||
QCheckBox *display_rows; ///< Checkbox stating whether to display row headers
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -32,12 +32,12 @@ BorderTitleBlock::BorderTitleBlock(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
// at first, the internal titleblock template renderer uses the default titleblock template
|
||||
titleblock_template_renderer = new TitleBlockTemplateRenderer(this);
|
||||
titleblock_template_renderer -> setTitleBlockTemplate(QETApp::defaultTitleBlockTemplate());
|
||||
titleblock_template_renderer_ = new TitleBlockTemplateRenderer(this);
|
||||
titleblock_template_renderer_ -> setTitleBlockTemplate(QETApp::defaultTitleBlockTemplate());
|
||||
|
||||
// disable the QPicture-based cache from Qt 4.8 to avoid rendering errors and crashes
|
||||
if (!QRegExp("4\\.[0-7]\\.").exactMatch(qVersion())) {
|
||||
titleblock_template_renderer -> setUseCache(false);
|
||||
titleblock_template_renderer_ -> setUseCache(false);
|
||||
}
|
||||
|
||||
// dimensions par defaut du schema
|
||||
@@ -46,8 +46,8 @@ BorderTitleBlock::BorderTitleBlock(QObject *parent) :
|
||||
// contenu par defaut du cartouche
|
||||
importTitleBlock(TitleBlockProperties());
|
||||
|
||||
display_titleblock = true;
|
||||
display_border = true;
|
||||
display_titleblock_ = true;
|
||||
display_border_ = true;
|
||||
setFolioData(1, 1);
|
||||
updateRectangles();
|
||||
}
|
||||
@@ -62,7 +62,7 @@ BorderTitleBlock::~BorderTitleBlock() {
|
||||
@return la hauteur du cartouche
|
||||
*/
|
||||
qreal BorderTitleBlock::titleBlockHeight() const {
|
||||
return(titleblock_template_renderer -> height());
|
||||
return(titleblock_template_renderer_ -> height());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -116,11 +116,11 @@ void BorderTitleBlock::titleBlockFromXml(const QDomElement &xml_elmt) {
|
||||
@param xml_elmt the XML element attributes will be added to
|
||||
*/
|
||||
void BorderTitleBlock::borderToXml(QDomElement &xml_elmt) {
|
||||
xml_elmt.setAttribute("cols", nbColumns());
|
||||
xml_elmt.setAttribute("cols", columnsCount());
|
||||
xml_elmt.setAttribute("colsize", QString("%1").arg(columnsWidth()));
|
||||
xml_elmt.setAttribute("displaycols", columnsAreDisplayed() ? "true" : "false");
|
||||
|
||||
xml_elmt.setAttribute("rows", nbRows());
|
||||
xml_elmt.setAttribute("rows", rowsCount());
|
||||
xml_elmt.setAttribute("rowsize", QString("%1").arg(rowsHeight()));
|
||||
xml_elmt.setAttribute("displayrows", rowsAreDisplayed() ? "true" : "false");
|
||||
|
||||
@@ -136,7 +136,7 @@ void BorderTitleBlock::borderFromXml(const QDomElement &xml_elmt) {
|
||||
bool ok;
|
||||
// columns count
|
||||
int cols_count = xml_elmt.attribute("cols").toInt(&ok);
|
||||
if (ok) setNbColumns(cols_count);
|
||||
if (ok) setColumnsCount(cols_count);
|
||||
|
||||
// columns width
|
||||
double cols_width = xml_elmt.attribute("colsize").toDouble(&ok);
|
||||
@@ -146,7 +146,7 @@ void BorderTitleBlock::borderFromXml(const QDomElement &xml_elmt) {
|
||||
if (xml_elmt.hasAttribute("rows") && xml_elmt.hasAttribute("rowsize")) {
|
||||
// rows counts
|
||||
int rows_count = xml_elmt.attribute("rows").toInt(&ok);
|
||||
if (ok) setNbRows(rows_count);
|
||||
if (ok) setRowsCount(rows_count);
|
||||
|
||||
// taille des lignes
|
||||
double rows_size = xml_elmt.attribute("rowsize").toDouble(&ok);
|
||||
@@ -202,11 +202,11 @@ void BorderTitleBlock::importTitleBlock(const TitleBlockProperties &ip) {
|
||||
*/
|
||||
BorderProperties BorderTitleBlock::exportBorder() {
|
||||
BorderProperties bp;
|
||||
bp.columns_count = nbColumns();
|
||||
bp.columns_count = columnsCount();
|
||||
bp.columns_width = columnsWidth();
|
||||
bp.columns_header_height = columnsHeaderHeight();
|
||||
bp.display_columns = columnsAreDisplayed();
|
||||
bp.rows_count = nbRows();
|
||||
bp.rows_count = rowsCount();
|
||||
bp.rows_height = rowsHeight();
|
||||
bp.rows_header_width = rowsHeaderWidth();
|
||||
bp.display_rows = rowsAreDisplayed();
|
||||
@@ -218,11 +218,11 @@ BorderProperties BorderTitleBlock::exportBorder() {
|
||||
*/
|
||||
void BorderTitleBlock::importBorder(const BorderProperties &bp) {
|
||||
setColumnsHeaderHeight(bp.columns_header_height);
|
||||
setNbColumns(bp.columns_count);
|
||||
setColumnsCount(bp.columns_count);
|
||||
setColumnsWidth(bp.columns_width);
|
||||
displayColumns(bp.display_columns);
|
||||
setRowsHeaderWidth(bp.rows_header_width);
|
||||
setNbRows(bp.rows_count);
|
||||
setRowsCount(bp.rows_count);
|
||||
setRowsHeight(bp.rows_height);
|
||||
displayRows(bp.display_rows);
|
||||
}
|
||||
@@ -232,7 +232,7 @@ void BorderTitleBlock::importBorder(const BorderProperties &bp) {
|
||||
@see TitleBlockTemplateRenderer::titleBlockTemplate()
|
||||
*/
|
||||
const TitleBlockTemplate *BorderTitleBlock::titleBlockTemplate() {
|
||||
return(titleblock_template_renderer -> titleBlockTemplate());
|
||||
return(titleblock_template_renderer_ -> titleBlockTemplate());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,14 +240,14 @@ const TitleBlockTemplate *BorderTitleBlock::titleBlockTemplate() {
|
||||
@see TitleBlockTemplateRenderer::setTitleBlockTemplate()
|
||||
*/
|
||||
void BorderTitleBlock::setTitleBlockTemplate(const TitleBlockTemplate *titleblock_template) {
|
||||
titleblock_template_renderer -> setTitleBlockTemplate(titleblock_template);
|
||||
titleblock_template_renderer_ -> setTitleBlockTemplate(titleblock_template);
|
||||
}
|
||||
|
||||
/**
|
||||
@return The name of the template used to render the titleblock.
|
||||
*/
|
||||
QString BorderTitleBlock::titleBlockTemplateName() const {
|
||||
QString tbt_name = titleblock_template_renderer -> titleBlockTemplate() -> name();
|
||||
QString tbt_name = titleblock_template_renderer_ -> titleBlockTemplate() -> name();
|
||||
return((tbt_name == "default") ? "" : tbt_name);
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ QString BorderTitleBlock::titleBlockTemplateName() const {
|
||||
*/
|
||||
void BorderTitleBlock::titleBlockTemplateChanged(const QString &template_name) {
|
||||
if (titleBlockTemplateName() != template_name) return;
|
||||
titleblock_template_renderer -> invalidateRenderedTemplate();
|
||||
titleblock_template_renderer_ -> invalidateRenderedTemplate();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -284,8 +284,8 @@ void BorderTitleBlock::titleBlockTemplateRemoved(const QString &removed_template
|
||||
@param di true pour afficher le cartouche, false sinon
|
||||
*/
|
||||
void BorderTitleBlock::displayTitleBlock(bool di) {
|
||||
bool change = (di != display_titleblock);
|
||||
display_titleblock = di;
|
||||
bool change = (di != display_titleblock_);
|
||||
display_titleblock_ = di;
|
||||
if (change) emit(displayChanged());
|
||||
}
|
||||
|
||||
@@ -293,8 +293,8 @@ void BorderTitleBlock::displayTitleBlock(bool di) {
|
||||
@param dc true pour afficher les entetes des colonnes, false sinon
|
||||
*/
|
||||
void BorderTitleBlock::displayColumns(bool dc) {
|
||||
bool change = (dc != display_columns);
|
||||
display_columns = dc;
|
||||
bool change = (dc != display_columns_);
|
||||
display_columns_ = dc;
|
||||
if (change) emit(displayChanged());
|
||||
}
|
||||
|
||||
@@ -302,8 +302,8 @@ void BorderTitleBlock::displayColumns(bool dc) {
|
||||
@param dr true pour afficher les entetes des lignes, false sinon
|
||||
*/
|
||||
void BorderTitleBlock::displayRows(bool dr) {
|
||||
bool change = (dr != display_rows);
|
||||
display_rows = dr;
|
||||
bool change = (dr != display_rows_);
|
||||
display_rows_ = dr;
|
||||
if (change) emit(displayChanged());
|
||||
}
|
||||
|
||||
@@ -313,8 +313,8 @@ void BorderTitleBlock::displayRows(bool dr) {
|
||||
colonnes ne seront pas dessinees.
|
||||
*/
|
||||
void BorderTitleBlock::displayBorder(bool db) {
|
||||
bool change = (db != display_border);
|
||||
display_border = db;
|
||||
bool change = (db != display_border_);
|
||||
display_border_ = db;
|
||||
if (change) emit(displayChanged());
|
||||
}
|
||||
|
||||
@@ -324,12 +324,12 @@ void BorderTitleBlock::displayBorder(bool db) {
|
||||
*/
|
||||
void BorderTitleBlock::updateRectangles() {
|
||||
// rectangle delimitant le schema
|
||||
QRectF previous_diagram = diagram;
|
||||
diagram = QRectF(0, 0, diagramWidth(), diagramHeight());
|
||||
if (diagram != previous_diagram) emit(borderChanged(previous_diagram, diagram));
|
||||
QRectF previous_diagram = diagram_rect_;
|
||||
diagram_rect_ = QRectF(0, 0, diagramWidth(), diagramHeight());
|
||||
if (diagram_rect_ != previous_diagram) emit(borderChanged(previous_diagram, diagram_rect_));
|
||||
|
||||
// rectangles relatifs au cartouche
|
||||
titleblock = QRectF(diagram.bottomLeft().x(), diagram.bottomLeft().y(), titleBlockWidth(), titleBlockHeight());
|
||||
titleblock_rect_ = QRectF(diagram_rect_.bottomLeft().x(), diagram_rect_.bottomLeft().y(), titleBlockWidth(), titleBlockHeight());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -340,8 +340,8 @@ void BorderTitleBlock::updateRectangles() {
|
||||
*/
|
||||
void BorderTitleBlock::draw(QPainter *qp, qreal x, qreal y) {
|
||||
// translate tous les rectangles
|
||||
diagram .translate(x, y);
|
||||
titleblock .translate(x, y);
|
||||
diagram_rect_ .translate(x, y);
|
||||
titleblock_rect_ .translate(x, y);
|
||||
|
||||
// prepare le QPainter
|
||||
qp -> save();
|
||||
@@ -349,30 +349,30 @@ void BorderTitleBlock::draw(QPainter *qp, qreal x, qreal y) {
|
||||
qp -> setBrush(Qt::NoBrush);
|
||||
|
||||
// dessine le cadre
|
||||
if (display_border) qp -> drawRect(diagram);
|
||||
if (display_border_) qp -> drawRect(diagram_rect_);
|
||||
|
||||
qp -> setFont(QETApp::diagramTextsFont());
|
||||
|
||||
// dessine la case vide qui apparait des qu'il y a un entete
|
||||
if (display_border && (display_columns || display_rows)) {
|
||||
if (display_border_ && (display_columns_ || display_rows_)) {
|
||||
qp -> setBrush(Qt::white);
|
||||
QRectF first_rectangle(
|
||||
diagram.topLeft().x(),
|
||||
diagram.topLeft().y(),
|
||||
rows_header_width,
|
||||
columns_header_height
|
||||
diagram_rect_.topLeft().x(),
|
||||
diagram_rect_.topLeft().y(),
|
||||
rows_header_width_,
|
||||
columns_header_height_
|
||||
);
|
||||
qp -> drawRect(first_rectangle);
|
||||
}
|
||||
|
||||
// dessine la numerotation des colonnes
|
||||
if (display_border && display_columns) {
|
||||
for (int i = 1 ; i <= nb_columns ; ++ i) {
|
||||
if (display_border_ && display_columns_) {
|
||||
for (int i = 1 ; i <= columns_count_ ; ++ i) {
|
||||
QRectF numbered_rectangle = QRectF(
|
||||
diagram.topLeft().x() + (rows_header_width + ((i - 1) * columns_width)),
|
||||
diagram.topLeft().y(),
|
||||
columns_width,
|
||||
columns_header_height
|
||||
diagram_rect_.topLeft().x() + (rows_header_width_ + ((i - 1) * columns_width_)),
|
||||
diagram_rect_.topLeft().y(),
|
||||
columns_width_,
|
||||
columns_header_height_
|
||||
);
|
||||
qp -> drawRect(numbered_rectangle);
|
||||
qp -> drawText(numbered_rectangle, Qt::AlignVCenter | Qt::AlignCenter, QString("%1").arg(i));
|
||||
@@ -380,14 +380,14 @@ void BorderTitleBlock::draw(QPainter *qp, qreal x, qreal y) {
|
||||
}
|
||||
|
||||
// dessine la numerotation des lignes
|
||||
if (display_border && display_rows) {
|
||||
if (display_border_ && display_rows_) {
|
||||
QString row_string("A");
|
||||
for (int i = 1 ; i <= nb_rows ; ++ i) {
|
||||
for (int i = 1 ; i <= rows_count_ ; ++ i) {
|
||||
QRectF lettered_rectangle = QRectF(
|
||||
diagram.topLeft().x(),
|
||||
diagram.topLeft().y() + (columns_header_height + ((i - 1) * rows_height)),
|
||||
rows_header_width,
|
||||
rows_height
|
||||
diagram_rect_.topLeft().x(),
|
||||
diagram_rect_.topLeft().y() + (columns_header_height_ + ((i - 1) * rows_height_)),
|
||||
rows_header_width_,
|
||||
rows_height_
|
||||
);
|
||||
qp -> drawRect(lettered_rectangle);
|
||||
qp -> drawText(lettered_rectangle, Qt::AlignVCenter | Qt::AlignCenter, row_string);
|
||||
@@ -396,24 +396,24 @@ void BorderTitleBlock::draw(QPainter *qp, qreal x, qreal y) {
|
||||
}
|
||||
|
||||
// render the titleblock, using the TitleBlockTemplate object
|
||||
if (display_titleblock) {
|
||||
qp -> translate(titleblock.topLeft());
|
||||
titleblock_template_renderer -> render(qp, titleblock.width());
|
||||
qp -> translate(-titleblock.topLeft());
|
||||
if (display_titleblock_) {
|
||||
qp -> translate(titleblock_rect_.topLeft());
|
||||
titleblock_template_renderer_ -> render(qp, titleblock_rect_.width());
|
||||
qp -> translate(-titleblock_rect_.topLeft());
|
||||
}
|
||||
|
||||
qp -> restore();
|
||||
|
||||
// annule la translation des rectangles
|
||||
diagram .translate(-x, -y);
|
||||
titleblock .translate(-x, -y);
|
||||
diagram_rect_ .translate(-x, -y);
|
||||
titleblock_rect_ .translate(-x, -y);
|
||||
}
|
||||
|
||||
/**
|
||||
Ajoute une colonne.
|
||||
*/
|
||||
void BorderTitleBlock::addColumn() {
|
||||
setNbColumns(nbColumns() + 1);
|
||||
setColumnsCount(columnsCount() + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -421,14 +421,14 @@ void BorderTitleBlock::addColumn() {
|
||||
@see minNbColumns()
|
||||
*/
|
||||
void BorderTitleBlock::removeColumn() {
|
||||
setNbColumns(nbColumns() - 1);
|
||||
setColumnsCount(columnsCount() - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
Ajoute une ligne.
|
||||
*/
|
||||
void BorderTitleBlock::addRow() {
|
||||
setNbRows(nbRows() + 1);
|
||||
setRowsCount(rowsCount() + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -436,7 +436,7 @@ void BorderTitleBlock::addRow() {
|
||||
@see minNbRows()
|
||||
*/
|
||||
void BorderTitleBlock::removeRow() {
|
||||
setNbRows(nbRows() - 1);
|
||||
setRowsCount(rowsCount() - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -446,9 +446,9 @@ void BorderTitleBlock::removeRow() {
|
||||
@param nb_c nouveau nombre de colonnes
|
||||
@see minNbColumns()
|
||||
*/
|
||||
void BorderTitleBlock::setNbColumns(int nb_c) {
|
||||
if (nb_c == nbColumns()) return;
|
||||
nb_columns = qMax(minNbColumns(), nb_c);
|
||||
void BorderTitleBlock::setColumnsCount(int nb_c) {
|
||||
if (nb_c == columnsCount()) return;
|
||||
columns_count_ = qMax(minNbColumns(), nb_c);
|
||||
setTitleBlockWidth(diagramWidth());
|
||||
}
|
||||
|
||||
@@ -461,7 +461,7 @@ void BorderTitleBlock::setNbColumns(int nb_c) {
|
||||
*/
|
||||
void BorderTitleBlock::setColumnsWidth(const qreal &new_cw) {
|
||||
if (new_cw == columnsWidth()) return;
|
||||
columns_width = qMax(minColumnsWidth(), new_cw);
|
||||
columns_width_ = qMax(minColumnsWidth(), new_cw);
|
||||
setTitleBlockWidth(diagramWidth());
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@ void BorderTitleBlock::setColumnsWidth(const qreal &new_cw) {
|
||||
@param new_chh nouvelle hauteur des en-tetes de colonnes
|
||||
*/
|
||||
void BorderTitleBlock::setColumnsHeaderHeight(const qreal &new_chh) {
|
||||
columns_header_height = qBound(qreal(5.0), new_chh, qreal(50.0));
|
||||
columns_header_height_ = qBound(qreal(5.0), new_chh, qreal(50.0));
|
||||
updateRectangles();
|
||||
}
|
||||
|
||||
@@ -482,9 +482,9 @@ void BorderTitleBlock::setColumnsHeaderHeight(const qreal &new_chh) {
|
||||
@param nb_r nouveau nombre de lignes
|
||||
@see minNbRows()
|
||||
*/
|
||||
void BorderTitleBlock::setNbRows(int nb_r) {
|
||||
if (nb_r == nbRows()) return;
|
||||
nb_rows = qMax(minNbRows(), nb_r);
|
||||
void BorderTitleBlock::setRowsCount(int nb_r) {
|
||||
if (nb_r == rowsCount()) return;
|
||||
rows_count_ = qMax(minNbRows(), nb_r);
|
||||
setTitleBlockWidth(diagramWidth());
|
||||
updateRectangles();
|
||||
}
|
||||
@@ -498,7 +498,7 @@ void BorderTitleBlock::setNbRows(int nb_r) {
|
||||
*/
|
||||
void BorderTitleBlock::setRowsHeight(const qreal &new_rh) {
|
||||
if (new_rh == rowsHeight()) return;
|
||||
rows_height = qMax(minRowsHeight(), new_rh);
|
||||
rows_height_ = qMax(minRowsHeight(), new_rh);
|
||||
updateRectangles();
|
||||
}
|
||||
|
||||
@@ -508,7 +508,7 @@ void BorderTitleBlock::setRowsHeight(const qreal &new_rh) {
|
||||
@param new_rhw nouvelle largeur des en-tetes des lignes
|
||||
*/
|
||||
void BorderTitleBlock::setRowsHeaderWidth(const qreal &new_rhw) {
|
||||
rows_header_width = qBound(qreal(5.0), new_rhw, qreal(50.0));
|
||||
rows_header_width_ = qBound(qreal(5.0), new_rhw, qreal(50.0));
|
||||
updateRectangles();
|
||||
}
|
||||
|
||||
@@ -518,7 +518,7 @@ void BorderTitleBlock::setRowsHeaderWidth(const qreal &new_rhw) {
|
||||
*/
|
||||
void BorderTitleBlock::setDiagramHeight(const qreal &height) {
|
||||
// taille des lignes a utiliser = rows_height
|
||||
setNbRows(qRound(ceil(height / rows_height)));
|
||||
setRowsCount(qRound(ceil(height / rows_height_)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -526,7 +526,7 @@ void BorderTitleBlock::setDiagramHeight(const qreal &height) {
|
||||
schema.
|
||||
*/
|
||||
void BorderTitleBlock::setTitleBlockWidth(const qreal &new_iw) {
|
||||
titleblock_width = qMin(diagramWidth(), new_iw);
|
||||
titleblock_width_ = qMin(diagramWidth(), new_iw);
|
||||
updateRectangles();
|
||||
}
|
||||
|
||||
@@ -584,15 +584,15 @@ void BorderTitleBlock::updateDiagramContextForTitleBlock(const DiagramContext &i
|
||||
}
|
||||
|
||||
// ... overridden by the historical and/or dynamically generated fields
|
||||
context.addValue("author", bi_author);
|
||||
context.addValue("date", bi_date.toString("dd/MM/yyyy"));
|
||||
context.addValue("title", bi_title);
|
||||
context.addValue("filename", bi_filename);
|
||||
context.addValue("folio", bi_final_folio);
|
||||
context.addValue("author", btb_author_);
|
||||
context.addValue("date", btb_date_.toString("dd/MM/yyyy"));
|
||||
context.addValue("title", btb_title_);
|
||||
context.addValue("filename", btb_filename_);
|
||||
context.addValue("folio", btb_final_folio_);
|
||||
context.addValue("folio-id", folio_index_);
|
||||
context.addValue("folio-total", folio_total_);
|
||||
|
||||
titleblock_template_renderer -> setContext(context);
|
||||
titleblock_template_renderer_ -> setContext(context);
|
||||
}
|
||||
|
||||
QString BorderTitleBlock::incrementLetters(const QString &string) {
|
||||
@@ -625,9 +625,9 @@ void BorderTitleBlock::setFolioData(int index, int total, const DiagramContext &
|
||||
folio_total_ = total;
|
||||
|
||||
// regenere le contenu du champ folio
|
||||
bi_final_folio = bi_folio;
|
||||
bi_final_folio.replace("%id", QString::number(folio_index_));
|
||||
bi_final_folio.replace("%total", QString::number(folio_total_));
|
||||
btb_final_folio_ = btb_folio_;
|
||||
btb_final_folio_.replace("%id", QString::number(folio_index_));
|
||||
btb_final_folio_.replace("%total", QString::number(folio_total_));
|
||||
|
||||
updateDiagramContextForTitleBlock(project_properties);
|
||||
}
|
||||
|
||||
@@ -28,13 +28,13 @@ class DiagramPosition;
|
||||
class TitleBlockTemplate;
|
||||
class TitleBlockTemplateRenderer;
|
||||
/**
|
||||
Cette classe represente l'ensemble bordure + cartouche qui encadre le
|
||||
schema electrique.
|
||||
This class represents the border and the titleblock which frame a
|
||||
particular electric diagram.
|
||||
*/
|
||||
class BorderTitleBlock : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
BorderTitleBlock(QObject * = 0);
|
||||
virtual ~BorderTitleBlock();
|
||||
@@ -42,7 +42,7 @@ class BorderTitleBlock : public QObject {
|
||||
private:
|
||||
BorderTitleBlock(const BorderTitleBlock &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
static int minNbColumns();
|
||||
static qreal minColumnsWidth();
|
||||
@@ -51,73 +51,73 @@ class BorderTitleBlock : public QObject {
|
||||
|
||||
void draw(QPainter *, qreal = 0.0, qreal = 0.0);
|
||||
|
||||
// methodes d'acces en lecture aux dimensions
|
||||
// colonnes
|
||||
/// @return le nombre de colonnes du schema
|
||||
int nbColumns() const { return(nb_columns); }
|
||||
/// @return la largeur des colonnes en pixels
|
||||
qreal columnsWidth() const { return(columns_width); }
|
||||
/// @return la taille de l'ensemble des colonnes, en-tete des lignes non inclus
|
||||
qreal columnsTotalWidth() const { return(nb_columns * columns_width); }
|
||||
/// @return la hauteur, en pixels, des en-tetes des colonnes
|
||||
qreal columnsHeaderHeight() const { return(columns_header_height); }
|
||||
// methods to get dimensions
|
||||
// columns
|
||||
/// @return the number of columns
|
||||
int columnsCount() const { return(columns_count_); }
|
||||
/// @return the columns width, in pixels
|
||||
qreal columnsWidth() const { return(columns_width_); }
|
||||
/// @return the total width of all columns, headers excluded
|
||||
qreal columnsTotalWidth() const { return(columns_count_ * columns_width_); }
|
||||
/// @return the column headers height, in pixels
|
||||
qreal columnsHeaderHeight() const { return(columns_header_height_); }
|
||||
|
||||
// lignes
|
||||
/// @return le nombre de lignes du schema
|
||||
int nbRows() const { return(nb_rows); }
|
||||
/// @return la hauteur des lignes en pixels
|
||||
qreal rowsHeight() const { return(rows_height); }
|
||||
/// @return la taille de l'ensemble des lignes, en-tete des colonnes non inclus
|
||||
qreal rowsTotalHeight() const { return(nb_rows * rows_height); }
|
||||
/// @return la largeur, en pixels, des en-tetes des lignes
|
||||
qreal rowsHeaderWidth() const { return(rows_header_width); }
|
||||
// rows
|
||||
/// @return the number of rows
|
||||
int rowsCount() const { return(rows_count_); }
|
||||
/// @return the rows height, in pixels
|
||||
qreal rowsHeight() const { return(rows_height_); }
|
||||
/// @return the total height of all rows, headers excluded
|
||||
qreal rowsTotalHeight() const { return(rows_count_ * rows_height_); }
|
||||
/// @return la rows header width, in pixels
|
||||
qreal rowsHeaderWidth() const { return(rows_header_width_); }
|
||||
|
||||
// cadre sans le cartouche = schema
|
||||
/// @return la largeur du schema, c'est-a-dire du cadre sans le cartouche
|
||||
// border - title block = diagram
|
||||
/// @return the diagram width, i.e. the width of the border without title block
|
||||
qreal diagramWidth() const { return(columnsTotalWidth() + rowsHeaderWidth()); }
|
||||
/// @return la hauteurdu schema, c'est-a-dire du cadre sans le cartouche
|
||||
/// @return the diagram height, i.e. the height of the border without title block
|
||||
qreal diagramHeight() const { return(rowsTotalHeight() + columnsHeaderHeight()); }
|
||||
|
||||
// cartouche
|
||||
/// @return la largeur du cartouche
|
||||
qreal titleBlockWidth() const { return(titleblock_width); }
|
||||
// title block
|
||||
/// @return the title block width
|
||||
qreal titleBlockWidth() const { return(titleblock_width_); }
|
||||
qreal titleBlockHeight() const;
|
||||
|
||||
// cadre avec le cartouche
|
||||
/// @return la hauteur de la bordure
|
||||
// border + title block
|
||||
/// @return the border width
|
||||
qreal borderWidth() const { return(diagramWidth()); }
|
||||
/// @return la hauteur de la bordure
|
||||
/// @return the border height
|
||||
qreal borderHeight() const { return(diagramHeight() + titleBlockHeight()); }
|
||||
|
||||
// methodes d'acces en lecture aux informations du cartouche
|
||||
/// @return le champ "Auteur" du cartouche
|
||||
QString author() const { return(bi_author); }
|
||||
/// @return le champ "Date" du cartouche
|
||||
QDate date() const { return(bi_date); }
|
||||
/// @return le champ "Titre" du cartouche
|
||||
QString title() const { return(bi_title); }
|
||||
/// @return le champ "Folio" du cartouche
|
||||
QString folio() const { return(bi_folio); }
|
||||
/// @return le champ "Fichier" du cartouche
|
||||
QString fileName() const { return(bi_filename); }
|
||||
// methods to get title block basic data
|
||||
/// @return the value of the title block "Author" field
|
||||
QString author() const { return(btb_author_); }
|
||||
/// @return the value of the title block "Date" field
|
||||
QDate date() const { return(btb_date_); }
|
||||
/// @return the value of the title block "Title" field
|
||||
QString title() const { return(btb_title_); }
|
||||
/// @return the value of the title block "Folio" field
|
||||
QString folio() const { return(btb_folio_); }
|
||||
/// @return the value of the title block "File" field
|
||||
QString fileName() const { return(btb_filename_); }
|
||||
|
||||
// methodes d'acces en lecture aux options
|
||||
// methods to get display options
|
||||
/// @return true si le cartouche est affiche, false sinon
|
||||
bool titleBlockIsDisplayed() const { return(display_titleblock); }
|
||||
bool titleBlockIsDisplayed() const { return(display_titleblock_); }
|
||||
/// @return true si les entetes des colonnes sont affiches, false sinon
|
||||
bool columnsAreDisplayed() const { return(display_columns); }
|
||||
bool columnsAreDisplayed() const { return(display_columns_); }
|
||||
/// @return true si les entetes des lignes sont affiches, false sinon
|
||||
bool rowsAreDisplayed() const { return(display_rows); }
|
||||
bool rowsAreDisplayed() const { return(display_rows_); }
|
||||
/// @return true si la bordure est affichee, false sinon
|
||||
bool borderIsDisplayed() const { return(display_border); }
|
||||
bool borderIsDisplayed() const { return(display_border_); }
|
||||
|
||||
// methodes d'acces en ecriture aux dimensions
|
||||
// methods to set dimensions
|
||||
void addColumn();
|
||||
void addRow();
|
||||
void removeColumn();
|
||||
void removeRow();
|
||||
void setNbColumns (int);
|
||||
void setNbRows (int);
|
||||
void setColumnsCount(int);
|
||||
void setRowsCount(int);
|
||||
void setColumnsWidth(const qreal &);
|
||||
void setRowsHeight(const qreal &);
|
||||
void setColumnsHeaderHeight(const qreal &);
|
||||
@@ -128,23 +128,23 @@ class BorderTitleBlock : public QObject {
|
||||
|
||||
DiagramPosition convertPosition(const QPointF &);
|
||||
|
||||
// methodes d'acces en ecriture aux informations du cartouche
|
||||
/// @param author le nouveau contenu du champ "Auteur"
|
||||
void setAuthor (const QString &author) { bi_author = author; }
|
||||
/// @param date le nouveau contenu du champ "Date"
|
||||
void setDate (const QDate &date) { bi_date = date; }
|
||||
/// @param title le nouveau contenu du champ "Titre"
|
||||
// methods to set title block basic data
|
||||
/// @param author the new value of the "Author" field
|
||||
void setAuthor(const QString &author) { btb_author_ = author; }
|
||||
/// @param author the new value of the "Date" field
|
||||
void setDate(const QDate &date) { btb_date_ = date; }
|
||||
/// @param author the new value of the "Title" field
|
||||
void setTitle(const QString &title) {
|
||||
if (bi_title != title) {
|
||||
bi_title = title;
|
||||
if (btb_title_ != title) {
|
||||
btb_title_ = title;
|
||||
emit(diagramTitleChanged(title));
|
||||
}
|
||||
}
|
||||
/// @param folio le nouveau contenu du champ "Folio"
|
||||
void setFolio (const QString &folio) { bi_folio = folio; }
|
||||
/// @param author the new value of the "Folio" field
|
||||
void setFolio(const QString &folio) { btb_folio_ = folio; }
|
||||
void setFolioData(int, int, const DiagramContext & = DiagramContext());
|
||||
/// @param filename le nouveau contenu du champ "Fichier"
|
||||
void setFileName (const QString &filename) { bi_filename = filename; }
|
||||
/// @param author the new value of the "File" field
|
||||
void setFileName(const QString &filename) { btb_filename_ = filename; }
|
||||
|
||||
void titleBlockToXml(QDomElement &);
|
||||
void titleBlockFromXml(const QDomElement &);
|
||||
@@ -164,7 +164,7 @@ class BorderTitleBlock : public QObject {
|
||||
void titleBlockTemplateChanged(const QString &);
|
||||
void titleBlockTemplateRemoved(const QString &, const TitleBlockTemplate * = 0);
|
||||
|
||||
// methodes d'acces en ecriture aux options
|
||||
// methods to set display options
|
||||
void displayTitleBlock(bool);
|
||||
void displayColumns(bool);
|
||||
void displayRows(bool);
|
||||
@@ -175,27 +175,26 @@ class BorderTitleBlock : public QObject {
|
||||
void updateDiagramContextForTitleBlock(const DiagramContext & = DiagramContext());
|
||||
QString incrementLetters(const QString &);
|
||||
|
||||
// signaux
|
||||
signals:
|
||||
/**
|
||||
Signal emis lorsque la bordure change
|
||||
@param old_border Ancienne bordure
|
||||
@param new_border Nouvelle bordure
|
||||
Signal emitted after the border has changed
|
||||
@param old_border Former border
|
||||
@param new_border New border
|
||||
*/
|
||||
void borderChanged(QRectF old_border, QRectF new_border);
|
||||
/**
|
||||
Signal emise lorsque des options d'affichage change
|
||||
Signal emitted after display options have changed
|
||||
*/
|
||||
void displayChanged();
|
||||
|
||||
/**
|
||||
Signal emis lorsque le titre du schema change
|
||||
Signal emitted after the title has changed
|
||||
*/
|
||||
void diagramTitleChanged(const QString &);
|
||||
|
||||
/**
|
||||
Signal emis lorsque le cartouche requiert une mise a jour des donnees
|
||||
utilisees pour generer le folio.
|
||||
Signal emitted when the title block requires its data to be updated in order
|
||||
to generate the folio field.
|
||||
*/
|
||||
void needFolioData();
|
||||
|
||||
@@ -206,43 +205,43 @@ class BorderTitleBlock : public QObject {
|
||||
*/
|
||||
void needTitleBlockTemplate(const QString &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
// informations du cartouche
|
||||
QString bi_author;
|
||||
QDate bi_date;
|
||||
QString bi_title;
|
||||
QString bi_folio;
|
||||
QString bi_final_folio;
|
||||
// titleblock basic data
|
||||
QString btb_author_;
|
||||
QDate btb_date_;
|
||||
QString btb_title_;
|
||||
QString btb_folio_;
|
||||
QString btb_final_folio_;
|
||||
int folio_index_;
|
||||
int folio_total_;
|
||||
QString bi_filename;
|
||||
QString btb_filename_;
|
||||
DiagramContext additional_fields_;
|
||||
|
||||
// dimensions du cadre (lignes et colonnes)
|
||||
// colonnes : nombres et dimensions
|
||||
int nb_columns;
|
||||
qreal columns_width;
|
||||
qreal columns_header_height;
|
||||
// border dimensions (rows and columns)
|
||||
// columns: number and dimensions
|
||||
int columns_count_;
|
||||
qreal columns_width_;
|
||||
qreal columns_header_height_;
|
||||
|
||||
// lignes : nombres et dimensions
|
||||
int nb_rows;
|
||||
qreal rows_height;
|
||||
qreal rows_header_width;
|
||||
// rows: number and dimensions
|
||||
int rows_count_;
|
||||
qreal rows_height_;
|
||||
qreal rows_header_width_;
|
||||
|
||||
// dimensions du cartouche
|
||||
qreal titleblock_width;
|
||||
qreal titleblock_height;
|
||||
// title block dimensions
|
||||
qreal titleblock_width_;
|
||||
qreal titleblock_height_;
|
||||
|
||||
// rectangles utilises pour le dessin
|
||||
QRectF diagram;
|
||||
QRectF titleblock;
|
||||
// rectangles used for drawing operations
|
||||
QRectF diagram_rect_;
|
||||
QRectF titleblock_rect_;
|
||||
|
||||
// booleens pour les options de dessin
|
||||
bool display_titleblock;
|
||||
bool display_columns;
|
||||
bool display_rows;
|
||||
bool display_border;
|
||||
TitleBlockTemplateRenderer *titleblock_template_renderer;
|
||||
// display options
|
||||
bool display_titleblock_;
|
||||
bool display_columns_;
|
||||
bool display_rows_;
|
||||
bool display_border_;
|
||||
TitleBlockTemplateRenderer *titleblock_template_renderer_;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -40,7 +40,7 @@ Conductor::Conductor(Terminal *p1, Terminal* p2, Diagram *parent_diagram) :
|
||||
QGraphicsPathItem(0, parent_diagram),
|
||||
terminal1(p1),
|
||||
terminal2(p2),
|
||||
destroyed(false),
|
||||
destroyed_(false),
|
||||
text_item(0),
|
||||
segments(NULL),
|
||||
moving_point(false),
|
||||
@@ -77,7 +77,7 @@ Conductor::Conductor(Terminal *p1, Terminal* p2, Diagram *parent_diagram) :
|
||||
conductor_profiles.insert(Qt::BottomRightCorner, ConductorProfile());
|
||||
|
||||
// calcul du rendu du conducteur
|
||||
priv_calculeConductor(terminal1 -> dockConductor(), terminal1 -> orientation(), terminal2 -> dockConductor(), terminal2 -> orientation());
|
||||
generateConductorPath(terminal1 -> dockConductor(), terminal1 -> orientation(), terminal2 -> dockConductor(), terminal2 -> orientation());
|
||||
setFlags(QGraphicsItem::ItemIsSelectable);
|
||||
setAcceptsHoverEvents(true);
|
||||
|
||||
@@ -116,10 +116,10 @@ void Conductor::updatePath(const QRectF &rect) {
|
||||
QPointF p1, p2;
|
||||
p1 = terminal1 -> dockConductor();
|
||||
p2 = terminal2 -> dockConductor();
|
||||
if (nbSegments() && !conductor_profiles[currentPathType()].isNull())
|
||||
priv_modifieConductor(p1, terminal1 -> orientation(), p2, terminal2 -> orientation());
|
||||
if (segmentsCount() && !conductor_profiles[currentPathType()].isNull())
|
||||
updateConductorPath(p1, terminal1 -> orientation(), p2, terminal2 -> orientation());
|
||||
else
|
||||
priv_calculeConductor(p1, terminal1 -> orientation(), p2, terminal2 -> orientation());
|
||||
generateConductorPath(p1, terminal1 -> orientation(), p2, terminal2 -> orientation());
|
||||
calculateTextItemPosition();
|
||||
QGraphicsPathItem::update(rect);
|
||||
}
|
||||
@@ -158,13 +158,13 @@ void Conductor::segmentsToPath() {
|
||||
@param p2 Coordonnees du point d'amarrage de la borne 2
|
||||
@param o2 Orientation de la borne 2
|
||||
*/
|
||||
void Conductor::priv_modifieConductor(const QPointF &p1, QET::Orientation o1, const QPointF &p2, QET::Orientation o2) {
|
||||
void Conductor::updateConductorPath(const QPointF &p1, QET::Orientation o1, const QPointF &p2, QET::Orientation o2) {
|
||||
Q_UNUSED(o1);
|
||||
Q_UNUSED(o2);
|
||||
|
||||
ConductorProfile &conductor_profile = conductor_profiles[currentPathType()];
|
||||
|
||||
Q_ASSERT_X(conductor_profile.nbSegments(QET::Both) > 1, "Conductor::priv_modifieConductor", "pas de points a modifier");
|
||||
Q_ASSERT_X(conductor_profile.segmentsCount(QET::Both) > 1, "Conductor::priv_modifieConductor", "pas de points a modifier");
|
||||
Q_ASSERT_X(!conductor_profile.isNull(), "Conductor::priv_modifieConductor", "pas de profil utilisable");
|
||||
|
||||
// recupere les coordonnees fournies des bornes
|
||||
@@ -286,7 +286,7 @@ QHash<ConductorSegmentProfile *, qreal> Conductor::shareOffsetBetweenSegments(
|
||||
@param p2 Coordonnees du point d'amarrage de la borne 2
|
||||
@param o2 Orientation de la borne 2
|
||||
*/
|
||||
void Conductor::priv_calculeConductor(const QPointF &p1, QET::Orientation o1, const QPointF &p2, QET::Orientation o2) {
|
||||
void Conductor::generateConductorPath(const QPointF &p1, QET::Orientation o1, const QPointF &p2, QET::Orientation o2) {
|
||||
QPointF sp1, sp2, depart, newp1, newp2, arrivee, depart0, arrivee0;
|
||||
QET::Orientation ori_depart, ori_arrivee;
|
||||
|
||||
@@ -509,7 +509,7 @@ void Conductor::paint(QPainter *qp, const QStyleOptionGraphicsItem *options, QWi
|
||||
Methode de preparation a la destruction du conducteur ; le conducteur se detache de ses deux bornes
|
||||
*/
|
||||
void Conductor::destroy() {
|
||||
destroyed = true;
|
||||
destroyed_ = true;
|
||||
terminal1 -> removeConductor(this);
|
||||
terminal2 -> removeConductor(this);
|
||||
}
|
||||
@@ -862,7 +862,7 @@ qreal Conductor::conductor_bound(qreal tobound, qreal bound, bool positive) {
|
||||
@param type Type de Segments
|
||||
@return Le nombre de segments composant le conducteur.
|
||||
*/
|
||||
uint Conductor::nbSegments(QET::ConductorSegmentType type) const {
|
||||
uint Conductor::segmentsCount(QET::ConductorSegmentType type) const {
|
||||
QList<ConductorSegment *> segments_list = segmentsList();
|
||||
if (type == QET::Both) return(segments_list.count());
|
||||
uint nb_seg = 0;
|
||||
@@ -1174,10 +1174,10 @@ void Conductor::setProfile(const ConductorProfile &cp, Qt::Corner path_type) {
|
||||
// si le type de trajet correspond a l'actuel
|
||||
if (currentPathType() == path_type) {
|
||||
if (conductor_profiles[path_type].isNull()) {
|
||||
priv_calculeConductor(terminal1 -> dockConductor(), terminal1 -> orientation(), terminal2 -> dockConductor(), terminal2 -> orientation());
|
||||
generateConductorPath(terminal1 -> dockConductor(), terminal1 -> orientation(), terminal2 -> dockConductor(), terminal2 -> orientation());
|
||||
modified_path = false;
|
||||
} else {
|
||||
priv_modifieConductor(terminal1 -> dockConductor(), terminal1 -> orientation(), terminal2 -> dockConductor(), terminal2 -> orientation());
|
||||
updateConductorPath(terminal1 -> dockConductor(), terminal1 -> orientation(), terminal2 -> dockConductor(), terminal2 -> orientation());
|
||||
modified_path = true;
|
||||
}
|
||||
if (type() == ConductorProperties::Multi) {
|
||||
@@ -1468,10 +1468,10 @@ ConductorProfilesGroup Conductor::profiles() const {
|
||||
void Conductor::setProfiles(const ConductorProfilesGroup &cpg) {
|
||||
conductor_profiles = cpg;
|
||||
if (conductor_profiles[currentPathType()].isNull()) {
|
||||
priv_calculeConductor(terminal1 -> dockConductor(), terminal1 -> orientation(), terminal2 -> dockConductor(), terminal2 -> orientation());
|
||||
generateConductorPath(terminal1 -> dockConductor(), terminal1 -> orientation(), terminal2 -> dockConductor(), terminal2 -> orientation());
|
||||
modified_path = false;
|
||||
} else {
|
||||
priv_modifieConductor(terminal1 -> dockConductor(), terminal1 -> orientation(), terminal2 -> dockConductor(), terminal2 -> orientation());
|
||||
updateConductorPath(terminal1 -> dockConductor(), terminal1 -> orientation(), terminal2 -> dockConductor(), terminal2 -> orientation());
|
||||
modified_path = true;
|
||||
}
|
||||
if (type() == ConductorProperties::Multi) {
|
||||
|
||||
@@ -27,13 +27,14 @@ class Element;
|
||||
typedef QPair<QPointF, Qt::Corner> ConductorBend;
|
||||
typedef QHash<Qt::Corner, ConductorProfile> ConductorProfilesGroup;
|
||||
/**
|
||||
Cette classe represente un conducteur. Un conducteur relie deux bornes d'element.
|
||||
This class represents a conductor, i.e. a wire between two element
|
||||
terminals.
|
||||
*/
|
||||
class Conductor : public QObject, public QGraphicsPathItem {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
Conductor(Terminal *, Terminal *, Diagram * = 0);
|
||||
virtual ~Conductor();
|
||||
@@ -41,26 +42,27 @@ class Conductor : public QObject, public QGraphicsPathItem {
|
||||
private:
|
||||
Conductor(const Conductor &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
public:
|
||||
enum { Type = UserType + 1001 };
|
||||
enum Highlight { None, Normal, Alert };
|
||||
|
||||
/// premiere borne a laquelle le fil est rattache
|
||||
/// First terminal the wire is attached to
|
||||
Terminal *terminal1;
|
||||
/// deuxieme borne a laquelle le fil est rattache
|
||||
/// Second terminal the wire is attached to
|
||||
Terminal *terminal2;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
/**
|
||||
permet de caster un QGraphicsItem en Conductor avec qgraphicsitem_cast
|
||||
@return le type de QGraphicsItem
|
||||
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a
|
||||
Conductor.
|
||||
@return the QGraphicsItem type
|
||||
*/
|
||||
virtual int type() const { return Type; }
|
||||
void destroy();
|
||||
/// @return true si ce conducteur est detruit
|
||||
bool isDestroyed() const { return(destroyed); }
|
||||
/// @return true if this conductor is destroyed
|
||||
bool isDestroyed() const { return(destroyed_); }
|
||||
Diagram *diagram() const;
|
||||
ConductorTextItem *textItem() const;
|
||||
void updatePath(const QRectF & = QRectF());
|
||||
@@ -104,15 +106,15 @@ class Conductor : public QObject, public QGraphicsPathItem {
|
||||
virtual QVariant itemChange(GraphicsItemChange, const QVariant &);
|
||||
|
||||
private:
|
||||
/// caracteristiques du conducteur
|
||||
/// Functional properties
|
||||
ConductorProperties properties_;
|
||||
/// booleen indiquant si le fil est encore valide
|
||||
bool destroyed;
|
||||
/// champ de texte editable pour les conducteurs non unifilaires
|
||||
/// Whether this conductor is still valid
|
||||
bool destroyed_;
|
||||
/// Text input for non simple, non-singleline conductors
|
||||
ConductorTextItem *text_item;
|
||||
/// segments composant le conducteur
|
||||
/// Segments composing the conductor
|
||||
ConductorSegment *segments;
|
||||
/// attributs lies aux manipulations a la souris
|
||||
/// Attributs related to mouse interaction
|
||||
QPointF press_point;
|
||||
bool moving_point;
|
||||
bool moving_segment;
|
||||
@@ -120,28 +122,29 @@ class Conductor : public QObject, public QGraphicsPathItem {
|
||||
qreal previous_z_value;
|
||||
ConductorSegment *moved_segment;
|
||||
QPointF before_mov_text_pos_;
|
||||
/// booleen indiquant si le conducteur a ete modifie manuellement par l'utilisateur
|
||||
/// Whether the conductor was manually modified by users
|
||||
bool modified_path;
|
||||
/// booleen indiquant s'il faut sauver le profil courant au plus tot
|
||||
/// Whether the current profile should be saved as soon as possible
|
||||
bool has_to_save_profile;
|
||||
/// profil du conducteur : "photo" de ce a quoi le conducteur doit ressembler - il y a un profil par type de trajet
|
||||
/// conductor profile: "photography" of what the conductor is supposed to look
|
||||
/// like - there is one profile per kind of traject
|
||||
ConductorProfilesGroup conductor_profiles;
|
||||
/// QPen et QBrush utilises pour dessiner les conducteurs
|
||||
/// QPen et QBrush objects used to draw conductors
|
||||
static QPen conductor_pen;
|
||||
static QBrush conductor_brush;
|
||||
static QBrush square_brush;
|
||||
static bool pen_and_brush_initialized;
|
||||
/// facteur de taille du carre de saisie du segment
|
||||
/// Scale factor to render square used to move segments
|
||||
qreal segments_squares_scale_;
|
||||
/// Definit la facon dont le conducteur doit etre mis en evidence
|
||||
/// Define whether and how the conductor should be highlighted
|
||||
Highlight must_highlight_;
|
||||
|
||||
private:
|
||||
void segmentsToPath();
|
||||
void saveProfile(bool = true);
|
||||
void priv_calculeConductor(const QPointF &, QET::Orientation, const QPointF &, QET::Orientation);
|
||||
void priv_modifieConductor(const QPointF &, QET::Orientation, const QPointF &, QET::Orientation);
|
||||
uint nbSegments(QET::ConductorSegmentType = QET::Both) const;
|
||||
void generateConductorPath(const QPointF &, QET::Orientation, const QPointF &, QET::Orientation);
|
||||
void updateConductorPath(const QPointF &, QET::Orientation, const QPointF &, QET::Orientation);
|
||||
uint segmentsCount(QET::ConductorSegmentType = QET::Both) const;
|
||||
QList<QPointF> segmentsToPoints() const;
|
||||
QSet<Conductor *> relatedConductors() const;
|
||||
QList<ConductorBend> bends() const;
|
||||
|
||||
@@ -100,7 +100,7 @@ qreal ConductorProfile::height() const{
|
||||
@param type Type de Segments
|
||||
@return Le nombre de segments composant le conducteur.
|
||||
*/
|
||||
uint ConductorProfile::nbSegments(QET::ConductorSegmentType type) const {
|
||||
uint ConductorProfile::segmentsCount(QET::ConductorSegmentType type) const {
|
||||
if (type == QET::Both) return(segments.count());
|
||||
uint nb_seg = 0;
|
||||
foreach(ConductorSegmentProfile *csp, segments) {
|
||||
|
||||
@@ -22,34 +22,34 @@
|
||||
class Conductor;
|
||||
class ConductorSegmentProfile;
|
||||
/**
|
||||
Cette classe contient le profil (= les caracteristiques essentielles) d'un
|
||||
conducteur.
|
||||
This class represents the profile of a conductor, i.e. its primary
|
||||
characteristics.
|
||||
*/
|
||||
class ConductorProfile {
|
||||
public:
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
ConductorProfile();
|
||||
ConductorProfile(Conductor *conductor);
|
||||
ConductorProfile(const ConductorProfile &);
|
||||
ConductorProfile &operator=(const ConductorProfile &);
|
||||
virtual ~ConductorProfile();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
public:
|
||||
/// Segment composant le profil du conducteur
|
||||
/// Segments composing the conductor
|
||||
QList<ConductorSegmentProfile *> segments;
|
||||
/// Orientation de la borne de depart du profil
|
||||
/// Orientation of the start terminal
|
||||
QET::Orientation beginOrientation;
|
||||
/// Orientation de la borne d'arrivee du profil
|
||||
/// Orientation of the end terminal.
|
||||
QET::Orientation endOrientation;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
bool isNull() const;
|
||||
void setNull();
|
||||
qreal width() const;
|
||||
qreal height() const;
|
||||
uint nbSegments(QET::ConductorSegmentType) const;
|
||||
uint segmentsCount(QET::ConductorSegmentType) const;
|
||||
QList<ConductorSegmentProfile *> horizontalSegments();
|
||||
QList<ConductorSegmentProfile *> verticalSegments();
|
||||
void fromConductor(Conductor *);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <QtGui>
|
||||
#include <QtXml>
|
||||
/**
|
||||
Cette classe represente les proprietes specifiques a un conducteur unifilaire
|
||||
This class represents the properties of a singleline conductor.
|
||||
*/
|
||||
class SingleLineProperties {
|
||||
public:
|
||||
@@ -37,9 +37,9 @@ class SingleLineProperties {
|
||||
void toSettings(QSettings &, const QString & = QString()) const;
|
||||
void fromSettings(QSettings &, const QString & = QString());
|
||||
|
||||
/// indique si le conducteur unifilaire doit afficher le symbole terre
|
||||
/// Whether the singleline conductor should display the ground symbol
|
||||
bool hasGround;
|
||||
/// indique si le conducteur unifilaire doit afficher le symbole neutre
|
||||
/// Whether the singleline conductor should display the neutral symbol
|
||||
bool hasNeutral;
|
||||
/// Protective Earth Neutral: visually merge neutral and ground
|
||||
bool is_pen;
|
||||
@@ -55,44 +55,44 @@ class SingleLineProperties {
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente les proprietes specifiques a un conducteur,
|
||||
en dehors de ses bornes et de son trajet.
|
||||
This class represents the functional properties of a particular conductor,
|
||||
i.e. properties other than path and terminals.
|
||||
*/
|
||||
class ConductorProperties {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ConductorProperties();
|
||||
virtual ~ConductorProperties();
|
||||
|
||||
/**
|
||||
Represente le type d'un conducteur :
|
||||
* Simple : ni symbole ni champ de texte
|
||||
* Single : symboles unifilaires, pas de champ de texte
|
||||
* Multi : champ de texte, pas de symbole
|
||||
Represents the kind of a particular conductor:
|
||||
* Simple: no symbols, no text input
|
||||
* Single: singleline symbols, no text input
|
||||
* Multi: text input, no symbol
|
||||
*/
|
||||
enum ConductorType { Simple, Single, Multi };
|
||||
|
||||
// attributs
|
||||
/// type du conducteur
|
||||
// attributes
|
||||
/// Conductor type
|
||||
ConductorType type;
|
||||
/// couleur du conducteur
|
||||
/// Conductor color
|
||||
QColor color;
|
||||
/// texte affiche si le conducteur est multifilaire
|
||||
/// Texte displayed for multiline conductors
|
||||
QString text;
|
||||
/// style du conducteur (Qt::SolidLine ou Qt::DashLine)
|
||||
/// conducteur style (Qt::SolidLine or Qt::DashLine)
|
||||
Qt::PenStyle style;
|
||||
|
||||
/// proprietes si le conducteur est unifilaire
|
||||
/// properties for singleline conductors
|
||||
SingleLineProperties singleLineProperties;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
void toXml(QDomElement &) const;
|
||||
void fromXml(QDomElement &);
|
||||
void toSettings(QSettings &, const QString & = QString()) const;
|
||||
void fromSettings(QSettings &, const QString & = QString());
|
||||
static QString typeToString(ConductorType);
|
||||
|
||||
// operateurs
|
||||
// operators
|
||||
int operator==(const ConductorProperties &);
|
||||
int operator!=(const ConductorProperties &);
|
||||
|
||||
|
||||
@@ -20,14 +20,13 @@
|
||||
#include "conductorproperties.h"
|
||||
#include <QWidget>
|
||||
/**
|
||||
Ce widget permet a l utilisateur d'editer les proprietes d'un conducteur.
|
||||
Par proprietes, on entend non pas le trajet effectue par le conducteur mais
|
||||
les options supplementaires : symboles unifilaires, presence ou non d'un
|
||||
champ de texte, contenu de ce champ de texte, etc.
|
||||
This widget enables users to change the properties of a particular
|
||||
conductor; these properties include singleline symbols, style, color, and
|
||||
conductor type but exclude the path it draws.
|
||||
*/
|
||||
class ConductorPropertiesWidget : public QWidget {
|
||||
Q_OBJECT
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ConductorPropertiesWidget(QWidget * = 0);
|
||||
ConductorPropertiesWidget(const ConductorProperties &, QWidget * = 0);
|
||||
@@ -36,7 +35,7 @@ class ConductorPropertiesWidget : public QWidget {
|
||||
private:
|
||||
ConductorPropertiesWidget(const ConductorPropertiesWidget &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
void setConductorProperties(const ConductorProperties &);
|
||||
ConductorProperties conductorProperties() const;
|
||||
@@ -57,7 +56,7 @@ class ConductorPropertiesWidget : public QWidget {
|
||||
protected:
|
||||
void focusInEvent(QFocusEvent *);
|
||||
|
||||
// attributs prives
|
||||
// private attributes
|
||||
private:
|
||||
QButtonGroup *radio_buttons;
|
||||
QRadioButton *simple;
|
||||
@@ -76,7 +75,7 @@ class ConductorPropertiesWidget : public QWidget {
|
||||
|
||||
ConductorProperties properties_;
|
||||
|
||||
// methodes privees
|
||||
// private methods
|
||||
void buildInterface();
|
||||
void buildConnections();
|
||||
void destroyConnections();
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
#include <QPointF>
|
||||
#include "qet.h"
|
||||
/**
|
||||
Cette classe represente un segment de conducteur.
|
||||
This class represents a conductor segment.
|
||||
*/
|
||||
class ConductorSegment {
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ConductorSegment(const QPointF &, const QPointF &, ConductorSegment * = NULL, ConductorSegment * = NULL);
|
||||
virtual ~ConductorSegment();
|
||||
@@ -32,14 +32,14 @@ class ConductorSegment {
|
||||
private:
|
||||
ConductorSegment(const ConductorSegment &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
ConductorSegment *previous_segment;
|
||||
ConductorSegment *next_segment;
|
||||
QPointF point1;
|
||||
QPointF point2;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
void moveX(const qreal &);
|
||||
void moveY(const qreal &);
|
||||
|
||||
@@ -20,16 +20,16 @@
|
||||
#include <QtCore>
|
||||
#include "conductorsegment.h"
|
||||
/**
|
||||
Cette classe contient le profil (= les caracteristiques essentielles) d'un
|
||||
segment de conducteur.
|
||||
This class embeds the profile (i.e. main characteristics) of a conductor
|
||||
segment.
|
||||
*/
|
||||
class ConductorSegmentProfile {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
/**
|
||||
Constructeur
|
||||
@param l longueur du segment
|
||||
@param ori true si le segment est horizontal, false s'il est vertical
|
||||
Constructor
|
||||
@param l segment length
|
||||
@param ori true if the segment is horizontal, false if it is vertical
|
||||
*/
|
||||
ConductorSegmentProfile(qreal l, bool ori = true) :
|
||||
length(l),
|
||||
@@ -38,8 +38,8 @@ class ConductorSegmentProfile {
|
||||
}
|
||||
|
||||
/**
|
||||
Constructeur
|
||||
@param segment ConductorSegment dont il faut extraire le profil
|
||||
Constructor
|
||||
@param segment Segment the profile should be copied from.
|
||||
*/
|
||||
ConductorSegmentProfile(ConductorSegment *segment) :
|
||||
length(segment -> length()),
|
||||
@@ -47,15 +47,15 @@ class ConductorSegmentProfile {
|
||||
{
|
||||
}
|
||||
|
||||
/// Destructeur
|
||||
/// Destructor
|
||||
virtual ~ConductorSegmentProfile() {
|
||||
}
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
public:
|
||||
/// longueur du segment
|
||||
/// segment length
|
||||
qreal length;
|
||||
/// orientation du segment
|
||||
/// segment orientation
|
||||
bool isHorizontal;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -20,16 +20,16 @@
|
||||
#include "diagramtextitem.h"
|
||||
class Conductor;
|
||||
/**
|
||||
Cette classe represente un champ de texte rattache a un conducteur.
|
||||
Il est editable et deplacable par l'utilisateur.
|
||||
Il peut egalement etre oriente a un angle quelconque.
|
||||
Ses deplacements sont toutefois limites a une certaine distance autour de
|
||||
son conducteur parent.
|
||||
This class represents a text item attached to a parent conductor.
|
||||
It may be moved and edited by users.
|
||||
It may also be rotated to any angle.
|
||||
Its movements are however limited to a particular distance around its
|
||||
parent conductor.
|
||||
*/
|
||||
class ConductorTextItem : public DiagramTextItem {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ConductorTextItem(Conductor * = 0, Diagram * = 0);
|
||||
ConductorTextItem(const QString &, Conductor * = 0, Diagram * = 0);
|
||||
@@ -37,14 +37,14 @@ class ConductorTextItem : public DiagramTextItem {
|
||||
private:
|
||||
ConductorTextItem(const ConductorTextItem &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
public:
|
||||
enum { Type = UserType + 1006 };
|
||||
Conductor *parentConductor() const;
|
||||
virtual void fromXml(const QDomElement &);
|
||||
virtual QDomElement toXml(QDomDocument &) const;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual int type() const { return Type; }
|
||||
virtual bool wasMovedByUser() const;
|
||||
@@ -55,7 +55,7 @@ class ConductorTextItem : public DiagramTextItem {
|
||||
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *);
|
||||
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
Conductor *parent_conductor_;
|
||||
bool moved_by_user_;
|
||||
|
||||
@@ -24,20 +24,20 @@ class QListWidgetItem;
|
||||
class QStackedWidget;
|
||||
class QDialogButtonBox;
|
||||
/**
|
||||
Cette classe represente le dialogue de configuration de QElectroTech.
|
||||
Il s'agit d'un dialogue affichant des "pages de configuration".
|
||||
Chaque page de configuration doit fournir une icone et un titre.
|
||||
This class represents the configuration dialog for QElectroTech.
|
||||
It displays "configuration pages", each page having to provide an icon and
|
||||
a title.
|
||||
*/
|
||||
class ConfigDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ConfigDialog(QWidget * = 0);
|
||||
virtual ~ConfigDialog();
|
||||
private:
|
||||
ConfigDialog(const ConfigDialog &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public slots:
|
||||
void changePage(QListWidgetItem *, QListWidgetItem *);
|
||||
void applyConf();
|
||||
@@ -47,7 +47,7 @@ class ConfigDialog : public QDialog {
|
||||
void buildPagesList();
|
||||
void addPageToList(ConfigPage *);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QListWidget *pages_list;
|
||||
QStackedWidget *pages_widget;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <QWidget>
|
||||
|
||||
/**
|
||||
This abstract class specifies methods all derived classes should should
|
||||
This abstract class specifies methods all derived classes should
|
||||
implement.
|
||||
*/
|
||||
class ConfigPage : public QWidget {
|
||||
|
||||
@@ -25,49 +25,51 @@ class TitleBlockPropertiesWidget;
|
||||
class ExportPropertiesWidget;
|
||||
|
||||
/**
|
||||
Cette classe represente la page de configuration des nouveaux schemas.
|
||||
This configuration page enables users to define the properties of new
|
||||
diagrams to come.
|
||||
*/
|
||||
class NewDiagramPage : public ConfigPage {
|
||||
Q_OBJECT
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
NewDiagramPage(QWidget * = 0);
|
||||
virtual ~NewDiagramPage();
|
||||
private:
|
||||
NewDiagramPage(const NewDiagramPage &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
void applyConf();
|
||||
QString title() const;
|
||||
QIcon icon() const;
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
public:
|
||||
BorderPropertiesWidget *bpw; ///< Widget d'edition des dimensions du schema
|
||||
TitleBlockPropertiesWidget *ipw; ///< Widget d'edition des proprietes par defaut du cartouche
|
||||
ConductorPropertiesWidget *cpw; ///< Widget d'edition des proprietes par defaut des conducteurs
|
||||
BorderPropertiesWidget *bpw; ///< Widget to edit default diagram dimensions
|
||||
TitleBlockPropertiesWidget *ipw; ///< Widget to edit default title block properties
|
||||
ConductorPropertiesWidget *cpw; ///< Widget to edit default conductor properties
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente la page de configuration generale.
|
||||
This configuration page enables users to specify various options,most of
|
||||
them applying to the whole application.
|
||||
*/
|
||||
class GeneralConfigurationPage : public ConfigPage {
|
||||
Q_OBJECT
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
GeneralConfigurationPage(QWidget * = 0);
|
||||
virtual ~GeneralConfigurationPage();
|
||||
private:
|
||||
GeneralConfigurationPage(const GeneralConfigurationPage &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
void applyConf();
|
||||
QString title() const;
|
||||
QIcon icon() const;
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
public:
|
||||
QLabel *title_label_;
|
||||
QFrame *horiz_line_;
|
||||
@@ -85,47 +87,47 @@ class GeneralConfigurationPage : public ConfigPage {
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente la page de configuration du dialogue d'exportation
|
||||
This configuration page enables users to set default export options.
|
||||
*/
|
||||
class ExportConfigPage : public ConfigPage {
|
||||
Q_OBJECT
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ExportConfigPage(QWidget * = 0);
|
||||
virtual ~ExportConfigPage();
|
||||
private:
|
||||
ExportConfigPage(const ExportConfigPage &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
void applyConf();
|
||||
QString title() const;
|
||||
QIcon icon() const;
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
public:
|
||||
ExportPropertiesWidget *epw;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente la page de configuration du dialogue d'impression
|
||||
This configuration page enables users to set default printing options.
|
||||
*/
|
||||
class PrintConfigPage : public ConfigPage {
|
||||
Q_OBJECT
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
PrintConfigPage(QWidget * = 0);
|
||||
virtual ~PrintConfigPage();
|
||||
private:
|
||||
PrintConfigPage(const PrintConfigPage &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
void applyConf();
|
||||
QString title() const;
|
||||
QIcon icon() const;
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
public:
|
||||
ExportPropertiesWidget *epw;
|
||||
};
|
||||
|
||||
@@ -24,16 +24,15 @@
|
||||
class ElementTextItem;
|
||||
class Terminal;
|
||||
/**
|
||||
Cette classe represente un element electrique. Elle est utilisable
|
||||
comme un element fixe. La difference est que l'element perso lit
|
||||
sa description (noms, dessin, comportement) dans un fichier XML a fournir
|
||||
en parametre.
|
||||
This class represents an electrical element; it may be used like a fixed
|
||||
element, the difference being that the CustomElement reads its description
|
||||
(names, drawing, behavior) from an XML document.
|
||||
*/
|
||||
class CustomElement : public FixedElement {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
CustomElement(const ElementsLocation &, QGraphicsItem * = 0, Diagram * = 0, int * = 0);
|
||||
CustomElement(const QDomElement &, QGraphicsItem * = 0, Diagram * = 0, int * = 0);
|
||||
@@ -42,9 +41,9 @@ class CustomElement : public FixedElement {
|
||||
private:
|
||||
CustomElement(const CustomElement &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
protected:
|
||||
int elmt_state; // contient le code d'erreur si l'instanciation a echoue ou 0 si l'instanciation s'est bien passe
|
||||
int elmt_state; // hold the error code in case the instanciation fails, or 0 if everything went well
|
||||
NamesList names;
|
||||
ElementsLocation location_;
|
||||
QPicture drawing;
|
||||
@@ -53,7 +52,7 @@ class CustomElement : public FixedElement {
|
||||
QList<ElementTextItem *> list_texts_;
|
||||
bool forbid_antialiasing;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual QList<Terminal *> terminals() const;
|
||||
virtual QList<Conductor *> conductors() const;
|
||||
@@ -84,8 +83,8 @@ class CustomElement : public FixedElement {
|
||||
};
|
||||
|
||||
/**
|
||||
@return L'ID du type de l'element ; pour un CustomElement, cela revient au
|
||||
nom du fichier
|
||||
@return The element type ID; considering a CustomElement, this means the
|
||||
@location of its XML description.
|
||||
@see location()
|
||||
*/
|
||||
inline QString CustomElement::typeId() const {
|
||||
@@ -93,38 +92,38 @@ inline QString CustomElement::typeId() const {
|
||||
}
|
||||
|
||||
/**
|
||||
@return L'adresse du fichier contenant la description XML de cet element
|
||||
@return the location of the XML document describing this element.
|
||||
*/
|
||||
inline ElementsLocation CustomElement::location() const {
|
||||
return(location_);
|
||||
}
|
||||
|
||||
/**
|
||||
@return true si cet element est nul, c'est-a-dire si le chargement de sa
|
||||
description XML a echoue
|
||||
@return true if this element is null, i.e. if its XML description could not
|
||||
be loaded.
|
||||
*/
|
||||
inline bool CustomElement::isNull() const {
|
||||
return(elmt_state);
|
||||
}
|
||||
|
||||
/**
|
||||
@return Un entier representant l'etat de l'element :
|
||||
- 0 : L'instanciation a reussi
|
||||
- 1 : Le fichier n'existe pas
|
||||
- 2 : Le fichier n'a pu etre ouvert
|
||||
- 3 : Le fichier n'est pas un document XML
|
||||
- 4 : Le document XML n'a pas une "definition" comme racine
|
||||
- 5 : Les attributs de la definition ne sont pas presents et / ou valides
|
||||
- 6 : La definition est vide
|
||||
- 7 : L'analyse d'un element XML decrivant une partie du dessin de l'element a echoue
|
||||
- 8 : Aucune partie du dessin n'a pu etre chargee
|
||||
@return An integer representing the state of this element:
|
||||
- 0: instantiation succeeded
|
||||
- 1: the file does not exist
|
||||
- 2: the file could not be opened
|
||||
- 3: The file is not a valid XML document
|
||||
- 4: The XML document does not have a "definition" root element.
|
||||
- 5: The definition attributes are missing or invalid
|
||||
- 6: The definition is empty
|
||||
- 7: The parsing of an XML element describing an element drawing primitive failed
|
||||
- 8: No primitive could be loadedAucune partie du dessin n'a pu etre chargee
|
||||
*/
|
||||
inline int CustomElement::state() const {
|
||||
return(elmt_state);
|
||||
}
|
||||
|
||||
/**
|
||||
@return Le nom de l'element
|
||||
@return The name of this element.
|
||||
*/
|
||||
inline QString CustomElement::name() const {
|
||||
return(names.name(location_.baseName()));
|
||||
|
||||
@@ -41,25 +41,25 @@ const qreal Diagram::margin = 5.0;
|
||||
*/
|
||||
Diagram::Diagram(QObject *parent) :
|
||||
QGraphicsScene(parent),
|
||||
draw_grid(true),
|
||||
use_border(true),
|
||||
draw_terminals(true),
|
||||
draw_grid_(true),
|
||||
use_border_(true),
|
||||
draw_terminals_(true),
|
||||
draw_colored_conductors_(true),
|
||||
project_(0),
|
||||
read_only_(false),
|
||||
diagram_qet_version_(-1)
|
||||
{
|
||||
undo_stack = new QUndoStack();
|
||||
qgi_manager = new QGIManager(this);
|
||||
undo_stack_ = new QUndoStack();
|
||||
qgi_manager_ = new QGIManager(this);
|
||||
setBackgroundBrush(Qt::white);
|
||||
conductor_setter = new QGraphicsLineItem(0, 0);
|
||||
conductor_setter -> setZValue(1000000);
|
||||
conductor_setter_ = new QGraphicsLineItem(0, 0);
|
||||
conductor_setter_ -> setZValue(1000000);
|
||||
QPen t;
|
||||
t.setColor(Qt::black);
|
||||
t.setWidthF(1.5);
|
||||
t.setStyle(Qt::DashLine);
|
||||
conductor_setter -> setPen(t);
|
||||
conductor_setter -> setLine(QLineF(QPointF(0.0, 0.0), QPointF(0.0, 0.0)));
|
||||
conductor_setter_ -> setPen(t);
|
||||
conductor_setter_ -> setLine(QLineF(QPointF(0.0, 0.0), QPointF(0.0, 0.0)));
|
||||
|
||||
// initialise les objets gerant les deplacements
|
||||
elements_mover_ = new ElementsMover(); // deplacements d'elements/conducteurs/textes
|
||||
@@ -80,9 +80,9 @@ Diagram::Diagram(QObject *parent) :
|
||||
*/
|
||||
Diagram::~Diagram() {
|
||||
// suppression de la liste des annulations - l'undo stack fait appel au qgimanager pour supprimer certains elements
|
||||
delete undo_stack;
|
||||
delete undo_stack_;
|
||||
// suppression du QGIManager - tous les elements qu'il connait sont supprimes
|
||||
delete qgi_manager;
|
||||
delete qgi_manager_;
|
||||
|
||||
// suppression des objets gerant les deplacements
|
||||
delete elements_mover_;
|
||||
@@ -120,7 +120,7 @@ void Diagram::drawBackground(QPainter *p, const QRectF &r) {
|
||||
p -> setBrush(Qt::white);
|
||||
p -> drawRect(r);
|
||||
|
||||
if (draw_grid) {
|
||||
if (draw_grid_) {
|
||||
// dessine les points de la grille
|
||||
p -> setPen(Qt::black);
|
||||
p -> setBrush(Qt::NoBrush);
|
||||
@@ -141,7 +141,7 @@ void Diagram::drawBackground(QPainter *p, const QRectF &r) {
|
||||
p -> drawPoints(points);
|
||||
}
|
||||
|
||||
if (use_border) border_and_titleblock.draw(p, margin, margin);
|
||||
if (use_border_) border_and_titleblock.draw(p, margin, margin);
|
||||
p -> restore();
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ void Diagram::keyReleaseEvent(QKeyEvent *e) {
|
||||
bool Diagram::toPaintDevice(QPaintDevice &pix, int width, int height, Qt::AspectRatioMode aspectRatioMode) {
|
||||
// determine la zone source = contenu du schema + marges
|
||||
QRectF source_area;
|
||||
if (!use_border) {
|
||||
if (!use_border_) {
|
||||
source_area = itemsBoundingRect();
|
||||
source_area.translate(-margin, -margin);
|
||||
source_area.setWidth (source_area.width () + 2.0 * margin);
|
||||
@@ -248,7 +248,7 @@ bool Diagram::toPaintDevice(QPaintDevice &pix, int width, int height, Qt::Aspect
|
||||
QSize Diagram::imageSize() const {
|
||||
// determine la zone source = contenu du schema + marges
|
||||
qreal image_width, image_height;
|
||||
if (!use_border) {
|
||||
if (!use_border_) {
|
||||
QRectF items_rect = itemsBoundingRect();
|
||||
image_width = items_rect.width();
|
||||
image_height = items_rect.height();
|
||||
@@ -399,8 +399,8 @@ bool Diagram::initFromXml(QDomElement &document, QPointF position, bool consider
|
||||
|
||||
// initialise le document XML interne a partir de l'element XML fourni en parametre
|
||||
if (from_xml) {
|
||||
xml_document.clear();
|
||||
xml_document.appendChild(xml_document.importNode(document, true));
|
||||
xml_document_.clear();
|
||||
xml_document_.appendChild(xml_document_.importNode(document, true));
|
||||
// a ce stade, le document XML interne contient le code XML qui a ete importe, et non pas une version re-exporte par la methode toXml()
|
||||
}
|
||||
return(from_xml);
|
||||
@@ -585,8 +585,8 @@ void Diagram::write() {
|
||||
@param element xml a enregistrer
|
||||
*/
|
||||
void Diagram::write(const QDomElement &element) {
|
||||
xml_document.clear();
|
||||
xml_document.appendChild(xml_document.importNode(element, true));
|
||||
xml_document_.clear();
|
||||
xml_document_.appendChild(xml_document_.importNode(element, true));
|
||||
emit(written());
|
||||
}
|
||||
|
||||
@@ -595,7 +595,7 @@ void Diagram::write(const QDomElement &element) {
|
||||
si le document XML utilise en interne n'est pas vide), false sinon
|
||||
*/
|
||||
bool Diagram::wasWritten() const {
|
||||
return(!xml_document.isNull());
|
||||
return(!xml_document_.isNull());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -606,7 +606,7 @@ QDomElement Diagram::writeXml(QDomDocument &xml_doc) const {
|
||||
// si le schema n'a pas ete enregistre explicitement, on n'ecrit rien
|
||||
if (!wasWritten()) return(QDomElement());
|
||||
|
||||
QDomElement diagram_elmt = xml_document.documentElement();
|
||||
QDomElement diagram_elmt = xml_document_.documentElement();
|
||||
QDomNode new_node = xml_doc.importNode(diagram_elmt, true);
|
||||
return(new_node.toElement());
|
||||
}
|
||||
@@ -737,7 +737,7 @@ void Diagram::titleChanged(const QString &title) {
|
||||
*/
|
||||
void Diagram::diagramTextChanged(DiagramTextItem *text_item, const QString &old_text, const QString &new_text) {
|
||||
if (!text_item) return;
|
||||
undo_stack -> push(new ChangeDiagramTextCommand(text_item, old_text, new_text));
|
||||
undo_stack_ -> push(new ChangeDiagramTextCommand(text_item, old_text, new_text));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,14 +37,13 @@ class IndependentTextItem;
|
||||
class QETProject;
|
||||
class Terminal;
|
||||
/**
|
||||
Cette classe represente un schema electrique.
|
||||
Elle gere les differents elements et conducteurs qui le composent
|
||||
et en effectue le rendu graphique.
|
||||
This class represents an electric diagram. It manages its various child
|
||||
elements, conductors and texts and handles their graphic rendering.
|
||||
*/
|
||||
class Diagram : public QGraphicsScene {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
Diagram(QObject * = 0);
|
||||
virtual ~Diagram();
|
||||
@@ -52,42 +51,42 @@ class Diagram : public QGraphicsScene {
|
||||
private:
|
||||
Diagram(const Diagram &diagram);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
public:
|
||||
/**
|
||||
Represente les options possibles pour l'affichage du schema :
|
||||
* EmptyBorder : N'afficher que la bordure
|
||||
* TitleBlock : Afficher le cartouche
|
||||
* Columns : Afficher les colonnes
|
||||
Represents available options when rendering a particular diagram:
|
||||
* EmptyBorder: display border only
|
||||
* TitleBlock: display title block
|
||||
* Columns: display columns
|
||||
*/
|
||||
enum BorderOptions { EmptyBorder, TitleBlock, Columns };
|
||||
/// Proprietes par defaut des nouveaux conducteurs
|
||||
/// Default properties for new conductors
|
||||
ConductorProperties defaultConductorProperties;
|
||||
/// Dimensions et cartouches du schema
|
||||
/// Diagram dimensions and title block
|
||||
BorderTitleBlock border_and_titleblock;
|
||||
/// taille de la grille en abscisse
|
||||
/// abscissa grid step size
|
||||
static const int xGrid;
|
||||
/// taille de la grille en ordonnee
|
||||
/// ordinate grid step size
|
||||
static const int yGrid;
|
||||
/// marge autour du schema
|
||||
/// margin around the diagram
|
||||
static const qreal margin;
|
||||
|
||||
private:
|
||||
QGraphicsLineItem *conductor_setter;
|
||||
QGraphicsLineItem *conductor_setter_;
|
||||
ElementsMover *elements_mover_;
|
||||
ElementTextsMover *element_texts_mover_;
|
||||
bool draw_grid;
|
||||
bool use_border;
|
||||
QGIManager *qgi_manager;
|
||||
QUndoStack *undo_stack;
|
||||
bool draw_terminals;
|
||||
bool draw_grid_;
|
||||
bool use_border_;
|
||||
QGIManager *qgi_manager_;
|
||||
QUndoStack *undo_stack_;
|
||||
bool draw_terminals_;
|
||||
bool draw_colored_conductors_;
|
||||
QDomDocument xml_document;
|
||||
QDomDocument xml_document_;
|
||||
QETProject *project_;
|
||||
bool read_only_;
|
||||
qreal diagram_qet_version_;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
protected:
|
||||
virtual void drawBackground(QPainter *, const QRectF &);
|
||||
virtual void keyPressEvent(QKeyEvent *);
|
||||
@@ -96,22 +95,22 @@ class Diagram : public QGraphicsScene {
|
||||
public:
|
||||
static bool clipboardMayContainDiagram();
|
||||
|
||||
// fonctions relatives au projet parent
|
||||
// methods related to parent project
|
||||
QETProject *project() const;
|
||||
void setProject(QETProject *);
|
||||
int folioIndex() const;
|
||||
qreal declaredQElectroTechVersion(bool = true) const;
|
||||
|
||||
// fonctions relatives a la lecture seule
|
||||
// methods related to read only mode
|
||||
bool isReadOnly() const;
|
||||
void setReadOnly(bool);
|
||||
|
||||
// fonctions relatives a la pose de conducteurs
|
||||
// methods related to conductor creation
|
||||
void setConductor(bool);
|
||||
void setConductorStart (QPointF);
|
||||
void setConductorStop(QPointF);
|
||||
|
||||
// fonctions relatives a l'import / export XML
|
||||
// methods related to XML import/export
|
||||
QDomDocument toXml(bool = true);
|
||||
bool initFromXml(QDomElement &, QPointF = QPointF(), bool = true, DiagramContent * = 0);
|
||||
bool fromXml(QDomDocument &, QPointF = QPointF(), bool = true, DiagramContent * = 0);
|
||||
@@ -121,7 +120,7 @@ class Diagram : public QGraphicsScene {
|
||||
bool wasWritten() const;
|
||||
QDomElement writeXml(QDomDocument &) const;
|
||||
|
||||
// fonctions relative a l'ajout et a l'enlevement d'elements graphiques sur le schema
|
||||
// methods related to graphics items addition/removal on the diagram
|
||||
void addElement(Element *);
|
||||
void addConductor(Conductor *);
|
||||
void addIndependentTextItem(IndependentTextItem *);
|
||||
@@ -130,7 +129,7 @@ class Diagram : public QGraphicsScene {
|
||||
void removeConductor(Conductor *);
|
||||
void removeIndependentTextItem(IndependentTextItem *);
|
||||
|
||||
// fonctions relatives aux options graphiques
|
||||
// methods related to graphics options
|
||||
ExportProperties applyProperties(const ExportProperties &);
|
||||
void setDisplayGrid(bool);
|
||||
bool displayGrid();
|
||||
@@ -177,7 +176,7 @@ class Diagram : public QGraphicsScene {
|
||||
void titleBlockTemplateRemoved(const QString &, const QString & = QString());
|
||||
void setTitleBlockTemplate(const QString &);
|
||||
|
||||
// fonctions relative a la selection sur le schema
|
||||
// methods related to graphics items selection
|
||||
void selectAll();
|
||||
void deselectAll();
|
||||
void invertSelection();
|
||||
@@ -191,71 +190,73 @@ class Diagram : public QGraphicsScene {
|
||||
Q_DECLARE_METATYPE(Diagram *)
|
||||
|
||||
/**
|
||||
Permet d'ajouter ou enlever le "poseur de conducteur", c'est-a-dire la
|
||||
droite en pointilles qui apparait lorsqu'on pose un conducteur entre deux
|
||||
bornes.
|
||||
Display or hide the conductor setter, i.e. a dashed conductor stub which appears when creating a conductor between two terminals.
|
||||
@param pf true pour ajouter le poseur de conducteur, false pour l'enlever
|
||||
*/
|
||||
inline void Diagram::setConductor(bool pf) {
|
||||
if (pf) {
|
||||
if (!conductor_setter -> scene()) addItem(conductor_setter);
|
||||
inline void Diagram::setConductor(bool adding) {
|
||||
if (adding) {
|
||||
if (!conductor_setter_ -> scene()) addItem(conductor_setter_);
|
||||
} else {
|
||||
if (conductor_setter -> scene()) removeItem(conductor_setter);
|
||||
if (conductor_setter_ -> scene()) removeItem(conductor_setter_);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Specifie les coordonnees du point de depart du poseur de conducteur
|
||||
@param d Le nouveau point de depart du poseur de conducteur
|
||||
Set the start point of the conductor setter.
|
||||
@param start the point (in scene coordinates) which the newly created
|
||||
conductor should start from.
|
||||
*/
|
||||
inline void Diagram::setConductorStart(QPointF d) {
|
||||
conductor_setter -> setLine(QLineF(d, conductor_setter -> line().p2()));
|
||||
inline void Diagram::setConductorStart(QPointF start) {
|
||||
conductor_setter_ -> setLine(QLineF(start, conductor_setter_ -> line().p2()));
|
||||
}
|
||||
|
||||
/**
|
||||
Specifie les coordonnees du point d'arrivee du poseur de conducteur
|
||||
@param a Le nouveau point d'arrivee du poseur de conducteur
|
||||
Set the end point of the conductor setter.
|
||||
@param end the point (in scene coordinates) upon to which the newly created
|
||||
conductor should be drawn.
|
||||
*/
|
||||
inline void Diagram::setConductorStop(QPointF a) {
|
||||
conductor_setter -> setLine(QLineF(conductor_setter -> line().p1(), a));
|
||||
inline void Diagram::setConductorStop(QPointF end) {
|
||||
conductor_setter_ -> setLine(QLineF(conductor_setter_ -> line().p1(), end));
|
||||
}
|
||||
|
||||
/**
|
||||
Permet de specifier si la grille du schema doit etre dessinee ou non
|
||||
@param dg true pour afficher la grille, false pour ne pas l'afficher
|
||||
Set whether the diagram grid should be drawn.
|
||||
@param dg true to render the grid, false otherwise.
|
||||
*/
|
||||
inline void Diagram::setDisplayGrid(bool dg) {
|
||||
draw_grid = dg;
|
||||
draw_grid_ = dg;
|
||||
}
|
||||
|
||||
/**
|
||||
Permet de savoir si la grille du schema est dessinee ou non
|
||||
@return true si la grille est affichee , false sinon
|
||||
@return true if the grid is drawn, false otherwise.
|
||||
*/
|
||||
inline bool Diagram::displayGrid() {
|
||||
return(draw_grid);
|
||||
return(draw_grid_);
|
||||
}
|
||||
|
||||
/**
|
||||
Permet de specifier si le cadre du schema doit etre pris en compte pour
|
||||
determiner le contour du schema.
|
||||
@param ub true pour prendre le schema en compte, false sinon
|
||||
Set whether the diagram border (including rows/colums headers and the title
|
||||
block) should be rendered along with the diagram. When set to false, the size
|
||||
of the smallest rectangle containing all items is considered as the diagram
|
||||
size.
|
||||
@param ub true to take the border into account, false otherwise
|
||||
*/
|
||||
inline void Diagram::setUseBorder(bool ub) {
|
||||
use_border = ub;
|
||||
use_border_ = ub;
|
||||
}
|
||||
|
||||
/**
|
||||
Permet de savoir si le cadre du schema est pris en compte pour
|
||||
determiner le contour du schema.
|
||||
@return true if the border is rendered and take into account, false
|
||||
otherwise.
|
||||
*/
|
||||
inline bool Diagram::useBorder() {
|
||||
return(use_border);
|
||||
return(use_border_);
|
||||
}
|
||||
|
||||
/**
|
||||
Permet de definir les options du cadre, des colonnes et du cartouche.
|
||||
@param bo Un OU binaire entre les options possibles
|
||||
Set the rendering options for the diagram border (including rows/colums
|
||||
headers and the title block)
|
||||
@param bo Enabled options ORed together
|
||||
@see BorderOptions
|
||||
*/
|
||||
inline void Diagram::setBorderOptions(Diagram::BorderOptions bo) {
|
||||
@@ -265,33 +266,32 @@ inline void Diagram::setBorderOptions(Diagram::BorderOptions bo) {
|
||||
}
|
||||
|
||||
/**
|
||||
Permet de savoir les options du cadre, des colonnes et du cartouche.
|
||||
@return Un OU binaire entre les options possibles
|
||||
@see BorderOptions
|
||||
@return The rendering optios for the diagram border
|
||||
@see setBorderOptions
|
||||
*/
|
||||
inline Diagram::BorderOptions Diagram::borderOptions() {
|
||||
BorderOptions retour = EmptyBorder;
|
||||
if (border_and_titleblock.titleBlockIsDisplayed()) retour = (BorderOptions)(retour|TitleBlock);
|
||||
if (border_and_titleblock.columnsAreDisplayed()) retour = (BorderOptions)(retour|Columns);
|
||||
return(retour);
|
||||
BorderOptions options = EmptyBorder;
|
||||
if (border_and_titleblock.titleBlockIsDisplayed()) options = (BorderOptions)(options|TitleBlock);
|
||||
if (border_and_titleblock.columnsAreDisplayed()) options = (BorderOptions)(options|Columns);
|
||||
return(options);
|
||||
}
|
||||
|
||||
/// @return la pile d'annulations de ce schema
|
||||
/// @return the diagram undo stack
|
||||
inline QUndoStack &Diagram::undoStack() {
|
||||
return(*undo_stack);
|
||||
return(*undo_stack_);
|
||||
}
|
||||
|
||||
/// @return le egstionnaire de QGraphicsItem de ce schema
|
||||
/// @return the diagram graphics item manager
|
||||
inline QGIManager &Diagram::qgiManager() {
|
||||
return(*qgi_manager);
|
||||
return(*qgi_manager_);
|
||||
}
|
||||
|
||||
/// @return true si les bornes sont affichees, false sinon
|
||||
/// @return true if terminals are rendered, false otherwise
|
||||
inline bool Diagram::drawTerminals() const {
|
||||
return(draw_terminals);
|
||||
return(draw_terminals_);
|
||||
}
|
||||
|
||||
/// @return true si les couleurs des conducteurs sont respectees, false sinon
|
||||
/// @return true if conductors colors are rendered, false otherwise.
|
||||
inline bool Diagram::drawColoredConductors() const {
|
||||
return(draw_colored_conductors_);
|
||||
}
|
||||
|
||||
@@ -31,140 +31,139 @@ class ElementTextItem;
|
||||
class IndependentTextItem;
|
||||
|
||||
/**
|
||||
Cette classe represente l'action d'ajouter un element au schema
|
||||
This command adds an element to a particular diagram.
|
||||
*/
|
||||
class AddElementCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
AddElementCommand(Diagram *, Element *, const QPointF &, QUndoCommand * = 0);
|
||||
virtual ~AddElementCommand();
|
||||
private:
|
||||
AddElementCommand(const AddElementCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// element ajoute
|
||||
/// added element
|
||||
Element *element;
|
||||
/// schema sur lequel on ajoute l'element
|
||||
/// diagram the element is added to
|
||||
Diagram *diagram;
|
||||
/// position de l'element sur le schema
|
||||
/// position of the element on the diagram
|
||||
QPointF position;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action d'ajouter du texte au schema
|
||||
This command adds an independent (i.e. related to neither an element nor a
|
||||
conductor) text item to a particular diagram.
|
||||
*/
|
||||
class AddTextCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
AddTextCommand(Diagram *, IndependentTextItem *, const QPointF &, QUndoCommand * = 0);
|
||||
virtual ~AddTextCommand();
|
||||
private:
|
||||
AddTextCommand(const AddTextCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// texte ajoute
|
||||
/// added text item
|
||||
IndependentTextItem *textitem;
|
||||
/// schema sur lequel on ajoute le texte
|
||||
/// diagram the text item is added to
|
||||
Diagram *diagram;
|
||||
/// position du texte sur le schema
|
||||
/// position of the text item on the diagram
|
||||
QPointF position;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action d'ajouter un conducteur au schema
|
||||
This command adds a conductor to a particular diagram.
|
||||
*/
|
||||
class AddConductorCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
AddConductorCommand(Diagram *, Conductor *, QUndoCommand * = 0);
|
||||
virtual ~AddConductorCommand();
|
||||
private:
|
||||
AddConductorCommand(const AddConductorCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// conducteur ajoute
|
||||
/// added conductor
|
||||
Conductor *conductor;
|
||||
/// schema auquel on ajoute le conducteur
|
||||
/// diagram the conductor is added to
|
||||
Diagram *diagram;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de supprimer des elements, conducteurs
|
||||
et / ou textes independants d'un schema
|
||||
This command removes content from a particular diagram.
|
||||
*/
|
||||
class DeleteElementsCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
DeleteElementsCommand(Diagram *, const DiagramContent &, QUndoCommand * = 0);
|
||||
virtual ~DeleteElementsCommand();
|
||||
private:
|
||||
DeleteElementsCommand(const DeleteElementsCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// contenu enleve
|
||||
/// removed content
|
||||
DiagramContent removed_content;
|
||||
/// schema dont on supprime des elements et conducteurs
|
||||
/// diagram which the content is removed from
|
||||
Diagram *diagram;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de coller quelque chose sur un schema
|
||||
This command pastes some content onto a particular diagram.
|
||||
*/
|
||||
class PasteDiagramCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
PasteDiagramCommand(Diagram *, const DiagramContent &, QUndoCommand * = 0);
|
||||
virtual ~PasteDiagramCommand();
|
||||
private:
|
||||
PasteDiagramCommand(const PasteDiagramCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// contenu ajoute
|
||||
/// pasted content
|
||||
DiagramContent content;
|
||||
/// schema sur lequel on colle les elements et conducteurs
|
||||
/// diagram content is pasted onto
|
||||
Diagram *diagram;
|
||||
/// entien pour filtrer le contenu du schema
|
||||
/// filter stating what kinds of items should be pasted
|
||||
int filter;
|
||||
/// 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 elements et / ou
|
||||
conducteurs d'un schema
|
||||
This command cuts content from a particular diagram.
|
||||
*/
|
||||
class CutDiagramCommand : public DeleteElementsCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
CutDiagramCommand(Diagram *, const DiagramContent &, QUndoCommand * = 0);
|
||||
virtual ~CutDiagramCommand();
|
||||
@@ -173,89 +172,84 @@ class CutDiagramCommand : public DeleteElementsCommand {
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de deplacer des elements et des
|
||||
conducteurs sur un schema
|
||||
This command moves some content on a particular diagram.
|
||||
*/
|
||||
class MoveElementsCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
MoveElementsCommand(Diagram *, const DiagramContent &, const QPointF &m, QUndoCommand * = 0);
|
||||
virtual ~MoveElementsCommand();
|
||||
private:
|
||||
MoveElementsCommand(const MoveElementsCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
virtual void move(const QPointF &);
|
||||
virtual void addConductorTextItemMovement(ConductorTextItem *, const QPointF &, const QPointF &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// schema sur lequel on deplace les elements
|
||||
/// diagram the movement takes place on.
|
||||
Diagram *diagram;
|
||||
/// contenu a deplacer
|
||||
/// moved content
|
||||
DiagramContent content_to_move;
|
||||
/// mouvement effectue
|
||||
/// applied movement
|
||||
QPointF movement;
|
||||
/**
|
||||
Deplacer des elements ou champs de texte entraine des conducteurs.
|
||||
Soit ces conducteurs sont betement deplaces, soit leur trajet est
|
||||
recalcule.
|
||||
Si leur trajet est recalcule, les champs de texte dont la position a ete
|
||||
personnalisee par l'utilisateur
|
||||
Liste des champs de texte de conducteurs dont la position a ete modifiee
|
||||
par des mises
|
||||
Moving elements impacts their conductors: either they are moved, or their path
|
||||
needs to be generated again, which in turn tends to move their child text
|
||||
items. This attribute holds both new and previous positions for each moved
|
||||
text item.
|
||||
*/
|
||||
QHash<ConductorTextItem *, QPair<QPointF, QPointF> > moved_conductor_texts_;
|
||||
/// booleen pour ne pas executer le premier redo()
|
||||
/// prevent the first call to redo()
|
||||
bool first_redo;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de deplacer des champs de texte rattaches
|
||||
a des elements sur un schema
|
||||
This command moves text items related to elements on a particular diagram.
|
||||
*/
|
||||
class MoveElementsTextsCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
MoveElementsTextsCommand(Diagram *, const QSet<ElementTextItem *> &, const QPointF &m, QUndoCommand * = 0);
|
||||
virtual ~MoveElementsTextsCommand();
|
||||
private:
|
||||
MoveElementsTextsCommand(const MoveElementsTextsCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
virtual void move(const QPointF &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// schema sur lequel on deplace les elements
|
||||
/// diagram the movement takes place on.
|
||||
Diagram *diagram;
|
||||
/// liste des champs de texte a deplacer
|
||||
/// text items to be moved
|
||||
QSet<ElementTextItem *> texts_to_move;
|
||||
/// mouvement effectue
|
||||
/// applied movement
|
||||
QPointF movement;
|
||||
/// booleen pour ne pas executer le premier redo()
|
||||
/// prevent the first call to redo()
|
||||
bool first_redo;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de deplacer des champs de texte rattaches
|
||||
a des conducteurs sur un schema
|
||||
This command moves text items related to conductors on a particular
|
||||
diagram.
|
||||
*/
|
||||
class MoveConductorsTextsCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
MoveConductorsTextsCommand(Diagram *, QUndoCommand * = 0);
|
||||
virtual ~MoveConductorsTextsCommand();
|
||||
private:
|
||||
MoveConductorsTextsCommand(const MoveConductorsTextsCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
@@ -264,56 +258,56 @@ class MoveConductorsTextsCommand : public QUndoCommand {
|
||||
private:
|
||||
void regenerateTextLabel();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// schema sur lequel on deplace les elements
|
||||
/// diagram the movement takes place on.
|
||||
Diagram *diagram;
|
||||
/// liste des champs de texte a deplacer
|
||||
/// text items to be moved
|
||||
QHash<ConductorTextItem *, QPair<QPointF, bool> > texts_to_move_;
|
||||
/// booleen pour ne pas executer le premier redo()
|
||||
/// prevent the first call to redo()
|
||||
bool first_redo;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente la modification d'un champ de texte
|
||||
This commad modifies a text item.
|
||||
*/
|
||||
class ChangeDiagramTextCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ChangeDiagramTextCommand(DiagramTextItem *, const QString &before, const QString &after, QUndoCommand * = 0);
|
||||
virtual ~ChangeDiagramTextCommand();
|
||||
private:
|
||||
ChangeDiagramTextCommand(const ChangeDiagramTextCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// DiagramTextItem modifie
|
||||
/// modified text item
|
||||
DiagramTextItem *text_item;
|
||||
/// texte avant changement
|
||||
/// former text
|
||||
QString text_before;
|
||||
/// texte apres changement
|
||||
/// new text
|
||||
QString text_after;
|
||||
/// booleen pour ne pas executer le premier redo()
|
||||
/// prevent the first call to redo()
|
||||
bool first_redo;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de pivoter plusieurs elements ou champs de textes avec un meme angle
|
||||
This command rotates several elements or text items by a particular angle.
|
||||
*/
|
||||
class RotateElementsCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
RotateElementsCommand(const QHash<Element *, QET::Orientation> &elements, const QList<DiagramTextItem *> &, QUndoCommand * = 0);
|
||||
virtual ~RotateElementsCommand();
|
||||
private:
|
||||
RotateElementsCommand(const RotateElementsCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
@@ -321,21 +315,22 @@ class RotateElementsCommand : public QUndoCommand {
|
||||
void setAppliedRotationAngle(const qreal &);
|
||||
static void rotateElement(Element *, QET::Orientation);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// elements pivotes associes a leur ancienne orientation
|
||||
/// hold rotated elements along with their former orientation
|
||||
QHash<Element *, QET::Orientation> elements_to_rotate;
|
||||
/// textes a pivoter
|
||||
/// text items to be rotated
|
||||
QList<DiagramTextItem *> texts_to_rotate;
|
||||
/// angle de rotation a appliquer aux textes (valeur utilisee dans le redo
|
||||
/// angle of rotation to be applied to text items
|
||||
qreal applied_rotation_angle_;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action d'orienter plusieurs textes a un meme angle de rotation bien precis
|
||||
This command directs several text items to a same particular angle of
|
||||
rotation.
|
||||
*/
|
||||
class RotateTextsCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
RotateTextsCommand(const QHash<DiagramTextItem *, double> &, double, QUndoCommand * = 0);
|
||||
RotateTextsCommand(const QList<DiagramTextItem *> &, double, QUndoCommand * = 0);
|
||||
@@ -343,7 +338,7 @@ class RotateTextsCommand : public QUndoCommand {
|
||||
private:
|
||||
RotateTextsCommand(const RotateTextsCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
@@ -351,152 +346,153 @@ class RotateTextsCommand : public QUndoCommand {
|
||||
private:
|
||||
void defineCommandName();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// textes pivotes associes a leur ancienne orientation
|
||||
/// hold rotated text items along with their former angle of rotation
|
||||
QHash<DiagramTextItem *, double> texts_to_rotate;
|
||||
/// angle de rotation a appliquer aux textes
|
||||
/// angle of rotation of all text items after the command
|
||||
double applied_rotation_angle_;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de modifier un conducteur
|
||||
This command changes a particular conductor.
|
||||
*/
|
||||
class ChangeConductorCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ChangeConductorCommand(Conductor *, const ConductorProfile &, const ConductorProfile &, Qt::Corner, QUndoCommand * = 0);
|
||||
virtual ~ChangeConductorCommand();
|
||||
private:
|
||||
ChangeConductorCommand(const ChangeConductorCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
virtual void setConductorTextItemMove(const QPointF &, const QPointF &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// conducteur modifie
|
||||
/// changed conductor
|
||||
Conductor *conductor;
|
||||
/// profil avant changement
|
||||
/// profile before the change
|
||||
ConductorProfile old_profile;
|
||||
/// profil apres changement
|
||||
/// profile after the change
|
||||
ConductorProfile new_profile;
|
||||
/// Type de trajet
|
||||
/// Path type of the modified conductor
|
||||
Qt::Corner path_type;
|
||||
/// Position du champ de texte avant le changement
|
||||
/// position of the text item before the change
|
||||
QPointF text_pos_before_mov_;
|
||||
/// Position du champ de texte apres le changement
|
||||
/// position of the text item after the change
|
||||
QPointF text_pos_after_mov_;
|
||||
/// booleen pour ne pas executer le premier redo()
|
||||
/// prevent the first call to redo()
|
||||
bool first_redo;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de reinitialiser des conducteurs
|
||||
This command resets conductor paths.
|
||||
*/
|
||||
class ResetConductorCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ResetConductorCommand(const QHash<Conductor *, ConductorProfilesGroup> &, QUndoCommand * = 0);
|
||||
virtual ~ResetConductorCommand();
|
||||
private:
|
||||
ResetConductorCommand(const ResetConductorCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// conducteurs reinitialises associes a leur ancien profil
|
||||
/// impacted conductors along with their former profiles
|
||||
QHash<Conductor *, ConductorProfilesGroup> conductors_profiles;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de modifier les informations du cartouche d'un schema
|
||||
This command changes the title block properties for a particular diagram.
|
||||
*/
|
||||
class ChangeTitleBlockCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ChangeTitleBlockCommand(Diagram *, const TitleBlockProperties &, const TitleBlockProperties &, QUndoCommand * = 0);
|
||||
virtual ~ChangeTitleBlockCommand();
|
||||
private:
|
||||
ChangeTitleBlockCommand(const ChangeTitleBlockCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// schema modifie
|
||||
/// modified diagram
|
||||
Diagram *diagram;
|
||||
/// proprietes avant changement
|
||||
/// properties before the change
|
||||
TitleBlockProperties old_titleblock;
|
||||
/// proprietes apres changement
|
||||
/// properties after the change
|
||||
TitleBlockProperties new_titleblock;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de modifier les dimensions d'un schema
|
||||
This command changes the border properties of a particular diagram.
|
||||
*/
|
||||
class ChangeBorderCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ChangeBorderCommand(Diagram *, const BorderProperties &, const BorderProperties &, QUndoCommand * = 0);
|
||||
virtual ~ChangeBorderCommand();
|
||||
private:
|
||||
ChangeBorderCommand(const ChangeBorderCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// schema modifie
|
||||
/// modified diagram
|
||||
Diagram *diagram;
|
||||
public:
|
||||
/// anciennes dimensions du schema
|
||||
/// properties before the change
|
||||
BorderProperties old_properties;
|
||||
/// nouvelles dimensions du schema
|
||||
/// properties after the change
|
||||
BorderProperties new_properties;
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente l'action de modifier les proprietes d'un conducteur
|
||||
This command changes the properties for a particular conductor.
|
||||
*/
|
||||
class ChangeConductorPropertiesCommand : public QUndoCommand {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ChangeConductorPropertiesCommand(Conductor *, QUndoCommand * = 0);
|
||||
virtual ~ChangeConductorPropertiesCommand();
|
||||
private:
|
||||
ChangeConductorPropertiesCommand(const ChangeConductorPropertiesCommand &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void undo();
|
||||
virtual void redo();
|
||||
virtual void setOldSettings(const ConductorProperties &);
|
||||
virtual void setNewSettings(const ConductorProperties &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
/// conducteur modifie
|
||||
/// modified conductor
|
||||
Conductor *conductor;
|
||||
/// anciennes proprietes
|
||||
/// properties before the change
|
||||
ConductorProperties old_properties;
|
||||
/// nouvelles proprietes
|
||||
/// properties after the change
|
||||
ConductorProperties new_properties;
|
||||
/// booleens indiquant si les proprietes ont ete definies ou non
|
||||
/// track whether pre-change properties were set
|
||||
bool old_settings_set;
|
||||
/// track whether post-change properties were set
|
||||
bool new_settings_set;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -22,14 +22,13 @@ class Conductor;
|
||||
class Element;
|
||||
class IndependentTextItem;
|
||||
/**
|
||||
Cette classe est un conteneur pour passer facilement le contenu d'un schema
|
||||
a une fonction. Il permet d'acceder rapidement aux differents types de
|
||||
composants que l'on peut trouver sur un schema, comme les elements, les
|
||||
champs de texte, les conducteurs (a deplacer ou a mettre a jour, en cas de
|
||||
deplacements), etc.
|
||||
A noter que ce container ne contient pas systematiquement l'integralite
|
||||
d'un schema. Il peut n'en contenir qu'une partie, typiquement les
|
||||
composants selectionnes.
|
||||
This class provides a container that makes the transmission of diagram content
|
||||
to other functions/methods easier. The different kind of items are made
|
||||
available through a handful of filter-aware methods. Considering selected
|
||||
elements are to be moved, the filter notably distinguishes conductors to be
|
||||
moved from those to be updated.
|
||||
Please note this container does not systematically contains a whole
|
||||
diagram: it may describe only a part of it, e.g. selected items.
|
||||
*/
|
||||
class DiagramContent {
|
||||
public:
|
||||
@@ -37,7 +36,7 @@ class DiagramContent {
|
||||
DiagramContent(const DiagramContent &);
|
||||
~DiagramContent();
|
||||
|
||||
/// Permet de filtrer facilement les differentes parties d'un schema
|
||||
/// Used to filter the different items carried by this container.
|
||||
enum Filter {
|
||||
Elements = 1,
|
||||
TextFields = 2,
|
||||
@@ -49,15 +48,15 @@ class DiagramContent {
|
||||
SelectedOnly = 32
|
||||
};
|
||||
|
||||
/// Elements de texte du schema
|
||||
/// Hold electrical elements
|
||||
QSet<Element *> elements;
|
||||
/// Champs de texte independants du schema
|
||||
/// Hold independent text items
|
||||
QSet<IndependentTextItem *> textFields;
|
||||
/// Conducteurs a mettre a jour du schema
|
||||
/// Hold conductors that would get updated considering electrical elements are moved
|
||||
QSet<Conductor *> conductorsToUpdate;
|
||||
/// Conducteurs a deplacer du schema
|
||||
/// Hold conductors that would be moved as is considering electrical elements are moved
|
||||
QSet<Conductor *> conductorsToMove;
|
||||
/// Conducteurs isoles (ni a deplacer, ni a mettre a jour)
|
||||
/// Hold conductors that would be left untouched considering electrical elements are moved
|
||||
QSet<Conductor *> otherConductors;
|
||||
|
||||
QList<Conductor *> conductors(int = AnyConductor) const;
|
||||
|
||||
@@ -21,25 +21,25 @@
|
||||
#include <QString>
|
||||
#include <QRegExp>
|
||||
/**
|
||||
Cette classe represente la position d'un element sur le schema. Il ne
|
||||
s'agit pas de ses coordonnees (bien que celles-ci puissent etre embarquees
|
||||
par commodite), mais du secteur du schema dans lequel il se situe, par
|
||||
exemple B2 ou C4.
|
||||
This class stores the position of an electrical element on its parent diagram.
|
||||
While exact coordinates can be stored for convenience, the concept of diagram
|
||||
position as implemented by this class simply designates the intersection
|
||||
between a column and a row, e.g. B2 or C4.
|
||||
*/
|
||||
class DiagramPosition {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
DiagramPosition(const QString & = "", unsigned int = 0);
|
||||
virtual ~DiagramPosition();
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
QPointF position() const;
|
||||
void setPosition(const QPointF &);
|
||||
QString toString();
|
||||
bool isOutOfBounds() const;
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QString letter_;
|
||||
unsigned int number_;
|
||||
|
||||
@@ -22,20 +22,19 @@
|
||||
#include "diagram.h"
|
||||
#include "exportproperties.h"
|
||||
/**
|
||||
Cette classe represente le dialogue de configuration de l'impression d'un
|
||||
schema electrique.
|
||||
Elle se charge egalement de l'impression elle-meme
|
||||
This class implements both the dialog allowing users to configure the printing
|
||||
of a project file and the printing itself.
|
||||
*/
|
||||
class DiagramPrintDialog : public QWidget {
|
||||
Q_OBJECT
|
||||
// Constructeurs, destructeur
|
||||
// Constructors, destructor
|
||||
public:
|
||||
DiagramPrintDialog(QETProject *, QWidget * = 0);
|
||||
virtual ~DiagramPrintDialog();
|
||||
private:
|
||||
DiagramPrintDialog(const DiagramPrintDialog &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
void setFileName(const QString &);
|
||||
QString fileName() const;
|
||||
@@ -62,14 +61,13 @@ class DiagramPrintDialog : public QWidget {
|
||||
void acceptPrintTypeDialog();
|
||||
void browseFilePrintTypeDialog();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QETProject *project_;
|
||||
QPrinter *printer_;
|
||||
QString doc_name_;
|
||||
QString file_name_;
|
||||
|
||||
/// Attributs relatifs au 1er dialogue
|
||||
QDialog *dialog_;
|
||||
QLabel *printtype_label_;
|
||||
QGridLayout *glayout0_;
|
||||
|
||||
@@ -21,20 +21,20 @@
|
||||
class QETProject;
|
||||
class Diagram;
|
||||
/**
|
||||
Cette classe represente un widget permettant de choisir 0 a n schemas parmi
|
||||
ceux d'un projet.
|
||||
This class provides a widget which allows users to select 0 to n diagrams
|
||||
among those of a particular project.
|
||||
*/
|
||||
class DiagramsChooser : public QScrollArea {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
DiagramsChooser(QETProject *, QWidget * = 0);
|
||||
virtual ~DiagramsChooser();
|
||||
private:
|
||||
DiagramsChooser(const DiagramsChooser &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
QETProject *project() const;
|
||||
QList<Diagram *> selectedDiagrams() const;
|
||||
@@ -52,7 +52,7 @@ class DiagramsChooser : public QScrollArea {
|
||||
private:
|
||||
void buildLayout();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QETProject *project_;
|
||||
QWidget *widget0_;
|
||||
|
||||
@@ -20,27 +20,28 @@
|
||||
#include <QtGui>
|
||||
#include "diagram.h"
|
||||
/**
|
||||
Cette classe represente un champ de texte editable sur le schema.
|
||||
Par defaut, les DiagramTextItem sont Selectable et Movable.
|
||||
This class represents a selectable, movable and editable text field on a
|
||||
diagram.
|
||||
@see QGraphicsItem::GraphicsItemFlags
|
||||
*/
|
||||
class DiagramTextItem : public QGraphicsTextItem {
|
||||
Q_OBJECT
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
DiagramTextItem(QGraphicsItem * = 0, Diagram * = 0);
|
||||
DiagramTextItem(const QString &, QGraphicsItem * = 0, Diagram * = 0);
|
||||
virtual ~DiagramTextItem();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
public:
|
||||
enum { Type = UserType + 1004 };
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
/**
|
||||
Cette methode permet d'utiliser qgraphicsitem_cast sur cet objet
|
||||
@return le type de QGraphicsItem
|
||||
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into a
|
||||
DiagramTextItem
|
||||
@return the QGraphicsItem type
|
||||
*/
|
||||
virtual int type() const { return Type; }
|
||||
Diagram *diagram() const;
|
||||
@@ -64,22 +65,19 @@ class DiagramTextItem : public QGraphicsTextItem {
|
||||
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *);
|
||||
virtual void applyRotation(const qreal &);
|
||||
|
||||
// signaux
|
||||
signals:
|
||||
/// signal emis lorsque le champ de texte perd le focus
|
||||
/// signal emitted when the text field loses focus
|
||||
void lostFocus();
|
||||
/// signal emis lorsque le champ de texte a ete modifie
|
||||
/// signal emitted after text was changed
|
||||
void diagramTextChanged(DiagramTextItem *, const QString &, const QString &);
|
||||
|
||||
// slots
|
||||
public slots:
|
||||
void setNonFocusable();
|
||||
|
||||
// attributs prives
|
||||
private:
|
||||
/// Texte precedent
|
||||
/// Previous text value
|
||||
QString previous_text_;
|
||||
/// angle de rotation du champ de texte
|
||||
/// angle of rotation of the text field
|
||||
qreal rotation_angle_;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -26,12 +26,13 @@ class Element;
|
||||
class IndependentTextItem;
|
||||
class QETDiagramEditor;
|
||||
/**
|
||||
Classe representant graphiquement un schema electrique
|
||||
This class provides a widget to render an electric diagram in an editable,
|
||||
interactive way.
|
||||
*/
|
||||
class DiagramView : public QGraphicsView {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
DiagramView(Diagram * = 0, QWidget * = 0);
|
||||
virtual ~DiagramView();
|
||||
@@ -39,7 +40,7 @@ class DiagramView : public QGraphicsView {
|
||||
private:
|
||||
DiagramView(const DiagramView &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
Diagram *scene;
|
||||
QMenu *context_menu;
|
||||
@@ -52,7 +53,7 @@ class DiagramView : public QGraphicsView {
|
||||
ElementsLocation next_location_;
|
||||
QPoint next_position_;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
QString title() const;
|
||||
void editDiagramProperties();
|
||||
@@ -60,7 +61,7 @@ class DiagramView : public QGraphicsView {
|
||||
void removeColumn();
|
||||
void addRow();
|
||||
void removeRow();
|
||||
/// @return Le schema visualise par ce DiagramView
|
||||
/// @return the diagram rendered by this view
|
||||
Diagram *diagram() { return(scene); }
|
||||
QETDiagramEditor *diagramEditor() const;
|
||||
bool hasSelectedItems();
|
||||
@@ -96,23 +97,23 @@ class DiagramView : public QGraphicsView {
|
||||
bool addElementAtPos(const ElementsLocation &, const QPoint &);
|
||||
|
||||
signals:
|
||||
/// Signal emis lorsque la selection change
|
||||
/// Signal emitted after the selection changed
|
||||
void selectionChanged();
|
||||
/// Signal emis lorsque le mode de selection change
|
||||
/// Signal emitted after the selection mode changed
|
||||
void modeChanged();
|
||||
/// Signal emis lorsqu'un texte a ete pose
|
||||
/// Signal emitted after a text was added
|
||||
void textAdded(bool);
|
||||
/// Signal emis lorsque le titre du schema change
|
||||
/// Signal emitted after the diagram title changed
|
||||
void titleChanged(DiagramView *, const QString &);
|
||||
/// Signal emis avant l'integration d'un element
|
||||
/// Signal emitted before integrating an element
|
||||
void aboutToAddElement();
|
||||
/// Signal emitted before integrating a title block template
|
||||
void aboutToSetDroppedTitleBlockTemplate(const TitleBlockTemplateLocation &);
|
||||
/// Signal emis lorsque l'utilisateur souhaite retrouver un element du schema dans les collections
|
||||
/// Signal emitted when users wish to locate an element from the diagram within elements collection
|
||||
void findElementRequired(const ElementsLocation &);
|
||||
/// Signal emis lorsque l'utilisateur souhaite editer un element du schema
|
||||
/// Signal emitted when users wish to edit an element from the diagram
|
||||
void editElementRequired(const ElementsLocation &);
|
||||
/// Signal emitted when the user wants to edit and/or duplicate an existing title block template
|
||||
/// Signal emitted when users want to edit and/or duplicate an existing title block template
|
||||
void editTitleBlockTemplate(const QString &, bool);
|
||||
|
||||
public slots:
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
Element::Element(QGraphicsItem *parent, Diagram *scene) :
|
||||
QObject(),
|
||||
QGraphicsItem(parent, scene),
|
||||
internal_connections(false),
|
||||
internal_connections_(false),
|
||||
must_highlight_(false),
|
||||
first_move_(true)
|
||||
{
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
class Diagram;
|
||||
class ElementTextItem;
|
||||
/**
|
||||
Cette classe abstraite represente un element electrique.
|
||||
This is the base class for electrical elements.
|
||||
*/
|
||||
class Element : public QObject, public QGraphicsItem {
|
||||
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QGraphicsItem)
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
Element(QGraphicsItem * = 0, Diagram * = 0);
|
||||
virtual ~Element();
|
||||
@@ -38,16 +38,16 @@ class Element : public QObject, public QGraphicsItem {
|
||||
private:
|
||||
Element(const Element &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
public:
|
||||
enum { Type = UserType + 1000 };
|
||||
|
||||
protected:
|
||||
/**
|
||||
orientations de l'element :
|
||||
* autorisations
|
||||
* orientation en cours
|
||||
* orientation par defaut
|
||||
Hold orientations for the element :
|
||||
* allowed orientations
|
||||
* current orientation
|
||||
* default orientation
|
||||
@see OrientationSet
|
||||
*/
|
||||
OrientationSet ori;
|
||||
@@ -57,34 +57,35 @@ class Element : public QObject, public QGraphicsItem {
|
||||
QPoint hotspot_coord;
|
||||
QPixmap preview;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
/**
|
||||
permet de caster un QGraphicsItem en Element avec qgraphicsitem_cast
|
||||
@return le type de QGraphicsItem
|
||||
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into an
|
||||
Element.
|
||||
@return the QGraphicsItem type
|
||||
*/
|
||||
virtual int type() const { return Type; }
|
||||
|
||||
// methodes virtuelles pures a definir dans les classes enfants
|
||||
/// @return la liste des bornes de cet element
|
||||
// pure virtual methods to be defined in derived classes
|
||||
/// @return the list of terminals for this element
|
||||
virtual QList<Terminal *> terminals() const = 0;
|
||||
/// @return la liste des conducteurs relies a cet element
|
||||
/// @return the list of conductors attached to this element
|
||||
virtual QList<Conductor *> conductors() const = 0;
|
||||
/// @return la liste des champs de textes de cet element
|
||||
/// @return the list of text items attached to this element
|
||||
virtual QList<ElementTextItem *> texts() const = 0;
|
||||
/// @return le nombre de bornes actuel de cet element
|
||||
/// @return the current number of terminals of this element
|
||||
virtual int terminalsCount() const = 0;
|
||||
/// @return le nombre de bornes minimum de cet element
|
||||
/// @return the minimum number of terminals for this element
|
||||
virtual int minTerminalsCount() const = 0;
|
||||
/// @return le nombre de bornes maximum de cet element
|
||||
/// @return the maximum number of terminals for this element
|
||||
virtual int maxTerminalsCount() const = 0;
|
||||
/**
|
||||
Dessine l'element
|
||||
Draw this element
|
||||
*/
|
||||
virtual void paint(QPainter *, const QStyleOptionGraphicsItem *) = 0;
|
||||
/// @return L'ID du type de l'element
|
||||
/// @return This element type ID
|
||||
virtual QString typeId() const = 0;
|
||||
/// @return Le nom de l'element
|
||||
/// @return the human name for this element
|
||||
virtual QString name() const = 0;
|
||||
Diagram *diagram() const;
|
||||
|
||||
@@ -96,28 +97,28 @@ class Element : public QObject, public QGraphicsItem {
|
||||
QSize size() const;
|
||||
QPixmap pixmap();
|
||||
|
||||
// methodes relatives au point de saisie
|
||||
// methods related to the hotspot
|
||||
QPoint setHotspot(QPoint);
|
||||
QPoint hotspot() const;
|
||||
|
||||
// methodes relatives a la selection
|
||||
// selection-related methods
|
||||
void select();
|
||||
void deselect();
|
||||
|
||||
// methodes relatives a la position
|
||||
// position-related methods
|
||||
void setPos(const QPointF &);
|
||||
void setPos(qreal, qreal);
|
||||
|
||||
// methodes relatives aux connexions internes
|
||||
// methods related to internal connections
|
||||
bool internalConnections();
|
||||
void setInternalConnections(bool);
|
||||
|
||||
// methodes relatives aux fichiers XML
|
||||
// methods related to XML import/export
|
||||
static bool valideXml(QDomElement &);
|
||||
virtual bool fromXml(QDomElement &, QHash<int, Terminal *> &, bool = false);
|
||||
virtual QDomElement toXml(QDomDocument &, QHash<Terminal *, int> &) const;
|
||||
|
||||
// methodes d'acces aux possibilites d'orientation
|
||||
// orientation-related methods
|
||||
bool setOrientation(QET::Orientation o);
|
||||
const OrientationSet &orientation() const;
|
||||
|
||||
@@ -128,7 +129,7 @@ class Element : public QObject, public QGraphicsItem {
|
||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent *);
|
||||
|
||||
private:
|
||||
bool internal_connections;
|
||||
bool internal_connections_;
|
||||
bool must_highlight_;
|
||||
bool first_move_;
|
||||
void drawSelection(QPainter *, const QStyleOptionGraphicsItem *);
|
||||
@@ -137,27 +138,26 @@ class Element : public QObject, public QGraphicsItem {
|
||||
};
|
||||
|
||||
/**
|
||||
Permet de savoir si l'element accepte les connexions internes,
|
||||
c'est-a-dire que ses bornes peuvent etre reliees entre elles
|
||||
@return true si l'element accepte les connexions internes, false sinon
|
||||
Indicate whether this element allows internal connections, i.e. whether its
|
||||
terminals can be linked together using a conductor.
|
||||
@return true if internal connections are accepted, false otherwise
|
||||
*/
|
||||
inline bool Element::internalConnections() {
|
||||
return(internal_connections);
|
||||
return(internal_connections_);
|
||||
}
|
||||
|
||||
/**
|
||||
Permet de specifier si l'element accepte les connexions internes,
|
||||
c'est-a-dire que ses bornes peuvent etre reliees entre elles
|
||||
@param ic true pour que l'element accepte les connexions internes, false pour
|
||||
qu'il les interdise
|
||||
Specify whether this element allows internal connections, i.e. whether its
|
||||
terminals can be linked together using a conductor.
|
||||
@return true for internal connections to be accepted, false otherwise
|
||||
*/
|
||||
inline void Element::setInternalConnections(bool ic) {
|
||||
internal_connections = ic;
|
||||
internal_connections_ = ic;
|
||||
}
|
||||
|
||||
/**
|
||||
Permet de connaitre l'orientation actuelle de l'element
|
||||
@return L'orientation actuelle de l'element
|
||||
Indicate the current orientation of this element
|
||||
@return the current orientation of this element
|
||||
*/
|
||||
inline const OrientationSet & Element::orientation() const {
|
||||
return(ori);
|
||||
|
||||
@@ -22,39 +22,37 @@
|
||||
class ElementsCollection;
|
||||
class MoveElementsHandler;
|
||||
/**
|
||||
Cette classe abstraite represente une definition XML d'element,
|
||||
c'est-a-dire qu'elle definit l'interface a implementer pour acceder a la
|
||||
definition XML d'un element, que celle-ci proviennt d'un fichier *.elmt ou
|
||||
d'un fichier projet QET.
|
||||
This abstract class represents a way to access the XML definition of an
|
||||
element, be it from a .elmt file or from a QET project file.
|
||||
*/
|
||||
class ElementDefinition : public ElementsCollectionItem {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/**
|
||||
Constructeur
|
||||
Constructor
|
||||
*/
|
||||
ElementDefinition(ElementsCategory *category = 0, ElementsCollection *collection = 0) : ElementsCollectionItem(category), parent_category_(category), parent_collection_(collection) {};
|
||||
|
||||
/**
|
||||
Destructeur
|
||||
Destructor
|
||||
*/
|
||||
virtual ~ElementDefinition() {};
|
||||
|
||||
/**
|
||||
@return la definition XML de l'element
|
||||
@return the XML definition of a particular element
|
||||
*/
|
||||
virtual QDomElement xml() = 0;
|
||||
|
||||
/**
|
||||
Change la definition XML de l'element
|
||||
@param xml_element Nouvelle definition XML de l'element
|
||||
@return true si l'operation s'est bien passee, false sinon
|
||||
Specify the XML definition of a particular element
|
||||
@param xml_element New XML definition
|
||||
@return true if everything went well, false otherwise
|
||||
*/
|
||||
virtual bool setXml(const QDomElement &xml_element) = 0;
|
||||
|
||||
/**
|
||||
@return true si la definition n'est pas disponible
|
||||
@return true if the definition is not available
|
||||
*/
|
||||
virtual bool isNull() const = 0;
|
||||
|
||||
@@ -63,35 +61,36 @@ class ElementDefinition : public ElementsCollectionItem {
|
||||
virtual bool hasParentCategory();
|
||||
|
||||
/**
|
||||
@return true si l'element est rattache a une collection d'elements
|
||||
Un element appartenant a une collection a forcement un chemin virtuel.
|
||||
@return whether the element is attached to an elements collection
|
||||
An elemet which belongs to a collection always has a virtual path.
|
||||
*/
|
||||
virtual bool hasParentCollection();
|
||||
virtual bool isChildOf(ElementsCollectionItem *);
|
||||
|
||||
/**
|
||||
@return la collection d'element a laquelle appartient cet element
|
||||
@return the elements collections this element belongs to
|
||||
*/
|
||||
virtual ElementsCollection *parentCollection();
|
||||
|
||||
virtual QETProject *project();
|
||||
virtual void setProject(QETProject *);
|
||||
/**
|
||||
@return le protocole utilise par la collection a laquelle appartient cet element
|
||||
@return the "protocol" used by the parent collection
|
||||
*/
|
||||
virtual QString protocol();
|
||||
/**
|
||||
Ne fait rien.
|
||||
Has no effect.
|
||||
*/
|
||||
virtual void setProtocol(const QString &);
|
||||
|
||||
/**
|
||||
@return le chemin virtuel complet de cet element (protocole + chemin)
|
||||
@return the full virtual path for this element (i.e. "protocol" + path)
|
||||
*/
|
||||
virtual QString fullVirtualPath();
|
||||
|
||||
/**
|
||||
@return l'emplacement de cet element
|
||||
@return the location of this element, as an ElementsLocation object.
|
||||
@see ElementsLocation
|
||||
*/
|
||||
virtual ElementsLocation location();
|
||||
|
||||
@@ -107,10 +106,10 @@ class ElementDefinition : public ElementsCollectionItem {
|
||||
virtual ElementsCollectionItem *copy(ElementsCategory *, MoveElementsHandler *, bool = true);
|
||||
virtual ElementsCollectionItem *move(ElementsCategory *, MoveElementsHandler *);
|
||||
|
||||
virtual bool isCollection() const { return(false); } ///< @return toujours false
|
||||
virtual bool isRootCategory() const { return(false); } ///< @return toujours false
|
||||
virtual bool isCategory() const { return(false); } ///< @return toujours false
|
||||
virtual bool isElement() const { return(true ); } ///< @return toujours true
|
||||
virtual bool isCollection() const { return(false); } ///< @return always false
|
||||
virtual bool isRootCategory() const { return(false); } ///< @return always false
|
||||
virtual bool isCategory() const { return(false); } ///< @return always false
|
||||
virtual bool isElement() const { return(true ); } ///< @return always true
|
||||
virtual ElementsCollection *toCollection();
|
||||
virtual ElementsCategory *toCategory();
|
||||
virtual ElementsCategory *toPureCategory();
|
||||
@@ -121,7 +120,7 @@ class ElementDefinition : public ElementsCollectionItem {
|
||||
void copy(MoveElementsDescription *);
|
||||
void move(MoveElementsDescription *);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
ElementsCategory *parent_category_;
|
||||
ElementsCollection *parent_collection_;
|
||||
|
||||
@@ -21,24 +21,23 @@
|
||||
#include "elementslocation.h"
|
||||
#include <QtGui>
|
||||
/**
|
||||
Cette classe represente une couche d'abstraction pour supprimer
|
||||
un element de la collection d'elements.
|
||||
Elle demande notamment confirmation a l'utilisateur.
|
||||
This class provides an abstract way to delete an element from its parent
|
||||
collection. Especially, it requires a confirmation from users.
|
||||
*/
|
||||
class ElementDeleter : public QWidget {
|
||||
Q_OBJECT
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ElementDeleter(const ElementsLocation &, QWidget * = 0);
|
||||
virtual ~ElementDeleter();
|
||||
private:
|
||||
ElementDeleter(const ElementsCategory &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public slots:
|
||||
bool exec();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
ElementsCollectionItem *element;
|
||||
};
|
||||
|
||||
@@ -24,30 +24,30 @@ class QDialogButtonBox;
|
||||
class ElementsCategoriesList;
|
||||
class QFileNameEdit;
|
||||
/**
|
||||
Cette classe permet d'acceder a plusieurs types de dialogues lies a la
|
||||
selection d'element ou de categorie.
|
||||
This class provides several dialogs to select an element or a category
|
||||
(e.g. new or existing, for opening or for saving...).
|
||||
*/
|
||||
class ElementDialog : public QObject {
|
||||
Q_OBJECT
|
||||
// enumerations
|
||||
/**
|
||||
Cette enum represente les configurations possible pour ce dialogue
|
||||
This enum represents the available configurations for the required dialog
|
||||
*/
|
||||
enum {
|
||||
OpenElement = 0, ///< Le dialogue sera en mode ouverture
|
||||
SaveElement = 1, ///< Le dialogue sera en mode enregistrement
|
||||
OpenCategory = 2, ///< Le dialogue concernera une categorie
|
||||
SaveCategory = 3 ///< Le dialogue concernera un element
|
||||
OpenElement = 0, ///< The dialog should open an element
|
||||
SaveElement = 1, ///< The dialog should select an element for saving
|
||||
OpenCategory = 2, ///< The dialog should open a category
|
||||
SaveCategory = 3 ///< The dialog should select a category for saving
|
||||
};
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ElementDialog(uint = ElementDialog::OpenElement, QWidget * = 0, QObject * = 0);
|
||||
virtual ~ElementDialog();
|
||||
private:
|
||||
ElementDialog(const ElementDialog &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
int exec();
|
||||
ElementsLocation location() const;
|
||||
@@ -69,7 +69,7 @@ class ElementDialog : public QObject {
|
||||
private:
|
||||
void makeInterface();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
uint mode_;
|
||||
ElementsLocation location_;
|
||||
|
||||
@@ -25,13 +25,12 @@ class ElementsCollection;
|
||||
class ElementsCategory;
|
||||
class ElementDefinition;
|
||||
/**
|
||||
Cette classe fournit une liste graphique des categories d'elements de
|
||||
l'utilisateur.
|
||||
This class provides a visual listing of available elements categories.
|
||||
*/
|
||||
class ElementsCategoriesList : public GenericPanel {
|
||||
Q_OBJECT
|
||||
|
||||
// Constructeurs, destructeur
|
||||
// Constructors, destructor
|
||||
public:
|
||||
ElementsCategoriesList(bool = false, uint = QET::All, QWidget * = 0);
|
||||
virtual ~ElementsCategoriesList();
|
||||
@@ -39,7 +38,7 @@ class ElementsCategoriesList : public GenericPanel {
|
||||
private:
|
||||
ElementsCategoriesList(const ElementsCategoriesList &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
ElementsLocation selectedLocation() const;
|
||||
bool selectLocation(const ElementsLocation &);
|
||||
@@ -57,7 +56,7 @@ class ElementsCategoriesList : public GenericPanel {
|
||||
signals:
|
||||
void locationChanged(const ElementsLocation &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
bool display_elements_;
|
||||
int selectables_;
|
||||
|
||||
@@ -20,14 +20,13 @@
|
||||
#include <QtGui>
|
||||
class ElementsCategoriesList;
|
||||
/**
|
||||
Cette classe represente un widget integrant la liste des categories
|
||||
de l'utilisteur surplombee de boutons permettant d'ajouter, de modifier
|
||||
ou de supprimer des categories
|
||||
This class provides a widget listing available elements categories along
|
||||
with buttons to add, change or create categories.
|
||||
*/
|
||||
class ElementsCategoriesWidget : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
// Constructeurs, destructeur
|
||||
// Constructors, destructor
|
||||
public:
|
||||
ElementsCategoriesWidget(QWidget * = 0);
|
||||
virtual ~ElementsCategoriesWidget();
|
||||
@@ -35,7 +34,7 @@ class ElementsCategoriesWidget : public QWidget {
|
||||
private:
|
||||
ElementsCategoriesWidget(const ElementsCategoriesWidget &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
ElementsCategoriesList *elementscategorieslist;
|
||||
QToolBar *toolbar;
|
||||
@@ -44,7 +43,7 @@ class ElementsCategoriesWidget : public QWidget {
|
||||
QAction *action_open;
|
||||
QAction *action_delete;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
ElementsCategoriesList &elementsCategoriesList() const;
|
||||
|
||||
@@ -56,7 +55,7 @@ class ElementsCategoriesWidget : public QWidget {
|
||||
};
|
||||
|
||||
/**
|
||||
@return La liste des categories d'elements du widget
|
||||
@return The ElementsCategoriesList embedded within this widget.
|
||||
*/
|
||||
inline ElementsCategoriesList &ElementsCategoriesWidget::elementsCategoriesList() const {
|
||||
return(*elementscategorieslist);
|
||||
|
||||
@@ -25,12 +25,13 @@ class ElementsCollection;
|
||||
class MoveElementsHandler;
|
||||
class MoveElementsDescription;
|
||||
/**
|
||||
Cette classe abstraite represente une categorie d'elements.
|
||||
This abstract class represents an elements category, i.e. a kind of
|
||||
subfolder within elements collections.
|
||||
*/
|
||||
class ElementsCategory : public ElementsCollectionItem {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ElementsCategory(ElementsCategory * = 0, ElementsCollection * = 0);
|
||||
virtual ~ElementsCategory();
|
||||
@@ -38,7 +39,7 @@ class ElementsCategory : public ElementsCollectionItem {
|
||||
private:
|
||||
ElementsCategory(const ElementsCategory &);
|
||||
|
||||
// Implementations de methodes virtuelles pures des classes parentes
|
||||
// Implementations of pure virtual methods from parent classes
|
||||
public:
|
||||
virtual QETProject *project();
|
||||
virtual void setProject(QETProject *);
|
||||
@@ -67,7 +68,7 @@ class ElementsCategory : public ElementsCollectionItem {
|
||||
virtual bool isEmpty();
|
||||
virtual int count();
|
||||
|
||||
// Methodes propres a la classe ElementsCategory
|
||||
// Methods specific to the ElementsCategory class
|
||||
public:
|
||||
virtual QString name() const;
|
||||
virtual NamesList categoryNames() const;
|
||||
@@ -77,13 +78,13 @@ class ElementsCategory : public ElementsCollectionItem {
|
||||
void copy(MoveElementsDescription *);
|
||||
void move(MoveElementsDescription *);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
protected:
|
||||
/// Collection parente
|
||||
/// parent collection
|
||||
ElementsCollection *parent_collection_;
|
||||
/// Categorie parente
|
||||
/// parent category
|
||||
ElementsCategory *parent_category_;
|
||||
/// Liste des noms de la categorie
|
||||
/// names list for this category
|
||||
NamesList category_names;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -21,26 +21,26 @@
|
||||
#include "elementslocation.h"
|
||||
#include <QtGui>
|
||||
/**
|
||||
Cette classe represente une couche d'abstraction pour supprimer
|
||||
une categorie d'elements et les elements qu'elle contient.
|
||||
Si la categorie racine d'une collection est fournie, elle sera
|
||||
videe apres un avertissement.
|
||||
Cette classe demande toujours confirmation a l'utilisateur par deux fois.
|
||||
This class provide an abstract way to delete an elements category along with
|
||||
its child elements and subcategories. It always requires a double confirmation
|
||||
from users before actually proceeding to the deletion.
|
||||
If the deletion of a whole elements collection is required, this class will
|
||||
require an extra confirmation.
|
||||
*/
|
||||
class ElementsCategoryDeleter : public QWidget {
|
||||
Q_OBJECT
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ElementsCategoryDeleter(const ElementsLocation &, QWidget * = 0);
|
||||
virtual ~ElementsCategoryDeleter();
|
||||
private:
|
||||
ElementsCategoryDeleter(const ElementsCategory &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public slots:
|
||||
bool exec();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
ElementsCollectionItem *category;
|
||||
};
|
||||
|
||||
@@ -23,13 +23,13 @@ class ElementsCategory;
|
||||
class NamesListWidget;
|
||||
class QFileNameEdit;
|
||||
/**
|
||||
Cette classe permet d'editer une categorie existante ou de creer une
|
||||
categorie.
|
||||
This class provides a dialog to edit an existing category or create a new
|
||||
one.
|
||||
*/
|
||||
class ElementsCategoryEditor : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ElementsCategoryEditor(const ElementsLocation &, bool = true, QWidget * = 0);
|
||||
virtual ~ElementsCategoryEditor();
|
||||
@@ -37,7 +37,7 @@ class ElementsCategoryEditor : public QDialog {
|
||||
private:
|
||||
ElementsCategoryEditor(const ElementsCategoryEditor &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
ElementsCategory *category;
|
||||
QDialogButtonBox *buttons;
|
||||
@@ -46,7 +46,7 @@ class ElementsCategoryEditor : public QDialog {
|
||||
QFileNameEdit *internal_name_;
|
||||
bool mode_edit;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
private:
|
||||
void buildDialog();
|
||||
|
||||
|
||||
@@ -26,21 +26,21 @@ class ElementsCollectionCache;
|
||||
class ElementDefinition;
|
||||
class MoveElementsHandler;
|
||||
/**
|
||||
Cette classe abstraite represente une collection d'elements. Il peut s'agir
|
||||
de la collection QET, de la collection utilisateur ou encore de la
|
||||
collection fournie par un fichier projet.
|
||||
This abstract class represents an elements collection. For instance, it may
|
||||
represent the collection provided along with QElectroTech, users custom
|
||||
collections or collections embedded within QET project files.
|
||||
*/
|
||||
class ElementsCollection : public ElementsCollectionItem {
|
||||
Q_OBJECT
|
||||
public:
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
ElementsCollection(ElementsCollectionItem * = 0);
|
||||
virtual ~ElementsCollection();
|
||||
|
||||
private:
|
||||
ElementsCollection(const ElementsCollection &);
|
||||
|
||||
// Implementations de methodes virtuelles pures des classes parentes
|
||||
// Implementations of pure virtual methodes from parent classes
|
||||
public:
|
||||
virtual QString title() const;
|
||||
virtual void setTitle(const QString &);
|
||||
@@ -81,10 +81,10 @@ class ElementsCollection : public ElementsCollectionItem {
|
||||
virtual bool isEmpty();
|
||||
virtual int count();
|
||||
|
||||
// Methodes propres a la classe ElementsCollection
|
||||
// Methods specific to the ElementsCollection class
|
||||
public:
|
||||
/**
|
||||
@return la categorie racine de cette collection
|
||||
@return the root category of this collection
|
||||
*/
|
||||
virtual ElementsCategory *rootCategory() = 0;
|
||||
virtual ElementsCollectionItem *item(const QString &, bool = true);
|
||||
@@ -95,15 +95,15 @@ class ElementsCollection : public ElementsCollectionItem {
|
||||
signals:
|
||||
void elementsCollectionChanged(ElementsCollection *);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
protected:
|
||||
/// Title to be used when referring to this collection
|
||||
QString title_;
|
||||
/// Icon to be displayed when representing this collection
|
||||
QIcon icon_;
|
||||
/// Protocole utilise pour acceder a cette collection
|
||||
/// "Protocol" used to access this collection
|
||||
QString protocol_;
|
||||
/// Projet auquel appartient cette collection
|
||||
/// Project this collection belongs to, if any
|
||||
QETProject *project_;
|
||||
/// Optional cache used to improve performance
|
||||
ElementsCollectionCache *cache_;
|
||||
|
||||
@@ -24,13 +24,13 @@ class ElementsCategory;
|
||||
class ElementDefinition;
|
||||
class MoveElementsHandler;
|
||||
/**
|
||||
Cette interface est la classe mere pour toutes les classes
|
||||
modelisant une partie d'une collection d'elements.
|
||||
This interface is the base class for all classes representing a part of an
|
||||
elements collection.
|
||||
*/
|
||||
class ElementsCollectionItem : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ElementsCollectionItem(ElementsCollectionItem *parent = 0) : QObject(parent) {};
|
||||
virtual ~ElementsCollectionItem() {};
|
||||
@@ -38,172 +38,170 @@ class ElementsCollectionItem : public QObject {
|
||||
private:
|
||||
ElementsCollectionItem(const ElementsCollectionItem &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
/// @return true si l'item est une collection d'elements
|
||||
/// @return whether the item is an elements collection
|
||||
virtual bool isCollection() const = 0;
|
||||
/// @return true si l'item est une categorie d'elements
|
||||
/// @return whether the item is an elements category
|
||||
virtual bool isCategory() const = 0;
|
||||
/// @return true si l'item est la categorie racine de sa collection
|
||||
/// @return whether the item is the root category of a collection
|
||||
virtual bool isRootCategory() const = 0;
|
||||
/// @return true si l'item est un element
|
||||
/// @return whether the item is an element
|
||||
virtual bool isElement() const = 0;
|
||||
|
||||
/**
|
||||
@return un pointeur sur cet item en tant que collection, ou 0 si cet item n'est pas une collection
|
||||
@return a pointer to this item as a collection object, or 0 if this item is not a collection.
|
||||
*/
|
||||
virtual ElementsCollection *toCollection() = 0;
|
||||
/**
|
||||
@return un pointeur sur cet item en tant que categorie.
|
||||
Si cet objet est une collection, un pointeur valide vers sa categorie racine sera renvoye.
|
||||
Si cet objet est une categorie, un pointeur valide sera renvoye.
|
||||
Si cet objet est un element, un pointeur valide vers sa categorie parente sera renvoye.
|
||||
@return a pointer to this item as a category object.
|
||||
If this item is a collection, return a valid pointer to its root category.
|
||||
If this item is a category, return a valid pointer.
|
||||
If this item is an element, return a valid pointer to its parent category.
|
||||
*/
|
||||
virtual ElementsCategory *toCategory() = 0;
|
||||
/**
|
||||
@return un pointeur sur cet item en tant que categorie si et seulement
|
||||
si cet objet est une categorie non racine.
|
||||
Si cet objet est une collection, 0 sera retourne
|
||||
Si cet objet est une categorie, un pointeur valide sera renvoye.
|
||||
Si cet objet est un element, 0 sera retourne.
|
||||
@return a pointer to this item as a category if and only if this object is a non-root elements category.
|
||||
If this item is a collection, return 0.
|
||||
If this item is a category, return a valid pointer.
|
||||
If this item is an element, return 0.
|
||||
*/
|
||||
virtual ElementsCategory *toPureCategory() = 0;
|
||||
/**
|
||||
@return un pointeur sur cet item en tant qu'element
|
||||
@return a pointer to this item as an element object.
|
||||
*/
|
||||
virtual ElementDefinition *toElement() = 0;
|
||||
|
||||
/**
|
||||
Copie l'item vers la destination indiquee en parametre ; le booleen
|
||||
doit etre a true pour une copie recursive, a false sinon.
|
||||
Copy this item to the specified target, using a specific strategy to handle
|
||||
corner cases (errors, conflicts, confirmations, ...), recursively or not.
|
||||
*/
|
||||
virtual ElementsCollectionItem *copy(ElementsCategory *, MoveElementsHandler *, bool = true) = 0;
|
||||
|
||||
/**
|
||||
Deplace l'item vers la destination indiquee en parametre.
|
||||
Move this item to the specified destination, using a specific strategy to
|
||||
handle corner cases (errors, conflicts, confirmations, ...).
|
||||
*/
|
||||
virtual ElementsCollectionItem *move(ElementsCategory *, MoveElementsHandler *) = 0;
|
||||
|
||||
/// Recharge l'item
|
||||
/// Reload this item
|
||||
virtual void reload() = 0;
|
||||
/// @return true si l'item existe
|
||||
/// @return whether the item really exists
|
||||
virtual bool exists() = 0;
|
||||
/// @return true si l'item est lisible
|
||||
/// @return whether the item is readable
|
||||
virtual bool isReadable() = 0;
|
||||
/// @return true si l'item est accessible en ecriture
|
||||
/// @return whether the item is writable
|
||||
virtual bool isWritable() = 0;
|
||||
/**
|
||||
supprime le contenu de l'item (categories et elements) sans supprimer
|
||||
l'item lui-meme
|
||||
@return true si l'operation a reussi, false sinon
|
||||
Delete the item content (elements and subcategories) without deleting the item itself.
|
||||
@return true if the operation succeeded, false otherwise
|
||||
*/
|
||||
virtual bool removeContent() = 0;
|
||||
/**
|
||||
supprime le contenu de l'item (categories et elements) puis l'item
|
||||
lui-meme
|
||||
@return true si l'operation a reussi, false sinon
|
||||
Delete the item content (elements and categories) before deleting the item itself.
|
||||
@return true if the operation succeeded, false otherwise
|
||||
*/
|
||||
virtual bool remove() = 0;
|
||||
/**
|
||||
Enregistre l'item
|
||||
@return true si l'operation a reussi, false sinon
|
||||
Save the item.
|
||||
@return true if the operation succeeded, false otherwise
|
||||
*/
|
||||
virtual bool write() = 0;
|
||||
/**
|
||||
@return le projet auquel appartient cet item
|
||||
@return the project this item belongs to
|
||||
*/
|
||||
virtual QETProject *project() = 0;
|
||||
/**
|
||||
Definit le projet auquel appartient cet item
|
||||
Set the project this item belongs to.
|
||||
*/
|
||||
virtual void setProject(QETProject *) = 0;
|
||||
/**
|
||||
@return le protocole utilise pour acceder a la collection de cet item
|
||||
@return the protocol used to access the collection this item belongs to.
|
||||
*/
|
||||
virtual QString protocol() = 0;
|
||||
/**
|
||||
Definit le protocole a utiliser pour acceder a la collection de cet item
|
||||
Set the protocol used to access the collection this item belongs to.
|
||||
*/
|
||||
virtual void setProtocol(const QString &) = 0;
|
||||
/**
|
||||
@return la categorie parente de cet item, ou 0 si celui-ci n'en possede pas
|
||||
@return the parent category of this item, or 0 if it does not have any
|
||||
*/
|
||||
virtual ElementsCategory *parentCategory() = 0;
|
||||
/**
|
||||
@return la liste des categories parentes de cet item
|
||||
@return the list of parent categories of this item
|
||||
*/
|
||||
virtual QList<ElementsCategory *> parentCategories() = 0;
|
||||
/**
|
||||
@return true si cet item possede une categorie parente, false sinon
|
||||
@return whether this item has a parent category
|
||||
*/
|
||||
virtual bool hasParentCategory() = 0;
|
||||
/**
|
||||
@return la collection parente de cet item, ou 0 si celui-ci n'en possede pas
|
||||
@return the parent collection of this item, or 0 if it does not have any
|
||||
*/
|
||||
virtual ElementsCollection *parentCollection() = 0;
|
||||
/**
|
||||
@return true si cet item possede une collection parente, false sinon
|
||||
@return whether this item belongs to an elements collection
|
||||
*/
|
||||
virtual bool hasParentCollection() = 0;
|
||||
/**
|
||||
@param other_item Autre item
|
||||
@return true si other_item est parent (direct ou indirect) de other_item, false sinon
|
||||
@param other_item other item
|
||||
@return whether \a other_item is a direct or indirect parent of this item.
|
||||
*/
|
||||
virtual bool isChildOf(ElementsCollectionItem *other_item) = 0;
|
||||
/**
|
||||
@return le nom de cet item dans l'arborescence
|
||||
@return the name of this item within the elements tree.
|
||||
*/
|
||||
virtual QString pathName() const = 0;
|
||||
/**
|
||||
@return le chemin virtuel vers cet item dans l'arborescence, sans le protocole
|
||||
@return the virtual path to this item within the elements tree, protocol excluded.
|
||||
*/
|
||||
virtual QString virtualPath() = 0;
|
||||
/**
|
||||
@return le chemin virtuel vers cet item dans l'arborescence, avec le protocole
|
||||
@return the virtual path to this item within the elements tree, protocol included.
|
||||
*/
|
||||
virtual QString fullVirtualPath() = 0;
|
||||
/**
|
||||
@return l'emplacement de cet item
|
||||
@return the location of this item
|
||||
*/
|
||||
virtual ElementsLocation location() = 0;
|
||||
/**
|
||||
@return true si cet item est represente quelque part sur le systeme de fichiers
|
||||
@return whether this item is stored somewhere on the filesystem.
|
||||
*/
|
||||
virtual bool hasFilePath() = 0;
|
||||
/**
|
||||
@return le chemin de cet item sur le systeme de fichiers
|
||||
@return the path of this item within the filesystem
|
||||
*/
|
||||
virtual QString filePath() = 0;
|
||||
/**
|
||||
Definit le chemin de cet item sur le systeme de fichiers
|
||||
Set the path to this item within the filesystem.
|
||||
*/
|
||||
virtual void setFilePath(const QString &) = 0;
|
||||
/**
|
||||
@return la liste des categories d'elements contenues dans cet item
|
||||
@return the list of direct child elements category within this item
|
||||
*/
|
||||
virtual QList<ElementsCategory *> categories() = 0;
|
||||
/**
|
||||
@return une categorie a partir de son chemin virtuel
|
||||
@return the specified category, provided its virtual path
|
||||
*/
|
||||
virtual ElementsCategory *category(const QString &) = 0;
|
||||
/**
|
||||
@return une nouvelle categorie creee a partir d'un chemin virtuel
|
||||
@return a new category, created from the spcified virtual path
|
||||
*/
|
||||
virtual ElementsCategory *createCategory(const QString &) = 0;
|
||||
/**
|
||||
@return la liste des elements contenus dans cet item
|
||||
@return the list of child elements within this item
|
||||
*/
|
||||
virtual QList<ElementDefinition *> elements() = 0;
|
||||
/**
|
||||
@return un element a partir de son chemin virtuel
|
||||
@return an element, provided its virtual path
|
||||
*/
|
||||
virtual ElementDefinition *element(const QString &) = 0;
|
||||
/**
|
||||
@return un nouvel element cree a partir d'un chemin virtuel
|
||||
@return a new element, created from the specified virtual path
|
||||
*/
|
||||
virtual ElementDefinition *createElement(const QString &) = 0;
|
||||
/**
|
||||
@return true if the item is empty, false otherwise
|
||||
@return whether the item is empty
|
||||
*/
|
||||
virtual bool isEmpty() = 0;
|
||||
/**
|
||||
|
||||
@@ -26,7 +26,7 @@ class QETProject;
|
||||
encapsule un chemin virtuel.
|
||||
*/
|
||||
class ElementsLocation {
|
||||
// constructeurs, destructeur et operateur d'affectation
|
||||
// constructors, destructor et operateur d'affectation
|
||||
public:
|
||||
ElementsLocation();
|
||||
explicit ElementsLocation(const QString &, QETProject * = 0);
|
||||
@@ -36,7 +36,7 @@ class ElementsLocation {
|
||||
bool operator==(const ElementsLocation &) const;
|
||||
bool operator!=(const ElementsLocation &) const;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
QString baseName() const;
|
||||
QString path() const;
|
||||
@@ -50,7 +50,7 @@ class ElementsLocation {
|
||||
void fromString(const QString &);
|
||||
static ElementsLocation locationFromString(const QString &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QString path_;
|
||||
QETProject *project_;
|
||||
|
||||
@@ -22,25 +22,25 @@
|
||||
class ConductorTextItem;
|
||||
class Diagram;
|
||||
/**
|
||||
Cette classe permet de gerer le deplacement des differents items composant
|
||||
un schema electrique sur ce schema.
|
||||
This class manages the interactive movement of different items (elements,
|
||||
conductors, text items) on a particular diagram.
|
||||
*/
|
||||
class ElementsMover {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ElementsMover();
|
||||
virtual ~ElementsMover();
|
||||
private:
|
||||
ElementsMover(const ElementsMover &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
bool isReady() const;
|
||||
int beginMovement(Diagram *, QGraphicsItem * = 0);
|
||||
void continueMovement(const QPointF &);
|
||||
void endMovement();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
bool movement_running_;
|
||||
QPointF current_movement_;
|
||||
|
||||
@@ -31,14 +31,15 @@ class ElementsCollectionCache;
|
||||
class TitleBlockTemplatesFilesCollection;
|
||||
|
||||
/**
|
||||
Cette classe represente le panel d'appareils (en tant qu'element
|
||||
graphique) dans lequel l'utilisateur choisit les composants de
|
||||
son choix et les depose sur le schema par drag'n drop.
|
||||
This class provides a tree widget listing known filesystem-based elements
|
||||
collections and opened project files along with their content (diagrams,
|
||||
embedded collections, ...). It enables users to perform various actions on
|
||||
the displayed content
|
||||
*/
|
||||
class ElementsPanel : public GenericPanel {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ElementsPanel(QWidget * = 0);
|
||||
virtual ~ElementsPanel();
|
||||
@@ -48,11 +49,11 @@ class ElementsPanel : public GenericPanel {
|
||||
|
||||
// methods
|
||||
public:
|
||||
// methodes pour determiner ce que represente un item donne
|
||||
// methods used to determine what is represented by a particular visual item
|
||||
bool itemIsWritable(QTreeWidgetItem *) const;
|
||||
bool selectedItemIsWritable() const;
|
||||
|
||||
// methodes pour obtenir ce que represente un item donne
|
||||
// methods used to get what is represented by a particular visual item
|
||||
ElementsCollectionItem *collectionItemForItem(QTreeWidgetItem *) const;
|
||||
ElementsCollectionItem *selectedItem() const;
|
||||
ElementsCategory *categoryForItem(QTreeWidgetItem *);
|
||||
|
||||
@@ -20,13 +20,14 @@
|
||||
#include <QtGui>
|
||||
#include "elementspanel.h"
|
||||
/**
|
||||
Cette classe est un widget qui contient le panel d'elements surplombe d'une
|
||||
barre d'outils avec differentes actions pour gerer les elements.
|
||||
This class embeds an elements panel under a toolbar providing various actions
|
||||
to manage elements.
|
||||
@see ElementsPanel
|
||||
*/
|
||||
class ElementsPanelWidget : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ElementsPanelWidget(QWidget * = 0);
|
||||
virtual ~ElementsPanelWidget();
|
||||
@@ -34,7 +35,7 @@ class ElementsPanelWidget : public QWidget {
|
||||
private:
|
||||
ElementsPanelWidget(const ElementsPanelWidget &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
ElementsPanel *elements_panel;
|
||||
QToolBar *toolbar, *filter_toolbar;
|
||||
@@ -51,7 +52,7 @@ class ElementsPanelWidget : public QWidget {
|
||||
ElementsCollectionItem *dnd_item_src_, *dnd_item_dst_;
|
||||
QProgressBar *progress_bar_;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
inline ElementsPanel &elementsPanel() const;
|
||||
|
||||
@@ -110,7 +111,7 @@ class ElementsPanelWidget : public QWidget {
|
||||
};
|
||||
|
||||
/**
|
||||
@return Le panel d'elements imbrique dans ce widget
|
||||
@return The elements panel embedded within this widget.
|
||||
*/
|
||||
inline ElementsPanel &ElementsPanelWidget::elementsPanel() const {
|
||||
return(*elements_panel);
|
||||
|
||||
@@ -22,22 +22,19 @@
|
||||
class Diagram;
|
||||
class Element;
|
||||
/**
|
||||
Cette classe represente un champ de texte rattache a un element.
|
||||
Il est editable et deplacable (relativement a son element parent) par
|
||||
l'utilisateur.
|
||||
Il peut egalement etre oriente a un angle quelconque.
|
||||
Il est possible pour ce champ de texte de rester dans le sens de la lecture
|
||||
malgre les rotations de son element parent.
|
||||
This class represents a text item attached to an element. Users can change its
|
||||
value, adjust its position (defined relatively to its parent element), and
|
||||
direct it to any angle.
|
||||
*/
|
||||
class ElementTextItem : public DiagramTextItem {
|
||||
Q_OBJECT
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ElementTextItem(Element * = 0, Diagram * = 0);
|
||||
ElementTextItem(const QString &, Element * = 0, Diagram * = 0);
|
||||
virtual ~ElementTextItem();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
public:
|
||||
enum { Type = UserType + 1003 };
|
||||
|
||||
@@ -48,11 +45,11 @@ class ElementTextItem : public DiagramTextItem {
|
||||
qreal original_rotation_angle_;
|
||||
bool first_move_;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual int type() const { return Type; }
|
||||
Element *parentElement() const;
|
||||
/// @return le rectangle delimitant le champ de texte
|
||||
/// @return the rectangle defining the bounds of this text item
|
||||
virtual QRectF boundingRect() const { return(QGraphicsTextItem::boundingRect().adjusted(0.0, -1.1, 0.0, 0.0)); }
|
||||
bool followParentRotations() const;
|
||||
void setFollowParentRotations(bool);
|
||||
@@ -78,18 +75,19 @@ class ElementTextItem : public DiagramTextItem {
|
||||
};
|
||||
|
||||
/**
|
||||
Permet de savoir si le champ de texte suit les rotations de son parent.
|
||||
@return true si le champ de texte suit les rotations de son parent, false
|
||||
sinon
|
||||
Element text items can optionally be applied a counter-rotation when their
|
||||
parent element is rotated, thus preserving their readability.
|
||||
@return whether this text item follows the rotations of its parent element.
|
||||
*/
|
||||
inline bool ElementTextItem::followParentRotations() const {
|
||||
return(follow_parent_rotations);
|
||||
}
|
||||
|
||||
/**
|
||||
Permet de specifier si le champ de texte suit les rotations de son parent.
|
||||
@param frp true si le champ de texte doit suivre les rotations de son
|
||||
parent, false pour qu'ils ne les suivent pas
|
||||
Element text items can optionally be applied a counter-rotation when their
|
||||
parent element is rotated, thus preserving their readability.
|
||||
@param frp whether this text item should follow the rotations of its parent
|
||||
element.
|
||||
*/
|
||||
inline void ElementTextItem::setFollowParentRotations(bool frp) {
|
||||
follow_parent_rotations = frp;
|
||||
|
||||
@@ -22,25 +22,25 @@
|
||||
class ElementTextItem;
|
||||
class Diagram;
|
||||
/**
|
||||
Cette classe permet de gerer le deplacement des ElementTextItems d'un schema
|
||||
electrique.
|
||||
This class manages the interactive movement of element text items on a
|
||||
particular diagram.
|
||||
*/
|
||||
class ElementTextsMover {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ElementTextsMover();
|
||||
virtual ~ElementTextsMover();
|
||||
private:
|
||||
ElementTextsMover(const ElementTextsMover &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
bool isReady() const;
|
||||
int beginMovement(Diagram *, QGraphicsItem * = 0);
|
||||
void continueMovement(const QPointF &);
|
||||
void endMovement();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
bool movement_running_;
|
||||
QPointF current_movement_;
|
||||
|
||||
@@ -23,13 +23,14 @@
|
||||
class QSvgGenerator;
|
||||
class ExportPropertiesWidget;
|
||||
/**
|
||||
Cette classe represente le dialogue permettant d'exporter un schema
|
||||
sous forme d'image selon les desirs de l'utilisateur
|
||||
This class provides a dialog enabling users to export 1 to n diagrams from
|
||||
a project as image files, with features like preview, copy to clipboard,
|
||||
resize, etc.
|
||||
*/
|
||||
class ExportDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ExportDialog(QETProject *, QWidget * = 0);
|
||||
virtual ~ExportDialog();
|
||||
@@ -37,11 +38,10 @@ class ExportDialog : public QDialog {
|
||||
private:
|
||||
ExportDialog(const ExportDialog &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
int diagramsToExportCount() const;
|
||||
|
||||
// classes privees
|
||||
private:
|
||||
class ExportDiagramLine {
|
||||
public:
|
||||
@@ -61,10 +61,10 @@ class ExportDialog : public QDialog {
|
||||
QPushButton *clipboard;
|
||||
};
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QHash<int, ExportDialog::ExportDiagramLine *> diagram_lines_;
|
||||
// elements graphiques
|
||||
// visual items
|
||||
QGridLayout *diagrams_list_layout_;
|
||||
ExportPropertiesWidget *epw;
|
||||
QDialogButtonBox *buttons;
|
||||
@@ -76,10 +76,10 @@ class ExportDialog : public QDialog {
|
||||
QSignalMapper *reset_mapper_;
|
||||
QSignalMapper *clipboard_mapper_;
|
||||
|
||||
// elements relatifs au traitement effectue par le dialogue
|
||||
// project whose diagrams are to be exported
|
||||
QETProject *project_;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
private:
|
||||
QWidget *initDiagramsListPart();
|
||||
void saveReloadDiagramParameters(Diagram *, bool = true);
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
#include "qet.h"
|
||||
|
||||
/**
|
||||
Cette classe represente les differentes options utilisees pour exporter un
|
||||
schema sous forme d'image, ou encore pour l'imprimer.
|
||||
This class is a container for various options used when printing or
|
||||
exporting a diagram as an image file.
|
||||
*/
|
||||
class ExportProperties {
|
||||
// constructeur, destructeur
|
||||
@@ -30,20 +30,20 @@ class ExportProperties {
|
||||
ExportProperties();
|
||||
virtual ~ExportProperties();
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
void toSettings (QSettings &, const QString & = QString()) const;
|
||||
void fromSettings(QSettings &, const QString & = QString());
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
public:
|
||||
QDir destination_directory; ///< Quel est le repertoire de destination du ou des fichiers generes ?
|
||||
QString format; ///< Quel format d'image faut-il utiliser ?
|
||||
bool draw_grid; ///< Faut-il dessiner la grille ?
|
||||
bool draw_border; ///< Faut-il dessiner le cadre ?
|
||||
bool draw_titleblock; ///< Faut-il dessiner le cartouche ?
|
||||
bool draw_terminals; ///< Faut-il dessiner les bornes ?
|
||||
bool draw_colored_conductors; ///< Faut-il respecter les couleurs des conducteurs ?
|
||||
QET::DiagramArea exported_area; ///< Zone du schema a exporter
|
||||
QDir destination_directory; ///< Target directory for generated files
|
||||
QString format; ///< Image format of generated files
|
||||
bool draw_grid; ///< Whether to render the diagram grid
|
||||
bool draw_border; ///< Whether to render the border (along with rows/columns headers)
|
||||
bool draw_titleblock; ///< Whether to render the title block
|
||||
bool draw_terminals; ///< Whether to render terminals
|
||||
bool draw_colored_conductors; ///< Whether to render conductors colors
|
||||
QET::DiagramArea exported_area; ///< Area of diagrams to be rendered
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -21,12 +21,12 @@
|
||||
#include "exportproperties.h"
|
||||
|
||||
/**
|
||||
Ce widget permet d'editer les differentes options utilisees
|
||||
pour exporter un projet.
|
||||
This widget enables users to edit the various options available when
|
||||
exporting a project.
|
||||
*/
|
||||
class ExportPropertiesWidget : public QWidget {
|
||||
Q_OBJECT
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ExportPropertiesWidget(QWidget * = 0);
|
||||
ExportPropertiesWidget(const ExportProperties &, QWidget * = 0);
|
||||
@@ -34,7 +34,7 @@ class ExportPropertiesWidget : public QWidget {
|
||||
private:
|
||||
ExportPropertiesWidget(const ExportPropertiesWidget &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
void setExportProperties(const ExportProperties &);
|
||||
ExportProperties exportProperties() const;
|
||||
@@ -48,11 +48,10 @@ class ExportPropertiesWidget : public QWidget {
|
||||
void exportedAreaChanged();
|
||||
void optionChanged();
|
||||
|
||||
// methodes privees
|
||||
private:
|
||||
void build();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QLabel *dirpath_label;
|
||||
QLineEdit *dirpath;
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
class FileElementsCategory;
|
||||
class FileElementsCollection;
|
||||
/**
|
||||
Cette classe represente la definition d'un element stockee dans un fichier.
|
||||
|
||||
This class represents an element definition stored into a file.
|
||||
*/
|
||||
class FileElementDefinition : public ElementDefinition {
|
||||
public:
|
||||
@@ -33,7 +32,7 @@ class FileElementDefinition : public ElementDefinition {
|
||||
private:
|
||||
FileElementDefinition(const FileElementDefinition &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual QDomElement xml();
|
||||
virtual bool setXml(const QDomElement &);
|
||||
@@ -51,7 +50,7 @@ class FileElementDefinition : public ElementDefinition {
|
||||
virtual void setFilePath(const QString &);
|
||||
virtual QDateTime modificationTime() const;
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
bool is_null;
|
||||
QString file_path;
|
||||
|
||||
@@ -22,13 +22,12 @@
|
||||
class FileElementsCollection;
|
||||
class FileElementDefinition;
|
||||
/**
|
||||
Cette classe represente une categorie d'elements accessible via un systeme
|
||||
de fichiers.
|
||||
This class represents an elements category stored on a filesystem.
|
||||
*/
|
||||
class FileElementsCategory : public ElementsCategory {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
FileElementsCategory(const QString & = QString(), FileElementsCategory * = 0, FileElementsCollection * = 0);
|
||||
virtual ~FileElementsCategory();
|
||||
@@ -36,7 +35,7 @@ class FileElementsCategory : public ElementsCategory {
|
||||
private:
|
||||
FileElementsCategory(const FileElementsCategory &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual QString pathName() const;
|
||||
virtual QString virtualPath();
|
||||
@@ -67,17 +66,17 @@ class FileElementsCategory : public ElementsCategory {
|
||||
void loadNames();
|
||||
void deleteContent();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
protected:
|
||||
/// Collection parente, de type fichier
|
||||
/// Parent collection, stored on filesystem too
|
||||
FileElementsCollection *file_parent_collection_;
|
||||
/// Categorie parente, de type fichier
|
||||
/// Paremt Collection, stored on filesystem too
|
||||
FileElementsCategory *file_parent_category_;
|
||||
/// Sous-categories contenues dans cette categorie
|
||||
/// Child sub-categories
|
||||
QHash<QString, FileElementsCategory *> categories_;
|
||||
/// Elements contenus dans cette categorie
|
||||
/// Child elements
|
||||
QHash<QString, FileElementDefinition *> elements_;
|
||||
/// Dossier representant cette categorie sur le systeme de fichiers
|
||||
/// Directory matching this category on filesystem
|
||||
QDir cat_dir;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -21,14 +21,13 @@
|
||||
#include "elementscollection.h"
|
||||
class FileElementsCategory;
|
||||
/**
|
||||
Cette classe represente une collection d'elements accessible via un
|
||||
systeme de fichier. Typiquement, il s'agit de la collection QET ou
|
||||
de la collection utilisateur.
|
||||
This class represents an elements collection stored on filesystem, like the
|
||||
collection provided along with QET or users custom collection.
|
||||
*/
|
||||
class FileElementsCollection : public ElementsCollection {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
FileElementsCollection(const QString &, ElementsCollectionItem *parent = 0);
|
||||
virtual ~FileElementsCollection();
|
||||
@@ -36,7 +35,7 @@ class FileElementsCollection : public ElementsCollection {
|
||||
private:
|
||||
FileElementsCollection(const FileElementsCollection &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void reload();
|
||||
virtual ElementsCategory *rootCategory();
|
||||
@@ -53,7 +52,7 @@ class FileElementsCollection : public ElementsCollection {
|
||||
private:
|
||||
void deleteContent();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QString coll_path;
|
||||
FileElementsCategory *root;
|
||||
|
||||
@@ -19,18 +19,18 @@
|
||||
#define ELEMENTFIXE_H
|
||||
#include "element.h"
|
||||
/**
|
||||
Cette classe represente un element avec un nombre fixe de bornes.
|
||||
This class represents an element having a fixed number of terminals.
|
||||
*/
|
||||
class FixedElement : public Element {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
FixedElement(QGraphicsItem * = 0, Diagram * = 0);
|
||||
virtual ~FixedElement();
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
int minTerminalsCount() const;
|
||||
int maxTerminalsCount() const;
|
||||
|
||||
@@ -23,26 +23,24 @@ class QGraphicsItem;
|
||||
class ElementsLocation;
|
||||
class Terminal;
|
||||
/**
|
||||
La classe GhostElement herite de la classe CustomElement. Un GhostElement
|
||||
est destine a remplacer visuellement un CustomElement dont la definition
|
||||
n'a pu etre trouvee. Ainsi, au lieu de ne pas charger un element, et donc
|
||||
de perdre potentiellement :
|
||||
* sa position, son orientation, ses textes,
|
||||
* les conducteurs qui y sont lies,
|
||||
on peut lui substituer un GhostElement. Celui-ci extrapolera depuis le
|
||||
schema la position des bornes et des champs de texte.
|
||||
Visuellement, il sera represente par un rectangle.
|
||||
The GhostElement class inherits CustomElement. A GhostElement aims at
|
||||
visually replacing a CustomElement whose definition could not be loaded.
|
||||
This way, instead of not loading an element, thus potentially losing its
|
||||
position, its orientation, its child text items and conductors, one can
|
||||
substitute a GhostElement. The GhostElement will extrapolate the position
|
||||
of terminals and text items from the rest of the diagram. It is visually
|
||||
rendered using a simple rectangle.
|
||||
*/
|
||||
class GhostElement : public CustomElement {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
// constructeur, destructeur
|
||||
// constructor, destructor
|
||||
public:
|
||||
GhostElement(const ElementsLocation &, QGraphicsItem * = 0, Diagram * = 0);
|
||||
virtual ~GhostElement();
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual bool fromXml(QDomElement &, QHash<int, Terminal *> &, bool = false);
|
||||
|
||||
|
||||
@@ -54,9 +54,9 @@ HotspotEditor::HotspotEditor(QWidget *parent) :
|
||||
|
||||
diagram_scene = new Diagram();
|
||||
diagram_scene -> border_and_titleblock.setColumnsWidth(50.0);
|
||||
diagram_scene -> border_and_titleblock.setNbColumns(3);
|
||||
diagram_scene -> border_and_titleblock.setColumnsCount(3);
|
||||
diagram_scene -> border_and_titleblock.setRowsHeight(60.0);
|
||||
diagram_scene -> border_and_titleblock.setNbRows(2);
|
||||
diagram_scene -> border_and_titleblock.setRowsCount(2);
|
||||
diagram_scene -> border_and_titleblock.displayRows(false);
|
||||
diagram_scene -> border_and_titleblock.displayTitleBlock(false);
|
||||
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
#include <QtGui>
|
||||
#include "diagram.h"
|
||||
/**
|
||||
Ce widget permet a l'utilisateur d'editer les dimensions ainsi que le point
|
||||
de saisie d'un element.
|
||||
This widget enable users to edit the dimensions and the hotspot of an
|
||||
electrical element.
|
||||
*/
|
||||
class HotspotEditor : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
HotspotEditor(QWidget * = 0);
|
||||
virtual ~HotspotEditor() {};
|
||||
@@ -34,7 +34,7 @@ class HotspotEditor : public QWidget {
|
||||
private:
|
||||
HotspotEditor(const HotspotEditor &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QLabel *informations_label_;
|
||||
QSpinBox *sb_width;
|
||||
@@ -49,7 +49,7 @@ class HotspotEditor : public QWidget {
|
||||
bool parts_rect_enabled;
|
||||
QVBoxLayout *vlayout;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
void setElementWidth(uint);
|
||||
void setElementHeight(uint);
|
||||
|
||||
@@ -20,25 +20,26 @@
|
||||
#include <QtGui>
|
||||
#include "diagramtextitem.h"
|
||||
/**
|
||||
Cette classe represente un champ de texte editable independant sur le schema.
|
||||
Il peut etre pivote et deplace.
|
||||
This class represents an independent text field on a particular diagram.
|
||||
It may be moved, edited, and rotated.
|
||||
*/
|
||||
class IndependentTextItem : public DiagramTextItem {
|
||||
Q_OBJECT
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
IndependentTextItem(Diagram * = 0);
|
||||
IndependentTextItem(const QString &, Diagram* = 0);
|
||||
virtual ~IndependentTextItem();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
public:
|
||||
enum { Type = UserType + 1005 };
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
/**
|
||||
Cette methode permet d'utiliser qgraphicsitem_cast sur cet objet
|
||||
Enable the use of qgraphicsitem_cast to safely cast a QGraphicsItem into an
|
||||
IndependentTextItem.
|
||||
@return le type de QGraphicsItem
|
||||
*/
|
||||
virtual int type() const { return Type; }
|
||||
|
||||
@@ -20,26 +20,25 @@
|
||||
#include "basicmoveelementshandler.h"
|
||||
#include <QtGui>
|
||||
/**
|
||||
Cette classe implemente la classe strategie MoveElementsHandler.
|
||||
Elle correspond a un BasiMoveElementsHandler configure pour repondre
|
||||
QET::Abort a toutes les questions.
|
||||
Elle redefinit seulement la methode elementAlreadyExists pour, dans le cadre
|
||||
de l'integration d'un element dans un projet demander a l'utilisateur s'il souahite :
|
||||
* ecraser l'element precedent, manifestement different
|
||||
* conserver l'element precedent, en renommant le nouveau
|
||||
* annuler l'integration de l'element dans le projet
|
||||
This class implements the MoveElementsHandler Strategy class.
|
||||
It acts like a BasiMoveElementsHandler configured to answer QET::Abort to any question.
|
||||
Please note this class was designed with the context of integrating an element definition into a project in mind.
|
||||
For this purpose, the elementAlreadyExists method was redefined to ask users whether they wish to:
|
||||
* erase a different, already-existing element,
|
||||
* keep the already-existing element by renaming the new one,
|
||||
* or cancel the integration.
|
||||
*/
|
||||
class IntegrationMoveElementsHandler : public BasicMoveElementsHandler {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
IntegrationMoveElementsHandler(QWidget * = 0);
|
||||
virtual ~IntegrationMoveElementsHandler();
|
||||
private:
|
||||
IntegrationMoveElementsHandler(const IntegrationMoveElementsHandler &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual QET::Action elementAlreadyExists(ElementDefinition *, ElementDefinition *);
|
||||
virtual QString nameForRenamingOperation();
|
||||
@@ -54,11 +53,11 @@ class IntegrationMoveElementsHandler : public BasicMoveElementsHandler {
|
||||
private slots:
|
||||
void correctRadioButtons();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QWidget *parent_widget_; ///< Widget a utiliser comme parent pour l'affichage des dialogues
|
||||
QString rename_; ///< Nom a utiliser lors d'une operation de renommage
|
||||
QDialog *integ_dialog_; ///< Dialogue en cas de conflit lors de l'integration d'un element
|
||||
QWidget *parent_widget_; ///< Widget to be used as parent when displaying dialogs
|
||||
QString rename_; ///< Name to be used when renaming the integrated element
|
||||
QDialog *integ_dialog_; ///< Dialog in case of conflict when integration an element
|
||||
QLabel *dialog_label_;
|
||||
QVBoxLayout *dialog_vlayout_;
|
||||
QGridLayout *dialog_glayout;
|
||||
|
||||
@@ -27,22 +27,21 @@ class QHBoxLayout;
|
||||
class QVBoxLayout;
|
||||
class QLabel;
|
||||
/**
|
||||
Cette classe implemente la classe strategie MoveElementsHandler.
|
||||
Via une interface graphique, elle demande a l'utilisateur comment il faut
|
||||
traiter tel ou tel probleme puis transmet la reponse via l'API de la classe
|
||||
MoveElementsHandler.
|
||||
This class implements the MoveElementsHandler Strategy class by asking
|
||||
users how to handle the various expected problems through interactive
|
||||
dialogs.
|
||||
*/
|
||||
class InteractiveMoveElementsHandler : public BasicMoveElementsHandler {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
InteractiveMoveElementsHandler(QWidget * = 0);
|
||||
virtual ~InteractiveMoveElementsHandler();
|
||||
private:
|
||||
InteractiveMoveElementsHandler(const InteractiveMoveElementsHandler &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual QET::Action categoryAlreadyExists(ElementsCategory *, ElementsCategory *);
|
||||
virtual QET::Action elementAlreadyExists(ElementDefinition *, ElementDefinition *);
|
||||
@@ -68,15 +67,16 @@ class InteractiveMoveElementsHandler : public BasicMoveElementsHandler {
|
||||
void simpleErrorMessage(const QString &) const;
|
||||
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QWidget *parent_widget_; ///< Widget a utiliser comme parent pour l'affichage des dialogues
|
||||
QString rename_; ///< Nom a utiliser lors d'une operation de renommage
|
||||
bool always_erase_; ///< Booleen indiquant qu'il faut toujours ecraser les cibles en conflit sans poser de question
|
||||
bool always_skip_; ///< Booleen indiquant qu'il faut toujours ignorer les cibles en conflit sans poser de question
|
||||
bool aborted_; /// Booleen indiquant que le mouvement a ete annule
|
||||
QWidget *parent_widget_; ///< Widget to be used as parent when displaying dialogs
|
||||
QString rename_; ///< Name to be used when renaming an item
|
||||
bool always_erase_; ///< Whether to systematically erase conflicting targets without bothering users
|
||||
bool always_skip_; ///< Whether to systematically ignore conflicting targets without bothering users
|
||||
bool aborted_; ///< Whether the movement has been cancelled
|
||||
|
||||
// attributs relatifs au dialogue affiche pour les elements et categories deja existants (= dialogue de conflit)
|
||||
// attributes related to the dialog displayed for already existing elements and
|
||||
// categories (= i.e. conflict dialog)
|
||||
QET::Action conflict_result_;
|
||||
QDialog *conflict_dialog_;
|
||||
QVBoxLayout *conflict_layout0_;
|
||||
@@ -84,7 +84,7 @@ class InteractiveMoveElementsHandler : public BasicMoveElementsHandler {
|
||||
QLabel *rename_label_;
|
||||
QFileNameEdit *rename_textfield_;
|
||||
|
||||
/// Boutons pour le dialogue de conflit
|
||||
/// Buttons for the conflict dialog
|
||||
QDialogButtonBox *conflict_buttons_;
|
||||
QPushButton *rename_button_;
|
||||
QPushButton *erase_button_;
|
||||
|
||||
@@ -22,21 +22,21 @@ class ElementsCollectionItem;
|
||||
class ElementsCategory;
|
||||
class MoveElementsHandler;
|
||||
/**
|
||||
Cette classe represente la description d'un mouvement d'elements.
|
||||
Il peut s'agir d'un deplacement ou d'une copie. La source n'est pas
|
||||
mentionnee
|
||||
This class describes the evolution of an elements item move (actually
|
||||
either move or copy), i.e. whether the source was deleted, whether the
|
||||
target changed and to what path, etc.
|
||||
*/
|
||||
class MoveElementsDescription : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
MoveElementsDescription(QObject * = 0);
|
||||
virtual ~MoveElementsDescription();
|
||||
private:
|
||||
MoveElementsDescription(const MoveElementsDescription &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
bool isRecursive() const;
|
||||
void setRecursive(bool);
|
||||
@@ -62,7 +62,7 @@ class MoveElementsDescription : public QObject {
|
||||
bool mustAbort() const;
|
||||
void abort();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
bool recursive_;
|
||||
MoveElementsHandler *handler_;
|
||||
|
||||
@@ -22,79 +22,75 @@
|
||||
class ElementDefinition;
|
||||
class ElementsCategory;
|
||||
/**
|
||||
Cette classe definit l'interface minimale pour implementer un objet capable
|
||||
de prendre en main une operation de deplacement ou de copie d'elements.
|
||||
Ce type d'objet est typiquement utilise dans les methodes move et copy des
|
||||
classes ElementDefinition et ElementsCategory. Ces methodes font appel a cet
|
||||
objet pour qu'il leur indique comment gerer les eventuels problemes
|
||||
rencontres lors du deplacement / de la copie.
|
||||
Exemple : lors de la recopie d'un element dans une categorie, il se peut que
|
||||
cet element existe deja. Il est alors possible d'ecraser l'element cible ou
|
||||
d'abandonner l'operation. Cette decision est a la charge d'une classe fille
|
||||
de MoveElementsHandler.
|
||||
Cet objet peut effectuer des interactions avec l'utilisateur ou non.
|
||||
Cet aspect, ainsi que la politique de gestion des elements, est laisse aux
|
||||
bons soins de l'implementation.
|
||||
Il s'agit d'un pattern Strategie qui encapsule non pas l'algorithme de
|
||||
deplacement / copie des categories / elements mais la gestion des erreurs
|
||||
durant l'execution de cet algorithme.
|
||||
This class defines the minimum interface required to implement an object able
|
||||
to handle a move/copy operation among elements collections. This kind of
|
||||
objects is typically useful in the move() and copy() method of the
|
||||
ElementDefinition and ElementsCategory classes. These methods simply rely on
|
||||
answers provided by an instance of this class as soon as they encounter
|
||||
typical move/copy problems, such as conflicts or permission issues.
|
||||
|
||||
For instance, when copying a particular element to a given category, that
|
||||
element may already exist in the target category. It is then possible either
|
||||
to erase the target element, change the target name or cancel the operation.
|
||||
There is no systematic or calculable answer to this kind of questions, hence
|
||||
the rational to delegate the decision process to a dedicated "Strategy" object.
|
||||
|
||||
All we know from this object is the fact it implements the interface defined
|
||||
below. It is then free to create complicated dialogs to ask a user what to do
|
||||
or even to pick a random decision.
|
||||
|
||||
@see ElementsCategory
|
||||
@see ElementDefinition
|
||||
*/
|
||||
class MoveElementsHandler : public QObject {
|
||||
Q_OBJECT
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
MoveElementsHandler(QObject * = 0) {};
|
||||
virtual ~MoveElementsHandler() {};
|
||||
private:
|
||||
MoveElementsHandler(const MoveElementsHandler &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
/**
|
||||
@return l'action a effectuer si la categorie cible existe deja
|
||||
@return what to do if the target category already exists
|
||||
*/
|
||||
virtual QET::Action categoryAlreadyExists(ElementsCategory *src, ElementsCategory *dst) = 0;
|
||||
/**
|
||||
@return l'action a effectuer si l'element cible existe deja
|
||||
@return what to do if the target element already exists
|
||||
*/
|
||||
virtual QET::Action elementAlreadyExists(ElementDefinition *src, ElementDefinition *dst) = 0;
|
||||
|
||||
/**
|
||||
@return l'action a effectuer si la categorie existe deja
|
||||
@return what to do if a category is not readable
|
||||
*/
|
||||
virtual QET::Action categoryIsNotReadable(ElementsCategory *) = 0;
|
||||
/**
|
||||
@return l'action a effectuer si l'element existe deja
|
||||
@return what to do if an element is not readable
|
||||
*/
|
||||
virtual QET::Action elementIsNotReadable(ElementDefinition *) = 0;
|
||||
|
||||
/**
|
||||
@return l'action a effectuer si la categorie cible n'est pas accessible
|
||||
en ecriture
|
||||
@return what to do if the target category is not writable
|
||||
*/
|
||||
virtual QET::Action categoryIsNotWritable(ElementsCategory *) = 0;
|
||||
/**
|
||||
@return l'action a effectuer si l'element cible n'est pas accessible
|
||||
en ecriture
|
||||
@return what to do if the target element is not writable
|
||||
*/
|
||||
virtual QET::Action elementIsNotWritable(ElementDefinition *) = 0;
|
||||
|
||||
/**
|
||||
@return l'action a effectuer lorsque l'erreur decrite dans la QString
|
||||
s'est produite avec la categorie indiquee
|
||||
@return what to do when an error, described by the provided QString, occurs in relation with the given elements category.
|
||||
*/
|
||||
virtual QET::Action errorWithACategory(ElementsCategory *, const QString &) = 0;
|
||||
/**
|
||||
@return l'action a effectuer lorsque l'erreur decrite dans la QString
|
||||
s'est produite avec l'element indique
|
||||
@return what to do when an error, described by the provided QString, occurs in relation with the given element.
|
||||
*/
|
||||
virtual QET::Action errorWithAnElement(ElementDefinition *, const QString &) = 0;
|
||||
|
||||
/**
|
||||
@return le nom a utiliser pour le renommage si une methode de cet objet
|
||||
a precedemment renvoye QET::Rename.
|
||||
@return the name to be used along with the latest QET::Rename answer
|
||||
*/
|
||||
virtual QString nameForRenamingOperation() = 0;
|
||||
};
|
||||
|
||||
@@ -27,22 +27,22 @@
|
||||
pour le francais.
|
||||
*/
|
||||
class NamesList {
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
NamesList();
|
||||
NamesList(const NamesList &);
|
||||
virtual ~NamesList();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QHash<QString, QString> hash_names;
|
||||
|
||||
public:
|
||||
static int MetaTypeId;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
// methodes relatives a la gestion de la liste
|
||||
// methods relatives a la gestion de la liste
|
||||
void addName(const QString &, const QString &);
|
||||
void removeName(const QString &);
|
||||
void clearNames();
|
||||
@@ -55,7 +55,7 @@ class NamesList {
|
||||
bool operator==(const NamesList &) const;
|
||||
QString name(const QString & = QString()) const;
|
||||
|
||||
// methodes relatives a XML
|
||||
// methods relatives a XML
|
||||
void fromXml(const QDomElement &, const QHash<QString, QString> & = QHash<QString, QString>());
|
||||
QDomElement toXml(QDomDocument &, const QHash<QString, QString> & = QHash<QString, QString>()) const;
|
||||
|
||||
|
||||
@@ -20,13 +20,13 @@
|
||||
#include <QtGui>
|
||||
#include "nameslist.h"
|
||||
/**
|
||||
Cette classe represente une interface permettant de saisir les noms des
|
||||
categories et elements.
|
||||
This class provides a widget enabling users to enter localized names for
|
||||
categories and elements.
|
||||
*/
|
||||
class NamesListWidget : public QWidget {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
NamesListWidget(QWidget * = 0);
|
||||
virtual ~NamesListWidget();
|
||||
@@ -34,14 +34,14 @@ class NamesListWidget : public QWidget {
|
||||
private:
|
||||
NamesListWidget(const NamesListWidget &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QTreeWidget *tree_names;
|
||||
QPushButton *button_add_line;
|
||||
NamesList hash_names;
|
||||
bool read_only;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
bool checkOneName();
|
||||
NamesList names();
|
||||
@@ -59,8 +59,8 @@ class NamesListWidget : public QWidget {
|
||||
|
||||
signals:
|
||||
/**
|
||||
Signal emis lors de la verification de la saisie s'il y a au moins un
|
||||
nom saisi
|
||||
Signal emitted after the widget successfully checked there was at least one
|
||||
name entered
|
||||
*/
|
||||
void inputChecked();
|
||||
};
|
||||
|
||||
@@ -25,20 +25,21 @@ class OrientationSetWidget;
|
||||
class HotspotEditor;
|
||||
class QFileNameEdit;
|
||||
/**
|
||||
Cette classe represente un dialogue qui permet a l'utilisateur de specifier
|
||||
les premiers parametres de l'element qu'il va construire.
|
||||
Ces parametres sont :
|
||||
- la categorie dans laquelle il faut enregistrer l'element
|
||||
- le nom du fichier dans lequel il faut enregistrer l'element
|
||||
- les noms de cet element
|
||||
- les dimensions
|
||||
- la position du hotspot
|
||||
- les orientations possibles
|
||||
This class provides a wizard dialog enabling users to to specify the basic
|
||||
parameters of the electrical elements they intend to draw.
|
||||
|
||||
These parameters include:
|
||||
- the category the element should be saved to
|
||||
- the filename the element should be saved to
|
||||
- localized names
|
||||
- dimensions
|
||||
- hotspot position
|
||||
- allowed and default orientations
|
||||
*/
|
||||
class NewElementWizard : public QWizard {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
NewElementWizard(QWidget * = 0, Qt::WindowFlags = 0);
|
||||
virtual ~NewElementWizard();
|
||||
@@ -46,12 +47,12 @@ class NewElementWizard : public QWizard {
|
||||
private:
|
||||
NewElementWizard(const NewElementWizard &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
ElementsCategory *selectedCategory() const;
|
||||
bool preselectCategory(ElementsCategory *);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
enum WizardState { Category, Filename, Names, Dimensions, Orientations };
|
||||
ElementsCategoriesWidget *categories_list;
|
||||
@@ -63,7 +64,7 @@ class NewElementWizard : public QWizard {
|
||||
QString chosen_file;
|
||||
ElementsCategory *chosen_category;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
private:
|
||||
QWizardPage *buildStep1();
|
||||
QWizardPage *buildStep2();
|
||||
|
||||
@@ -19,23 +19,20 @@
|
||||
#define ORIENTATION_SET_H
|
||||
#include "qet.h"
|
||||
/**
|
||||
Cette classe represente un containeur d'orientations, c'est-a-dire une
|
||||
structure de donnees stockant une orientation par defaut, une orientation
|
||||
courante et l'autorisation ou non d'utiliser les quatre autres orientations
|
||||
: nord, est, sud, ouest.
|
||||
Elle possede des methodes pour definir les autorisations. Le changement
|
||||
d'autorisation peut echouer car il faut au moins une orientation autorisee.
|
||||
Le changement d'autorisation peut eventuellement modifier les orientations
|
||||
par defaut et courante.
|
||||
This class provides a container for element orientations, i.e. a data
|
||||
structure that stores, for a particular element:
|
||||
- its default orientation,
|
||||
- its current orientation,
|
||||
- whether the North, East, South and West orientations are allowed.
|
||||
*/
|
||||
class OrientationSet {
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
OrientationSet();
|
||||
virtual ~OrientationSet() {};
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
bool north_ori;
|
||||
bool east_ori;
|
||||
@@ -44,7 +41,7 @@ class OrientationSet {
|
||||
QET::Orientation default_ori;
|
||||
QET::Orientation current_ori;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
bool north() const;
|
||||
bool east() const;
|
||||
@@ -74,49 +71,49 @@ class OrientationSet {
|
||||
};
|
||||
|
||||
/**
|
||||
@return true si l'orientation "Nord" est autorisee, false sinon
|
||||
@return whether the Northern orientation is allowed
|
||||
*/
|
||||
inline bool OrientationSet::north() const {
|
||||
return(north_ori);
|
||||
}
|
||||
|
||||
/**
|
||||
@return true si l'orientation "Est" est autorisee, false sinon
|
||||
@return whether the Eastern orientation is allowed
|
||||
*/
|
||||
inline bool OrientationSet::east() const {
|
||||
return(east_ori);
|
||||
}
|
||||
|
||||
/**
|
||||
@return true si l'orientation "Sud" est autorisee, false sinon
|
||||
@return whether the Southern orientation is allowed
|
||||
*/
|
||||
inline bool OrientationSet::south() const {
|
||||
return(south_ori);
|
||||
}
|
||||
|
||||
/**
|
||||
@return true si l'orientation "Ouest" est autorisee, false sinon
|
||||
@return whether the Western orientation is allowed
|
||||
*/
|
||||
inline bool OrientationSet::west() const {
|
||||
return(west_ori);
|
||||
}
|
||||
|
||||
/**
|
||||
@param theValue La nouvelle orientation par defaut
|
||||
@param new_default_orientation The new default orientation
|
||||
*/
|
||||
inline void OrientationSet::setDefaultOrientation(const QET::Orientation& theValue) {
|
||||
default_ori = theValue;
|
||||
inline void OrientationSet::setDefaultOrientation(const QET::Orientation& new_default_orientation) {
|
||||
default_ori = new_default_orientation;
|
||||
}
|
||||
|
||||
/**
|
||||
@return L'orientation par defaut
|
||||
@return the default orientation
|
||||
*/
|
||||
inline QET::Orientation OrientationSet::defaultOrientation() const {
|
||||
return(default_ori);
|
||||
}
|
||||
|
||||
/**
|
||||
@return L'orientation actuelle
|
||||
@return the current orientation
|
||||
*/
|
||||
inline QET::Orientation OrientationSet::current() const {
|
||||
return(current_ori);
|
||||
|
||||
@@ -20,11 +20,12 @@
|
||||
#include <QtGui>
|
||||
#include "orientationset.h"
|
||||
/**
|
||||
Widget permettant d'editer un OrientationSet
|
||||
Widget to edit an OrientationSet.
|
||||
@see OrientationSet
|
||||
*/
|
||||
class OrientationSetWidget : public QWidget {
|
||||
Q_OBJECT
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
OrientationSetWidget(QWidget * = 0);
|
||||
virtual ~OrientationSetWidget() {};
|
||||
@@ -32,7 +33,7 @@ class OrientationSetWidget : public QWidget {
|
||||
private:
|
||||
OrientationSetWidget(const OrientationSetWidget &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
OrientationSet ori;
|
||||
QComboBox *north_orientation;
|
||||
@@ -45,7 +46,7 @@ class OrientationSetWidget : public QWidget {
|
||||
QRadioButton *west_default;
|
||||
QButtonGroup *default_radios;
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
OrientationSet orientationSet() const;
|
||||
void setOrientationSet(const OrientationSet &);
|
||||
|
||||
@@ -26,7 +26,8 @@ class Diagram;
|
||||
class ElementsLocation;
|
||||
class QETTabWidget;
|
||||
/**
|
||||
Cette classe affiche les schemas d'un projet dans des onglets.
|
||||
This class provides a widget displaying the diagrams of a particular
|
||||
project using tabs.
|
||||
*/
|
||||
class ProjectView : public QWidget {
|
||||
Q_OBJECT
|
||||
@@ -41,14 +42,14 @@ class ProjectView : public QWidget {
|
||||
Q_DECLARE_FLAGS(ProjectSaveOptions, ProjectSaveOption)
|
||||
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
ProjectView(QETProject *, QWidget * = 0);
|
||||
virtual ~ProjectView();
|
||||
private:
|
||||
ProjectView(const ProjectView &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
QETProject *project();
|
||||
void setProject(QETProject *);
|
||||
@@ -119,7 +120,7 @@ class ProjectView : public QWidget {
|
||||
void setDisplayFallbackWidget(bool);
|
||||
void adjustReadOnlyState();
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QAction *add_new_diagram_;
|
||||
QETProject *project_;
|
||||
|
||||
@@ -19,20 +19,19 @@
|
||||
#define _QET_H
|
||||
#include <QtXml>
|
||||
/**
|
||||
Ce fichier contient des fonctions utiles pouvant etre appelees depuis
|
||||
n'importe ou. Il contient egalement des enums utilises dans plusieurs
|
||||
classes de l'application
|
||||
This file provides useful functions and enums that may be used from
|
||||
anywhere else within the QElectroTech application.
|
||||
*/
|
||||
namespace QET {
|
||||
/// version de QElectroTech (utilisee pour estampiller les projets et elements)
|
||||
/// QElectroTech version (as string, used to mark projects and elements XML documents)
|
||||
const QString version = "0.3";
|
||||
/// version affichee de QElectroTech
|
||||
/// QElectroTech displayed version
|
||||
const QString displayedVersion = "0.3a";
|
||||
QString license();
|
||||
/// Orientation (utilise pour les bornes mais aussi pour les elements)
|
||||
/// Orientation (used for electrical elements and their terminals)
|
||||
enum Orientation {North, East, South, West};
|
||||
|
||||
/// Mouvements orientes
|
||||
/// Oriented movements
|
||||
enum OrientedMovement {
|
||||
ToNorth,
|
||||
ToNorthEast,
|
||||
@@ -44,28 +43,28 @@ namespace QET {
|
||||
ToNorthWest
|
||||
};
|
||||
|
||||
/// Types de segment de conducteurs
|
||||
/// Known kinds of conductor segments
|
||||
enum ConductorSegmentType {
|
||||
Horizontal = 1, ///< Segment horizontal
|
||||
Vertical = 2, ///< Segment vertical
|
||||
Both = 3 ///< Segment en biais / invalide
|
||||
Horizontal = 1, ///< Horizontal segment
|
||||
Vertical = 2, ///< Vertical segment
|
||||
Both = 3 ///< Invalid segment
|
||||
};
|
||||
|
||||
/**
|
||||
Cet enum represente les differents embouts possibles pour les
|
||||
extremites d'une ligne.
|
||||
This enum lists the various available endings for line primitives when drawing
|
||||
an electrical element.
|
||||
*/
|
||||
enum EndType {
|
||||
None, ///< Ligne normale
|
||||
Simple, ///< Triangle sans base
|
||||
None, ///< Regular line
|
||||
Simple, ///< Base-less triangle
|
||||
Triangle, ///< Triangle
|
||||
Circle, ///< Cercle
|
||||
Diamond ///< Losange
|
||||
Circle, ///< Circle
|
||||
Diamond ///< Diamond
|
||||
};
|
||||
|
||||
/**
|
||||
Cet enum represente les differents items manipulables dans une
|
||||
collection d'elements.
|
||||
This enums lists the various kind of items users can manage within the
|
||||
application.
|
||||
*/
|
||||
enum ItemType {
|
||||
Element = 1,
|
||||
@@ -91,25 +90,25 @@ namespace QET {
|
||||
};
|
||||
|
||||
/**
|
||||
Cet enum represente les differentes facons de gerer un probleme lors de
|
||||
la recopie ou du deplacement d'un element ou d'une categorie.
|
||||
This enums lists the various ways to handle a standard problem when copying
|
||||
or moving element items (collections, categories, elements).
|
||||
@see MoveElementsHandler
|
||||
*/
|
||||
enum Action {
|
||||
Retry, ///< il faut reessayer l'operation
|
||||
Ignore, ///< il faut passer a la suite
|
||||
Erase, ///< il faut ecraser le contenu cible
|
||||
Abort, ///< il faut arreter : ignorer l'item en cours et ne pas continuer
|
||||
Managed, ///< le cas a ete gere par l'objet delegue : ne pas le traiter et passer a la suite
|
||||
Rename ///< il faut renommer la cible
|
||||
Retry, ///< The operation must be tried again
|
||||
Ignore, ///< Skip the current item
|
||||
Erase, ///< Erase the target content
|
||||
Abort, ///< abort the whole operation, ignoring the curent item
|
||||
Managed, ///< the current item was handled by the Strategy object: do not treat it and continue
|
||||
Rename ///< the target has to be renamed
|
||||
};
|
||||
|
||||
/**
|
||||
Cet enum represente la zone d'un schema a exporter / imprimer
|
||||
This enum represents diagram areas that may be exported/printed.
|
||||
*/
|
||||
enum DiagramArea {
|
||||
BorderArea, ///< Exporte le schema avec son cadre et son cartouche
|
||||
ElementsArea ///< Exporte le contenu du schema sans le cadre et le cartouche
|
||||
BorderArea, ///< Export the diagram along with its border and title block
|
||||
ElementsArea ///< Export the content of the diagram only
|
||||
};
|
||||
|
||||
/// enum used to specify the type of a length
|
||||
|
||||
@@ -45,12 +45,11 @@ class QTextOrientationSpinBoxWidget;
|
||||
class RecentFiles;
|
||||
|
||||
/**
|
||||
Cette classe represente l'application QElectroTech.
|
||||
|
||||
This class represents the QElectroTech application.
|
||||
*/
|
||||
class QETApp : public QETSingleApplication {
|
||||
Q_OBJECT
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
QETApp(int &, char **);
|
||||
virtual ~QETApp();
|
||||
@@ -58,7 +57,7 @@ class QETApp : public QETSingleApplication {
|
||||
private:
|
||||
QETApp(const QETApp &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
static QETApp *instance();
|
||||
void setLanguage(const QString &);
|
||||
@@ -103,7 +102,7 @@ class QETApp : public QETSingleApplication {
|
||||
public:
|
||||
static void overrideCommonElementsDir(const QString &);
|
||||
private:
|
||||
static QString common_elements_dir; ///< Dossier contenant la collection d'elements commune
|
||||
static QString common_elements_dir; ///< Directory containing the common elements collection
|
||||
#endif
|
||||
#ifdef QET_ALLOW_OVERRIDE_CTBTD_OPTION
|
||||
public:
|
||||
@@ -115,11 +114,11 @@ class QETApp : public QETSingleApplication {
|
||||
public:
|
||||
static void overrideConfigDir(const QString &);
|
||||
private:
|
||||
static QString config_dir; ///< Dossier contenant la configuration et la collection d'elements de l'utilisateur
|
||||
static QString config_dir; ///< Directory containing the user configuration and the custom elements collection
|
||||
#endif
|
||||
public:
|
||||
static void overrideLangDir(const QString &);
|
||||
static QString lang_dir; ///< Dossier contenant les fichiers de langue
|
||||
static QString lang_dir; ///< Directory containing localization files.
|
||||
static QFont diagramTextsFont(qreal = -1.0);
|
||||
static QETDiagramEditor *diagramEditorForFile(const QString &);
|
||||
static QList<QETDiagramEditor *> diagramEditors();
|
||||
@@ -135,7 +134,7 @@ class QETApp : public QETSingleApplication {
|
||||
bool event(QEvent *);
|
||||
#endif
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QTranslator qtTranslator;
|
||||
QTranslator qetTranslator;
|
||||
@@ -164,9 +163,9 @@ class QETApp : public QETSingleApplication {
|
||||
bool every_template_visible;
|
||||
QSignalMapper signal_map;
|
||||
QSettings *qet_settings;
|
||||
QETArguments qet_arguments_; ///< Analyseur d'arguments
|
||||
bool non_interactive_execution_; ///< booleen indiquant si l'application va se terminer immediatement apres un court traitement
|
||||
QPalette initial_palette_; ///< Palette des couleurs systeme
|
||||
QETArguments qet_arguments_; ///< Comand-line arguments parser
|
||||
bool non_interactive_execution_; ///< Whether the application will end without any user interaction
|
||||
QPalette initial_palette_; ///< System color palette
|
||||
|
||||
static FileElementsCollection *common_collection;
|
||||
static FileElementsCollection *custom_collection;
|
||||
@@ -209,7 +208,6 @@ class QETApp : public QETSingleApplication {
|
||||
void configureQET();
|
||||
void aboutQET();
|
||||
|
||||
// methodes privees
|
||||
private slots:
|
||||
void cleanup();
|
||||
|
||||
@@ -236,8 +234,8 @@ class QETApp : public QETSingleApplication {
|
||||
};
|
||||
|
||||
/**
|
||||
Cette classe represente le style de QElectroTech
|
||||
Il s'agit de modifications simples appliquees aux styles communs de Qt
|
||||
This class represents the custom QElectroTech style.
|
||||
It implements simple modification such as extra standard icons.
|
||||
*/
|
||||
class QETStyle : public QPlastiqueStyle {
|
||||
Q_OBJECT
|
||||
|
||||
@@ -19,15 +19,14 @@
|
||||
#define QET_ARGUMENTS_H
|
||||
#include <QtCore>
|
||||
/**
|
||||
Cette classe represente un ensemble d'arguments que l'application peut
|
||||
recevoir en parametres. Initialisee a partir d'une liste de chaine de
|
||||
caracteres, chaque instance de cette classe permet d'acceder aux differents
|
||||
types de fichiers et options passes en parametres.
|
||||
This class represents a set of arguments the application has received as
|
||||
parameters. Initialized from a list of strings, an instance of this class
|
||||
provides access to the differents options and files given on the command line.
|
||||
*/
|
||||
class QETArguments : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
QETArguments(QObject * = 0);
|
||||
QETArguments(const QList<QString> &, QObject * = 0);
|
||||
@@ -35,7 +34,7 @@ class QETArguments : public QObject {
|
||||
QETArguments &operator=(const QETArguments &);
|
||||
virtual ~QETArguments();
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
virtual void setArguments(const QList<QString> &);
|
||||
virtual QList<QString> arguments() const;
|
||||
@@ -69,7 +68,7 @@ class QETArguments : public QObject {
|
||||
void handleFileArgument(const QString &);
|
||||
void handleOptionArgument(const QString &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
private:
|
||||
QList<QString> project_files_;
|
||||
QList<QString> element_files_;
|
||||
|
||||
@@ -32,16 +32,13 @@ class ElementsPanelWidget;
|
||||
class ElementsLocation;
|
||||
class RecentFiles;
|
||||
/**
|
||||
Cette classe represente la fenetre principale de QElectroTech et,
|
||||
ipso facto, la plus grande partie de l'interface graphique de QElectroTech.
|
||||
Il s'agit d'un objet QMainWindow avec un QWorkSpace contenant des objets
|
||||
"DiagramView" en guise de widget central et un "Panel d'Elements" en
|
||||
guise de widget "Dock".
|
||||
This class represents the main window of the QElectroTech diagram editor and,
|
||||
ipso facto, the most important part of the QElectroTech user interface.
|
||||
*/
|
||||
class QETDiagramEditor : public QETMainWindow {
|
||||
Q_OBJECT
|
||||
|
||||
// constructeurs, destructeur
|
||||
// constructors, destructor
|
||||
public:
|
||||
QETDiagramEditor(const QStringList & = QStringList(), QWidget * = 0);
|
||||
virtual ~QETDiagramEditor();
|
||||
@@ -49,7 +46,7 @@ class QETDiagramEditor : public QETMainWindow {
|
||||
private:
|
||||
QETDiagramEditor(const QETDiagramEditor &);
|
||||
|
||||
// methodes
|
||||
// methods
|
||||
public:
|
||||
void closeEvent(QCloseEvent *);
|
||||
QList<ProjectView *> openedProjects() const;
|
||||
@@ -152,69 +149,69 @@ class QETDiagramEditor : public QETMainWindow {
|
||||
void showError(const QETResult &);
|
||||
void showError(const QString &);
|
||||
|
||||
// attributs
|
||||
// attributes
|
||||
public:
|
||||
// Actions faisables au travers de menus dans l'application QElectroTech
|
||||
QActionGroup *grp_visu_sel; ///< Groupe d'actions pour les modes (edition et visualisation)
|
||||
QActionGroup *grp_view_mode; ///< Groupe d'actions pour l'affichage des projets (onglets ou fenetres)
|
||||
QAction *tabbed_view_mode; ///< Passe les projets en mode onglets
|
||||
QAction *windowed_view_mode; ///< Passe les projets en mode fenetre
|
||||
QAction *mode_selection; ///< Passe en mode edition
|
||||
QAction *mode_visualise; ///< Passe en mode visualisation
|
||||
QAction *new_file; ///< Cree un nouveau schema
|
||||
QAction *open_file; ///< OUvre un fichier
|
||||
QAction *close_file; ///< Ferme le fichier
|
||||
// Actions reachable through menus within QElectroTech
|
||||
QActionGroup *grp_visu_sel; ///< Action group for visualisation vs edition mode
|
||||
QActionGroup *grp_view_mode; ///< Action group for project
|
||||
QAction *tabbed_view_mode; ///< Display projects as tabs
|
||||
QAction *windowed_view_mode; ///< Display projects as windows
|
||||
QAction *mode_selection; ///< Set edition mode
|
||||
QAction *mode_visualise; ///< Set visualisation mode
|
||||
QAction *new_file; ///< Create new project file
|
||||
QAction *open_file; ///< Open project file
|
||||
QAction *close_file; ///< Close current project file
|
||||
QAction *save_file; ///< Save current project
|
||||
QAction *save_file_as; ///< Save current project as a specific file
|
||||
QAction *save_cur_diagram; ///< Save current diagram of the current project only
|
||||
QAction *import_diagram; ///< Importe un schema existant (non implemente)
|
||||
QAction *export_diagram; ///< Exporte le schema sous forme d'image
|
||||
QAction *print; ///< Imprime le schema
|
||||
QAction *quit_editor; ///< Quitte l'editeur de schema
|
||||
QAction *undo; ///< Annule la derniere action
|
||||
QAction *redo; ///< Refait une action annulee
|
||||
QAction *cut; ///< Coupe la selection dans le presse-papier
|
||||
QAction *copy; ///< Copie la selection dans le presse-papier
|
||||
QAction *paste; ///< Colle le contenu du presse-papier sur le schema
|
||||
QAction *select_all; ///< Selectionne tout
|
||||
QAction *select_nothing; ///< Deselectionne tout
|
||||
QAction *select_invert; ///< Inverse la selection
|
||||
QAction *delete_selection; ///< Supprime la selection
|
||||
QAction *rotate_selection; ///< Pivote les elements et textes selectionnes de 90 degres
|
||||
QAction *rotate_texts; ///< Pivote les textes selectionnes selon un angle parametrable
|
||||
QAction *selection_prop; ///< Lance le dialogue de description ou d'edition de la selection
|
||||
QAction *conductor_reset; ///< Reinitialise les conducteurs selectionnes
|
||||
QAction *conductor_default; ///< Lance le dialogue d'edition des conducteurs par defaut
|
||||
QAction *infos_diagram; ///< Lance le dialogue d'edition des proprietes du schema
|
||||
QAction *add_text; ///< Passe en mode "Ajout de texte"
|
||||
QAction *add_column; ///< Ajoute une colonne au schema
|
||||
QAction *remove_column; ///< Enleve une colonne du schema
|
||||
QAction *add_row; ///< Augmente la hauteur du schema
|
||||
QAction *remove_row; ///< Reduit la hauteur du schema
|
||||
QAction *prj_edit_prop; ///< Edite les proprietes du projet
|
||||
QAction *prj_add_diagram; ///< Ajoute un schema au projet
|
||||
QAction *prj_del_diagram; ///< Supprime un schema du projet
|
||||
QAction *prj_clean; ///< Nettoie un projet
|
||||
QAction *zoom_in; ///< Zoome avant
|
||||
QAction *zoom_out; ///< Zoome arriere
|
||||
QAction *import_diagram; ///< Importe an existing diagram (not implemented)
|
||||
QAction *export_diagram; ///< Export diagrams of the current project as imagess
|
||||
QAction *print; ///< Print diagrams of the current project
|
||||
QAction *quit_editor; ///< Quit the diagram editor
|
||||
QAction *undo; ///< Cancel the latest action
|
||||
QAction *redo; ///< Redo the latest cancelled operation
|
||||
QAction *cut; ///< Cut selection to clipboard
|
||||
QAction *copy; ///< Copy selection to clipboard
|
||||
QAction *paste; ///< Paste clipboard content on the current diagram
|
||||
QAction *select_all; ///< Select all
|
||||
QAction *select_nothing; ///< Cancel selection
|
||||
QAction *select_invert; ///< Invest selection
|
||||
QAction *delete_selection; ///< Delete selection
|
||||
QAction *rotate_selection; ///< Rotate selected elements and text items by 90 degrees
|
||||
QAction *rotate_texts; ///< Direct selected text items to a specific angle
|
||||
QAction *selection_prop; ///< Show a dialog describing the selection
|
||||
QAction *conductor_reset; ///< Reset paths of selected conductors
|
||||
QAction *conductor_default; ///< Show a dialog to edit default conductor properties
|
||||
QAction *infos_diagram; ///< Show a dialog to edit diagram properties
|
||||
QAction *add_text; ///< Tool to add an independent text item on diagrams
|
||||
QAction *add_column; ///< Increase diagram width by adding an extra column
|
||||
QAction *remove_column; ///< Decrease diagram width by removing the last column
|
||||
QAction *add_row; ///< Increase diagram height by adding an extra row
|
||||
QAction *remove_row; ///< Decrease diagram height by removing the last row
|
||||
QAction *prj_edit_prop; ///< Edit the properties of the current project.
|
||||
QAction *prj_add_diagram; ///< Add a diagram to the current project.
|
||||
QAction *prj_del_diagram; ///< Delete a diagram from the current project
|
||||
QAction *prj_clean; ///< Clean the content of the curent project by removing useless items
|
||||
QAction *zoom_in; ///< Zoom in
|
||||
QAction *zoom_out; ///< Zoom out
|
||||
QAction *zoom_fit; ///< Adjust zoom to fit the whole diagram, including potential elements outside its borders, in the view
|
||||
QAction *zoom_content; ///< Adjust zoom to fit all elements in the view, regardless of diagram borders
|
||||
QAction *zoom_reset; ///< Remet le zoom 1:1
|
||||
QAction *tile_window; ///< Affiche les fenetre MDI en mosaique
|
||||
QAction *cascade_window; ///< Affiche les fenetres MDI en cascade
|
||||
QAction *prev_window; ///< Affiche la fenetre MDI precedente
|
||||
QAction *next_window; ///< Affiche la fenetre MDI suivante
|
||||
QAction *zoom_reset; ///< Reset zoom to 1:1
|
||||
QAction *tile_window; ///< Show MDI subwindows as tile
|
||||
QAction *cascade_window; ///< Show MDI subwindows as cascade
|
||||
QAction *prev_window; ///< Switch to the previous document
|
||||
QAction *next_window; ///< Switch to the next document
|
||||
|
||||
private:
|
||||
QMdiArea workspace;
|
||||
QSignalMapper windowMapper;
|
||||
/// Dossier a utiliser pour Fichier > ouvrir
|
||||
/// Directory to use for file dialogs such as File > save
|
||||
QDir open_dialog_dir;
|
||||
/// Dock pour le Panel d'Elements
|
||||
/// Dock for the elements panel
|
||||
QDockWidget *qdw_pa;
|
||||
/// Dock pour la liste des annulations
|
||||
/// Dock for the undo list
|
||||
QDockWidget *qdw_undo;
|
||||
/// Panel d'Elements
|
||||
/// Elements panel
|
||||
ElementsPanelWidget *pa;
|
||||
QMenu *windows_menu;
|
||||
QToolBar *main_bar;
|
||||
|
||||
@@ -19,15 +19,15 @@
|
||||
#define QET_ICONS_H
|
||||
#include <QIcon>
|
||||
/**
|
||||
Ce namespace est reserve a la declaration des icones de l'application
|
||||
QElectroTech.
|
||||
This namespace is meant to delare icons used within the QElectroTech
|
||||
application.
|
||||
*/
|
||||
namespace QET {
|
||||
namespace Icons {
|
||||
void initIcons();
|
||||
|
||||
// l'utilisation du mot-cle extern permet l'acces aux objets statiques
|
||||
// depuis l'exterieur du namespace
|
||||
// using the extern keyword enables access to static objects from outside the
|
||||
// namespace
|
||||
extern QIcon Add;
|
||||
extern QIcon Allowed;
|
||||
extern QIcon ApplicationExit;
|
||||
|
||||
@@ -20,14 +20,11 @@
|
||||
#include <QMessageBox>
|
||||
namespace QET {
|
||||
/**
|
||||
Ce namespace definit certaines methodes statiques visant a recreer le
|
||||
comportement de certaines methodes statiques de la classe Qt
|
||||
QMessageBox.
|
||||
Le comportement est sense etre le meme sur les plateformes X11 et
|
||||
Windows. En revanche, sous MacOS, si un widget parent est fourni, ces
|
||||
methodes s'assurent que la boite de dialogue sera "window modal" mais
|
||||
aussi qu'elle sera dotee du flag "Qt:Sheet", qui permet une meilleure
|
||||
integration sous MacOS.
|
||||
This namespace defines static methods behaving in a very similar way to some
|
||||
static methods from the QMessageBox Qt class. The behavior is expected to be
|
||||
the same under X11 and Windows. However, under MacOS, when a parent widget is
|
||||
provided, these methodes ensure the dialog box is "window modal" and has the
|
||||
Qt:Sheet flag, thus enabling a better MacOS integration.
|
||||
*/
|
||||
namespace MessageBox {
|
||||
QMessageBox::StandardButton critical (QWidget *, const QString &, const QString &, QMessageBox::StandardButtons = QMessageBox::Ok, QMessageBox::StandardButton = QMessageBox::NoButton);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user