2007-12-01 10:47:15 +00:00
|
|
|
/*
|
2024-03-29 10:09:48 +01:00
|
|
|
Copyright 2006-2024 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_SEGMENT_PROFILE_H
|
|
|
|
#define CONDUCTOR_SEGMENT_PROFILE_H
|
2007-09-20 20:16:08 +00:00
|
|
|
#include <QtCore>
|
2007-10-03 17:02:39 +00:00
|
|
|
#include "conductorsegment.h"
|
2007-09-20 20:16:08 +00:00
|
|
|
/**
|
2012-11-09 21:09:24 +00:00
|
|
|
This class embeds the profile (i.e. main characteristics) of a conductor
|
|
|
|
segment.
|
2007-09-20 20:16:08 +00:00
|
|
|
*/
|
2007-10-03 17:02:39 +00:00
|
|
|
class ConductorSegmentProfile {
|
2012-11-09 21:09:24 +00:00
|
|
|
// constructors, destructor
|
2007-09-20 20:16:08 +00:00
|
|
|
public:
|
|
|
|
/**
|
2012-11-09 21:09:24 +00:00
|
|
|
Constructor
|
|
|
|
@param l segment length
|
|
|
|
@param ori true if the segment is horizontal, false if it is vertical
|
2007-09-20 20:16:08 +00:00
|
|
|
*/
|
2007-10-03 17:02:39 +00:00
|
|
|
ConductorSegmentProfile(qreal l, bool ori = true) :
|
2007-09-20 20:16:08 +00:00
|
|
|
length(l),
|
|
|
|
isHorizontal(ori)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2012-11-09 21:09:24 +00:00
|
|
|
Constructor
|
|
|
|
@param segment Segment the profile should be copied from.
|
2007-09-20 20:16:08 +00:00
|
|
|
*/
|
2007-10-03 17:02:39 +00:00
|
|
|
ConductorSegmentProfile(ConductorSegment *segment) :
|
2007-09-20 20:16:08 +00:00
|
|
|
length(segment -> length()),
|
|
|
|
isHorizontal(segment -> isHorizontal())
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-11-09 21:09:24 +00:00
|
|
|
/// Destructor
|
2007-10-03 17:02:39 +00:00
|
|
|
virtual ~ConductorSegmentProfile() {
|
2007-09-20 20:16:08 +00:00
|
|
|
}
|
|
|
|
|
2012-11-09 21:09:24 +00:00
|
|
|
// attributes
|
2007-09-20 20:16:08 +00:00
|
|
|
public:
|
2012-11-09 21:09:24 +00:00
|
|
|
/// segment length
|
2007-10-21 16:10:21 +00:00
|
|
|
qreal length;
|
2012-11-09 21:09:24 +00:00
|
|
|
/// segment orientation
|
2007-10-21 16:10:21 +00:00
|
|
|
bool isHorizontal;
|
2007-09-20 20:16:08 +00:00
|
|
|
};
|
|
|
|
#endif
|