2007-12-01 10:47:15 +00:00
|
|
|
/*
|
2013-06-18 11:10:19 +00:00
|
|
|
Copyright 2006-2013 The QElectroTech Team
|
2007-12-01 10:47:15 +00:00
|
|
|
This file is part of QElectroTech.
|
|
|
|
|
|
|
|
QElectroTech is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
QElectroTech is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2007-10-03 17:02:39 +00:00
|
|
|
#ifndef CONDUCTOR_PROFILE_H
|
|
|
|
#define CONDUCTOR_PROFILE_H
|
|
|
|
#include <QList>
|
|
|
|
#include "qet.h"
|
|
|
|
class Conductor;
|
|
|
|
class ConductorSegmentProfile;
|
|
|
|
/**
|
2012-11-09 21:09:24 +00:00
|
|
|
This class represents the profile of a conductor, i.e. its primary
|
|
|
|
characteristics.
|
2007-10-03 17:02:39 +00:00
|
|
|
*/
|
|
|
|
class ConductorProfile {
|
|
|
|
public:
|
2012-11-09 21:09:24 +00:00
|
|
|
// constructors, destructor
|
2007-10-03 17:02:39 +00:00
|
|
|
ConductorProfile();
|
|
|
|
ConductorProfile(Conductor *conductor);
|
|
|
|
ConductorProfile(const ConductorProfile &);
|
|
|
|
ConductorProfile &operator=(const ConductorProfile &);
|
|
|
|
virtual ~ConductorProfile();
|
|
|
|
|
2012-11-09 21:09:24 +00:00
|
|
|
// attributes
|
2007-10-03 17:02:39 +00:00
|
|
|
public:
|
2012-11-09 21:09:24 +00:00
|
|
|
/// Segments composing the conductor
|
2007-10-03 17:02:39 +00:00
|
|
|
QList<ConductorSegmentProfile *> segments;
|
2012-11-09 21:09:24 +00:00
|
|
|
/// Orientation of the start terminal
|
2007-10-03 17:02:39 +00:00
|
|
|
QET::Orientation beginOrientation;
|
2012-11-09 21:09:24 +00:00
|
|
|
/// Orientation of the end terminal.
|
2007-10-03 17:02:39 +00:00
|
|
|
QET::Orientation endOrientation;
|
|
|
|
|
2012-11-09 21:09:24 +00:00
|
|
|
// methods
|
2007-10-03 17:02:39 +00:00
|
|
|
public:
|
|
|
|
bool isNull() const;
|
|
|
|
void setNull();
|
|
|
|
qreal width() const;
|
|
|
|
qreal height() const;
|
2012-11-09 21:09:24 +00:00
|
|
|
uint segmentsCount(QET::ConductorSegmentType) const;
|
2007-10-03 17:02:39 +00:00
|
|
|
QList<ConductorSegmentProfile *> horizontalSegments();
|
|
|
|
QList<ConductorSegmentProfile *> verticalSegments();
|
|
|
|
void fromConductor(Conductor *);
|
|
|
|
};
|
|
|
|
QDebug &operator<<(QDebug d, ConductorProfile &);
|
|
|
|
#endif
|