Sun, 10 Jun 2018 23:25:08 +0300
some rework in description
| 
1149
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
1 | /* | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
2 | * LDForge: LDraw parts authoring CAD | 
| 1326 | 3 | * Copyright (C) 2013 - 2018 Teemu Piippo | 
| 
1149
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
4 | * | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
5 | * This program is free software: you can redistribute it and/or modify | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
6 | * it under the terms of the GNU General Public License as published by | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
7 | * the Free Software Foundation, either version 3 of the License, or | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
8 | * (at your option) any later version. | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
9 | * | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
10 | * This program is distributed in the hope that it will be useful, | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
13 | * GNU General Public License for more details. | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
14 | * | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
15 | * You should have received a copy of the GNU General Public License | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
17 | */ | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
18 | |
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
19 | #pragma once | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
20 | #include "modelobject.h" | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
21 | |
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
22 | /* | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
23 | * Represents a single code-4 quadrilateral. | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
24 | */ | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
25 | class LDQuadrilateral : public LDObject | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
26 | { | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
27 | public: | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
28 | static constexpr LDObjectType SubclassType = LDObjectType::Quadrilateral; | 
| 
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
29 | |
| 
1269
 
ec691d9472b3
Added LDObject serialization and refactored the internal resource managing to use it. No more tearing objects from one model into another, and this provides a stable way to keep an object's state in memory such as the edit history.
 
Santeri Piippo 
parents: 
1263 
diff
changeset
 | 
30 | LDQuadrilateral() = default; | 
| 
 
ec691d9472b3
Added LDObject serialization and refactored the internal resource managing to use it. No more tearing objects from one model into another, and this provides a stable way to keep an object's state in memory such as the edit history.
 
Santeri Piippo 
parents: 
1263 
diff
changeset
 | 
31 | LDQuadrilateral(const Vertex& v1, const Vertex& v2, const Vertex& v3, const Vertex& v4); | 
| 
 
ec691d9472b3
Added LDObject serialization and refactored the internal resource managing to use it. No more tearing objects from one model into another, and this provides a stable way to keep an object's state in memory such as the edit history.
 
Santeri Piippo 
parents: 
1263 
diff
changeset
 | 
32 | |
| 
1149
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
33 | QString asText() const override; | 
| 
1390
 
3eace926af7f
added draw plane feature (doesn't work with circle draw quite right yet)
 
Teemu Piippo <teemu@hecknology.net> 
parents: 
1326 
diff
changeset
 | 
34 | bool isCoPlanar() const; | 
| 
 
3eace926af7f
added draw plane feature (doesn't work with circle draw quite right yet)
 
Teemu Piippo <teemu@hecknology.net> 
parents: 
1326 
diff
changeset
 | 
35 | qreal planeAngle() const; | 
| 
1149
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
36 | int numVertices() const override; | 
| 
1263
 
0256edecda54
LDSubfileReference now contains the name of the subfile and not a pointer anymore. Some methods now require a DocumentManager* for context on resolving the name.
 
Santeri Piippo 
parents: 
1261 
diff
changeset
 | 
37 | int triangleCount(DocumentManager*) const override; | 
| 
1149
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
38 | LDObjectType type() const override; | 
| 
1402
 
8bbf2af8c3f5
some rework in description
 
Teemu Piippo <teemu@hecknology.net> 
parents: 
1390 
diff
changeset
 | 
39 | QString iconName() const override; | 
| 
1149
 
502c866b8512
Moved LDQuadrilateral into its own source pair.
 
Teemu Piippo <teemu@hecknology.net> 
parents:  
diff
changeset
 | 
40 | }; |