src/ldtypes.h

Fri, 10 Jan 2014 15:48:40 +0200

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Fri, 10 Jan 2014 15:48:40 +0200
changeset 617
f5059d144438
parent 609
a8dc74a809c6
child 618
de0d51349f6c
permissions
-rw-r--r--

- added a type alias LDObjectList

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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
26 #define LDOBJ(T) \
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
27 protected: \
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
28 virtual LD##T* clone() override \
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
29 { \
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
30 return new LD##T (*this); \
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
31 } \
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
32 \
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
33 public: \
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
34 virtual LDObject::Type getType() const override \
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
35 { \
604
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
36 return LDObject::E##T; \
603
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
62 //
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
81 {
604
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
82 ESubfile, // Object represents a sub-file reference
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
83 EQuad, // Object represents a quadrilateral
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
84 ETriangle, // Object represents a triangle
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
85 ELine, // Object represents a line
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
86 ECondLine, // Object represents a conditional line
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
87 EVertex, // Object is a vertex, LDForge extension object
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
88 EBFC, // Object represents a BFC statement
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
89 EOverlay, // Object contains meta-info about an overlay image.
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
90 EComment, // Object represents a comment
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
91 EError, // Object is the result of failed parsing
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
92 EEmpty, // Object represents an empty line
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
93 EUnidentified, // Object is an uninitialized (SHOULD NEVER HAPPEN)
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
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
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
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
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
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
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
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?
617
f5059d144438 - added a type alias LDObjectList
Santeri Piippo <crimsondusk64@gmail.com>
parents: 609
diff changeset
172 static void moveObjects (LDObjectList objs, const bool up);
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
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
617
f5059d144438 - added a type alias LDObjectList
Santeri Piippo <crimsondusk64@gmail.com>
parents: 609
diff changeset
175 static QString describeObjects (const LDObjectList& 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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
206 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
207 public:
604
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
208 inline const Vertex& data() const
603
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
209 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
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
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
213 inline operator const Vertex&() const
603
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
214 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
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
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
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
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
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:
617
f5059d144438 - added a type alias LDObjectList
Santeri Piippo <crimsondusk64@gmail.com>
parents: 609
diff changeset
227 LDObjectList m_refs;
604
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
232 // LDMatrixObject
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
233 // =============================================================================
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
234 //
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
235 // Common code for objects with matrices. This class is multiple-derived in
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
236 // and thus not used directly other than as a common storage point for matrices
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
237 // and vertices.
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
238 //
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
239 // The link pointer is a pointer to this object's LDObject self - since this is
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
240 // multiple-derived in, static_cast or dynamic_cast won't budge here.
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
241 //
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
242 // In 0.1-alpha, there was a separate 'radial' type which had a position and
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
243 // matrix as well. Even though right now only LDSubfile uses this, I'm keeping
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
244 // this class distinct in case I get new extension ideas. :)
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
245 // =============================================================================
493
16766ac1bbd9 last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents: 460
diff changeset
246 class LDMatrixObject
603
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
247 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
248 PROPERTY (public, LDObject*, LinkPointer, NO_OPS, STOCK_WRITE)
604
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
249 PROPERTY (public, Matrix, Transform, NO_OPS, CUSTOM_WRITE)
376
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
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
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
259 inline const Vertex& getPosition() const
603
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
260 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
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
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
265 {
604
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
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
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
275 };
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
276
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
286 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
287 LDOBJ (Error)
376
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
312 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
328 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
329 LDOBJ (Comment)
376
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
350 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
351 public:
493
16766ac1bbd9 last code reformatting i swear
Santeri Piippo <crimsondusk64@gmail.com>
parents: 460
diff changeset
352 enum Type
603
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
353 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
390 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
391 LDOBJ (Subfile)
376
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
401 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
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
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
412 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
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.
617
f5059d144438 - added a type alias LDObjectList
Santeri Piippo <crimsondusk64@gmail.com>
parents: 609
diff changeset
418 LDObjectList 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
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
434 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
435 LDOBJ (Line)
376
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
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
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
454 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
455 LDOBJ (CondLine)
376
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
475 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
476 LDOBJ (Triangle)
376
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
485 LDTriangle (Vertex v0, Vertex v1, Vertex v2)
603
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
486 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
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
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
500 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
501 LDOBJ (Quad)
376
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
510 LDQuad (const Vertex& v0, const Vertex& v1, const Vertex& v2, const Vertex& v3);
376
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
525 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
526 LDOBJ (Vertex)
376
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
535
604
01bdac75994a - some cleanup
Santeri Piippo <crimsondusk64@gmail.com>
parents: 603
diff changeset
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
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
546 {
47e7773c7841 - reformatting
Santeri Piippo <crimsondusk64@gmail.com>
parents: 600
diff changeset
547 LDOBJ (Overlay)
376
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
548 LDOBJ_NAME (overlay)
4a89dd47535f Reformatting..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 367
diff changeset
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

mercurial