Wed, 08 Jan 2014 21:43:46 +0200
- removed the File class in favor of QFile
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
1 | /* |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
2 | * LDForge: LDraw parts authoring CAD |
600
209e3f1f7b2c
- updated copyright year. Best wishes for 2014!
Santeri Piippo <crimsondusk64@gmail.com>
parents:
583
diff
changeset
|
3 | * Copyright (C) 2013, 2014 Santeri Piippo |
376 | 4 | * |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
5 | * This program is free software: you can redistribute it and/or modify |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
6 | * it under the terms of the GNU General Public License as published by |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
7 | * the Free Software Foundation, either version 3 of the License, or |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
8 | * (at your option) any later version. |
376 | 9 | * |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
10 | * This program is distributed in the hope that it will be useful, |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
13 | * GNU General Public License for more details. |
376 | 14 | * |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
15 | * You should have received a copy of the GNU General Public License |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
17 | */ |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
18 | |
538
2f85d4d286e5
- ensured header files' guards start with LDFORGE_
Santeri Piippo <crimsondusk64@gmail.com>
parents:
522
diff
changeset
|
19 | #ifndef LDFORGE_LDTYPES_H |
2f85d4d286e5
- ensured header files' guards start with LDFORGE_
Santeri Piippo <crimsondusk64@gmail.com>
parents:
522
diff
changeset
|
20 | #define LDFORGE_LDTYPES_H |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
21 | |
541
0e38beeb050a
- Renamed common.h to main.h, split the PROPERTY macro and supporting macros to property.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
540
diff
changeset
|
22 | #include "main.h" |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
23 | #include "types.h" |
583
4906c5c1670f
- documents are now refcounted. This should seriously stabilize (and speed up!) the pruning of unused files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
564
diff
changeset
|
24 | #include "misc/documentPointer.h" |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
25 | |
603 | 26 | #define LDOBJ(T) \ |
27 | protected: \ | |
28 | virtual LD##T* clone() override \ | |
29 | { \ | |
30 | return new LD##T (*this); \ | |
31 | } \ | |
32 | \ | |
33 | public: \ | |
34 | virtual LDObject::Type getType() const override \ | |
35 | { \ | |
604 | 36 | return LDObject::E##T; \ |
603 | 37 | } \ |
606
3dd6f343ec06
- removed the 'str' typedef, use QString directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
604
diff
changeset
|
38 | virtual QString raw() const override; \ |
560
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
39 | virtual void invert() override; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
40 | |
606
3dd6f343ec06
- removed the 'str' typedef, use QString directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
604
diff
changeset
|
41 | #define LDOBJ_NAME(N) virtual QString getTypeName() const override { return #N; } |
538
2f85d4d286e5
- ensured header files' guards start with LDFORGE_
Santeri Piippo <crimsondusk64@gmail.com>
parents:
522
diff
changeset
|
42 | #define LDOBJ_VERTICES(V) virtual int vertices() const override { return V; } |
421
7d26db0be944
style cleanup - it should be all unified now
Santeri Piippo <crimsondusk64@gmail.com>
parents:
418
diff
changeset
|
43 | #define LDOBJ_SETCOLORED(V) virtual bool isColored() const override { return V; } |
7d26db0be944
style cleanup - it should be all unified now
Santeri Piippo <crimsondusk64@gmail.com>
parents:
418
diff
changeset
|
44 | #define LDOBJ_COLORED LDOBJ_SETCOLORED (true) |
7d26db0be944
style cleanup - it should be all unified now
Santeri Piippo <crimsondusk64@gmail.com>
parents:
418
diff
changeset
|
45 | #define LDOBJ_UNCOLORED LDOBJ_SETCOLORED (false) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
46 | |
367
3745caa5d87d
apply the c++11 'override' keyword to overriding virtual functions
Santeri Piippo <crimsondusk64@gmail.com>
parents:
357
diff
changeset
|
47 | #define LDOBJ_CUSTOM_SCEMANTIC virtual bool isScemantic() const override |
357
9c954c222996
Removed the two string arrays containing object types and icon names, moved these as LDObjects' virtual functions
Santeri Piippo <crimsondusk64@gmail.com>
parents:
316
diff
changeset
|
48 | #define LDOBJ_SCEMANTIC LDOBJ_CUSTOM_SCEMANTIC { return true; } |
9c954c222996
Removed the two string arrays containing object types and icon names, moved these as LDObjects' virtual functions
Santeri Piippo <crimsondusk64@gmail.com>
parents:
316
diff
changeset
|
49 | #define LDOBJ_NON_SCEMANTIC LDOBJ_CUSTOM_SCEMANTIC { return false; } |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
50 | |
367
3745caa5d87d
apply the c++11 'override' keyword to overriding virtual functions
Santeri Piippo <crimsondusk64@gmail.com>
parents:
357
diff
changeset
|
51 | #define LDOBJ_SETMATRIX(V) virtual bool hasMatrix() const override { return V; } |
421
7d26db0be944
style cleanup - it should be all unified now
Santeri Piippo <crimsondusk64@gmail.com>
parents:
418
diff
changeset
|
52 | #define LDOBJ_HAS_MATRIX LDOBJ_SETMATRIX (true) |
7d26db0be944
style cleanup - it should be all unified now
Santeri Piippo <crimsondusk64@gmail.com>
parents:
418
diff
changeset
|
53 | #define LDOBJ_NO_MATRIX LDOBJ_SETMATRIX (false) |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
54 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
55 | class QListWidgetItem; |
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
56 | class LDSubfile; |
553
2418d5955421
- LDFile renamed to LDDocument, file.h -> document.h
Santeri Piippo <crimsondusk64@gmail.com>
parents:
551
diff
changeset
|
57 | class LDDocument; |
516
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
58 | class LDSharedVertex; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
59 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
60 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
61 | // LDObject |
376 | 62 | // |
63 | // Base class object for all object types. Each LDObject represents a single line | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
64 | // in the LDraw code file. The virtual method getType returns an enumerator |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
65 | // which is a token of the object's type. The object can be casted into |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
66 | // sub-classes based on this enumerator. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
67 | // ============================================================================= |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
68 | class LDObject |
603 | 69 | { |
607
353e418f161a
- corrected relationships between documents: opening a main file with the same name as another document is to overload it and editing the document is to invalidate its cache so that it gets rendered properly in other documents possibly referencing it.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
606
diff
changeset
|
70 | PROPERTY (public, bool, Hidden, BOOL_OPS, STOCK_WRITE) |
353e418f161a
- corrected relationships between documents: opening a main file with the same name as another document is to overload it and editing the document is to invalidate its cache so that it gets rendered properly in other documents possibly referencing it.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
606
diff
changeset
|
71 | PROPERTY (public, bool, Selected, BOOL_OPS, STOCK_WRITE) |
353e418f161a
- corrected relationships between documents: opening a main file with the same name as another document is to overload it and editing the document is to invalidate its cache so that it gets rendered properly in other documents possibly referencing it.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
606
diff
changeset
|
72 | PROPERTY (public, LDObject*, Parent, NO_OPS, STOCK_WRITE) |
353e418f161a
- corrected relationships between documents: opening a main file with the same name as another document is to overload it and editing the document is to invalidate its cache so that it gets rendered properly in other documents possibly referencing it.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
606
diff
changeset
|
73 | PROPERTY (public, LDDocument*, File, NO_OPS, STOCK_WRITE) // TODO: rename~ |
609
a8dc74a809c6
- removed the File class in favor of QFile
Santeri Piippo <crimsondusk64@gmail.com>
parents:
607
diff
changeset
|
74 | PROPERTY (private, int, ID, NUM_OPS, STOCK_WRITE) |
a8dc74a809c6
- removed the File class in favor of QFile
Santeri Piippo <crimsondusk64@gmail.com>
parents:
607
diff
changeset
|
75 | PROPERTY (public, int, Color, NUM_OPS, CUSTOM_WRITE) |
607
353e418f161a
- corrected relationships between documents: opening a main file with the same name as another document is to overload it and editing the document is to invalidate its cache so that it gets rendered properly in other documents possibly referencing it.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
606
diff
changeset
|
76 | PROPERTY (public, bool, GLInit, BOOL_OPS, STOCK_WRITE) |
376 | 77 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
78 | public: |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
79 | // Object type codes. Codes are sorted in order of significance. |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
80 | enum Type |
603 | 81 | { |
604 | 82 | ESubfile, // Object represents a sub-file reference |
83 | EQuad, // Object represents a quadrilateral | |
84 | ETriangle, // Object represents a triangle | |
85 | ELine, // Object represents a line | |
86 | ECondLine, // Object represents a conditional line | |
87 | EVertex, // Object is a vertex, LDForge extension object | |
88 | EBFC, // Object represents a BFC statement | |
89 | EOverlay, // Object contains meta-info about an overlay image. | |
90 | EComment, // Object represents a comment | |
91 | EError, // Object is the result of failed parsing | |
92 | EEmpty, // Object represents an empty line | |
93 | EUnidentified, // Object is an uninitialized (SHOULD NEVER HAPPEN) | |
94 | ENumTypes // Amount of object types | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
95 | }; |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
96 | |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
97 | LDObject(); |
560
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
98 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
99 | // Makes a copy of this object |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
100 | LDObject* createCopy() const; |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
101 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
102 | // Deletes this object |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
103 | void deleteSelf(); |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
104 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
105 | // Index (i.e. line number) of this object |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
106 | long getIndex() const; |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
107 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
108 | // Type enumerator of this object |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
109 | virtual LDObject::Type getType() const; |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
110 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
111 | // Get a vertex by index |
604 | 112 | const Vertex& getVertex (int i) const; |
560
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
113 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
114 | // Type name of this object |
606
3dd6f343ec06
- removed the 'str' typedef, use QString directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
604
diff
changeset
|
115 | virtual QString getTypeName() const; |
560
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
116 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
117 | // Does this object have a matrix and position? (see LDMatrixObject) |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
118 | virtual bool hasMatrix() const; |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
119 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
120 | // Inverts this object (winding is reversed) |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
121 | virtual void invert(); |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
122 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
123 | // Is this object colored? |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
124 | virtual bool isColored() const; |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
125 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
126 | // Does this object have meaning in the part model? |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
127 | virtual bool isScemantic() const; |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
128 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
129 | // Moves this object using the given vertex as a movement List |
604 | 130 | void move (Vertex vect); |
560
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
131 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
132 | // Object after this in the current file |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
133 | LDObject* next() const; |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
134 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
135 | // Object prior to this in the current file |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
136 | LDObject* prev() const; |
376 | 137 | |
560
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
138 | // This object as LDraw code |
606
3dd6f343ec06
- removed the 'str' typedef, use QString directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
604
diff
changeset
|
139 | virtual QString raw() const = 0; |
560
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
140 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
141 | // Replace this LDObject with another LDObject. Object is deleted in the process. |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
142 | void replace (LDObject* other); |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
143 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
144 | // Selects this object. |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
145 | void select(); |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
146 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
147 | // Set a vertex to the given value |
604 | 148 | void setVertex (int i, const Vertex& vert); |
560
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
149 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
150 | // Set a single coordinate of a vertex |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
151 | void setVertexCoord (int i, Axis ax, double value); |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
152 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
153 | // Swap this object with another. |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
154 | void swap (LDObject* other); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
155 | |
560
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
156 | // What object in the current file ultimately references this? |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
157 | LDObject* topLevelParent(); |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
158 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
159 | // Removes this object from selection // TODO: rename to deselect? |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
160 | void unselect(); |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
161 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
162 | // Number of vertices this object has // TODO: rename to getNumVertices |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
163 | virtual int vertices() const; |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
164 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
165 | // Get type name by enumerator |
606
3dd6f343ec06
- removed the 'str' typedef, use QString directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
604
diff
changeset
|
166 | static QString typeName (LDObject::Type type); |
560
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
167 | |
604 | 168 | // Returns a default-constructed LDObject by the given type |
560
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
169 | static LDObject* getDefault (const LDObject::Type type); |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
170 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
171 | // TODO: move this to LDDocument? |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
172 | static void moveObjects (QList<LDObject*> objs, const bool up); |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
173 | |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
174 | // Get a description of a list of LDObjects |
606
3dd6f343ec06
- removed the 'str' typedef, use QString directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
604
diff
changeset
|
175 | static QString describeObjects (const QList<LDObject*>& objs); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
176 | static LDObject* fromID (int id); |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
177 | |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
178 | // TODO: make these private! |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
179 | // OpenGL list for this object |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
180 | uint glLists[4]; |
376 | 181 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
182 | // Object list entry for this object |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
183 | QListWidgetItem* qObjListEntry; |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
184 | |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
185 | protected: |
560
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
186 | // LDObjects are to be deleted with the deleteSelf() method, not with |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
187 | // operator delete. This is because it seems virtual functions cannot |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
188 | // be properly called from the destructor, thus a normal method must |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
189 | // be used instead. The destructor also doesn't seem to be able to |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
190 | // be private without causing a truckload of problems so it's protected |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
191 | // instead. |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
192 | virtual ~LDObject(); |
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
193 | void chooseID(); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
194 | |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
195 | private: |
560
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
196 | virtual LDObject* clone() = 0; |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
197 | LDSharedVertex* m_coords[4]; |
516
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
198 | }; |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
199 | |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
200 | // ============================================================================= |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
201 | // LDSharedVertex |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
202 | // |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
203 | // For use as coordinates of LDObjects. Keeps count of references. |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
204 | // ----------------------------------------------------------------------------- |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
205 | class LDSharedVertex |
603 | 206 | { |
207 | public: | |
604 | 208 | inline const Vertex& data() const |
603 | 209 | { |
210 | return m_data; | |
516
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
211 | } |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
212 | |
604 | 213 | inline operator const Vertex&() const |
603 | 214 | { |
215 | return m_data; | |
516
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
216 | } |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
217 | |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
218 | void addRef (LDObject* a); |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
219 | void delRef (LDObject* a); |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
220 | |
604 | 221 | static LDSharedVertex* getSharedVertex (const Vertex& a); |
516
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
222 | |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
223 | protected: |
604 | 224 | LDSharedVertex (const Vertex& a) : m_data (a) {} |
516
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
225 | |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
226 | private: |
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
227 | QList<LDObject*> m_refs; |
604 | 228 | Vertex m_data; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
229 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
230 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
231 | // ============================================================================= |
376 | 232 | // LDMatrixObject |
233 | // ============================================================================= | |
234 | // | |
235 | // Common code for objects with matrices. This class is multiple-derived in | |
236 | // and thus not used directly other than as a common storage point for matrices | |
237 | // and vertices. | |
238 | // | |
239 | // The link pointer is a pointer to this object's LDObject self - since this is | |
240 | // multiple-derived in, static_cast or dynamic_cast won't budge here. | |
241 | // | |
242 | // In 0.1-alpha, there was a separate 'radial' type which had a position and | |
243 | // matrix as well. Even though right now only LDSubfile uses this, I'm keeping | |
244 | // this class distinct in case I get new extension ideas. :) | |
245 | // ============================================================================= | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
246 | class LDMatrixObject |
603 | 247 | { |
248 | PROPERTY (public, LDObject*, LinkPointer, NO_OPS, STOCK_WRITE) | |
604 | 249 | PROPERTY (public, Matrix, Transform, NO_OPS, CUSTOM_WRITE) |
376 | 250 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
251 | public: |
555
5bf1f8dd901d
- fixed: LDMatrixObject's position would be an invalid pointer if it was created with the default constructor, causing a crash
Santeri Piippo <crimsondusk64@gmail.com>
parents:
554
diff
changeset
|
252 | LDMatrixObject() : |
556
5f4395ec5db0
- LDObject::move is no longer virtual
Santeri Piippo <crimsondusk64@gmail.com>
parents:
555
diff
changeset
|
253 | m_Position (LDSharedVertex::getSharedVertex (g_origin)) {} |
555
5bf1f8dd901d
- fixed: LDMatrixObject's position would be an invalid pointer if it was created with the default constructor, causing a crash
Santeri Piippo <crimsondusk64@gmail.com>
parents:
554
diff
changeset
|
254 | |
604 | 255 | LDMatrixObject (const Matrix& transform, const Vertex& pos) : |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
256 | m_Transform (transform), |
542
46a33bdc0b36
- Improved coordinate rounding, replaced the hack with a proper implementation, now rounds properly and works on subfiles as well
Santeri Piippo <crimsondusk64@gmail.com>
parents:
541
diff
changeset
|
257 | m_Position (LDSharedVertex::getSharedVertex (pos)) {} |
516
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
258 | |
604 | 259 | inline const Vertex& getPosition() const |
603 | 260 | { |
261 | return m_Position->data(); | |
542
46a33bdc0b36
- Improved coordinate rounding, replaced the hack with a proper implementation, now rounds properly and works on subfiles as well
Santeri Piippo <crimsondusk64@gmail.com>
parents:
541
diff
changeset
|
262 | } |
46a33bdc0b36
- Improved coordinate rounding, replaced the hack with a proper implementation, now rounds properly and works on subfiles as well
Santeri Piippo <crimsondusk64@gmail.com>
parents:
541
diff
changeset
|
263 | |
46a33bdc0b36
- Improved coordinate rounding, replaced the hack with a proper implementation, now rounds properly and works on subfiles as well
Santeri Piippo <crimsondusk64@gmail.com>
parents:
541
diff
changeset
|
264 | void setCoordinate (const Axis ax, double value) |
603 | 265 | { |
604 | 266 | Vertex v = getPosition(); |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
267 | v[ax] = value; |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
268 | setPosition (v); |
539
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
269 | } |
72ad83a67165
- upgraded the PROPERTY macro, resulting in a major code refactor
Santeri Piippo <crimsondusk64@gmail.com>
parents:
538
diff
changeset
|
270 | |
604 | 271 | void setPosition (const Vertex& a); |
542
46a33bdc0b36
- Improved coordinate rounding, replaced the hack with a proper implementation, now rounds properly and works on subfiles as well
Santeri Piippo <crimsondusk64@gmail.com>
parents:
541
diff
changeset
|
272 | |
516
d3373bc7ca3b
- added LDSharedVertex class for holding copy-on-write vertices. Will need this for future features..
Santeri Piippo <crimsondusk64@gmail.com>
parents:
506
diff
changeset
|
273 | private: |
542
46a33bdc0b36
- Improved coordinate rounding, replaced the hack with a proper implementation, now rounds properly and works on subfiles as well
Santeri Piippo <crimsondusk64@gmail.com>
parents:
541
diff
changeset
|
274 | LDSharedVertex* m_Position; |
376 | 275 | }; |
276 | ||
277 | // ============================================================================= | |
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
278 | // LDError |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
279 | // |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
280 | // Represents a line in the LDraw file that could not be properly parsed. It is |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
281 | // represented by a (!) ERROR in the code view. It exists for the purpose of |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
282 | // allowing garbage lines be debugged and corrected within LDForge. The member |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
283 | // zContent contains the contents of the unparsable line. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
284 | // ============================================================================= |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
285 | class LDError : public LDObject |
603 | 286 | { |
287 | LDOBJ (Error) | |
376 | 288 | LDOBJ_NAME (error) |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
289 | LDOBJ_VERTICES (0) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
290 | LDOBJ_UNCOLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
291 | LDOBJ_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
292 | LDOBJ_NO_MATRIX |
606
3dd6f343ec06
- removed the 'str' typedef, use QString directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
604
diff
changeset
|
293 | PROPERTY (public, QString, FileReferenced, STR_OPS, STOCK_WRITE) |
376 | 294 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
295 | public: |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
296 | LDError(); |
606
3dd6f343ec06
- removed the 'str' typedef, use QString directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
604
diff
changeset
|
297 | LDError (QString contents, QString reason) : contents (contents), reason (reason) {} |
376 | 298 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
299 | // Content of this unknown line |
606
3dd6f343ec06
- removed the 'str' typedef, use QString directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
604
diff
changeset
|
300 | QString contents; |
376 | 301 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
302 | // Why is this gibberish? |
606
3dd6f343ec06
- removed the 'str' typedef, use QString directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
604
diff
changeset
|
303 | QString reason; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
304 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
305 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
306 | // ============================================================================= |
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
307 | // LDEmpty |
376 | 308 | // |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
309 | // Represents an empty line in the LDraw code file. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
310 | // ============================================================================= |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
311 | class LDEmpty : public LDObject |
603 | 312 | { |
313 | LDOBJ (Empty) | |
558
5f6e30e0450c
- LDEmpty now overrides getTypeName properly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
556
diff
changeset
|
314 | LDOBJ_NAME (empty) |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
315 | LDOBJ_VERTICES (0) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
316 | LDOBJ_UNCOLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
317 | LDOBJ_NON_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
318 | LDOBJ_NO_MATRIX |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
319 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
320 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
321 | // ============================================================================= |
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
322 | // LDComment |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
323 | // |
376 | 324 | // Represents a code-0 comment in the LDraw code file. Member text contains |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
325 | // the text of the comment. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
326 | // ============================================================================= |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
327 | class LDComment : public LDObject |
603 | 328 | { |
329 | LDOBJ (Comment) | |
376 | 330 | LDOBJ_NAME (comment) |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
331 | LDOBJ_VERTICES (0) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
332 | LDOBJ_UNCOLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
333 | LDOBJ_NON_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
334 | LDOBJ_NO_MATRIX |
376 | 335 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
336 | public: |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
337 | LDComment() {} |
606
3dd6f343ec06
- removed the 'str' typedef, use QString directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
604
diff
changeset
|
338 | LDComment (QString text) : text (text) {} |
376 | 339 | |
606
3dd6f343ec06
- removed the 'str' typedef, use QString directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
604
diff
changeset
|
340 | QString text; // The text of this comment |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
341 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
342 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
343 | // ============================================================================= |
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
344 | // LDBFC |
376 | 345 | // |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
346 | // Represents a 0 BFC statement in the LDraw code. eStatement contains the type |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
347 | // of this statement. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
348 | // ============================================================================= |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
349 | class LDBFC : public LDObject |
603 | 350 | { |
351 | public: | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
352 | enum Type |
603 | 353 | { |
354 | CertifyCCW, | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
355 | CCW, |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
356 | CertifyCW, |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
357 | CW, |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
358 | NoCertify, |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
359 | InvertNext, |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
360 | Clip, |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
361 | ClipCCW, |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
362 | ClipCW, |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
363 | NoClip, |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
364 | NumStatements |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
365 | }; |
376 | 366 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
367 | LDOBJ (BFC) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
368 | LDOBJ_NAME (bfc) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
369 | LDOBJ_VERTICES (0) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
370 | LDOBJ_UNCOLORED |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
371 | LDOBJ_CUSTOM_SCEMANTIC { return (type == InvertNext); } |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
372 | LDOBJ_NO_MATRIX |
376 | 373 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
374 | public: |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
375 | LDBFC() {} |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
376 | LDBFC (const LDBFC::Type type) : type (type) {} |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
377 | |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
378 | // Statement strings |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
379 | static const char* statements[]; |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
380 | |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
381 | Type type; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
382 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
383 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
384 | // ============================================================================= |
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
385 | // LDSubfile |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
386 | // |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
387 | // Represents a single code-1 subfile reference. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
388 | // ============================================================================= |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
389 | class LDSubfile : public LDObject, public LDMatrixObject |
603 | 390 | { |
391 | LDOBJ (Subfile) | |
376 | 392 | LDOBJ_NAME (subfile) |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
393 | LDOBJ_VERTICES (0) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
394 | LDOBJ_COLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
395 | LDOBJ_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
396 | LDOBJ_HAS_MATRIX |
583
4906c5c1670f
- documents are now refcounted. This should seriously stabilize (and speed up!) the pruning of unused files
Santeri Piippo <crimsondusk64@gmail.com>
parents:
564
diff
changeset
|
397 | PROPERTY (public, LDDocumentPointer, FileInfo, NO_OPS, STOCK_WRITE) |
376 | 398 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
399 | public: |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
400 | enum InlineFlag |
603 | 401 | { |
402 | DeepInline = (1 << 0), | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
403 | CacheInline = (1 << 1), |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
404 | RendererInline = (1 << 2), |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
405 | |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
406 | DeepCacheInline = DeepInline | CacheInline, |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
407 | }; |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
408 | |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
409 | Q_DECLARE_FLAGS (InlineFlags, InlineFlag) |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
410 | |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
411 | LDSubfile() |
603 | 412 | { |
413 | setLinkPointer (this); | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
414 | } |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
415 | |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
416 | // Inlines this subfile. Note that return type is an array of heap-allocated |
560
39085791128f
- corrected history behavior. LDObject::clone() is now off-limits, createCopy() must be used instead. LDObject::deleteSelf() must be used to delete LDObjects (destructor is protected now)
Santeri Piippo <crimsondusk64@gmail.com>
parents:
558
diff
changeset
|
417 | // LDObject copies, they must be deleted manually. |
504
6a1fa662bfc1
Removed the List -> QList alias, use QList directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
493
diff
changeset
|
418 | QList<LDObject*> inlineContents (InlineFlags flags); |
564
79b23e02dcf1
- implicit documents are now auto-closed when rendered unused, in general, a LOT better document closing behavior
Santeri Piippo <crimsondusk64@gmail.com>
parents:
560
diff
changeset
|
419 | |
79b23e02dcf1
- implicit documents are now auto-closed when rendered unused, in general, a LOT better document closing behavior
Santeri Piippo <crimsondusk64@gmail.com>
parents:
560
diff
changeset
|
420 | protected: |
79b23e02dcf1
- implicit documents are now auto-closed when rendered unused, in general, a LOT better document closing behavior
Santeri Piippo <crimsondusk64@gmail.com>
parents:
560
diff
changeset
|
421 | ~LDSubfile(); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
422 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
423 | |
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
424 | Q_DECLARE_OPERATORS_FOR_FLAGS (LDSubfile::InlineFlags) |
459
51cca3ce540d
Use QFlags for the inlining flags, type-safety++
Santeri Piippo <crimsondusk64@gmail.com>
parents:
458
diff
changeset
|
425 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
426 | // ============================================================================= |
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
427 | // LDLine |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
428 | // |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
429 | // Represents a single code-2 line in the LDraw code file. v0 and v1 are the end |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
430 | // points of the line. The line is colored with dColor unless uncolored mode is |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
431 | // set. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
432 | // ============================================================================= |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
433 | class LDLine : public LDObject |
603 | 434 | { |
435 | LDOBJ (Line) | |
376 | 436 | LDOBJ_NAME (line) |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
437 | LDOBJ_VERTICES (2) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
438 | LDOBJ_COLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
439 | LDOBJ_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
440 | LDOBJ_NO_MATRIX |
376 | 441 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
442 | public: |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
443 | LDLine() {} |
604 | 444 | LDLine (Vertex v1, Vertex v2); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
445 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
446 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
447 | // ============================================================================= |
551
0efe5dbcef07
renamed LDCndLine to LDCondLine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
542
diff
changeset
|
448 | // LDCondLine |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
449 | // |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
450 | // Represents a single code-5 conditional line. The end-points v0 and v1 are |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
451 | // inherited from LDLine, c0 and c1 are the control points of this line. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
452 | // ============================================================================= |
551
0efe5dbcef07
renamed LDCndLine to LDCondLine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
542
diff
changeset
|
453 | class LDCondLine : public LDLine |
603 | 454 | { |
455 | LDOBJ (CondLine) | |
376 | 456 | LDOBJ_NAME (condline) |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
457 | LDOBJ_VERTICES (4) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
458 | LDOBJ_COLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
459 | LDOBJ_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
460 | LDOBJ_NO_MATRIX |
376 | 461 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
462 | public: |
551
0efe5dbcef07
renamed LDCndLine to LDCondLine
Santeri Piippo <crimsondusk64@gmail.com>
parents:
542
diff
changeset
|
463 | LDCondLine() {} |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
464 | LDLine* demote(); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
465 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
466 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
467 | // ============================================================================= |
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
468 | // LDTriangle |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
469 | // |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
470 | // Represents a single code-3 triangle in the LDraw code file. Vertices v0, v1 |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
471 | // and v2 contain the end-points of this triangle. dColor is the color the |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
472 | // triangle is colored with. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
473 | // ============================================================================= |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
474 | class LDTriangle : public LDObject |
603 | 475 | { |
476 | LDOBJ (Triangle) | |
376 | 477 | LDOBJ_NAME (triangle) |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
478 | LDOBJ_VERTICES (3) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
479 | LDOBJ_COLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
480 | LDOBJ_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
481 | LDOBJ_NO_MATRIX |
376 | 482 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
483 | public: |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
484 | LDTriangle() {} |
604 | 485 | LDTriangle (Vertex v0, Vertex v1, Vertex v2) |
603 | 486 | { |
487 | setVertex (0, v0); | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
488 | setVertex (1, v1); |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
489 | setVertex (2, v2); |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
490 | } |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
491 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
492 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
493 | // ============================================================================= |
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
494 | // LDQuad |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
495 | // |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
496 | // Represents a single code-4 quadrilateral. v0, v1, v2 and v3 are the end points |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
497 | // of the quad, dColor is the color used for the quad. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
498 | // ============================================================================= |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
499 | class LDQuad : public LDObject |
603 | 500 | { |
501 | LDOBJ (Quad) | |
376 | 502 | LDOBJ_NAME (quad) |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
503 | LDOBJ_VERTICES (4) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
504 | LDOBJ_COLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
505 | LDOBJ_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
506 | LDOBJ_NO_MATRIX |
376 | 507 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
508 | public: |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
509 | LDQuad() {} |
604 | 510 | LDQuad (const Vertex& v0, const Vertex& v1, const Vertex& v2, const Vertex& v3); |
376 | 511 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
512 | // Split this quad into two triangles (note: heap-allocated) |
504
6a1fa662bfc1
Removed the List -> QList alias, use QList directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
493
diff
changeset
|
513 | QList<LDTriangle*> splitToTriangles(); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
514 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
515 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
516 | // ============================================================================= |
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
517 | // LDVertex |
376 | 518 | // |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
519 | // The vertex is an LDForce-specific extension which represents a single |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
520 | // vertex which can be used as a parameter to tools or to store coordinates |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
521 | // with. Vertices are a part authoring tool and they should not appear in |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
522 | // finished parts. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
523 | // ============================================================================= |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
524 | class LDVertex : public LDObject |
603 | 525 | { |
526 | LDOBJ (Vertex) | |
376 | 527 | LDOBJ_NAME (vertex) |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
528 | LDOBJ_VERTICES (0) // TODO: move pos to vaCoords[0] |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
529 | LDOBJ_COLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
530 | LDOBJ_NON_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
531 | LDOBJ_NO_MATRIX |
376 | 532 | |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
533 | public: |
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
534 | LDVertex() {} |
376 | 535 | |
604 | 536 | Vertex pos; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
537 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
538 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
539 | // ============================================================================= |
460
b230ae09c8e5
Cut the Object-suffix from LDObject types, it doesn't help things at all
Santeri Piippo <crimsondusk64@gmail.com>
parents:
459
diff
changeset
|
540 | // LDOverlay |
376 | 541 | // |
316
b4fefda58f43
Made overlay data be contained in the part files, still wip
Santeri Piippo <crimsondusk64@gmail.com>
parents:
312
diff
changeset
|
542 | // Overlay image meta, stored in the header of parts so as to preserve overlay |
b4fefda58f43
Made overlay data be contained in the part files, still wip
Santeri Piippo <crimsondusk64@gmail.com>
parents:
312
diff
changeset
|
543 | // information. |
b4fefda58f43
Made overlay data be contained in the part files, still wip
Santeri Piippo <crimsondusk64@gmail.com>
parents:
312
diff
changeset
|
544 | // ============================================================================= |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
545 | class LDOverlay : public LDObject |
603 | 546 | { |
547 | LDOBJ (Overlay) | |
376 | 548 | LDOBJ_NAME (overlay) |
549 | LDOBJ_VERTICES (0) | |
316
b4fefda58f43
Made overlay data be contained in the part files, still wip
Santeri Piippo <crimsondusk64@gmail.com>
parents:
312
diff
changeset
|
550 | LDOBJ_UNCOLORED |
b4fefda58f43
Made overlay data be contained in the part files, still wip
Santeri Piippo <crimsondusk64@gmail.com>
parents:
312
diff
changeset
|
551 | LDOBJ_NON_SCEMANTIC |
b4fefda58f43
Made overlay data be contained in the part files, still wip
Santeri Piippo <crimsondusk64@gmail.com>
parents:
312
diff
changeset
|
552 | LDOBJ_NO_MATRIX |
540
0334789cb4d7
- Changed the callback parm of PROPERTY to a stock/custom write method argument.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
539
diff
changeset
|
553 | PROPERTY (public, int, Camera, NUM_OPS, STOCK_WRITE) |
0334789cb4d7
- Changed the callback parm of PROPERTY to a stock/custom write method argument.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
539
diff
changeset
|
554 | PROPERTY (public, int, X, NUM_OPS, STOCK_WRITE) |
0334789cb4d7
- Changed the callback parm of PROPERTY to a stock/custom write method argument.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
539
diff
changeset
|
555 | PROPERTY (public, int, Y, NUM_OPS, STOCK_WRITE) |
0334789cb4d7
- Changed the callback parm of PROPERTY to a stock/custom write method argument.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
539
diff
changeset
|
556 | PROPERTY (public, int, Width, NUM_OPS, STOCK_WRITE) |
0334789cb4d7
- Changed the callback parm of PROPERTY to a stock/custom write method argument.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
539
diff
changeset
|
557 | PROPERTY (public, int, Height, NUM_OPS, STOCK_WRITE) |
606
3dd6f343ec06
- removed the 'str' typedef, use QString directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
604
diff
changeset
|
558 | PROPERTY (public, QString, FileName, STR_OPS, STOCK_WRITE) |
316
b4fefda58f43
Made overlay data be contained in the part files, still wip
Santeri Piippo <crimsondusk64@gmail.com>
parents:
312
diff
changeset
|
559 | }; |
b4fefda58f43
Made overlay data be contained in the part files, still wip
Santeri Piippo <crimsondusk64@gmail.com>
parents:
312
diff
changeset
|
560 | |
381
241f65769a57
restructure; removed g_BBox
Santeri Piippo <crimsondusk64@gmail.com>
parents:
377
diff
changeset
|
561 | // Other common LDraw stuff |
606
3dd6f343ec06
- removed the 'str' typedef, use QString directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
604
diff
changeset
|
562 | static const QString CALicense = "!LICENSE Redistributable under CCAL version 2.0 : see CAreadme.txt", |
493
16766ac1bbd9
last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents:
460
diff
changeset
|
563 | NonCALicense = "!LICENSE Not redistributable : see NonCAreadme.txt"; |
538
2f85d4d286e5
- ensured header files' guards start with LDFORGE_
Santeri Piippo <crimsondusk64@gmail.com>
parents:
522
diff
changeset
|
564 | static const int lores = 16; |
2f85d4d286e5
- ensured header files' guards start with LDFORGE_
Santeri Piippo <crimsondusk64@gmail.com>
parents:
522
diff
changeset
|
565 | static const int hires = 48; |
381
241f65769a57
restructure; removed g_BBox
Santeri Piippo <crimsondusk64@gmail.com>
parents:
377
diff
changeset
|
566 | |
606
3dd6f343ec06
- removed the 'str' typedef, use QString directly
Santeri Piippo <crimsondusk64@gmail.com>
parents:
604
diff
changeset
|
567 | QString getLicenseText (int id); |
554
2478a6b3106d
- Reworked primitive listing. No longer uses multi-threading.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
553
diff
changeset
|
568 | |
538
2f85d4d286e5
- ensured header files' guards start with LDFORGE_
Santeri Piippo <crimsondusk64@gmail.com>
parents:
522
diff
changeset
|
569 | #endif // LDFORGE_LDTYPES_H |