--- a/src/ldtypes.h Sun Aug 18 17:38:33 2013 +0300 +++ b/src/ldtypes.h Sun Aug 18 17:53:23 2013 +0300 @@ -24,15 +24,15 @@ #define LDOBJ(T) \ public: \ - virtual ~LD##T##Object() {} \ + virtual ~LD##T() {} \ virtual LDObject::Type getType() const override { \ return LDObject::T; \ } \ virtual str raw(); \ - virtual LD##T##Object* clone() { \ - return new LD##T##Object (*this); \ + virtual LD##T* clone() { \ + return new LD##T (*this); \ } \ - virtual void move (vertex vVector); \ + virtual void move (vertex where); \ virtual void invert(); #define LDOBJ_NAME(N) virtual str typeName() const override { return #N; } @@ -50,7 +50,7 @@ #define LDOBJ_NO_MATRIX LDOBJ_SETMATRIX (false) class QListWidgetItem; -class LDSubfileObject; +class LDSubfile; class LDFile; // ============================================================================= @@ -76,7 +76,7 @@ Quad, // Object represents a quadrilateral Triangle, // Object represents a triangle Line, // Object represents a line - CondLine, // Object represents a conditional line + CndLine, // Object represents a conditional line Vertex, // Object is a vertex, LDForge extension object BFC, // Object represents a BFC statement Overlay, // Object contains meta-info about an overlay image. @@ -166,14 +166,14 @@ }; // ============================================================================= -// LDErrorObject +// LDError // // Represents a line in the LDraw file that could not be properly parsed. It is // represented by a (!) ERROR in the code view. It exists for the purpose of // allowing garbage lines be debugged and corrected within LDForge. The member // zContent contains the contents of the unparsable line. // ============================================================================= -class LDErrorObject : public LDObject { +class LDError : public LDObject { LDOBJ (Error) LDOBJ_NAME (error) LDOBJ_VERTICES (0) @@ -183,8 +183,8 @@ PROPERTY (str, fileRef, setFileRef) public: - LDErrorObject(); - LDErrorObject (str contents, str reason) : contents (contents), reason (reason) {} + LDError(); + LDError (str contents, str reason) : contents (contents), reason (reason) {} // Content of this unknown line str contents; @@ -194,11 +194,11 @@ }; // ============================================================================= -// LDEmptyObject +// LDEmpty // // Represents an empty line in the LDraw code file. // ============================================================================= -class LDEmptyObject : public LDObject { +class LDEmpty : public LDObject { LDOBJ (Empty) LDOBJ_VERTICES (0) LDOBJ_UNCOLORED @@ -207,12 +207,12 @@ }; // ============================================================================= -// LDCommentObject +// LDComment // // Represents a code-0 comment in the LDraw code file. Member text contains // the text of the comment. // ============================================================================= -class LDCommentObject : public LDObject { +class LDComment : public LDObject { LDOBJ (Comment) LDOBJ_NAME (comment) LDOBJ_VERTICES (0) @@ -221,19 +221,19 @@ LDOBJ_NO_MATRIX public: - LDCommentObject() {} - LDCommentObject (str text) : text (text) {} + LDComment() {} + LDComment (str text) : text (text) {} str text; // The text of this comment }; // ============================================================================= -// LDBFCObject +// LDBFC // // Represents a 0 BFC statement in the LDraw code. eStatement contains the type // of this statement. // ============================================================================= -class LDBFCObject : public LDObject { +class LDBFC : public LDObject { public: enum Type { CertifyCCW, @@ -257,8 +257,8 @@ LDOBJ_NO_MATRIX public: - LDBFCObject() {} - LDBFCObject (const LDBFCObject::Type type) : type (type) {} + LDBFC() {} + LDBFC (const LDBFC::Type type) : type (type) {} // Statement strings static const char* statements[]; @@ -267,11 +267,11 @@ }; // ============================================================================= -// LDSubfileObject +// LDSubfile // // Represents a single code-1 subfile reference. // ============================================================================= -class LDSubfileObject : public LDObject, public LDMatrixObject { +class LDSubfile : public LDObject, public LDMatrixObject { LDOBJ (Subfile) LDOBJ_NAME (subfile) LDOBJ_VERTICES (0) @@ -291,7 +291,7 @@ Q_DECLARE_FLAGS (InlineFlags, InlineFlag) - LDSubfileObject() { + LDSubfile() { setLinkPointer (this); } @@ -300,16 +300,16 @@ List<LDObject*> inlineContents (InlineFlags flags); }; -Q_DECLARE_OPERATORS_FOR_FLAGS (LDSubfileObject::InlineFlags) +Q_DECLARE_OPERATORS_FOR_FLAGS (LDSubfile::InlineFlags) // ============================================================================= -// LDLineObject +// LDLine // // Represents a single code-2 line in the LDraw code file. v0 and v1 are the end // points of the line. The line is colored with dColor unless uncolored mode is // set. // ============================================================================= -class LDLineObject : public LDObject { +class LDLine : public LDObject { LDOBJ (Line) LDOBJ_NAME (line) LDOBJ_VERTICES (2) @@ -318,18 +318,18 @@ LDOBJ_NO_MATRIX public: - LDLineObject() {} - LDLineObject (vertex v1, vertex v2); + LDLine() {} + LDLine (vertex v1, vertex v2); }; // ============================================================================= -// LDCondLineObject +// LDCndLine // // Represents a single code-5 conditional line. The end-points v0 and v1 are // inherited from LDLine, c0 and c1 are the control points of this line. // ============================================================================= -class LDCondLineObject : public LDLineObject { - LDOBJ (CondLine) +class LDCndLine : public LDLine { + LDOBJ (CndLine) LDOBJ_NAME (condline) LDOBJ_VERTICES (4) LDOBJ_COLORED @@ -337,18 +337,18 @@ LDOBJ_NO_MATRIX public: - LDCondLineObject() {} - LDLineObject* demote(); + LDCndLine() {} + LDLine* demote(); }; // ============================================================================= -// LDTriangleObject +// LDTriangle // // Represents a single code-3 triangle in the LDraw code file. Vertices v0, v1 // and v2 contain the end-points of this triangle. dColor is the color the // triangle is colored with. // ============================================================================= -class LDTriangleObject : public LDObject { +class LDTriangle : public LDObject { LDOBJ (Triangle) LDOBJ_NAME (triangle) LDOBJ_VERTICES (3) @@ -357,8 +357,8 @@ LDOBJ_NO_MATRIX public: - LDTriangleObject() {} - LDTriangleObject (vertex v0, vertex v1, vertex v2) { + LDTriangle() {} + LDTriangle (vertex v0, vertex v1, vertex v2) { setVertex (0, v0); setVertex (1, v1); setVertex (2, v2); @@ -366,12 +366,12 @@ }; // ============================================================================= -// LDQuadObject +// LDQuad // // Represents a single code-4 quadrilateral. v0, v1, v2 and v3 are the end points // of the quad, dColor is the color used for the quad. // ============================================================================= -class LDQuadObject : public LDObject { +class LDQuad : public LDObject { public: LDOBJ (Quad) LDOBJ_NAME (quad) @@ -380,21 +380,21 @@ LDOBJ_SCEMANTIC LDOBJ_NO_MATRIX - LDQuadObject() {} + LDQuad() {} // Split this quad into two triangles (note: heap-allocated) - List<LDTriangleObject*> splitToTriangles(); + List<LDTriangle*> splitToTriangles(); }; // ============================================================================= -// LDVertexObject +// LDVertex // // The vertex is an LDForce-specific extension which represents a single // vertex which can be used as a parameter to tools or to store coordinates // with. Vertices are a part authoring tool and they should not appear in // finished parts. // ============================================================================= -class LDVertexObject : public LDObject { +class LDVertex : public LDObject { public: LDOBJ (Vertex) LDOBJ_NAME (vertex) @@ -403,18 +403,18 @@ LDOBJ_NON_SCEMANTIC LDOBJ_NO_MATRIX - LDVertexObject() {} + LDVertex() {} vertex pos; }; // ============================================================================= -// LDOverlayObject +// LDOverlay // // Overlay image meta, stored in the header of parts so as to preserve overlay // information. // ============================================================================= -class LDOverlayObject : public LDObject { +class LDOverlay : public LDObject { LDOBJ (Overlay) LDOBJ_NAME (overlay) LDOBJ_VERTICES (0)