2013-04-04 16:57:15 +00:00
|
|
|
#ifndef CONDUCTORAUTONUMEROTATION_H
|
|
|
|
#define CONDUCTORAUTONUMEROTATION_H
|
|
|
|
|
2013-04-10 09:31:51 +00:00
|
|
|
#include <QObject>
|
|
|
|
#include "conductor.h"
|
|
|
|
#include "diagram.h"
|
2013-04-04 16:57:15 +00:00
|
|
|
|
|
|
|
class NumStrategy;
|
|
|
|
|
|
|
|
class ConductorAutoNumerotation
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
//constructors & destructor
|
|
|
|
ConductorAutoNumerotation ();
|
|
|
|
ConductorAutoNumerotation(Conductor *);
|
|
|
|
~ConductorAutoNumerotation();
|
|
|
|
|
|
|
|
//methods
|
|
|
|
void setConductor(Conductor *);
|
|
|
|
void numerate();
|
2013-04-10 09:31:51 +00:00
|
|
|
void setText(QString);
|
2013-04-04 16:57:15 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
//methods
|
2013-04-10 09:31:51 +00:00
|
|
|
void setNumStrategy ();
|
2013-04-04 16:57:15 +00:00
|
|
|
|
|
|
|
//attributes
|
|
|
|
Conductor *conductor_;
|
|
|
|
Diagram *diagram_;
|
|
|
|
QSet <Conductor *> conductor_list;
|
|
|
|
NumStrategy *strategy_;
|
2013-04-10 09:31:51 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool strategy_is_set;
|
2013-04-04 16:57:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-04-10 09:31:51 +00:00
|
|
|
class NumStrategy: public QObject
|
2013-04-04 16:57:15 +00:00
|
|
|
{
|
2013-04-10 09:31:51 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
2013-04-04 16:57:15 +00:00
|
|
|
public:
|
2013-04-10 09:31:51 +00:00
|
|
|
NumStrategy (Conductor *);
|
2013-04-04 16:57:15 +00:00
|
|
|
virtual ~NumStrategy ();
|
2013-04-10 09:31:51 +00:00
|
|
|
virtual void createNumerotation() = 0; //cree la numerotation en fonction de la strategie utilisé
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void applyText(QString);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
Conductor *conductor_;
|
|
|
|
QSet <Conductor *> c_list;
|
|
|
|
Diagram *diagram_;
|
2013-04-04 16:57:15 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class SamePotential: public NumStrategy
|
|
|
|
{
|
2013-04-10 09:31:51 +00:00
|
|
|
public:
|
|
|
|
SamePotential (Conductor *);
|
|
|
|
virtual void createNumerotation();
|
2013-04-04 16:57:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
bool eachIsEqual (const QStringList &);
|
|
|
|
|
|
|
|
#endif // CONDUCTORAUTONUMEROTATION_H
|