Thu, 27 Jun 2013 14:55:32 +0300
Use unique IDs instead of file indices in picking lists, this is much less prone to error
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 |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
3 | * Copyright (C) 2013 Santeri Piippo |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
4 | * |
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. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
9 | * |
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. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
14 | * |
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 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
19 | #ifndef LDTYPES_H |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
20 | #define LDTYPES_H |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
21 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
22 | #include "common.h" |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
23 | #include "types.h" |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
24 | |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
25 | #define LDOBJ(T) \ |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
26 | virtual ~LD##T () {} \ |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
27 | virtual LDObject::Type getType () const { \ |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
28 | return LDObject::T; \ |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
29 | } \ |
270
f5f2353af0d9
fixed: subfiles and radials couldn't be moved, made add-picking with control work again despite its double-use as range picking, changed 'Name' to 'Title' in new part dialog and widened it a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
269
diff
changeset
|
30 | virtual str raw (); \ |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
31 | virtual LD##T* clone () { \ |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
32 | return new LD##T (*this); \ |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
33 | } \ |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
34 | virtual void move (vertex vVector); \ |
265
955c0aabfebf
Purged out the old history code
Santeri Piippo <crimsondusk64@gmail.com>
parents:
251
diff
changeset
|
35 | virtual void invert (); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
36 | |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
37 | #define LDOBJ_VERTICES(V) virtual short vertices () const { return V; } |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
38 | #define LDOBJ_SETCOLORED(V) virtual bool isColored () const { return V; } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
39 | #define LDOBJ_COLORED LDOBJ_SETCOLORED (true) |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
40 | #define LDOBJ_UNCOLORED LDOBJ_SETCOLORED (false) |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
41 | |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
42 | #define LDOBJ_CUSTOM_SCEMANTIC virtual bool isScemantic () const |
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
43 | #define LDOBJ_SCEMANTIC LDOBJ_CUSTOM_SCEMANTIC { return true; } |
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
44 | #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
|
45 | |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
46 | #define LDOBJ_SETMATRIX(V) virtual bool hasMatrix () const { return V; } |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
47 | #define LDOBJ_HAS_MATRIX LDOBJ_SETMATRIX (true) |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
48 | #define LDOBJ_NO_MATRIX LDOBJ_SETMATRIX (false) |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
49 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
50 | class QListWidgetItem; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
51 | class LDSubfile; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
52 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
53 | // ============================================================================= |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
54 | // LDMatrixObject |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
55 | // |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
56 | // Common code for objects with matrices |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
57 | // ============================================================================= |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
58 | class LDMatrixObject { |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
59 | DECLARE_PROPERTY (matrix, transform, setTransform) |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
60 | DECLARE_PROPERTY (vertex, position, setPosition) |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
61 | PROPERTY (LDObject*, linkPointer, setLinkPointer) |
268
778eed342ee4
Make LDMatrixObject's transform and pos members properties
Santeri Piippo <crimsondusk64@gmail.com>
parents:
267
diff
changeset
|
62 | |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
63 | public: |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
64 | LDMatrixObject () {} |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
65 | LDMatrixObject (const matrix& transform, const vertex& pos) : |
268
778eed342ee4
Make LDMatrixObject's transform and pos members properties
Santeri Piippo <crimsondusk64@gmail.com>
parents:
267
diff
changeset
|
66 | PROP_NAME (transform) (transform), PROP_NAME (position) (pos) {} |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
67 | |
268
778eed342ee4
Make LDMatrixObject's transform and pos members properties
Santeri Piippo <crimsondusk64@gmail.com>
parents:
267
diff
changeset
|
68 | const double& setCoordinate (const Axis ax, double value) { |
778eed342ee4
Make LDMatrixObject's transform and pos members properties
Santeri Piippo <crimsondusk64@gmail.com>
parents:
267
diff
changeset
|
69 | vertex v = position (); |
778eed342ee4
Make LDMatrixObject's transform and pos members properties
Santeri Piippo <crimsondusk64@gmail.com>
parents:
267
diff
changeset
|
70 | v[ax] = value; |
778eed342ee4
Make LDMatrixObject's transform and pos members properties
Santeri Piippo <crimsondusk64@gmail.com>
parents:
267
diff
changeset
|
71 | setPosition (v); |
778eed342ee4
Make LDMatrixObject's transform and pos members properties
Santeri Piippo <crimsondusk64@gmail.com>
parents:
267
diff
changeset
|
72 | |
778eed342ee4
Make LDMatrixObject's transform and pos members properties
Santeri Piippo <crimsondusk64@gmail.com>
parents:
267
diff
changeset
|
73 | return position ()[ax]; |
778eed342ee4
Make LDMatrixObject's transform and pos members properties
Santeri Piippo <crimsondusk64@gmail.com>
parents:
267
diff
changeset
|
74 | } |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
75 | }; |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
76 | |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
77 | // ============================================================================= |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
78 | // LDObject |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
79 | // |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
80 | // Base class object for all LD* types. Each LDObject represents a single line |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
81 | // 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
|
82 | // 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
|
83 | // 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
|
84 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
85 | class LDObject { |
223
4f95d7f2e9ef
Added PROPERTY macro for easier exposed member variable management
Santeri Piippo <crimsondusk64@gmail.com>
parents:
216
diff
changeset
|
86 | PROPERTY (bool, hidden, setHidden) |
4f95d7f2e9ef
Added PROPERTY macro for easier exposed member variable management
Santeri Piippo <crimsondusk64@gmail.com>
parents:
216
diff
changeset
|
87 | PROPERTY (bool, selected, setSelected) |
266
12e7302f14e9
Make LDObject's color and parent properties with accessors
Santeri Piippo <crimsondusk64@gmail.com>
parents:
265
diff
changeset
|
88 | PROPERTY (LDObject*, parent, setParent) |
306
fef00a6cbff0
minor improvements to primitive handling
Santeri Piippo <crimsondusk64@gmail.com>
parents:
276
diff
changeset
|
89 | READ_PROPERTY (int, id, setID) |
275
7b5afec27688
Color changing is now logged into history
Santeri Piippo <crimsondusk64@gmail.com>
parents:
270
diff
changeset
|
90 | DECLARE_PROPERTY (short, color, setColor) |
223
4f95d7f2e9ef
Added PROPERTY macro for easier exposed member variable management
Santeri Piippo <crimsondusk64@gmail.com>
parents:
216
diff
changeset
|
91 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
92 | public: |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
93 | // Object type codes. Codes are sorted in order of significance. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
94 | enum Type { |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
95 | Subfile, // Object represents a sub-file reference |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
96 | Radial, // Object represents a generic radial |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
97 | Quad, // Object represents a quadrilateral |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
98 | Triangle, // Object represents a triangle |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
99 | Line, // Object represents a line |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
100 | CondLine, // Object represents a conditional line |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
101 | Vertex, // Object is a vertex, LDForge extension object |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
102 | BFC, // Object represents a BFC statement |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
103 | Comment, // Object represents a comment |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
104 | Gibberish, // Object is the result of failed parsing |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
105 | Empty, // Object represents an empty line |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
106 | Unidentified, // Object is an uninitialized (SHOULD NEVER HAPPEN) |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
107 | NumTypes // Amount of object types |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
108 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
109 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
110 | LDObject (); |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
111 | virtual ~LDObject (); |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
112 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
113 | // Index (i.e. line number) of this object |
232
4e44c92e21dd
Renamed the OpenFile class to LDOpenFile as MinGW doesn't appear to like the former name
Santeri Piippo <crimsondusk64@gmail.com>
parents:
223
diff
changeset
|
114 | long getIndex (LDOpenFile* pFile) const; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
115 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
116 | // OpenGL list for this object |
191
9bb6a17305ad
Readded BFC red-green view, although determining inversion isn't always correct and it cannot handle CW-certified files...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
188
diff
changeset
|
117 | uint glLists[4]; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
118 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
119 | // Type enumerator of this object |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
120 | virtual LDObject::Type getType () const { |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
121 | return LDObject::Unidentified; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
122 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
123 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
124 | // A string that represents this line |
270
f5f2353af0d9
fixed: subfiles and radials couldn't be moved, made add-picking with control work again despite its double-use as range picking, changed 'Name' to 'Title' in new part dialog and widened it a bit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
269
diff
changeset
|
125 | virtual str raw () { |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
126 | return ""; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
127 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
128 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
129 | // Creates a new LDObject identical to this one and returns a pointer to it. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
130 | virtual LDObject* clone () { |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
131 | return new LDObject (*this); |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
132 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
133 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
134 | // Replace this LDObject with another LDObject. This method deletes the |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
135 | // object and any pointers to it become invalid. |
223
4f95d7f2e9ef
Added PROPERTY macro for easier exposed member variable management
Santeri Piippo <crimsondusk64@gmail.com>
parents:
216
diff
changeset
|
136 | void replace (LDObject* replacement); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
137 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
138 | // Swap this object with another. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
139 | void swap (LDObject* other); |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
140 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
141 | // Moves this object using the given vertex as a movement vector |
188
4e686b771996
Further removal of hungarian notation
Santeri Piippo <crimsondusk64@gmail.com>
parents:
185
diff
changeset
|
142 | virtual void move (vertex vect); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
143 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
144 | // What object in the current file ultimately references this? |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
145 | LDObject* topLevelParent (); |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
146 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
147 | // Number of vertices this object has |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
148 | virtual short vertices () const { return 0; } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
149 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
150 | // Is this object colored? |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
151 | virtual bool isColored () const { return false; } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
152 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
153 | // Does this object have meaning in the part model? |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
154 | virtual bool isScemantic () const { return false; } |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
155 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
156 | // Returns a sample object by the given value |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
157 | static LDObject* getDefault (const LDObject::Type type); |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
158 | |
251
c4b96bc41298
Made a vector class which wraps around std::vector... finally I have an operator<< for the thing.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
232
diff
changeset
|
159 | static void moveObjects (vector<LDObject*> objs, const bool bUp); |
c4b96bc41298
Made a vector class which wraps around std::vector... finally I have an operator<< for the thing.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
232
diff
changeset
|
160 | static str objectListContents (const vector<LDObject*>& objs); |
307
c731a22899a3
Use unique IDs instead of file indices in picking lists, this is much less prone to error
Santeri Piippo <crimsondusk64@gmail.com>
parents:
306
diff
changeset
|
161 | static LDObject* fromID( int id ); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
162 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
163 | // Object list entry for this object |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
164 | QListWidgetItem* qObjListEntry; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
165 | |
265
955c0aabfebf
Purged out the old history code
Santeri Piippo <crimsondusk64@gmail.com>
parents:
251
diff
changeset
|
166 | virtual bool hasMatrix () const { return false; } |
955c0aabfebf
Purged out the old history code
Santeri Piippo <crimsondusk64@gmail.com>
parents:
251
diff
changeset
|
167 | virtual void invert (); |
955c0aabfebf
Purged out the old history code
Santeri Piippo <crimsondusk64@gmail.com>
parents:
251
diff
changeset
|
168 | LDObject* next () const; |
955c0aabfebf
Purged out the old history code
Santeri Piippo <crimsondusk64@gmail.com>
parents:
251
diff
changeset
|
169 | LDObject* prev () const; |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
170 | void setVertex (int i, const vertex& vert); |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
171 | const vertex& getVertex (int i) const; |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
172 | void setVertexCoord (int i, const Axis ax, double value); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
173 | |
216
c8882ff62d61
Hopefully fixed the problem regarding objects not getting drawn at first
Santeri Piippo <crimsondusk64@gmail.com>
parents:
214
diff
changeset
|
174 | protected: |
c8882ff62d61
Hopefully fixed the problem regarding objects not getting drawn at first
Santeri Piippo <crimsondusk64@gmail.com>
parents:
214
diff
changeset
|
175 | bool m_glinit; |
c8882ff62d61
Hopefully fixed the problem regarding objects not getting drawn at first
Santeri Piippo <crimsondusk64@gmail.com>
parents:
214
diff
changeset
|
176 | friend class GLRenderer; |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
177 | |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
178 | private: |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
179 | vertex m_coords[4]; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
180 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
181 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
182 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
183 | // LDGibberish |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
184 | // |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
185 | // 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
|
186 | // 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
|
187 | // 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
|
188 | // 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
|
189 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
190 | class LDGibberish : public LDObject { |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
191 | public: |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
192 | LDOBJ (Gibberish) |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
193 | LDOBJ_VERTICES (0) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
194 | LDOBJ_UNCOLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
195 | LDOBJ_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
196 | LDOBJ_NO_MATRIX |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
197 | |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
198 | LDGibberish (); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
199 | LDGibberish (str _zContent, str _zReason); |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
200 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
201 | // Content of this unknown line |
188
4e686b771996
Further removal of hungarian notation
Santeri Piippo <crimsondusk64@gmail.com>
parents:
185
diff
changeset
|
202 | str contents; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
203 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
204 | // Why is this gibberish? |
188
4e686b771996
Further removal of hungarian notation
Santeri Piippo <crimsondusk64@gmail.com>
parents:
185
diff
changeset
|
205 | str reason; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
206 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
207 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
208 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
209 | // LDEmptyLine |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
210 | // |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
211 | // 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
|
212 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
213 | class LDEmpty : public LDObject { |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
214 | public: |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
215 | LDOBJ (Empty) |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
216 | LDOBJ_VERTICES (0) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
217 | LDOBJ_UNCOLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
218 | LDOBJ_NON_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
219 | LDOBJ_NO_MATRIX |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
220 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
221 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
222 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
223 | // LDComment |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
224 | // |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
225 | // Represents a code-0 comment in the LDraw code file. Member zText contains |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
226 | // 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
|
227 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
228 | class LDComment : public LDObject { |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
229 | public: |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
230 | LDOBJ (Comment) |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
231 | LDOBJ_VERTICES (0) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
232 | LDOBJ_UNCOLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
233 | LDOBJ_NON_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
234 | LDOBJ_NO_MATRIX |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
235 | |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
236 | LDComment () {} |
188
4e686b771996
Further removal of hungarian notation
Santeri Piippo <crimsondusk64@gmail.com>
parents:
185
diff
changeset
|
237 | LDComment (str text) : text (text) {} |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
238 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
239 | str text; // The text of this comment |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
240 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
241 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
242 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
243 | // LDBFC |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
244 | // |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
245 | // 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
|
246 | // of this statement. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
247 | // ============================================================================= |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
248 | class LDBFC : public LDObject { |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
249 | public: |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
250 | enum Type { CertifyCCW, CCW, CertifyCW, CW, NoCertify, InvertNext, NumStatements }; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
251 | |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
252 | LDOBJ (BFC) |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
253 | LDOBJ_VERTICES (0) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
254 | LDOBJ_UNCOLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
255 | LDOBJ_CUSTOM_SCEMANTIC { return (type == InvertNext); } |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
256 | LDOBJ_NO_MATRIX |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
257 | |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
258 | LDBFC () {} |
188
4e686b771996
Further removal of hungarian notation
Santeri Piippo <crimsondusk64@gmail.com>
parents:
185
diff
changeset
|
259 | LDBFC (const LDBFC::Type type) : type (type) {} |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
260 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
261 | // Statement strings |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
262 | static const char* statements[]; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
263 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
264 | Type type; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
265 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
266 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
267 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
268 | // LDSubfile |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
269 | // |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
270 | // 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
|
271 | // ============================================================================= |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
272 | class LDSubfile : public LDObject, public LDMatrixObject { |
269
2d71227f35cb
Refactor LDSubfile
Santeri Piippo <crimsondusk64@gmail.com>
parents:
268
diff
changeset
|
273 | PROPERTY (LDOpenFile*, fileInfo, setFileInfo) |
2d71227f35cb
Refactor LDSubfile
Santeri Piippo <crimsondusk64@gmail.com>
parents:
268
diff
changeset
|
274 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
275 | public: |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
276 | LDOBJ (Subfile) |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
277 | LDOBJ_VERTICES (0) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
278 | LDOBJ_COLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
279 | LDOBJ_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
280 | LDOBJ_HAS_MATRIX |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
281 | |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
282 | LDSubfile () { |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
283 | setLinkPointer (this); |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
284 | } |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
285 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
286 | // Inlines this subfile. Note that return type is an array of heap-allocated |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
287 | // LDObject-clones, they must be deleted one way or another. |
251
c4b96bc41298
Made a vector class which wraps around std::vector... finally I have an operator<< for the thing.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
232
diff
changeset
|
288 | vector<LDObject*> inlineContents (bool deep, bool cache); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
289 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
290 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
291 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
292 | // LDLine |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
293 | // |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
294 | // 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
|
295 | // 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
|
296 | // set. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
297 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
298 | class LDLine : public LDObject { |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
299 | public: |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
300 | LDOBJ (Line) |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
301 | LDOBJ_VERTICES (2) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
302 | LDOBJ_COLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
303 | LDOBJ_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
304 | LDOBJ_NO_MATRIX |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
305 | |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
306 | LDLine () {} |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
307 | LDLine (vertex v1, vertex v2); |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
308 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
309 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
310 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
311 | // LDCondLine |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
312 | // |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
313 | // 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
|
314 | // 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
|
315 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
316 | class LDCondLine : public LDLine { |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
317 | public: |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
318 | LDOBJ (CondLine) |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
319 | LDOBJ_VERTICES (4) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
320 | LDOBJ_COLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
321 | LDOBJ_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
322 | LDOBJ_NO_MATRIX |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
323 | |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
324 | LDCondLine () {} |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
325 | LDLine* demote (); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
326 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
327 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
328 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
329 | // LDTriangle |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
330 | // |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
331 | // 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
|
332 | // 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
|
333 | // triangle is colored with. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
334 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
335 | class LDTriangle : public LDObject { |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
336 | public: |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
337 | LDOBJ (Triangle) |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
338 | LDOBJ_VERTICES (3) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
339 | LDOBJ_COLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
340 | LDOBJ_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
341 | LDOBJ_NO_MATRIX |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
342 | |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
343 | LDTriangle () {} |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
344 | LDTriangle (vertex v0, vertex v1, vertex v2) { |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
345 | setVertex (0, v0); |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
346 | setVertex (1, v1); |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
347 | setVertex (2, v2); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
348 | } |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
349 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
350 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
351 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
352 | // LDQuad |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
353 | // |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
354 | // 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
|
355 | // 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
|
356 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
357 | class LDQuad : public LDObject { |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
358 | public: |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
359 | LDOBJ (Quad) |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
360 | LDOBJ_VERTICES (4) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
361 | LDOBJ_COLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
362 | LDOBJ_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
363 | LDOBJ_NO_MATRIX |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
364 | |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
365 | LDQuad () {} |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
366 | |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
367 | // Split this quad into two triangles (note: heap-allocated) |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
368 | vector<LDTriangle*> splitToTriangles (); |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
369 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
370 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
371 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
372 | // LDVertex |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
373 | // |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
374 | // 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
|
375 | // 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
|
376 | // 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
|
377 | // finished parts. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
378 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
379 | class LDVertex : public LDObject { |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
380 | public: |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
381 | LDOBJ (Vertex) |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
382 | 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
|
383 | LDOBJ_COLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
384 | LDOBJ_NON_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
385 | LDOBJ_NO_MATRIX |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
386 | |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
387 | LDVertex () {} |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
388 | |
188
4e686b771996
Further removal of hungarian notation
Santeri Piippo <crimsondusk64@gmail.com>
parents:
185
diff
changeset
|
389 | vertex pos; |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
390 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
391 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
392 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
393 | // LDRadial |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
394 | // |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
395 | // The generic radial primitive (radial for short) is another LDforge-specific |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
396 | // extension which represents an arbitrary circular primitive. Radials can appear |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
397 | // as circles, cylinders, rings, cones, discs and disc negatives; the point is to |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
398 | // allow part authors to add radial primitives to parts without much hassle about |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
399 | // non-existant primitive parts. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
400 | // ============================================================================= |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
401 | class LDRadial : public LDObject, public LDMatrixObject { |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
402 | public: |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
403 | enum Type { |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
404 | Circle, |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
405 | Cylinder, |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
406 | Disc, |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
407 | DiscNeg, |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
408 | Ring, |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
409 | Cone, |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
410 | NumTypes |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
411 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
412 | |
267
95fde37e1f00
Make LDRadial's members accessed properties
Santeri Piippo <crimsondusk64@gmail.com>
parents:
266
diff
changeset
|
413 | PROPERTY (LDRadial::Type, type, setType) |
95fde37e1f00
Make LDRadial's members accessed properties
Santeri Piippo <crimsondusk64@gmail.com>
parents:
266
diff
changeset
|
414 | PROPERTY (short, divisions, setDivisions) |
95fde37e1f00
Make LDRadial's members accessed properties
Santeri Piippo <crimsondusk64@gmail.com>
parents:
266
diff
changeset
|
415 | PROPERTY (short, segments, setSegments) |
95fde37e1f00
Make LDRadial's members accessed properties
Santeri Piippo <crimsondusk64@gmail.com>
parents:
266
diff
changeset
|
416 | PROPERTY (short, number, setNumber) |
95fde37e1f00
Make LDRadial's members accessed properties
Santeri Piippo <crimsondusk64@gmail.com>
parents:
266
diff
changeset
|
417 | |
95fde37e1f00
Make LDRadial's members accessed properties
Santeri Piippo <crimsondusk64@gmail.com>
parents:
266
diff
changeset
|
418 | public: |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
419 | LDOBJ (Radial) |
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
420 | LDOBJ_VERTICES (0) |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
421 | LDOBJ_COLORED |
214
28e0b37156be
Added demote function for making conditional lines normal lines
Santeri Piippo <crimsondusk64@gmail.com>
parents:
211
diff
changeset
|
422 | LDOBJ_SCEMANTIC |
211
8d35e631bef3
Added dialog for rotation points
Santeri Piippo <crimsondusk64@gmail.com>
parents:
192
diff
changeset
|
423 | LDOBJ_HAS_MATRIX |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
424 | |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
425 | LDRadial () { setLinkPointer (this); } |
191
9bb6a17305ad
Readded BFC red-green view, although determining inversion isn't always correct and it cannot handle CW-certified files...
Santeri Piippo <crimsondusk64@gmail.com>
parents:
188
diff
changeset
|
426 | LDRadial (LDRadial::Type radType, vertex pos, matrix transform, short divs, short segs, short ringNum) : |
267
95fde37e1f00
Make LDRadial's members accessed properties
Santeri Piippo <crimsondusk64@gmail.com>
parents:
266
diff
changeset
|
427 | LDMatrixObject (transform, pos), PROP_NAME (type) (radType), PROP_NAME (divisions) (divs), |
276
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
428 | PROP_NAME (segments) (segs), PROP_NAME (number) (ringNum) |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
429 | { |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
430 | setLinkPointer (this); |
a21e49914264
Made history work with most things
Santeri Piippo <crimsondusk64@gmail.com>
parents:
275
diff
changeset
|
431 | } |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
432 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
433 | // Returns a set of objects that provide the equivalent of this radial. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
434 | // Note: objects are heap-allocated. |
251
c4b96bc41298
Made a vector class which wraps around std::vector... finally I have an operator<< for the thing.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
232
diff
changeset
|
435 | vector<LDObject*> decompose (bool applyTransform); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
436 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
437 | // Compose a file name for this radial. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
438 | str makeFileName (); |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
439 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
440 | char const* radialTypeName (); |
188
4e686b771996
Further removal of hungarian notation
Santeri Piippo <crimsondusk64@gmail.com>
parents:
185
diff
changeset
|
441 | static char const* radialTypeName (const LDRadial::Type type); |
183
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
442 | }; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
443 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
444 | // ============================================================================= |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
445 | // Object type names. Pass the return value of getType as the index to get a |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
446 | // string representation of the object's type. |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
447 | extern const char* g_saObjTypeNames[]; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
448 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
449 | // Icons for these types |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
450 | extern const char* g_saObjTypeIcons[]; |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
451 | |
f1b8cb53d2a2
Moved source files to src/, removed zz_ prefix off dialog files.
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff
changeset
|
452 | #endif // LDTYPES_H |