1 /*
2 	Copyright 2006-2019 The QElectroTech Team
3 	This file is part of QElectroTech.
4 
5 	QElectroTech is free software: you can redistribute it and/or modify
6 	it under the terms of the GNU General Public License as published by
7 	the Free Software Foundation, either version 2 of the License, or
8 	(at your option) any later version.
9 
10 	QElectroTech is distributed in the hope that it will be useful,
11 	but WITHOUT ANY WARRANTY; without even the implied warranty of
12 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 	GNU General Public License for more details.
14 
15 	You should have received a copy of the GNU General Public License
16 	along with QElectroTech.  If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef CONDUCTOR_PROFILE_H
19 #define CONDUCTOR_PROFILE_H
20 #include <QList>
21 #include "qet.h"
22 class Conductor;
23 class ConductorSegmentProfile;
24 /**
25 	This class represents the profile of a conductor, i.e. its primary
26 	characteristics.
27 */
28 class ConductorProfile {
29 	public:
30 	// constructors, destructor
31 	ConductorProfile();
32 	ConductorProfile(Conductor *conductor);
33 	ConductorProfile(const ConductorProfile &);
34 	ConductorProfile &operator=(const ConductorProfile &);
35 	virtual ~ConductorProfile();
36 
37 	// attributes
38 	public:
39 	/// Segments composing the conductor
40 	QList<ConductorSegmentProfile *> segments;
41 	/// Orientation of the start terminal
42 	Qet::Orientation beginOrientation;
43 	/// Orientation of the end terminal.
44 	Qet::Orientation endOrientation;
45 
46 	// methods
47 	public:
48 	bool isNull() const;
49 	void setNull();
50 	qreal width() const;
51 	qreal height() const;
52 	uint segmentsCount(QET::ConductorSegmentType) const;
53 	QList<ConductorSegmentProfile *> horizontalSegments();
54 	QList<ConductorSegmentProfile *> verticalSegments();
55 	void fromConductor(Conductor *);
56 };
57 QDebug &operator<<(QDebug d, ConductorProfile &);
58 #endif
59