39 struct ColorDefinition |
43 struct ColorDefinition |
40 { |
44 { |
41 QColor faceColor; |
45 QColor faceColor; |
42 QColor edgeColor; |
46 QColor edgeColor; |
43 QString name; |
47 QString name; |
|
48 QString displayName; |
44 }; |
49 }; |
45 void clear(); |
50 void clear(); |
46 Result load(QIODevice& device, QTextStream& errors); |
51 Result load(QIODevice& device, QTextStream& errors); |
47 const ColorDefinition& operator[](Color index) const; |
52 const ColorDefinition& operator[](Color index) const; |
48 static const ColorDefinition unknownColor; |
53 static const ColorDefinition unknownColor; |
|
54 auto begin() const { return this->definitions.begin(); } |
|
55 auto end() const { return this->definitions.end(); } |
|
56 int size() const { return this->definitions.size(); } |
49 private: |
57 private: |
50 void loadColorFromString(const QString& string); |
58 void loadColorFromString(const QString& string); |
51 QMap<qint32, ColorDefinition> definitions; |
59 std::map<qint32, ColorDefinition> definitions; |
52 }; |
60 }; |
53 |
61 |
54 namespace ldraw |
62 namespace ldraw |
55 { |
63 { |
56 inline bool operator==(const ldraw::Color& one, const ldraw::Color& other) |
64 inline bool operator==(const ldraw::Color& one, const ldraw::Color& other) |