--- a/src/linetypes/modelobject.h Tue Feb 14 14:59:26 2017 +0200 +++ b/src/linetypes/modelobject.h Tue Feb 14 15:11:33 2017 +0200 @@ -29,7 +29,7 @@ /* * Object type codes. */ -enum LDObjectType +enum class LDObjectType { SubfileReference, // Object represents a sub-file reference Quadrilateral, // Object represents a quadrilateral @@ -46,6 +46,11 @@ MAKE_ITERABLE_ENUM(LDObjectType) +inline int qHash(LDObjectType type) +{ + return qHash(static_cast<int>(type)); +} + /* * Represents one line of code in an LDraw model file. */ @@ -253,31 +258,6 @@ }; /* - * Represents a single code-3 triangle in the LDraw code file. - */ -class LDTriangle : public LDObject -{ -public: - static constexpr LDObjectType SubclassType = LDObjectType::Triangle; - - virtual LDObjectType type() const override - { - return SubclassType; - } - - virtual QString asText() const override; - virtual void invert() override; - int triangleCount() const override; - int numVertices() const override { return 3; } - QString typeName() const override { return "triangle"; } - -protected: - friend class Model; - LDTriangle (Model* model); - LDTriangle (Vertex const& v1, Vertex const& v2, Vertex const& v3, Model* model = nullptr); -}; - -/* * Represents a single code-4 quadrilateral. */ class LDQuadrilateral : public LDObject