diff -r fe67489523b5 -r 6e838748867b src/objecttypes/modelobject.h --- a/src/objecttypes/modelobject.h Sun Nov 03 17:57:21 2019 +0200 +++ b/src/objecttypes/modelobject.h Sun Nov 03 18:09:47 2019 +0200 @@ -6,32 +6,35 @@ #include "colors.h" #include "vertex.h" -namespace modelobjects +namespace linetypes { enum class Property; - class BaseObject; - class ColoredBaseObject; + class Object; + class ColoredObject; class Empty; } -enum class modelobjects::Property +/** + * @brief Different properties that can be queried with getProperty + */ +enum class linetypes::Property { - Color, - Text, - Point1, - Point2, - Point3, - Point4, - ControlPoint1, - ControlPoint2, - Position, - Transformation, - ReferenceName, - IsInverted, - ErrorMessage + Color, // Color of the object + Text, // Text contained in a comment + Point1, // First vertex in a polygon or edge line + Point2, // Second vertex in a polygon or edge line + Point3, // Third vertex in a polygon + Point4, // Fourth vertex in a quadrilateral + ControlPoint1, // First control point in a conditional edge line + ControlPoint2, // Second control point in a conditional edge line + Position, // Position of a subfile reference + Transformation, // Transformation matrix of a subfile reference + ReferenceName, // Subfile reference name + IsInverted, // Whether or not the object has been inverted with BFC INVERTNEXT + ErrorMessage // For error lines, why parsing failed }; -class modelobjects::BaseObject +class linetypes::Object { public: enum class SetPropertyResult @@ -40,9 +43,9 @@ PropertyNotHandled, InvalidValue }; - BaseObject(); - BaseObject(const BaseObject&) = delete; - virtual ~BaseObject(); + Object(); + Object(const Object&) = delete; + virtual ~Object(); const unsigned int id; //virtual void toString(QTextStream &out) = 0; virtual bool hasColor() const; @@ -54,23 +57,26 @@ virtual QFont textRepresentationFont() const; }; -class modelobjects::ColoredBaseObject : public BaseObject +class linetypes::ColoredObject : public Object { public: - ColoredBaseObject(const Color color_index = colors::main); + ColoredObject(const Color colorIndex = colors::main); bool hasColor() const override final; QVariant getProperty(Property id) const override; SetPropertyResult setProperty(Property id, const QVariant& value) override; private: - Color color_index = colors::main; + Color colorIndex = colors::main; }; -class modelobjects::Empty : public BaseObject +/** + * @brief Represents an empty line. + */ +class linetypes::Empty : public Object { QString textRepresentation() const override; }; -namespace modelobjects +namespace linetypes { - using Id = std::remove_const_t; + using Id = std::decay_t; }