Sun, 10 Jun 2018 23:07:24 +0300
fixed bugs regarding circular primitives
1251
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
1 | /* |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
2 | * LDForge: LDraw parts authoring CAD |
1326 | 3 | * Copyright (C) 2013 - 2018 Teemu Piippo |
1251
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
4 | * |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
5 | * This program is free software: you can redistribute it and/or modify |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
6 | * it under the terms of the GNU General Public License as published by |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
7 | * the Free Software Foundation, either version 3 of the License, or |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
8 | * (at your option) any later version. |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
9 | * |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
13 | * GNU General Public License for more details. |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
14 | * |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
17 | */ |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
18 | |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
19 | #pragma once |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
20 | #include "../basics.h" |
1315
23d48a709ffc
moved Vertex and BoundingBox into new code units
Teemu Piippo <teemu@hecknology.net>
parents:
1251
diff
changeset
|
21 | #include "../types/vertex.h" |
1251
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
22 | |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
23 | /* |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
24 | * Models a 3D line segment. |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
25 | */ |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
26 | struct LineSegment |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
27 | { |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
28 | Vertex v_1; |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
29 | Vertex v_2; |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
30 | |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
31 | QPair<Vertex, Vertex> toPair() const; |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
32 | }; |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
33 | |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
34 | LineSegment normalized(const LineSegment& segment); |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
35 | unsigned int qHash(const LineSegment& segment); |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
36 | bool operator==(const LineSegment& one, const LineSegment& other); |
e75cc5bff076
Converted magic wand mode and other selection stuff to mvc
Santeri Piippo
parents:
diff
changeset
|
37 | bool operator<(const LineSegment& one, const LineSegment& other); |
1390
3eace926af7f
added draw plane feature (doesn't work with circle draw quite right yet)
Teemu Piippo <teemu@hecknology.net>
parents:
1326
diff
changeset
|
38 | |
3eace926af7f
added draw plane feature (doesn't work with circle draw quite right yet)
Teemu Piippo <teemu@hecknology.net>
parents:
1326
diff
changeset
|
39 | using Line = LineSegment; |