forked from chili-epfl/Carpenter-App-RoofDesigner
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstrainedline.cpp
More file actions
52 lines (44 loc) · 1.27 KB
/
constrainedline.cpp
File metadata and controls
52 lines (44 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "constrainedline.h"
#include <QDebug>
ConstrainedLine::ConstrainedLine(QSharedPointer<ConstrainedPoint> start,
QSharedPointer<ConstrainedPoint> end,
int identifier)
{
this->identifier = identifier;
this->horizontal = false;
this->vertical = false;
this->start = start;
this->end = end;
this->distanceFixed = false;
}
ConstrainedLine* ConstrainedLine::horizontallyConstrained() {
#ifdef CARPENTER_DEBUG
qDebug() << "ConstrainedLine: horizontal constrained";
#endif
this->horizontal = true;
return this;
}
ConstrainedLine* ConstrainedLine::verticallyConstrained() {
#ifdef CARPENTER_DEBUG
qDebug() << "ConstrainedLine: vertical constrained";
#endif
this->vertical = true;
return this;
}
bool ConstrainedLine::isVerticallyConstrained() {
return this->vertical;
}
bool ConstrainedLine::isHorizontalConstrained() {
return this->horizontal;
}
bool ConstrainedLine::isDistanceFixed() {
return this->distanceFixed;
}
ConstrainedLine* ConstrainedLine::setDesiredDistance(double distance) {
this->distanceFixed = true;
this->desiredDistance = distance;
return this;
}
double ConstrainedLine::getDesiredDistance() {
return this->desiredDistance;
}