mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
Translate documentation + Fix indentation
This commit is contained in:
@@ -1125,7 +1125,7 @@ bool Diagram::fromXml(QDomElement &document, QPointF position, bool consider_inf
|
|||||||
|
|
||||||
QPointF point_ = items_rect.topLeft();
|
QPointF point_ = items_rect.topLeft();
|
||||||
QPointF pos_ = Diagram::snapToGrid(QPointF (position.x() - point_.x(),
|
QPointF pos_ = Diagram::snapToGrid(QPointF (position.x() - point_.x(),
|
||||||
position.y() - point_.y()));
|
position.y() - point_.y()));
|
||||||
|
|
||||||
//Translate all added items
|
//Translate all added items
|
||||||
for (auto qgi : added_items)
|
for (auto qgi : added_items)
|
||||||
|
|||||||
@@ -66,7 +66,10 @@ QET::ScalingMethod CustomElementPart::preferredScalingMethod() const {
|
|||||||
@param points List of points when the movement started, in scene coordinates.
|
@param points List of points when the movement started, in scene coordinates.
|
||||||
@return The list of points mapped from initial_selection_rect to new_selection_rect
|
@return The list of points mapped from initial_selection_rect to new_selection_rect
|
||||||
*/
|
*/
|
||||||
QList<QPointF> CustomElementPart::mapPoints(const QRectF &initial_selection_rect, const QRectF &new_selection_rect, const QList<QPointF> &points) {
|
QList<QPointF> CustomElementPart::mapPoints(
|
||||||
|
const QRectF &initial_selection_rect,
|
||||||
|
const QRectF &new_selection_rect,
|
||||||
|
const QList<QPointF> &points) {
|
||||||
QList<QPointF> new_points;
|
QList<QPointF> new_points;
|
||||||
if (!points.count()) return(new_points);
|
if (!points.count()) return(new_points);
|
||||||
|
|
||||||
|
|||||||
@@ -29,21 +29,27 @@ class QGraphicsItem;
|
|||||||
class QGraphicsSceneMouseEvent;
|
class QGraphicsSceneMouseEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This abstract class represents a primitive of the visual representation of an
|
@brief The CustomElementPart class
|
||||||
electrical element. The Element, FixedElement and CustomElement classes do not
|
This abstract class represents a primitive of
|
||||||
embed its attributes and methods in order to remain lightweight; indeed, there
|
the visual representation of an electrical element.
|
||||||
is no point for those classes to store their visual representation with
|
The Element, FixedElement and CustomElement classes do not embed
|
||||||
anything more complex than a QImage.
|
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 {
|
class CustomElementPart {
|
||||||
// constructors, destructor
|
// constructors, destructor
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
@brief CustomElementPart
|
||||||
Constructor
|
Constructor
|
||||||
@param editor Element editor this primitive is attached to
|
@param editor Element editor this primitive is attached to
|
||||||
*/
|
*/
|
||||||
CustomElementPart(QETElementEditor *editor) : element_editor(editor) {}
|
CustomElementPart(QETElementEditor *editor) : element_editor(editor) {}
|
||||||
/// Destructor
|
/**
|
||||||
|
@brief ~CustomElementPart
|
||||||
|
Destructor
|
||||||
|
*/
|
||||||
virtual ~CustomElementPart() {}
|
virtual ~CustomElementPart() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -78,13 +84,15 @@ class CustomElementPart {
|
|||||||
virtual bool isUseless() const = 0;
|
virtual bool isUseless() const = 0;
|
||||||
virtual QRectF sceneGeometricRect() const = 0;
|
virtual QRectF sceneGeometricRect() const = 0;
|
||||||
/**
|
/**
|
||||||
Inform this part a user-induced transformation is about to begin. This method can be used to save data required by handleUserTransformation().
|
Inform this part a user-induced transformation is about to begin.
|
||||||
|
This method can be used to save data required by handleUserTransformation().
|
||||||
*/
|
*/
|
||||||
virtual void startUserTransformation(const QRectF &) = 0;
|
virtual void startUserTransformation(const QRectF &) = 0;
|
||||||
/**
|
/**
|
||||||
Make this part fit into the provided rectangle.
|
Make this part fit into the provided rectangle.
|
||||||
*/
|
*/
|
||||||
virtual void handleUserTransformation(const QRectF &, const QRectF &) = 0;
|
virtual void handleUserTransformation(const QRectF &,
|
||||||
|
const QRectF &) = 0;
|
||||||
/// @return a pointer to the parent element editor
|
/// @return a pointer to the parent element editor
|
||||||
virtual QETElementEditor *elementEditor() const;
|
virtual QETElementEditor *elementEditor() const;
|
||||||
/**
|
/**
|
||||||
@@ -106,6 +114,9 @@ class CustomElementPart {
|
|||||||
virtual QET::ScalingMethod preferredScalingMethod() const;
|
virtual QET::ScalingMethod preferredScalingMethod() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
QList<QPointF> mapPoints(const QRectF &, const QRectF &, const QList<QPointF> &);
|
QList<QPointF> mapPoints(
|
||||||
|
const QRectF &,
|
||||||
|
const QRectF &,
|
||||||
|
const QList<QPointF> &);
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -133,12 +133,15 @@ void PartTerminal::setOrientation(Qet::Orientation ori)
|
|||||||
updateSecondPoint();
|
updateSecondPoint();
|
||||||
emit orientationChanged();
|
emit orientationChanged();
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
@brief PartTerminal::setName
|
||||||
|
@param name
|
||||||
|
*/
|
||||||
void PartTerminal::setName(QString& name)
|
void PartTerminal::setName(QString& name)
|
||||||
{
|
{
|
||||||
if (d->m_name == name) return;
|
if (d->m_name == name) return;
|
||||||
d->m_name = name;
|
d->m_name = name;
|
||||||
emit nameChanged();
|
emit nameChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -997,12 +997,20 @@ bool Element::fromXml(QDomElement &e, QHash<int, Terminal *> &table_id_adr, bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Permet d'exporter l'element en XML
|
@brief Element::toXml
|
||||||
@param document Document XML a utiliser
|
Allows to export the element in XML
|
||||||
@param table_adr_id Table de correspondance entre les adresses des bornes
|
\~French Permet d'exporter l'element en XML
|
||||||
et leur id dans la representation XML ; cette table completee par cette
|
\~ @param document : XML document to use
|
||||||
methode
|
\~French Document XML a utiliser
|
||||||
@return L'element XML representant cet element electrique
|
\~ @param table_adr_id :
|
||||||
|
Correspondence table between the addresses of the terminals
|
||||||
|
and their id in the XML representation;
|
||||||
|
this table completed by this method
|
||||||
|
\~French Table de correspondance entre les adresses des bornes
|
||||||
|
et leur id dans la representation XML ;
|
||||||
|
cette table completee par cette methode
|
||||||
|
\~ @return The XML element representing this electrical element
|
||||||
|
\~French L'element XML representant cet element electrique
|
||||||
*/
|
*/
|
||||||
QDomElement Element::toXml(QDomDocument &document, QHash<Terminal *, int> &table_adr_id) const
|
QDomElement Element::toXml(QDomDocument &document, QHash<Terminal *, int> &table_adr_id) const
|
||||||
{
|
{
|
||||||
@@ -1031,7 +1039,8 @@ QDomElement Element::toXml(QDomDocument &document, QHash<Terminal *, int> &table
|
|||||||
element.setAttribute("z", QString::number(this->zValue()));
|
element.setAttribute("z", QString::number(this->zValue()));
|
||||||
element.setAttribute("orientation", QString::number(orientation()));
|
element.setAttribute("orientation", QString::number(orientation()));
|
||||||
|
|
||||||
/* recupere le premier id a utiliser pour les bornes de cet element */
|
/* get the first id to use for the bounds of this element
|
||||||
|
* recupere le premier id a utiliser pour les bornes de cet element */
|
||||||
int id_terminal = 0;
|
int id_terminal = 0;
|
||||||
if (!table_adr_id.isEmpty()) {
|
if (!table_adr_id.isEmpty()) {
|
||||||
// trouve le plus grand id
|
// trouve le plus grand id
|
||||||
@@ -1042,8 +1051,10 @@ QDomElement Element::toXml(QDomDocument &document, QHash<Terminal *, int> &table
|
|||||||
id_terminal = max_id_t + 1;
|
id_terminal = max_id_t + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// registration of device terminals
|
||||||
// enregistrement des bornes de l'appareil
|
// enregistrement des bornes de l'appareil
|
||||||
QDomElement xml_terminals = document.createElement("terminals");
|
QDomElement xml_terminals = document.createElement("terminals");
|
||||||
|
// for each child of the element
|
||||||
// pour chaque enfant de l'element
|
// pour chaque enfant de l'element
|
||||||
foreach(Terminal *t, terminals()) {
|
foreach(Terminal *t, terminals()) {
|
||||||
// alors on enregistre la borne
|
// alors on enregistre la borne
|
||||||
|
|||||||
@@ -113,7 +113,6 @@ Terminal::Terminal(QPointF pf, Qet::Orientation o, Element *e) :
|
|||||||
@param pf_y Ordonnee du point d'amarrage pour un conducteur
|
@param pf_y Ordonnee du point d'amarrage pour un conducteur
|
||||||
@param o orientation de la borne : Qt::Horizontal ou Qt::Vertical
|
@param o orientation de la borne : Qt::Horizontal ou Qt::Vertical
|
||||||
@param e Element auquel cette borne appartient
|
@param e Element auquel cette borne appartient
|
||||||
@param s Scene sur laquelle figure cette borne
|
|
||||||
*/
|
*/
|
||||||
Terminal::Terminal(qreal pf_x, qreal pf_y, Qet::Orientation o, Element *e) :
|
Terminal::Terminal(qreal pf_x, qreal pf_y, Qet::Orientation o, Element *e) :
|
||||||
QGraphicsObject(e),
|
QGraphicsObject(e),
|
||||||
|
|||||||
Reference in New Issue
Block a user